]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.0 - patch 20171118
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.62 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.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 cc cl
3413 do
3414   # Extract the first word of "$ac_prog", so it can be a program name with args.
3415 set dummy $ac_prog; ac_word=$2
3416 echo "$as_me:3416: checking for $ac_word" >&5
3417 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3418 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3419   echo $ECHO_N "(cached) $ECHO_C" >&6
3420 else
3421   if test -n "$BUILD_CC"; then
3422   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3423 else
3424   ac_save_IFS=$IFS; IFS=$ac_path_separator
3425 ac_dummy="$PATH"
3426 for ac_dir in $ac_dummy; do
3427   IFS=$ac_save_IFS
3428   test -z "$ac_dir" && ac_dir=.
3429   $as_executable_p "$ac_dir/$ac_word" || continue
3430 ac_cv_prog_BUILD_CC="$ac_prog"
3431 echo "$as_me:3431: found $ac_dir/$ac_word" >&5
3432 break
3433 done
3434
3435 fi
3436 fi
3437 BUILD_CC=$ac_cv_prog_BUILD_CC
3438 if test -n "$BUILD_CC"; then
3439   echo "$as_me:3439: result: $BUILD_CC" >&5
3440 echo "${ECHO_T}$BUILD_CC" >&6
3441 else
3442   echo "$as_me:3442: result: no" >&5
3443 echo "${ECHO_T}no" >&6
3444 fi
3445
3446   test -n "$BUILD_CC" && break
3447 done
3448
3449 fi;
3450         echo "$as_me:3450: checking for native build C compiler" >&5
3451 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3452         echo "$as_me:3452: result: $BUILD_CC" >&5
3453 echo "${ECHO_T}$BUILD_CC" >&6
3454
3455         echo "$as_me:3455: checking for native build C preprocessor" >&5
3456 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3457
3458 # Check whether --with-build-cpp or --without-build-cpp was given.
3459 if test "${with_build_cpp+set}" = set; then
3460   withval="$with_build_cpp"
3461   BUILD_CPP="$withval"
3462 else
3463   BUILD_CPP='${BUILD_CC} -E'
3464 fi;
3465         echo "$as_me:3465: result: $BUILD_CPP" >&5
3466 echo "${ECHO_T}$BUILD_CPP" >&6
3467
3468         echo "$as_me:3468: checking for native build C flags" >&5
3469 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3470
3471 # Check whether --with-build-cflags or --without-build-cflags was given.
3472 if test "${with_build_cflags+set}" = set; then
3473   withval="$with_build_cflags"
3474   BUILD_CFLAGS="$withval"
3475 fi;
3476         echo "$as_me:3476: result: $BUILD_CFLAGS" >&5
3477 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3478
3479         echo "$as_me:3479: checking for native build C preprocessor-flags" >&5
3480 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3481
3482 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3483 if test "${with_build_cppflags+set}" = set; then
3484   withval="$with_build_cppflags"
3485   BUILD_CPPFLAGS="$withval"
3486 fi;
3487         echo "$as_me:3487: result: $BUILD_CPPFLAGS" >&5
3488 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3489
3490         echo "$as_me:3490: checking for native build linker-flags" >&5
3491 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3492
3493 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3494 if test "${with_build_ldflags+set}" = set; then
3495   withval="$with_build_ldflags"
3496   BUILD_LDFLAGS="$withval"
3497 fi;
3498         echo "$as_me:3498: result: $BUILD_LDFLAGS" >&5
3499 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3500
3501         echo "$as_me:3501: checking for native build linker-libraries" >&5
3502 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3503
3504 # Check whether --with-build-libs or --without-build-libs was given.
3505 if test "${with_build_libs+set}" = set; then
3506   withval="$with_build_libs"
3507   BUILD_LIBS="$withval"
3508 fi;
3509         echo "$as_me:3509: result: $BUILD_LIBS" >&5
3510 echo "${ECHO_T}$BUILD_LIBS" >&6
3511
3512         # this assumes we're on Unix.
3513         BUILD_EXEEXT=
3514         BUILD_OBJEXT=o
3515
3516         : ${BUILD_CC:='${CC}'}
3517
3518         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3519                 { { echo "$as_me:3519: error: Cross-build requires two compilers.
3520 Use --with-build-cc to specify the native compiler." >&5
3521 echo "$as_me: error: Cross-build requires two compilers.
3522 Use --with-build-cc to specify the native compiler." >&2;}
3523    { (exit 1); exit 1; }; }
3524         fi
3525
3526 else
3527         : ${BUILD_CC:='${CC}'}
3528         : ${BUILD_CPP:='${CPP}'}
3529         : ${BUILD_CFLAGS:='${CFLAGS}'}
3530         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3531         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3532         : ${BUILD_LIBS:='${LIBS}'}
3533         : ${BUILD_EXEEXT:='$x'}
3534         : ${BUILD_OBJEXT:='o'}
3535 fi
3536
3537 ###############################################################################
3538
3539 ### Options to allow the user to specify the set of libraries which are used.
3540 ### Use "--without-normal --with-shared" to allow the default model to be
3541 ### shared, for example.
3542 cf_list_models=""
3543
3544 echo "$as_me:3544: checking if you want to build shared C-objects" >&5
3545 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3546
3547 # Check whether --with-shared or --without-shared was given.
3548 if test "${with_shared+set}" = set; then
3549   withval="$with_shared"
3550   with_shared=$withval
3551 else
3552   with_shared=no
3553 fi;
3554 echo "$as_me:3554: result: $with_shared" >&5
3555 echo "${ECHO_T}$with_shared" >&6
3556 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3557
3558 echo "$as_me:3558: checking for specified models" >&5
3559 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3560 test -z "$cf_list_models" && cf_list_models=normal
3561 echo "$as_me:3561: result: $cf_list_models" >&5
3562 echo "${ECHO_T}$cf_list_models" >&6
3563
3564 ### Use the first model as the default, and save its suffix for use in building
3565 ### up test-applications.
3566 echo "$as_me:3566: checking for default model" >&5
3567 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3568 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3569 echo "$as_me:3569: result: $DFT_LWR_MODEL" >&5
3570 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3571
3572 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3573
3574 echo "$as_me:3574: checking for specific curses-directory" >&5
3575 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3576
3577 # Check whether --with-curses-dir or --without-curses-dir was given.
3578 if test "${with_curses_dir+set}" = set; then
3579   withval="$with_curses_dir"
3580   cf_cv_curses_dir=$withval
3581 else
3582   cf_cv_curses_dir=no
3583 fi;
3584 echo "$as_me:3584: result: $cf_cv_curses_dir" >&5
3585 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3586
3587 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3588 then
3589
3590 if test "x$prefix" != xNONE; then
3591         cf_path_syntax="$prefix"
3592 else
3593         cf_path_syntax="$ac_default_prefix"
3594 fi
3595
3596 case ".$withval" in
3597 (.\$\(*\)*|.\'*\'*)
3598         ;;
3599 (..|./*|.\\*)
3600         ;;
3601 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3602         ;;
3603 (.\${*prefix}*|.\${*dir}*)
3604         eval withval="$withval"
3605         case ".$withval" in
3606         (.NONE/*)
3607                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3608                 ;;
3609         esac
3610         ;;
3611 (.no|.NONE/*)
3612         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3613         ;;
3614 (*)
3615         { { echo "$as_me:3615: error: expected a pathname, not \"$withval\"" >&5
3616 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3617    { (exit 1); exit 1; }; }
3618         ;;
3619 esac
3620
3621         if test -d "$cf_cv_curses_dir"
3622         then
3623
3624 if test -n "$cf_cv_curses_dir/include" ; then
3625   for cf_add_incdir in $cf_cv_curses_dir/include
3626   do
3627         while test $cf_add_incdir != /usr/include
3628         do
3629           if test -d $cf_add_incdir
3630           then
3631                 cf_have_incdir=no
3632                 if test -n "$CFLAGS$CPPFLAGS" ; then
3633                   # a loop is needed to ensure we can add subdirs of existing dirs
3634                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3635                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3636                           cf_have_incdir=yes; break
3637                         fi
3638                   done
3639                 fi
3640
3641                 if test "$cf_have_incdir" = no ; then
3642                   if test "$cf_add_incdir" = /usr/local/include ; then
3643                         if test "$GCC" = yes
3644                         then
3645                           cf_save_CPPFLAGS=$CPPFLAGS
3646                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3647                           cat >conftest.$ac_ext <<_ACEOF
3648 #line 3648 "configure"
3649 #include "confdefs.h"
3650 #include <stdio.h>
3651 int
3652 main (void)
3653 {
3654 printf("Hello")
3655   ;
3656   return 0;
3657 }
3658 _ACEOF
3659 rm -f conftest.$ac_objext
3660 if { (eval echo "$as_me:3660: \"$ac_compile\"") >&5
3661   (eval $ac_compile) 2>&5
3662   ac_status=$?
3663   echo "$as_me:3663: \$? = $ac_status" >&5
3664   (exit $ac_status); } &&
3665          { ac_try='test -s conftest.$ac_objext'
3666   { (eval echo "$as_me:3666: \"$ac_try\"") >&5
3667   (eval $ac_try) 2>&5
3668   ac_status=$?
3669   echo "$as_me:3669: \$? = $ac_status" >&5
3670   (exit $ac_status); }; }; then
3671   :
3672 else
3673   echo "$as_me: failed program was:" >&5
3674 cat conftest.$ac_ext >&5
3675 cf_have_incdir=yes
3676 fi
3677 rm -f conftest.$ac_objext conftest.$ac_ext
3678                           CPPFLAGS=$cf_save_CPPFLAGS
3679                         fi
3680                   fi
3681                 fi
3682
3683                 if test "$cf_have_incdir" = no ; then
3684                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3685
3686 echo "${as_me:-configure}:3686: testing adding $cf_add_incdir to include-path ..." 1>&5
3687
3688                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3689
3690                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3691                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3692                   cf_add_incdir="$cf_top_incdir"
3693                 else
3694                   break
3695                 fi
3696           else
3697                 break
3698           fi
3699         done
3700   done
3701 fi
3702
3703 if test -n "$cf_cv_curses_dir/lib" ; then
3704         for cf_add_libdir in $cf_cv_curses_dir/lib
3705         do
3706                 if test $cf_add_libdir = /usr/lib ; then
3707                         :
3708                 elif test -d $cf_add_libdir
3709                 then
3710                         cf_have_libdir=no
3711                         if test -n "$LDFLAGS$LIBS" ; then
3712                                 # a loop is needed to ensure we can add subdirs of existing dirs
3713                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3714                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3715                                                 cf_have_libdir=yes; break
3716                                         fi
3717                                 done
3718                         fi
3719                         if test "$cf_have_libdir" = no ; then
3720                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3721
3722 echo "${as_me:-configure}:3722: testing adding $cf_add_libdir to library-path ..." 1>&5
3723
3724                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3725                         fi
3726                 fi
3727         done
3728 fi
3729
3730         fi
3731 fi
3732
3733 cf_ncuconfig_root=ncurses
3734 cf_have_ncuconfig=no
3735
3736 if test "x${PKG_CONFIG:=none}" != xnone; then
3737         echo "$as_me:3737: checking pkg-config for $cf_ncuconfig_root" >&5
3738 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3739         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3740                 echo "$as_me:3740: result: yes" >&5
3741 echo "${ECHO_T}yes" >&6
3742
3743                 echo "$as_me:3743: checking if the $cf_ncuconfig_root package files work" >&5
3744 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3745                 cf_have_ncuconfig=unknown
3746
3747                 cf_save_CPPFLAGS="$CPPFLAGS"
3748                 cf_save_LIBS="$LIBS"
3749
3750                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3751
3752 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3753 # Filter out duplicates - this happens with badly-designed ".pc" files...
3754 for cf_add_1lib in $LIBS
3755 do
3756         for cf_add_2lib in $cf_add_libs
3757         do
3758                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3759                 then
3760                         cf_add_1lib=
3761                         break
3762                 fi
3763         done
3764         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3765 done
3766 LIBS="$cf_add_libs"
3767
3768                 cat >conftest.$ac_ext <<_ACEOF
3769 #line 3769 "configure"
3770 #include "confdefs.h"
3771 #include <${cf_cv_ncurses_header:-curses.h}>
3772 int
3773 main (void)
3774 {
3775 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3776   ;
3777   return 0;
3778 }
3779 _ACEOF
3780 rm -f conftest.$ac_objext conftest$ac_exeext
3781 if { (eval echo "$as_me:3781: \"$ac_link\"") >&5
3782   (eval $ac_link) 2>&5
3783   ac_status=$?
3784   echo "$as_me:3784: \$? = $ac_status" >&5
3785   (exit $ac_status); } &&
3786          { ac_try='test -s conftest$ac_exeext'
3787   { (eval echo "$as_me:3787: \"$ac_try\"") >&5
3788   (eval $ac_try) 2>&5
3789   ac_status=$?
3790   echo "$as_me:3790: \$? = $ac_status" >&5
3791   (exit $ac_status); }; }; then
3792   if test "$cross_compiling" = yes; then
3793   cf_have_ncuconfig=maybe
3794 else
3795   cat >conftest.$ac_ext <<_ACEOF
3796 #line 3796 "configure"
3797 #include "confdefs.h"
3798 #include <${cf_cv_ncurses_header:-curses.h}>
3799                                 int main(void)
3800                                 { char *xx = curses_version(); return (xx == 0); }
3801 _ACEOF
3802 rm -f conftest$ac_exeext
3803 if { (eval echo "$as_me:3803: \"$ac_link\"") >&5
3804   (eval $ac_link) 2>&5
3805   ac_status=$?
3806   echo "$as_me:3806: \$? = $ac_status" >&5
3807   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3808   { (eval echo "$as_me:3808: \"$ac_try\"") >&5
3809   (eval $ac_try) 2>&5
3810   ac_status=$?
3811   echo "$as_me:3811: \$? = $ac_status" >&5
3812   (exit $ac_status); }; }; then
3813   cf_have_ncuconfig=yes
3814 else
3815   echo "$as_me: program exited with status $ac_status" >&5
3816 echo "$as_me: failed program was:" >&5
3817 cat conftest.$ac_ext >&5
3818 cf_have_ncuconfig=no
3819 fi
3820 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3821 fi
3822 else
3823   echo "$as_me: failed program was:" >&5
3824 cat conftest.$ac_ext >&5
3825 cf_have_ncuconfig=no
3826 fi
3827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3828                 echo "$as_me:3828: result: $cf_have_ncuconfig" >&5
3829 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3830                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3831                 if test "$cf_have_ncuconfig" != "yes"
3832                 then
3833                         CPPFLAGS="$cf_save_CPPFLAGS"
3834                         LIBS="$cf_save_LIBS"
3835                         NCURSES_CONFIG_PKG=none
3836                 else
3837
3838 cat >>confdefs.h <<\EOF
3839 #define NCURSES 1
3840 EOF
3841
3842                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3843                 fi
3844
3845 echo "$as_me:3845: checking for terminfo header" >&5
3846 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
3847 if test "${cf_cv_term_header+set}" = set; then
3848   echo $ECHO_N "(cached) $ECHO_C" >&6
3849 else
3850
3851 case ${cf_cv_ncurses_header} in
3852 (*/ncurses.h|*/ncursesw.h)
3853         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3854         ;;
3855 (*)
3856         cf_term_header=term.h
3857         ;;
3858 esac
3859
3860 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3861 do
3862 cat >conftest.$ac_ext <<_ACEOF
3863 #line 3863 "configure"
3864 #include "confdefs.h"
3865 #include <stdio.h>
3866 #include <${cf_cv_ncurses_header:-curses.h}>
3867 #include <$cf_test>
3868
3869 int
3870 main (void)
3871 {
3872 int x = auto_left_margin
3873   ;
3874   return 0;
3875 }
3876 _ACEOF
3877 rm -f conftest.$ac_objext
3878 if { (eval echo "$as_me:3878: \"$ac_compile\"") >&5
3879   (eval $ac_compile) 2>&5
3880   ac_status=$?
3881   echo "$as_me:3881: \$? = $ac_status" >&5
3882   (exit $ac_status); } &&
3883          { ac_try='test -s conftest.$ac_objext'
3884   { (eval echo "$as_me:3884: \"$ac_try\"") >&5
3885   (eval $ac_try) 2>&5
3886   ac_status=$?
3887   echo "$as_me:3887: \$? = $ac_status" >&5
3888   (exit $ac_status); }; }; then
3889
3890         cf_cv_term_header="$cf_test"
3891 else
3892   echo "$as_me: failed program was:" >&5
3893 cat conftest.$ac_ext >&5
3894
3895         cf_cv_term_header=unknown
3896
3897 fi
3898 rm -f conftest.$ac_objext conftest.$ac_ext
3899         test "$cf_cv_term_header" != unknown && break
3900 done
3901
3902 fi
3903 echo "$as_me:3903: result: $cf_cv_term_header" >&5
3904 echo "${ECHO_T}$cf_cv_term_header" >&6
3905
3906 # Set definitions to allow ifdef'ing to accommodate subdirectories
3907
3908 case $cf_cv_term_header in
3909 (*term.h)
3910
3911 cat >>confdefs.h <<\EOF
3912 #define HAVE_TERM_H 1
3913 EOF
3914
3915         ;;
3916 esac
3917
3918 case $cf_cv_term_header in
3919 (ncurses/term.h)
3920
3921 cat >>confdefs.h <<\EOF
3922 #define HAVE_NCURSES_TERM_H 1
3923 EOF
3924
3925         ;;
3926 (ncursesw/term.h)
3927
3928 cat >>confdefs.h <<\EOF
3929 #define HAVE_NCURSESW_TERM_H 1
3930 EOF
3931
3932         ;;
3933 esac
3934
3935         else
3936                 echo "$as_me:3936: result: no" >&5
3937 echo "${ECHO_T}no" >&6
3938                 NCURSES_CONFIG_PKG=none
3939         fi
3940 else
3941         NCURSES_CONFIG_PKG=none
3942 fi
3943
3944 if test "x$cf_have_ncuconfig" = "xno"; then
3945         echo "Looking for ${cf_ncuconfig_root}-config"
3946
3947 if test -n "$ac_tool_prefix"; then
3948   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3949   do
3950     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3951 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3952 echo "$as_me:3952: checking for $ac_word" >&5
3953 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3954 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3955   echo $ECHO_N "(cached) $ECHO_C" >&6
3956 else
3957   if test -n "$NCURSES_CONFIG"; then
3958   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3959 else
3960   ac_save_IFS=$IFS; IFS=$ac_path_separator
3961 ac_dummy="$PATH"
3962 for ac_dir in $ac_dummy; do
3963   IFS=$ac_save_IFS
3964   test -z "$ac_dir" && ac_dir=.
3965   $as_executable_p "$ac_dir/$ac_word" || continue
3966 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3967 echo "$as_me:3967: found $ac_dir/$ac_word" >&5
3968 break
3969 done
3970
3971 fi
3972 fi
3973 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3974 if test -n "$NCURSES_CONFIG"; then
3975   echo "$as_me:3975: result: $NCURSES_CONFIG" >&5
3976 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3977 else
3978   echo "$as_me:3978: result: no" >&5
3979 echo "${ECHO_T}no" >&6
3980 fi
3981
3982     test -n "$NCURSES_CONFIG" && break
3983   done
3984 fi
3985 if test -z "$NCURSES_CONFIG"; then
3986   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3987   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3988 do
3989   # Extract the first word of "$ac_prog", so it can be a program name with args.
3990 set dummy $ac_prog; ac_word=$2
3991 echo "$as_me:3991: checking for $ac_word" >&5
3992 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3993 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3994   echo $ECHO_N "(cached) $ECHO_C" >&6
3995 else
3996   if test -n "$ac_ct_NCURSES_CONFIG"; then
3997   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3998 else
3999   ac_save_IFS=$IFS; IFS=$ac_path_separator
4000 ac_dummy="$PATH"
4001 for ac_dir in $ac_dummy; do
4002   IFS=$ac_save_IFS
4003   test -z "$ac_dir" && ac_dir=.
4004   $as_executable_p "$ac_dir/$ac_word" || continue
4005 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4006 echo "$as_me:4006: found $ac_dir/$ac_word" >&5
4007 break
4008 done
4009
4010 fi
4011 fi
4012 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4013 if test -n "$ac_ct_NCURSES_CONFIG"; then
4014   echo "$as_me:4014: result: $ac_ct_NCURSES_CONFIG" >&5
4015 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4016 else
4017   echo "$as_me:4017: result: no" >&5
4018 echo "${ECHO_T}no" >&6
4019 fi
4020
4021   test -n "$ac_ct_NCURSES_CONFIG" && break
4022 done
4023 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4024
4025   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4026 fi
4027
4028         if test "$NCURSES_CONFIG" != none ; then
4029
4030                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4031
4032 cf_add_libs="`$NCURSES_CONFIG --libs`"
4033 # Filter out duplicates - this happens with badly-designed ".pc" files...
4034 for cf_add_1lib in $LIBS
4035 do
4036         for cf_add_2lib in $cf_add_libs
4037         do
4038                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4039                 then
4040                         cf_add_1lib=
4041                         break
4042                 fi
4043         done
4044         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4045 done
4046 LIBS="$cf_add_libs"
4047
4048                 # even with config script, some packages use no-override for curses.h
4049
4050 echo "$as_me:4050: checking if we have identified curses headers" >&5
4051 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4052 if test "${cf_cv_ncurses_header+set}" = set; then
4053   echo $ECHO_N "(cached) $ECHO_C" >&6
4054 else
4055
4056 cf_cv_ncurses_header=none
4057 for cf_header in \
4058         ncurses.h ncurses/ncurses.h \
4059         curses.h ncurses/curses.h
4060 do
4061 cat >conftest.$ac_ext <<_ACEOF
4062 #line 4062 "configure"
4063 #include "confdefs.h"
4064 #include <${cf_header}>
4065 int
4066 main (void)
4067 {
4068 initscr(); tgoto("?", 0,0)
4069   ;
4070   return 0;
4071 }
4072 _ACEOF
4073 rm -f conftest.$ac_objext
4074 if { (eval echo "$as_me:4074: \"$ac_compile\"") >&5
4075   (eval $ac_compile) 2>&5
4076   ac_status=$?
4077   echo "$as_me:4077: \$? = $ac_status" >&5
4078   (exit $ac_status); } &&
4079          { ac_try='test -s conftest.$ac_objext'
4080   { (eval echo "$as_me:4080: \"$ac_try\"") >&5
4081   (eval $ac_try) 2>&5
4082   ac_status=$?
4083   echo "$as_me:4083: \$? = $ac_status" >&5
4084   (exit $ac_status); }; }; then
4085   cf_cv_ncurses_header=$cf_header; break
4086 else
4087   echo "$as_me: failed program was:" >&5
4088 cat conftest.$ac_ext >&5
4089 fi
4090 rm -f conftest.$ac_objext conftest.$ac_ext
4091 done
4092
4093 fi
4094 echo "$as_me:4094: result: $cf_cv_ncurses_header" >&5
4095 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4096
4097 if test "$cf_cv_ncurses_header" = none ; then
4098         { { echo "$as_me:4098: error: No curses header-files found" >&5
4099 echo "$as_me: error: No curses header-files found" >&2;}
4100    { (exit 1); exit 1; }; }
4101 fi
4102
4103 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4104
4105 for ac_header in $cf_cv_ncurses_header
4106 do
4107 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4108 echo "$as_me:4108: checking for $ac_header" >&5
4109 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4110 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4111   echo $ECHO_N "(cached) $ECHO_C" >&6
4112 else
4113   cat >conftest.$ac_ext <<_ACEOF
4114 #line 4114 "configure"
4115 #include "confdefs.h"
4116 #include <$ac_header>
4117 _ACEOF
4118 if { (eval echo "$as_me:4118: \"$ac_cpp conftest.$ac_ext\"") >&5
4119   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4120   ac_status=$?
4121   egrep -v '^ *\+' conftest.er1 >conftest.err
4122   rm -f conftest.er1
4123   cat conftest.err >&5
4124   echo "$as_me:4124: \$? = $ac_status" >&5
4125   (exit $ac_status); } >/dev/null; then
4126   if test -s conftest.err; then
4127     ac_cpp_err=$ac_c_preproc_warn_flag
4128   else
4129     ac_cpp_err=
4130   fi
4131 else
4132   ac_cpp_err=yes
4133 fi
4134 if test -z "$ac_cpp_err"; then
4135   eval "$as_ac_Header=yes"
4136 else
4137   echo "$as_me: failed program was:" >&5
4138   cat conftest.$ac_ext >&5
4139   eval "$as_ac_Header=no"
4140 fi
4141 rm -f conftest.err conftest.$ac_ext
4142 fi
4143 echo "$as_me:4143: result: `eval echo '${'$as_ac_Header'}'`" >&5
4144 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4145 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4146   cat >>confdefs.h <<EOF
4147 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4148 EOF
4149
4150 fi
4151 done
4152
4153 cat >>confdefs.h <<\EOF
4154 #define NCURSES 1
4155 EOF
4156
4157 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4158
4159                 cat >>confdefs.h <<EOF
4160 #define $cf_nculib_ROOT 1
4161 EOF
4162
4163                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4164
4165         else
4166
4167 cf_ncuhdr_root=ncurses
4168
4169 test -n "$cf_cv_curses_dir" && \
4170 test "$cf_cv_curses_dir" != "no" && { \
4171
4172 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4173   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4174   do
4175         while test $cf_add_incdir != /usr/include
4176         do
4177           if test -d $cf_add_incdir
4178           then
4179                 cf_have_incdir=no
4180                 if test -n "$CFLAGS$CPPFLAGS" ; then
4181                   # a loop is needed to ensure we can add subdirs of existing dirs
4182                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4183                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4184                           cf_have_incdir=yes; break
4185                         fi
4186                   done
4187                 fi
4188
4189                 if test "$cf_have_incdir" = no ; then
4190                   if test "$cf_add_incdir" = /usr/local/include ; then
4191                         if test "$GCC" = yes
4192                         then
4193                           cf_save_CPPFLAGS=$CPPFLAGS
4194                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4195                           cat >conftest.$ac_ext <<_ACEOF
4196 #line 4196 "configure"
4197 #include "confdefs.h"
4198 #include <stdio.h>
4199 int
4200 main (void)
4201 {
4202 printf("Hello")
4203   ;
4204   return 0;
4205 }
4206 _ACEOF
4207 rm -f conftest.$ac_objext
4208 if { (eval echo "$as_me:4208: \"$ac_compile\"") >&5
4209   (eval $ac_compile) 2>&5
4210   ac_status=$?
4211   echo "$as_me:4211: \$? = $ac_status" >&5
4212   (exit $ac_status); } &&
4213          { ac_try='test -s conftest.$ac_objext'
4214   { (eval echo "$as_me:4214: \"$ac_try\"") >&5
4215   (eval $ac_try) 2>&5
4216   ac_status=$?
4217   echo "$as_me:4217: \$? = $ac_status" >&5
4218   (exit $ac_status); }; }; then
4219   :
4220 else
4221   echo "$as_me: failed program was:" >&5
4222 cat conftest.$ac_ext >&5
4223 cf_have_incdir=yes
4224 fi
4225 rm -f conftest.$ac_objext conftest.$ac_ext
4226                           CPPFLAGS=$cf_save_CPPFLAGS
4227                         fi
4228                   fi
4229                 fi
4230
4231                 if test "$cf_have_incdir" = no ; then
4232                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4233
4234 echo "${as_me:-configure}:4234: testing adding $cf_add_incdir to include-path ..." 1>&5
4235
4236                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4237
4238                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4239                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4240                   cf_add_incdir="$cf_top_incdir"
4241                 else
4242                   break
4243                 fi
4244           else
4245                 break
4246           fi
4247         done
4248   done
4249 fi
4250
4251 }
4252
4253 echo "$as_me:4253: checking for $cf_ncuhdr_root header in include-path" >&5
4254 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4255 if test "${cf_cv_ncurses_h+set}" = set; then
4256   echo $ECHO_N "(cached) $ECHO_C" >&6
4257 else
4258
4259         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4260         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4261         for cf_header in $cf_header_list
4262         do
4263
4264         cat >conftest.$ac_ext <<_ACEOF
4265 #line 4265 "configure"
4266 #include "confdefs.h"
4267
4268 #include <$cf_header>
4269 int
4270 main (void)
4271 {
4272
4273 #ifdef NCURSES_VERSION
4274
4275 printf("%s\n", NCURSES_VERSION);
4276 #else
4277 #ifdef __NCURSES_H
4278 printf("old\n");
4279 #else
4280         make an error
4281 #endif
4282 #endif
4283
4284   ;
4285   return 0;
4286 }
4287 _ACEOF
4288 rm -f conftest.$ac_objext
4289 if { (eval echo "$as_me:4289: \"$ac_compile\"") >&5
4290   (eval $ac_compile) 2>&5
4291   ac_status=$?
4292   echo "$as_me:4292: \$? = $ac_status" >&5
4293   (exit $ac_status); } &&
4294          { ac_try='test -s conftest.$ac_objext'
4295   { (eval echo "$as_me:4295: \"$ac_try\"") >&5
4296   (eval $ac_try) 2>&5
4297   ac_status=$?
4298   echo "$as_me:4298: \$? = $ac_status" >&5
4299   (exit $ac_status); }; }; then
4300   cf_cv_ncurses_h=$cf_header
4301
4302 else
4303   echo "$as_me: failed program was:" >&5
4304 cat conftest.$ac_ext >&5
4305 cf_cv_ncurses_h=no
4306 fi
4307 rm -f conftest.$ac_objext conftest.$ac_ext
4308
4309                 test "$cf_cv_ncurses_h" != no && break
4310         done
4311
4312 fi
4313 echo "$as_me:4313: result: $cf_cv_ncurses_h" >&5
4314 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4315
4316 if test "$cf_cv_ncurses_h" != no ; then
4317         cf_cv_ncurses_header=$cf_cv_ncurses_h
4318 else
4319
4320 echo "$as_me:4320: checking for $cf_ncuhdr_root include-path" >&5
4321 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4322 if test "${cf_cv_ncurses_h2+set}" = set; then
4323   echo $ECHO_N "(cached) $ECHO_C" >&6
4324 else
4325
4326         test -n "$verbose" && echo
4327
4328 cf_search=
4329
4330 # collect the current set of include-directories from compiler flags
4331 cf_header_path_list=""
4332 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4333         for cf_header_path in $CPPFLAGS $CFLAGS
4334         do
4335                 case $cf_header_path in
4336                 (-I*)
4337                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4338
4339 test "x$cf_header_path" != "xNONE" && \
4340 test -d "$cf_header_path" && \
4341  {
4342         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4343         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4344         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4345         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4346         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4347         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"
4348 }
4349
4350                         cf_header_path_list="$cf_header_path_list $cf_search"
4351                         ;;
4352                 esac
4353         done
4354 fi
4355
4356 # add the variations for the package we are looking for
4357
4358 cf_search=
4359
4360 test "x$prefix" != "xNONE" && \
4361 test -d "$prefix" && \
4362  {
4363         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4364         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4365         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4366         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4367         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4368         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4369 }
4370
4371 for cf_subdir_prefix in \
4372         /usr \
4373         /usr/local \
4374         /usr/pkg \
4375         /opt \
4376         /opt/local \
4377         $HOME
4378 do
4379
4380 test "x$cf_subdir_prefix" != "x$prefix" && \
4381 test -d "$cf_subdir_prefix" && \
4382 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4383         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4384         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4385         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4386         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4387         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4388         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"
4389 }
4390
4391 done
4392
4393 test "$includedir" != NONE && \
4394 test "$includedir" != "/usr/include" && \
4395 test -d "$includedir" && {
4396         test -d $includedir &&    cf_search="$cf_search $includedir"
4397         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4398 }
4399
4400 test "$oldincludedir" != NONE && \
4401 test "$oldincludedir" != "/usr/include" && \
4402 test -d "$oldincludedir" && {
4403         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4404         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4405 }
4406
4407 cf_search="$cf_search $cf_header_path_list"
4408
4409         test -n "$verbose" && echo search path $cf_search
4410         cf_save2_CPPFLAGS="$CPPFLAGS"
4411         for cf_incdir in $cf_search
4412         do
4413
4414 if test -n "$cf_incdir" ; then
4415   for cf_add_incdir in $cf_incdir
4416   do
4417         while test $cf_add_incdir != /usr/include
4418         do
4419           if test -d $cf_add_incdir
4420           then
4421                 cf_have_incdir=no
4422                 if test -n "$CFLAGS$CPPFLAGS" ; then
4423                   # a loop is needed to ensure we can add subdirs of existing dirs
4424                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4425                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4426                           cf_have_incdir=yes; break
4427                         fi
4428                   done
4429                 fi
4430
4431                 if test "$cf_have_incdir" = no ; then
4432                   if test "$cf_add_incdir" = /usr/local/include ; then
4433                         if test "$GCC" = yes
4434                         then
4435                           cf_save_CPPFLAGS=$CPPFLAGS
4436                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4437                           cat >conftest.$ac_ext <<_ACEOF
4438 #line 4438 "configure"
4439 #include "confdefs.h"
4440 #include <stdio.h>
4441 int
4442 main (void)
4443 {
4444 printf("Hello")
4445   ;
4446   return 0;
4447 }
4448 _ACEOF
4449 rm -f conftest.$ac_objext
4450 if { (eval echo "$as_me:4450: \"$ac_compile\"") >&5
4451   (eval $ac_compile) 2>&5
4452   ac_status=$?
4453   echo "$as_me:4453: \$? = $ac_status" >&5
4454   (exit $ac_status); } &&
4455          { ac_try='test -s conftest.$ac_objext'
4456   { (eval echo "$as_me:4456: \"$ac_try\"") >&5
4457   (eval $ac_try) 2>&5
4458   ac_status=$?
4459   echo "$as_me:4459: \$? = $ac_status" >&5
4460   (exit $ac_status); }; }; then
4461   :
4462 else
4463   echo "$as_me: failed program was:" >&5
4464 cat conftest.$ac_ext >&5
4465 cf_have_incdir=yes
4466 fi
4467 rm -f conftest.$ac_objext conftest.$ac_ext
4468                           CPPFLAGS=$cf_save_CPPFLAGS
4469                         fi
4470                   fi
4471                 fi
4472
4473                 if test "$cf_have_incdir" = no ; then
4474                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4475
4476 echo "${as_me:-configure}:4476: testing adding $cf_add_incdir to include-path ..." 1>&5
4477
4478                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4479
4480                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4481                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4482                   cf_add_incdir="$cf_top_incdir"
4483                 else
4484                   break
4485                 fi
4486           else
4487                 break
4488           fi
4489         done
4490   done
4491 fi
4492
4493                 for cf_header in \
4494                         ncurses.h \
4495                         curses.h
4496                 do
4497
4498         cat >conftest.$ac_ext <<_ACEOF
4499 #line 4499 "configure"
4500 #include "confdefs.h"
4501
4502 #include <$cf_header>
4503 int
4504 main (void)
4505 {
4506
4507 #ifdef NCURSES_VERSION
4508
4509 printf("%s\n", NCURSES_VERSION);
4510 #else
4511 #ifdef __NCURSES_H
4512 printf("old\n");
4513 #else
4514         make an error
4515 #endif
4516 #endif
4517
4518   ;
4519   return 0;
4520 }
4521 _ACEOF
4522 rm -f conftest.$ac_objext
4523 if { (eval echo "$as_me:4523: \"$ac_compile\"") >&5
4524   (eval $ac_compile) 2>&5
4525   ac_status=$?
4526   echo "$as_me:4526: \$? = $ac_status" >&5
4527   (exit $ac_status); } &&
4528          { ac_try='test -s conftest.$ac_objext'
4529   { (eval echo "$as_me:4529: \"$ac_try\"") >&5
4530   (eval $ac_try) 2>&5
4531   ac_status=$?
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit $ac_status); }; }; then
4534   cf_cv_ncurses_h2=$cf_header
4535
4536 else
4537   echo "$as_me: failed program was:" >&5
4538 cat conftest.$ac_ext >&5
4539 cf_cv_ncurses_h2=no
4540 fi
4541 rm -f conftest.$ac_objext conftest.$ac_ext
4542
4543                         if test "$cf_cv_ncurses_h2" != no ; then
4544                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4545                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4546                                 break
4547                         fi
4548                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4549                 done
4550                 CPPFLAGS="$cf_save2_CPPFLAGS"
4551                 test "$cf_cv_ncurses_h2" != no && break
4552         done
4553         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4553: error: not found" >&5
4554 echo "$as_me: error: not found" >&2;}
4555    { (exit 1); exit 1; }; }
4556
4557 fi
4558 echo "$as_me:4558: result: $cf_cv_ncurses_h2" >&5
4559 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4560
4561         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4562         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4563         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4564                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4565         fi
4566
4567 if test -n "$cf_1st_incdir" ; then
4568   for cf_add_incdir in $cf_1st_incdir
4569   do
4570         while test $cf_add_incdir != /usr/include
4571         do
4572           if test -d $cf_add_incdir
4573           then
4574                 cf_have_incdir=no
4575                 if test -n "$CFLAGS$CPPFLAGS" ; then
4576                   # a loop is needed to ensure we can add subdirs of existing dirs
4577                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4578                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4579                           cf_have_incdir=yes; break
4580                         fi
4581                   done
4582                 fi
4583
4584                 if test "$cf_have_incdir" = no ; then
4585                   if test "$cf_add_incdir" = /usr/local/include ; then
4586                         if test "$GCC" = yes
4587                         then
4588                           cf_save_CPPFLAGS=$CPPFLAGS
4589                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4590                           cat >conftest.$ac_ext <<_ACEOF
4591 #line 4591 "configure"
4592 #include "confdefs.h"
4593 #include <stdio.h>
4594 int
4595 main (void)
4596 {
4597 printf("Hello")
4598   ;
4599   return 0;
4600 }
4601 _ACEOF
4602 rm -f conftest.$ac_objext
4603 if { (eval echo "$as_me:4603: \"$ac_compile\"") >&5
4604   (eval $ac_compile) 2>&5
4605   ac_status=$?
4606   echo "$as_me:4606: \$? = $ac_status" >&5
4607   (exit $ac_status); } &&
4608          { ac_try='test -s conftest.$ac_objext'
4609   { (eval echo "$as_me:4609: \"$ac_try\"") >&5
4610   (eval $ac_try) 2>&5
4611   ac_status=$?
4612   echo "$as_me:4612: \$? = $ac_status" >&5
4613   (exit $ac_status); }; }; then
4614   :
4615 else
4616   echo "$as_me: failed program was:" >&5
4617 cat conftest.$ac_ext >&5
4618 cf_have_incdir=yes
4619 fi
4620 rm -f conftest.$ac_objext conftest.$ac_ext
4621                           CPPFLAGS=$cf_save_CPPFLAGS
4622                         fi
4623                   fi
4624                 fi
4625
4626                 if test "$cf_have_incdir" = no ; then
4627                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4628
4629 echo "${as_me:-configure}:4629: testing adding $cf_add_incdir to include-path ..." 1>&5
4630
4631                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4632
4633                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4634                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4635                   cf_add_incdir="$cf_top_incdir"
4636                 else
4637                   break
4638                 fi
4639           else
4640                 break
4641           fi
4642         done
4643   done
4644 fi
4645
4646 fi
4647
4648 # Set definitions to allow ifdef'ing for ncurses.h
4649
4650 case $cf_cv_ncurses_header in
4651 (*ncurses.h)
4652
4653 cat >>confdefs.h <<\EOF
4654 #define HAVE_NCURSES_H 1
4655 EOF
4656
4657         ;;
4658 esac
4659
4660 case $cf_cv_ncurses_header in
4661 (ncurses/curses.h|ncurses/ncurses.h)
4662
4663 cat >>confdefs.h <<\EOF
4664 #define HAVE_NCURSES_NCURSES_H 1
4665 EOF
4666
4667         ;;
4668 (ncursesw/curses.h|ncursesw/ncurses.h)
4669
4670 cat >>confdefs.h <<\EOF
4671 #define HAVE_NCURSESW_NCURSES_H 1
4672 EOF
4673
4674         ;;
4675 esac
4676
4677 echo "$as_me:4677: checking for terminfo header" >&5
4678 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4679 if test "${cf_cv_term_header+set}" = set; then
4680   echo $ECHO_N "(cached) $ECHO_C" >&6
4681 else
4682
4683 case ${cf_cv_ncurses_header} in
4684 (*/ncurses.h|*/ncursesw.h)
4685         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4686         ;;
4687 (*)
4688         cf_term_header=term.h
4689         ;;
4690 esac
4691
4692 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4693 do
4694 cat >conftest.$ac_ext <<_ACEOF
4695 #line 4695 "configure"
4696 #include "confdefs.h"
4697 #include <stdio.h>
4698 #include <${cf_cv_ncurses_header:-curses.h}>
4699 #include <$cf_test>
4700
4701 int
4702 main (void)
4703 {
4704 int x = auto_left_margin
4705   ;
4706   return 0;
4707 }
4708 _ACEOF
4709 rm -f conftest.$ac_objext
4710 if { (eval echo "$as_me:4710: \"$ac_compile\"") >&5
4711   (eval $ac_compile) 2>&5
4712   ac_status=$?
4713   echo "$as_me:4713: \$? = $ac_status" >&5
4714   (exit $ac_status); } &&
4715          { ac_try='test -s conftest.$ac_objext'
4716   { (eval echo "$as_me:4716: \"$ac_try\"") >&5
4717   (eval $ac_try) 2>&5
4718   ac_status=$?
4719   echo "$as_me:4719: \$? = $ac_status" >&5
4720   (exit $ac_status); }; }; then
4721
4722         cf_cv_term_header="$cf_test"
4723 else
4724   echo "$as_me: failed program was:" >&5
4725 cat conftest.$ac_ext >&5
4726
4727         cf_cv_term_header=unknown
4728
4729 fi
4730 rm -f conftest.$ac_objext conftest.$ac_ext
4731         test "$cf_cv_term_header" != unknown && break
4732 done
4733
4734 fi
4735 echo "$as_me:4735: result: $cf_cv_term_header" >&5
4736 echo "${ECHO_T}$cf_cv_term_header" >&6
4737
4738 # Set definitions to allow ifdef'ing to accommodate subdirectories
4739
4740 case $cf_cv_term_header in
4741 (*term.h)
4742
4743 cat >>confdefs.h <<\EOF
4744 #define HAVE_TERM_H 1
4745 EOF
4746
4747         ;;
4748 esac
4749
4750 case $cf_cv_term_header in
4751 (ncurses/term.h)
4752
4753 cat >>confdefs.h <<\EOF
4754 #define HAVE_NCURSES_TERM_H 1
4755 EOF
4756
4757         ;;
4758 (ncursesw/term.h)
4759
4760 cat >>confdefs.h <<\EOF
4761 #define HAVE_NCURSESW_TERM_H 1
4762 EOF
4763
4764         ;;
4765 esac
4766
4767 # some applications need this, but should check for NCURSES_VERSION
4768
4769 cat >>confdefs.h <<\EOF
4770 #define NCURSES 1
4771 EOF
4772
4773 echo "$as_me:4773: checking for ncurses version" >&5
4774 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4775 if test "${cf_cv_ncurses_version+set}" = set; then
4776   echo $ECHO_N "(cached) $ECHO_C" >&6
4777 else
4778
4779         cf_cv_ncurses_version=no
4780         cf_tempfile=out$$
4781         rm -f $cf_tempfile
4782         if test "$cross_compiling" = yes; then
4783
4784         # This will not work if the preprocessor splits the line after the
4785         # Autoconf token.  The 'unproto' program does that.
4786         cat > conftest.$ac_ext <<EOF
4787 #include <${cf_cv_ncurses_header:-curses.h}>
4788 #undef Autoconf
4789 #ifdef NCURSES_VERSION
4790 Autoconf NCURSES_VERSION
4791 #else
4792 #ifdef __NCURSES_H
4793 Autoconf "old"
4794 #endif
4795 ;
4796 #endif
4797 EOF
4798         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4799         { (eval echo "$as_me:4799: \"$cf_try\"") >&5
4800   (eval $cf_try) 2>&5
4801   ac_status=$?
4802   echo "$as_me:4802: \$? = $ac_status" >&5
4803   (exit $ac_status); }
4804         if test -f conftest.out ; then
4805                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4806                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4807                 rm -f conftest.out
4808         fi
4809
4810 else
4811   cat >conftest.$ac_ext <<_ACEOF
4812 #line 4812 "configure"
4813 #include "confdefs.h"
4814
4815 #include <${cf_cv_ncurses_header:-curses.h}>
4816 #include <stdio.h>
4817 int main(void)
4818 {
4819         FILE *fp = fopen("$cf_tempfile", "w");
4820 #ifdef NCURSES_VERSION
4821 # ifdef NCURSES_VERSION_PATCH
4822         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4823 # else
4824         fprintf(fp, "%s\n", NCURSES_VERSION);
4825 # endif
4826 #else
4827 # ifdef __NCURSES_H
4828         fprintf(fp, "old\n");
4829 # else
4830         make an error
4831 # endif
4832 #endif
4833         ${cf_cv_main_return:-return}(0);
4834 }
4835 _ACEOF
4836 rm -f conftest$ac_exeext
4837 if { (eval echo "$as_me:4837: \"$ac_link\"") >&5
4838   (eval $ac_link) 2>&5
4839   ac_status=$?
4840   echo "$as_me:4840: \$? = $ac_status" >&5
4841   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4842   { (eval echo "$as_me:4842: \"$ac_try\"") >&5
4843   (eval $ac_try) 2>&5
4844   ac_status=$?
4845   echo "$as_me:4845: \$? = $ac_status" >&5
4846   (exit $ac_status); }; }; then
4847
4848         cf_cv_ncurses_version=`cat $cf_tempfile`
4849 else
4850   echo "$as_me: program exited with status $ac_status" >&5
4851 echo "$as_me: failed program was:" >&5
4852 cat conftest.$ac_ext >&5
4853 fi
4854 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4855 fi
4856         rm -f $cf_tempfile
4857
4858 fi
4859 echo "$as_me:4859: result: $cf_cv_ncurses_version" >&5
4860 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4861 test "$cf_cv_ncurses_version" = no ||
4862 cat >>confdefs.h <<\EOF
4863 #define NCURSES 1
4864 EOF
4865
4866 cf_nculib_root=ncurses
4867         # This works, except for the special case where we find gpm, but
4868         # ncurses is in a nonstandard location via $LIBS, and we really want
4869         # to link gpm.
4870 cf_ncurses_LIBS=""
4871 cf_ncurses_SAVE="$LIBS"
4872 echo "$as_me:4872: checking for Gpm_Open in -lgpm" >&5
4873 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4874 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4875   echo $ECHO_N "(cached) $ECHO_C" >&6
4876 else
4877   ac_check_lib_save_LIBS=$LIBS
4878 LIBS="-lgpm  $LIBS"
4879 cat >conftest.$ac_ext <<_ACEOF
4880 #line 4880 "configure"
4881 #include "confdefs.h"
4882
4883 /* Override any gcc2 internal prototype to avoid an error.  */
4884 #ifdef __cplusplus
4885 extern "C"
4886 #endif
4887 /* We use char because int might match the return type of a gcc2
4888    builtin and then its argument prototype would still apply.  */
4889 char Gpm_Open ();
4890 int
4891 main (void)
4892 {
4893 Gpm_Open ();
4894   ;
4895   return 0;
4896 }
4897 _ACEOF
4898 rm -f conftest.$ac_objext conftest$ac_exeext
4899 if { (eval echo "$as_me:4899: \"$ac_link\"") >&5
4900   (eval $ac_link) 2>&5
4901   ac_status=$?
4902   echo "$as_me:4902: \$? = $ac_status" >&5
4903   (exit $ac_status); } &&
4904          { ac_try='test -s conftest$ac_exeext'
4905   { (eval echo "$as_me:4905: \"$ac_try\"") >&5
4906   (eval $ac_try) 2>&5
4907   ac_status=$?
4908   echo "$as_me:4908: \$? = $ac_status" >&5
4909   (exit $ac_status); }; }; then
4910   ac_cv_lib_gpm_Gpm_Open=yes
4911 else
4912   echo "$as_me: failed program was:" >&5
4913 cat conftest.$ac_ext >&5
4914 ac_cv_lib_gpm_Gpm_Open=no
4915 fi
4916 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4917 LIBS=$ac_check_lib_save_LIBS
4918 fi
4919 echo "$as_me:4919: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4920 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4921 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4922   echo "$as_me:4922: checking for initscr in -lgpm" >&5
4923 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4924 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4925   echo $ECHO_N "(cached) $ECHO_C" >&6
4926 else
4927   ac_check_lib_save_LIBS=$LIBS
4928 LIBS="-lgpm  $LIBS"
4929 cat >conftest.$ac_ext <<_ACEOF
4930 #line 4930 "configure"
4931 #include "confdefs.h"
4932
4933 /* Override any gcc2 internal prototype to avoid an error.  */
4934 #ifdef __cplusplus
4935 extern "C"
4936 #endif
4937 /* We use char because int might match the return type of a gcc2
4938    builtin and then its argument prototype would still apply.  */
4939 char initscr ();
4940 int
4941 main (void)
4942 {
4943 initscr ();
4944   ;
4945   return 0;
4946 }
4947 _ACEOF
4948 rm -f conftest.$ac_objext conftest$ac_exeext
4949 if { (eval echo "$as_me:4949: \"$ac_link\"") >&5
4950   (eval $ac_link) 2>&5
4951   ac_status=$?
4952   echo "$as_me:4952: \$? = $ac_status" >&5
4953   (exit $ac_status); } &&
4954          { ac_try='test -s conftest$ac_exeext'
4955   { (eval echo "$as_me:4955: \"$ac_try\"") >&5
4956   (eval $ac_try) 2>&5
4957   ac_status=$?
4958   echo "$as_me:4958: \$? = $ac_status" >&5
4959   (exit $ac_status); }; }; then
4960   ac_cv_lib_gpm_initscr=yes
4961 else
4962   echo "$as_me: failed program was:" >&5
4963 cat conftest.$ac_ext >&5
4964 ac_cv_lib_gpm_initscr=no
4965 fi
4966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4967 LIBS=$ac_check_lib_save_LIBS
4968 fi
4969 echo "$as_me:4969: result: $ac_cv_lib_gpm_initscr" >&5
4970 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4971 if test $ac_cv_lib_gpm_initscr = yes; then
4972   LIBS="$cf_ncurses_SAVE"
4973 else
4974   cf_ncurses_LIBS="-lgpm"
4975 fi
4976
4977 fi
4978
4979 case $host_os in
4980 (freebsd*)
4981         # This is only necessary if you are linking against an obsolete
4982         # version of ncurses (but it should do no harm, since it's static).
4983         if test "$cf_nculib_root" = ncurses ; then
4984                 echo "$as_me:4984: checking for tgoto in -lmytinfo" >&5
4985 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4986 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4987   echo $ECHO_N "(cached) $ECHO_C" >&6
4988 else
4989   ac_check_lib_save_LIBS=$LIBS
4990 LIBS="-lmytinfo  $LIBS"
4991 cat >conftest.$ac_ext <<_ACEOF
4992 #line 4992 "configure"
4993 #include "confdefs.h"
4994
4995 /* Override any gcc2 internal prototype to avoid an error.  */
4996 #ifdef __cplusplus
4997 extern "C"
4998 #endif
4999 /* We use char because int might match the return type of a gcc2
5000    builtin and then its argument prototype would still apply.  */
5001 char tgoto ();
5002 int
5003 main (void)
5004 {
5005 tgoto ();
5006   ;
5007   return 0;
5008 }
5009 _ACEOF
5010 rm -f conftest.$ac_objext conftest$ac_exeext
5011 if { (eval echo "$as_me:5011: \"$ac_link\"") >&5
5012   (eval $ac_link) 2>&5
5013   ac_status=$?
5014   echo "$as_me:5014: \$? = $ac_status" >&5
5015   (exit $ac_status); } &&
5016          { ac_try='test -s conftest$ac_exeext'
5017   { (eval echo "$as_me:5017: \"$ac_try\"") >&5
5018   (eval $ac_try) 2>&5
5019   ac_status=$?
5020   echo "$as_me:5020: \$? = $ac_status" >&5
5021   (exit $ac_status); }; }; then
5022   ac_cv_lib_mytinfo_tgoto=yes
5023 else
5024   echo "$as_me: failed program was:" >&5
5025 cat conftest.$ac_ext >&5
5026 ac_cv_lib_mytinfo_tgoto=no
5027 fi
5028 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5029 LIBS=$ac_check_lib_save_LIBS
5030 fi
5031 echo "$as_me:5031: result: $ac_cv_lib_mytinfo_tgoto" >&5
5032 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5033 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5034   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5035 fi
5036
5037         fi
5038         ;;
5039 esac
5040
5041 cf_add_libs="$cf_ncurses_LIBS"
5042 # Filter out duplicates - this happens with badly-designed ".pc" files...
5043 for cf_add_1lib in $LIBS
5044 do
5045         for cf_add_2lib in $cf_add_libs
5046         do
5047                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5048                 then
5049                         cf_add_1lib=
5050                         break
5051                 fi
5052         done
5053         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5054 done
5055 LIBS="$cf_add_libs"
5056
5057 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5058 then
5059
5060 cf_add_libs="-l$cf_nculib_root"
5061 # Filter out duplicates - this happens with badly-designed ".pc" files...
5062 for cf_add_1lib in $LIBS
5063 do
5064         for cf_add_2lib in $cf_add_libs
5065         do
5066                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5067                 then
5068                         cf_add_1lib=
5069                         break
5070                 fi
5071         done
5072         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5073 done
5074 LIBS="$cf_add_libs"
5075
5076 else
5077
5078         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5079         cf_libdir=""
5080         echo "$as_me:5080: checking for initscr" >&5
5081 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5082 if test "${ac_cv_func_initscr+set}" = set; then
5083   echo $ECHO_N "(cached) $ECHO_C" >&6
5084 else
5085   cat >conftest.$ac_ext <<_ACEOF
5086 #line 5086 "configure"
5087 #include "confdefs.h"
5088 /* System header to define __stub macros and hopefully few prototypes,
5089     which can conflict with char initscr (); below.  */
5090 #include <assert.h>
5091 /* Override any gcc2 internal prototype to avoid an error.  */
5092 #ifdef __cplusplus
5093 extern "C"
5094 #endif
5095 /* We use char because int might match the return type of a gcc2
5096    builtin and then its argument prototype would still apply.  */
5097 char initscr ();
5098 char (*f) ();
5099
5100 int
5101 main (void)
5102 {
5103 /* The GNU C library defines this for functions which it implements
5104     to always fail with ENOSYS.  Some functions are actually named
5105     something starting with __ and the normal name is an alias.  */
5106 #if defined (__stub_initscr) || defined (__stub___initscr)
5107 choke me
5108 #else
5109 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5110 #endif
5111
5112   ;
5113   return 0;
5114 }
5115 _ACEOF
5116 rm -f conftest.$ac_objext conftest$ac_exeext
5117 if { (eval echo "$as_me:5117: \"$ac_link\"") >&5
5118   (eval $ac_link) 2>&5
5119   ac_status=$?
5120   echo "$as_me:5120: \$? = $ac_status" >&5
5121   (exit $ac_status); } &&
5122          { ac_try='test -s conftest$ac_exeext'
5123   { (eval echo "$as_me:5123: \"$ac_try\"") >&5
5124   (eval $ac_try) 2>&5
5125   ac_status=$?
5126   echo "$as_me:5126: \$? = $ac_status" >&5
5127   (exit $ac_status); }; }; then
5128   ac_cv_func_initscr=yes
5129 else
5130   echo "$as_me: failed program was:" >&5
5131 cat conftest.$ac_ext >&5
5132 ac_cv_func_initscr=no
5133 fi
5134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5135 fi
5136 echo "$as_me:5136: result: $ac_cv_func_initscr" >&5
5137 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5138 if test $ac_cv_func_initscr = yes; then
5139   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5140 else
5141
5142                 cf_save_LIBS="$LIBS"
5143                 echo "$as_me:5143: checking for initscr in -l$cf_nculib_root" >&5
5144 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5145                 LIBS="-l$cf_nculib_root $LIBS"
5146                 cat >conftest.$ac_ext <<_ACEOF
5147 #line 5147 "configure"
5148 #include "confdefs.h"
5149 #include <${cf_cv_ncurses_header:-curses.h}>
5150 int
5151 main (void)
5152 {
5153 initscr()
5154   ;
5155   return 0;
5156 }
5157 _ACEOF
5158 rm -f conftest.$ac_objext conftest$ac_exeext
5159 if { (eval echo "$as_me:5159: \"$ac_link\"") >&5
5160   (eval $ac_link) 2>&5
5161   ac_status=$?
5162   echo "$as_me:5162: \$? = $ac_status" >&5
5163   (exit $ac_status); } &&
5164          { ac_try='test -s conftest$ac_exeext'
5165   { (eval echo "$as_me:5165: \"$ac_try\"") >&5
5166   (eval $ac_try) 2>&5
5167   ac_status=$?
5168   echo "$as_me:5168: \$? = $ac_status" >&5
5169   (exit $ac_status); }; }; then
5170   echo "$as_me:5170: result: yes" >&5
5171 echo "${ECHO_T}yes" >&6
5172                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5173
5174 else
5175   echo "$as_me: failed program was:" >&5
5176 cat conftest.$ac_ext >&5
5177 echo "$as_me:5177: result: no" >&5
5178 echo "${ECHO_T}no" >&6
5179
5180 cf_search=
5181 cf_library_path_list=""
5182 if test -n "${LDFLAGS}${LIBS}" ; then
5183         for cf_library_path in $LDFLAGS $LIBS
5184         do
5185                 case $cf_library_path in
5186                 (-L*)
5187                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5188
5189 test "x$cf_library_path" != "xNONE" && \
5190 test -d "$cf_library_path" && \
5191  {
5192         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5193         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5194         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5195         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5196         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5197         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"
5198 }
5199
5200                         cf_library_path_list="$cf_library_path_list $cf_search"
5201                         ;;
5202                 esac
5203         done
5204 fi
5205
5206 cf_search=
5207
5208 test "x$prefix" != "xNONE" && \
5209 test -d "$prefix" && \
5210  {
5211         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5212         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5213         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5214         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5215         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5216         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5217 }
5218
5219 for cf_subdir_prefix in \
5220         /usr \
5221         /usr/local \
5222         /usr/pkg \
5223         /opt \
5224         /opt/local \
5225         $HOME
5226 do
5227
5228 test "x$cf_subdir_prefix" != "x$prefix" && \
5229 test -d "$cf_subdir_prefix" && \
5230 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5231         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5232         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5233         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5234         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5235         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5236         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"
5237 }
5238
5239 done
5240
5241 cf_search="$cf_library_path_list $cf_search"
5242
5243                         for cf_libdir in $cf_search
5244                         do
5245                                 echo "$as_me:5245: checking for -l$cf_nculib_root in $cf_libdir" >&5
5246 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5247                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5248                                 cat >conftest.$ac_ext <<_ACEOF
5249 #line 5249 "configure"
5250 #include "confdefs.h"
5251 #include <${cf_cv_ncurses_header:-curses.h}>
5252 int
5253 main (void)
5254 {
5255 initscr()
5256   ;
5257   return 0;
5258 }
5259 _ACEOF
5260 rm -f conftest.$ac_objext conftest$ac_exeext
5261 if { (eval echo "$as_me:5261: \"$ac_link\"") >&5
5262   (eval $ac_link) 2>&5
5263   ac_status=$?
5264   echo "$as_me:5264: \$? = $ac_status" >&5
5265   (exit $ac_status); } &&
5266          { ac_try='test -s conftest$ac_exeext'
5267   { (eval echo "$as_me:5267: \"$ac_try\"") >&5
5268   (eval $ac_try) 2>&5
5269   ac_status=$?
5270   echo "$as_me:5270: \$? = $ac_status" >&5
5271   (exit $ac_status); }; }; then
5272   echo "$as_me:5272: result: yes" >&5
5273 echo "${ECHO_T}yes" >&6
5274                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5275                                          break
5276 else
5277   echo "$as_me: failed program was:" >&5
5278 cat conftest.$ac_ext >&5
5279 echo "$as_me:5279: result: no" >&5
5280 echo "${ECHO_T}no" >&6
5281                                          LIBS="$cf_save_LIBS"
5282 fi
5283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5284                         done
5285
5286 fi
5287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5288
5289 fi
5290
5291 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5292
5293 if test $cf_found_library = no ; then
5294         { { echo "$as_me:5294: error: Cannot link $cf_nculib_root library" >&5
5295 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5296    { (exit 1); exit 1; }; }
5297 fi
5298
5299 fi
5300
5301 if test -n "$cf_ncurses_LIBS" ; then
5302         echo "$as_me:5302: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5303 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5304         cf_ncurses_SAVE="$LIBS"
5305         for p in $cf_ncurses_LIBS ; do
5306                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5307                 if test "$q" != "$LIBS" ; then
5308                         LIBS="$q"
5309                 fi
5310         done
5311         cat >conftest.$ac_ext <<_ACEOF
5312 #line 5312 "configure"
5313 #include "confdefs.h"
5314 #include <${cf_cv_ncurses_header:-curses.h}>
5315 int
5316 main (void)
5317 {
5318 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5319   ;
5320   return 0;
5321 }
5322 _ACEOF
5323 rm -f conftest.$ac_objext conftest$ac_exeext
5324 if { (eval echo "$as_me:5324: \"$ac_link\"") >&5
5325   (eval $ac_link) 2>&5
5326   ac_status=$?
5327   echo "$as_me:5327: \$? = $ac_status" >&5
5328   (exit $ac_status); } &&
5329          { ac_try='test -s conftest$ac_exeext'
5330   { (eval echo "$as_me:5330: \"$ac_try\"") >&5
5331   (eval $ac_try) 2>&5
5332   ac_status=$?
5333   echo "$as_me:5333: \$? = $ac_status" >&5
5334   (exit $ac_status); }; }; then
5335   echo "$as_me:5335: result: yes" >&5
5336 echo "${ECHO_T}yes" >&6
5337 else
5338   echo "$as_me: failed program was:" >&5
5339 cat conftest.$ac_ext >&5
5340 echo "$as_me:5340: result: no" >&5
5341 echo "${ECHO_T}no" >&6
5342                  LIBS="$cf_ncurses_SAVE"
5343 fi
5344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5345 fi
5346
5347 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5348
5349 cat >>confdefs.h <<EOF
5350 #define $cf_nculib_ROOT 1
5351 EOF
5352
5353         fi
5354 else
5355         NCURSES_CONFIG=none
5356 fi
5357
5358 echo "$as_me:5358: checking if you want wide-character code" >&5
5359 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5360
5361 # Check whether --enable-widec or --disable-widec was given.
5362 if test "${enable_widec+set}" = set; then
5363   enableval="$enable_widec"
5364   with_widec=$enableval
5365 else
5366   with_widec=no
5367 fi;
5368 echo "$as_me:5368: result: $with_widec" >&5
5369 echo "${ECHO_T}$with_widec" >&6
5370 if test "$with_widec" = yes ; then
5371
5372 echo "$as_me:5372: checking for multibyte character support" >&5
5373 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5374 if test "${cf_cv_utf8_lib+set}" = set; then
5375   echo $ECHO_N "(cached) $ECHO_C" >&6
5376 else
5377
5378         cf_save_LIBS="$LIBS"
5379         cat >conftest.$ac_ext <<_ACEOF
5380 #line 5380 "configure"
5381 #include "confdefs.h"
5382
5383 #include <stdlib.h>
5384 int
5385 main (void)
5386 {
5387 putwc(0,0);
5388   ;
5389   return 0;
5390 }
5391 _ACEOF
5392 rm -f conftest.$ac_objext conftest$ac_exeext
5393 if { (eval echo "$as_me:5393: \"$ac_link\"") >&5
5394   (eval $ac_link) 2>&5
5395   ac_status=$?
5396   echo "$as_me:5396: \$? = $ac_status" >&5
5397   (exit $ac_status); } &&
5398          { ac_try='test -s conftest$ac_exeext'
5399   { (eval echo "$as_me:5399: \"$ac_try\"") >&5
5400   (eval $ac_try) 2>&5
5401   ac_status=$?
5402   echo "$as_me:5402: \$? = $ac_status" >&5
5403   (exit $ac_status); }; }; then
5404   cf_cv_utf8_lib=yes
5405 else
5406   echo "$as_me: failed program was:" >&5
5407 cat conftest.$ac_ext >&5
5408
5409 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5410 # will be set on completion of the AC_TRY_LINK below.
5411 cf_cv_header_path_utf8=
5412 cf_cv_library_path_utf8=
5413
5414 echo "${as_me:-configure}:5414: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5415
5416 cf_save_LIBS="$LIBS"
5417
5418 cat >conftest.$ac_ext <<_ACEOF
5419 #line 5419 "configure"
5420 #include "confdefs.h"
5421
5422 #include <libutf8.h>
5423 int
5424 main (void)
5425 {
5426 putwc(0,0);
5427   ;
5428   return 0;
5429 }
5430 _ACEOF
5431 rm -f conftest.$ac_objext conftest$ac_exeext
5432 if { (eval echo "$as_me:5432: \"$ac_link\"") >&5
5433   (eval $ac_link) 2>&5
5434   ac_status=$?
5435   echo "$as_me:5435: \$? = $ac_status" >&5
5436   (exit $ac_status); } &&
5437          { ac_try='test -s conftest$ac_exeext'
5438   { (eval echo "$as_me:5438: \"$ac_try\"") >&5
5439   (eval $ac_try) 2>&5
5440   ac_status=$?
5441   echo "$as_me:5441: \$? = $ac_status" >&5
5442   (exit $ac_status); }; }; then
5443
5444         cf_cv_find_linkage_utf8=yes
5445         cf_cv_header_path_utf8=/usr/include
5446         cf_cv_library_path_utf8=/usr/lib
5447
5448 else
5449   echo "$as_me: failed program was:" >&5
5450 cat conftest.$ac_ext >&5
5451
5452 LIBS="-lutf8  $cf_save_LIBS"
5453
5454 cat >conftest.$ac_ext <<_ACEOF
5455 #line 5455 "configure"
5456 #include "confdefs.h"
5457
5458 #include <libutf8.h>
5459 int
5460 main (void)
5461 {
5462 putwc(0,0);
5463   ;
5464   return 0;
5465 }
5466 _ACEOF
5467 rm -f conftest.$ac_objext conftest$ac_exeext
5468 if { (eval echo "$as_me:5468: \"$ac_link\"") >&5
5469   (eval $ac_link) 2>&5
5470   ac_status=$?
5471   echo "$as_me:5471: \$? = $ac_status" >&5
5472   (exit $ac_status); } &&
5473          { ac_try='test -s conftest$ac_exeext'
5474   { (eval echo "$as_me:5474: \"$ac_try\"") >&5
5475   (eval $ac_try) 2>&5
5476   ac_status=$?
5477   echo "$as_me:5477: \$? = $ac_status" >&5
5478   (exit $ac_status); }; }; then
5479
5480         cf_cv_find_linkage_utf8=yes
5481         cf_cv_header_path_utf8=/usr/include
5482         cf_cv_library_path_utf8=/usr/lib
5483         cf_cv_library_file_utf8="-lutf8"
5484
5485 else
5486   echo "$as_me: failed program was:" >&5
5487 cat conftest.$ac_ext >&5
5488
5489         cf_cv_find_linkage_utf8=no
5490         LIBS="$cf_save_LIBS"
5491
5492         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5493
5494 echo "${as_me:-configure}:5494: testing find linkage for utf8 library ..." 1>&5
5495
5496 echo "${as_me:-configure}:5496: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5497
5498         cf_save_CPPFLAGS="$CPPFLAGS"
5499         cf_test_CPPFLAGS="$CPPFLAGS"
5500
5501 cf_search=
5502
5503 # collect the current set of include-directories from compiler flags
5504 cf_header_path_list=""
5505 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5506         for cf_header_path in $CPPFLAGS $CFLAGS
5507         do
5508                 case $cf_header_path in
5509                 (-I*)
5510                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5511
5512 test "x$cf_header_path" != "xNONE" && \
5513 test -d "$cf_header_path" && \
5514  {
5515         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5516         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5517         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5518         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5519         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5520         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5521 }
5522
5523                         cf_header_path_list="$cf_header_path_list $cf_search"
5524                         ;;
5525                 esac
5526         done
5527 fi
5528
5529 # add the variations for the package we are looking for
5530
5531 cf_search=
5532
5533 test "x$prefix" != "xNONE" && \
5534 test -d "$prefix" && \
5535  {
5536         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5537         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5538         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5539         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5540         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5541         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5542 }
5543
5544 for cf_subdir_prefix in \
5545         /usr \
5546         /usr/local \
5547         /usr/pkg \
5548         /opt \
5549         /opt/local \
5550         $HOME
5551 do
5552
5553 test "x$cf_subdir_prefix" != "x$prefix" && \
5554 test -d "$cf_subdir_prefix" && \
5555 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5556         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5557         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5558         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5559         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5560         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5561         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5562 }
5563
5564 done
5565
5566 test "$includedir" != NONE && \
5567 test "$includedir" != "/usr/include" && \
5568 test -d "$includedir" && {
5569         test -d $includedir &&    cf_search="$cf_search $includedir"
5570         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5571 }
5572
5573 test "$oldincludedir" != NONE && \
5574 test "$oldincludedir" != "/usr/include" && \
5575 test -d "$oldincludedir" && {
5576         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5577         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5578 }
5579
5580 cf_search="$cf_search $cf_header_path_list"
5581
5582         for cf_cv_header_path_utf8 in $cf_search
5583         do
5584                 if test -d $cf_cv_header_path_utf8 ; then
5585                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5586
5587 echo "${as_me:-configure}:5587: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5588
5589                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5590                         cat >conftest.$ac_ext <<_ACEOF
5591 #line 5591 "configure"
5592 #include "confdefs.h"
5593
5594 #include <libutf8.h>
5595 int
5596 main (void)
5597 {
5598 putwc(0,0);
5599   ;
5600   return 0;
5601 }
5602 _ACEOF
5603 rm -f conftest.$ac_objext
5604 if { (eval echo "$as_me:5604: \"$ac_compile\"") >&5
5605   (eval $ac_compile) 2>&5
5606   ac_status=$?
5607   echo "$as_me:5607: \$? = $ac_status" >&5
5608   (exit $ac_status); } &&
5609          { ac_try='test -s conftest.$ac_objext'
5610   { (eval echo "$as_me:5610: \"$ac_try\"") >&5
5611   (eval $ac_try) 2>&5
5612   ac_status=$?
5613   echo "$as_me:5613: \$? = $ac_status" >&5
5614   (exit $ac_status); }; }; then
5615
5616                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5617
5618 echo "${as_me:-configure}:5618: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5619
5620                                 cf_cv_find_linkage_utf8=maybe
5621                                 cf_test_CPPFLAGS="$CPPFLAGS"
5622                                 break
5623 else
5624   echo "$as_me: failed program was:" >&5
5625 cat conftest.$ac_ext >&5
5626
5627                                 CPPFLAGS="$cf_save_CPPFLAGS"
5628
5629 fi
5630 rm -f conftest.$ac_objext conftest.$ac_ext
5631                 fi
5632         done
5633
5634         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5635
5636 echo "${as_me:-configure}:5636: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5637
5638                 cf_save_LIBS="$LIBS"
5639                 cf_save_LDFLAGS="$LDFLAGS"
5640
5641                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5642
5643 cf_search=
5644 cf_library_path_list=""
5645 if test -n "${LDFLAGS}${LIBS}" ; then
5646         for cf_library_path in $LDFLAGS $LIBS
5647         do
5648                 case $cf_library_path in
5649                 (-L*)
5650                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5651
5652 test "x$cf_library_path" != "xNONE" && \
5653 test -d "$cf_library_path" && \
5654  {
5655         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5656         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5657         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5658         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5659         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5660         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5661 }
5662
5663                         cf_library_path_list="$cf_library_path_list $cf_search"
5664                         ;;
5665                 esac
5666         done
5667 fi
5668
5669 cf_search=
5670
5671 test "x$prefix" != "xNONE" && \
5672 test -d "$prefix" && \
5673  {
5674         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5675         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5676         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5677         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5678         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5679         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5680 }
5681
5682 for cf_subdir_prefix in \
5683         /usr \
5684         /usr/local \
5685         /usr/pkg \
5686         /opt \
5687         /opt/local \
5688         $HOME
5689 do
5690
5691 test "x$cf_subdir_prefix" != "x$prefix" && \
5692 test -d "$cf_subdir_prefix" && \
5693 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5694         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5695         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5696         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5697         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5698         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5699         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5700 }
5701
5702 done
5703
5704 cf_search="$cf_library_path_list $cf_search"
5705
5706                         for cf_cv_library_path_utf8 in $cf_search
5707                         do
5708                                 if test -d $cf_cv_library_path_utf8 ; then
5709                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5710
5711 echo "${as_me:-configure}:5711: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5712
5713                                         CPPFLAGS="$cf_test_CPPFLAGS"
5714                                         LIBS="-lutf8  $cf_save_LIBS"
5715                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5716                                         cat >conftest.$ac_ext <<_ACEOF
5717 #line 5717 "configure"
5718 #include "confdefs.h"
5719
5720 #include <libutf8.h>
5721 int
5722 main (void)
5723 {
5724 putwc(0,0);
5725   ;
5726   return 0;
5727 }
5728 _ACEOF
5729 rm -f conftest.$ac_objext conftest$ac_exeext
5730 if { (eval echo "$as_me:5730: \"$ac_link\"") >&5
5731   (eval $ac_link) 2>&5
5732   ac_status=$?
5733   echo "$as_me:5733: \$? = $ac_status" >&5
5734   (exit $ac_status); } &&
5735          { ac_try='test -s conftest$ac_exeext'
5736   { (eval echo "$as_me:5736: \"$ac_try\"") >&5
5737   (eval $ac_try) 2>&5
5738   ac_status=$?
5739   echo "$as_me:5739: \$? = $ac_status" >&5
5740   (exit $ac_status); }; }; then
5741
5742                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5743
5744 echo "${as_me:-configure}:5744: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5745
5746                                         cf_cv_find_linkage_utf8=yes
5747                                         cf_cv_library_file_utf8="-lutf8"
5748                                         break
5749 else
5750   echo "$as_me: failed program was:" >&5
5751 cat conftest.$ac_ext >&5
5752
5753                                         CPPFLAGS="$cf_save_CPPFLAGS"
5754                                         LIBS="$cf_save_LIBS"
5755                                         LDFLAGS="$cf_save_LDFLAGS"
5756
5757 fi
5758 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5759                                 fi
5760                         done
5761                         CPPFLAGS="$cf_save_CPPFLAGS"
5762                         LDFLAGS="$cf_save_LDFLAGS"
5763                 fi
5764
5765         else
5766                 cf_cv_find_linkage_utf8=no
5767         fi
5768
5769 fi
5770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5771
5772 fi
5773 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5774
5775 LIBS="$cf_save_LIBS"
5776
5777 if test "$cf_cv_find_linkage_utf8" = yes ; then
5778 cf_cv_utf8_lib=add-on
5779 else
5780 cf_cv_utf8_lib=no
5781 fi
5782
5783 fi
5784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5785 fi
5786 echo "$as_me:5786: result: $cf_cv_utf8_lib" >&5
5787 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5788
5789 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5790 # ncurses/ncursesw:
5791 if test "$cf_cv_utf8_lib" = "add-on" ; then
5792
5793 cat >>confdefs.h <<\EOF
5794 #define HAVE_LIBUTF8_H 1
5795 EOF
5796
5797 if test -n "$cf_cv_header_path_utf8" ; then
5798   for cf_add_incdir in $cf_cv_header_path_utf8
5799   do
5800         while test $cf_add_incdir != /usr/include
5801         do
5802           if test -d $cf_add_incdir
5803           then
5804                 cf_have_incdir=no
5805                 if test -n "$CFLAGS$CPPFLAGS" ; then
5806                   # a loop is needed to ensure we can add subdirs of existing dirs
5807                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5808                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5809                           cf_have_incdir=yes; break
5810                         fi
5811                   done
5812                 fi
5813
5814                 if test "$cf_have_incdir" = no ; then
5815                   if test "$cf_add_incdir" = /usr/local/include ; then
5816                         if test "$GCC" = yes
5817                         then
5818                           cf_save_CPPFLAGS=$CPPFLAGS
5819                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5820                           cat >conftest.$ac_ext <<_ACEOF
5821 #line 5821 "configure"
5822 #include "confdefs.h"
5823 #include <stdio.h>
5824 int
5825 main (void)
5826 {
5827 printf("Hello")
5828   ;
5829   return 0;
5830 }
5831 _ACEOF
5832 rm -f conftest.$ac_objext
5833 if { (eval echo "$as_me:5833: \"$ac_compile\"") >&5
5834   (eval $ac_compile) 2>&5
5835   ac_status=$?
5836   echo "$as_me:5836: \$? = $ac_status" >&5
5837   (exit $ac_status); } &&
5838          { ac_try='test -s conftest.$ac_objext'
5839   { (eval echo "$as_me:5839: \"$ac_try\"") >&5
5840   (eval $ac_try) 2>&5
5841   ac_status=$?
5842   echo "$as_me:5842: \$? = $ac_status" >&5
5843   (exit $ac_status); }; }; then
5844   :
5845 else
5846   echo "$as_me: failed program was:" >&5
5847 cat conftest.$ac_ext >&5
5848 cf_have_incdir=yes
5849 fi
5850 rm -f conftest.$ac_objext conftest.$ac_ext
5851                           CPPFLAGS=$cf_save_CPPFLAGS
5852                         fi
5853                   fi
5854                 fi
5855
5856                 if test "$cf_have_incdir" = no ; then
5857                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5858
5859 echo "${as_me:-configure}:5859: testing adding $cf_add_incdir to include-path ..." 1>&5
5860
5861                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5862
5863                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5864                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5865                   cf_add_incdir="$cf_top_incdir"
5866                 else
5867                   break
5868                 fi
5869           else
5870                 break
5871           fi
5872         done
5873   done
5874 fi
5875
5876 if test -n "$cf_cv_library_path_utf8" ; then
5877         for cf_add_libdir in $cf_cv_library_path_utf8
5878         do
5879                 if test $cf_add_libdir = /usr/lib ; then
5880                         :
5881                 elif test -d $cf_add_libdir
5882                 then
5883                         cf_have_libdir=no
5884                         if test -n "$LDFLAGS$LIBS" ; then
5885                                 # a loop is needed to ensure we can add subdirs of existing dirs
5886                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5887                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5888                                                 cf_have_libdir=yes; break
5889                                         fi
5890                                 done
5891                         fi
5892                         if test "$cf_have_libdir" = no ; then
5893                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5894
5895 echo "${as_me:-configure}:5895: testing adding $cf_add_libdir to library-path ..." 1>&5
5896
5897                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5898                         fi
5899                 fi
5900         done
5901 fi
5902
5903 cf_add_libs="$cf_cv_library_file_utf8"
5904 # Filter out duplicates - this happens with badly-designed ".pc" files...
5905 for cf_add_1lib in $LIBS
5906 do
5907         for cf_add_2lib in $cf_add_libs
5908         do
5909                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5910                 then
5911                         cf_add_1lib=
5912                         break
5913                 fi
5914         done
5915         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5916 done
5917 LIBS="$cf_add_libs"
5918
5919 fi
5920
5921 cf_ncuconfig_root=ncursesw
5922 cf_have_ncuconfig=no
5923
5924 if test "x${PKG_CONFIG:=none}" != xnone; then
5925         echo "$as_me:5925: checking pkg-config for $cf_ncuconfig_root" >&5
5926 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5927         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5928                 echo "$as_me:5928: result: yes" >&5
5929 echo "${ECHO_T}yes" >&6
5930
5931                 echo "$as_me:5931: checking if the $cf_ncuconfig_root package files work" >&5
5932 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5933                 cf_have_ncuconfig=unknown
5934
5935                 cf_save_CPPFLAGS="$CPPFLAGS"
5936                 cf_save_LIBS="$LIBS"
5937
5938                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5939
5940 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5941 # Filter out duplicates - this happens with badly-designed ".pc" files...
5942 for cf_add_1lib in $LIBS
5943 do
5944         for cf_add_2lib in $cf_add_libs
5945         do
5946                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5947                 then
5948                         cf_add_1lib=
5949                         break
5950                 fi
5951         done
5952         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5953 done
5954 LIBS="$cf_add_libs"
5955
5956                 cat >conftest.$ac_ext <<_ACEOF
5957 #line 5957 "configure"
5958 #include "confdefs.h"
5959 #include <${cf_cv_ncurses_header:-curses.h}>
5960 int
5961 main (void)
5962 {
5963 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5964   ;
5965   return 0;
5966 }
5967 _ACEOF
5968 rm -f conftest.$ac_objext conftest$ac_exeext
5969 if { (eval echo "$as_me:5969: \"$ac_link\"") >&5
5970   (eval $ac_link) 2>&5
5971   ac_status=$?
5972   echo "$as_me:5972: \$? = $ac_status" >&5
5973   (exit $ac_status); } &&
5974          { ac_try='test -s conftest$ac_exeext'
5975   { (eval echo "$as_me:5975: \"$ac_try\"") >&5
5976   (eval $ac_try) 2>&5
5977   ac_status=$?
5978   echo "$as_me:5978: \$? = $ac_status" >&5
5979   (exit $ac_status); }; }; then
5980   if test "$cross_compiling" = yes; then
5981   cf_have_ncuconfig=maybe
5982 else
5983   cat >conftest.$ac_ext <<_ACEOF
5984 #line 5984 "configure"
5985 #include "confdefs.h"
5986 #include <${cf_cv_ncurses_header:-curses.h}>
5987                                 int main(void)
5988                                 { char *xx = curses_version(); return (xx == 0); }
5989 _ACEOF
5990 rm -f conftest$ac_exeext
5991 if { (eval echo "$as_me:5991: \"$ac_link\"") >&5
5992   (eval $ac_link) 2>&5
5993   ac_status=$?
5994   echo "$as_me:5994: \$? = $ac_status" >&5
5995   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5996   { (eval echo "$as_me:5996: \"$ac_try\"") >&5
5997   (eval $ac_try) 2>&5
5998   ac_status=$?
5999   echo "$as_me:5999: \$? = $ac_status" >&5
6000   (exit $ac_status); }; }; then
6001   cf_have_ncuconfig=yes
6002 else
6003   echo "$as_me: program exited with status $ac_status" >&5
6004 echo "$as_me: failed program was:" >&5
6005 cat conftest.$ac_ext >&5
6006 cf_have_ncuconfig=no
6007 fi
6008 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6009 fi
6010 else
6011   echo "$as_me: failed program was:" >&5
6012 cat conftest.$ac_ext >&5
6013 cf_have_ncuconfig=no
6014 fi
6015 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6016                 echo "$as_me:6016: result: $cf_have_ncuconfig" >&5
6017 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6018                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6019                 if test "$cf_have_ncuconfig" != "yes"
6020                 then
6021                         CPPFLAGS="$cf_save_CPPFLAGS"
6022                         LIBS="$cf_save_LIBS"
6023                         NCURSES_CONFIG_PKG=none
6024                 else
6025
6026 cat >>confdefs.h <<\EOF
6027 #define NCURSES 1
6028 EOF
6029
6030                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6031                 fi
6032
6033 echo "$as_me:6033: checking for terminfo header" >&5
6034 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6035 if test "${cf_cv_term_header+set}" = set; then
6036   echo $ECHO_N "(cached) $ECHO_C" >&6
6037 else
6038
6039 case ${cf_cv_ncurses_header} in
6040 (*/ncurses.h|*/ncursesw.h)
6041         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6042         ;;
6043 (*)
6044         cf_term_header=term.h
6045         ;;
6046 esac
6047
6048 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6049 do
6050 cat >conftest.$ac_ext <<_ACEOF
6051 #line 6051 "configure"
6052 #include "confdefs.h"
6053 #include <stdio.h>
6054 #include <${cf_cv_ncurses_header:-curses.h}>
6055 #include <$cf_test>
6056
6057 int
6058 main (void)
6059 {
6060 int x = auto_left_margin
6061   ;
6062   return 0;
6063 }
6064 _ACEOF
6065 rm -f conftest.$ac_objext
6066 if { (eval echo "$as_me:6066: \"$ac_compile\"") >&5
6067   (eval $ac_compile) 2>&5
6068   ac_status=$?
6069   echo "$as_me:6069: \$? = $ac_status" >&5
6070   (exit $ac_status); } &&
6071          { ac_try='test -s conftest.$ac_objext'
6072   { (eval echo "$as_me:6072: \"$ac_try\"") >&5
6073   (eval $ac_try) 2>&5
6074   ac_status=$?
6075   echo "$as_me:6075: \$? = $ac_status" >&5
6076   (exit $ac_status); }; }; then
6077
6078         cf_cv_term_header="$cf_test"
6079 else
6080   echo "$as_me: failed program was:" >&5
6081 cat conftest.$ac_ext >&5
6082
6083         cf_cv_term_header=unknown
6084
6085 fi
6086 rm -f conftest.$ac_objext conftest.$ac_ext
6087         test "$cf_cv_term_header" != unknown && break
6088 done
6089
6090 fi
6091 echo "$as_me:6091: result: $cf_cv_term_header" >&5
6092 echo "${ECHO_T}$cf_cv_term_header" >&6
6093
6094 # Set definitions to allow ifdef'ing to accommodate subdirectories
6095
6096 case $cf_cv_term_header in
6097 (*term.h)
6098
6099 cat >>confdefs.h <<\EOF
6100 #define HAVE_TERM_H 1
6101 EOF
6102
6103         ;;
6104 esac
6105
6106 case $cf_cv_term_header in
6107 (ncurses/term.h)
6108
6109 cat >>confdefs.h <<\EOF
6110 #define HAVE_NCURSES_TERM_H 1
6111 EOF
6112
6113         ;;
6114 (ncursesw/term.h)
6115
6116 cat >>confdefs.h <<\EOF
6117 #define HAVE_NCURSESW_TERM_H 1
6118 EOF
6119
6120         ;;
6121 esac
6122
6123         else
6124                 echo "$as_me:6124: result: no" >&5
6125 echo "${ECHO_T}no" >&6
6126                 NCURSES_CONFIG_PKG=none
6127         fi
6128 else
6129         NCURSES_CONFIG_PKG=none
6130 fi
6131
6132 if test "x$cf_have_ncuconfig" = "xno"; then
6133         echo "Looking for ${cf_ncuconfig_root}-config"
6134
6135 if test -n "$ac_tool_prefix"; then
6136   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6137   do
6138     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6139 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6140 echo "$as_me:6140: checking for $ac_word" >&5
6141 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6142 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6143   echo $ECHO_N "(cached) $ECHO_C" >&6
6144 else
6145   if test -n "$NCURSES_CONFIG"; then
6146   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6147 else
6148   ac_save_IFS=$IFS; IFS=$ac_path_separator
6149 ac_dummy="$PATH"
6150 for ac_dir in $ac_dummy; do
6151   IFS=$ac_save_IFS
6152   test -z "$ac_dir" && ac_dir=.
6153   $as_executable_p "$ac_dir/$ac_word" || continue
6154 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6155 echo "$as_me:6155: found $ac_dir/$ac_word" >&5
6156 break
6157 done
6158
6159 fi
6160 fi
6161 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6162 if test -n "$NCURSES_CONFIG"; then
6163   echo "$as_me:6163: result: $NCURSES_CONFIG" >&5
6164 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6165 else
6166   echo "$as_me:6166: result: no" >&5
6167 echo "${ECHO_T}no" >&6
6168 fi
6169
6170     test -n "$NCURSES_CONFIG" && break
6171   done
6172 fi
6173 if test -z "$NCURSES_CONFIG"; then
6174   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6175   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6176 do
6177   # Extract the first word of "$ac_prog", so it can be a program name with args.
6178 set dummy $ac_prog; ac_word=$2
6179 echo "$as_me:6179: checking for $ac_word" >&5
6180 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6181 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6182   echo $ECHO_N "(cached) $ECHO_C" >&6
6183 else
6184   if test -n "$ac_ct_NCURSES_CONFIG"; then
6185   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6186 else
6187   ac_save_IFS=$IFS; IFS=$ac_path_separator
6188 ac_dummy="$PATH"
6189 for ac_dir in $ac_dummy; do
6190   IFS=$ac_save_IFS
6191   test -z "$ac_dir" && ac_dir=.
6192   $as_executable_p "$ac_dir/$ac_word" || continue
6193 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6194 echo "$as_me:6194: found $ac_dir/$ac_word" >&5
6195 break
6196 done
6197
6198 fi
6199 fi
6200 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6201 if test -n "$ac_ct_NCURSES_CONFIG"; then
6202   echo "$as_me:6202: result: $ac_ct_NCURSES_CONFIG" >&5
6203 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6204 else
6205   echo "$as_me:6205: result: no" >&5
6206 echo "${ECHO_T}no" >&6
6207 fi
6208
6209   test -n "$ac_ct_NCURSES_CONFIG" && break
6210 done
6211 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6212
6213   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6214 fi
6215
6216         if test "$NCURSES_CONFIG" != none ; then
6217
6218                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6219
6220 cf_add_libs="`$NCURSES_CONFIG --libs`"
6221 # Filter out duplicates - this happens with badly-designed ".pc" files...
6222 for cf_add_1lib in $LIBS
6223 do
6224         for cf_add_2lib in $cf_add_libs
6225         do
6226                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6227                 then
6228                         cf_add_1lib=
6229                         break
6230                 fi
6231         done
6232         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6233 done
6234 LIBS="$cf_add_libs"
6235
6236                 # even with config script, some packages use no-override for curses.h
6237
6238 echo "$as_me:6238: checking if we have identified curses headers" >&5
6239 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6240 if test "${cf_cv_ncurses_header+set}" = set; then
6241   echo $ECHO_N "(cached) $ECHO_C" >&6
6242 else
6243
6244 cf_cv_ncurses_header=none
6245 for cf_header in \
6246         ncurses.h ncursesw/ncurses.h \
6247         curses.h ncursesw/curses.h
6248 do
6249 cat >conftest.$ac_ext <<_ACEOF
6250 #line 6250 "configure"
6251 #include "confdefs.h"
6252 #include <${cf_header}>
6253 int
6254 main (void)
6255 {
6256 initscr(); tgoto("?", 0,0)
6257   ;
6258   return 0;
6259 }
6260 _ACEOF
6261 rm -f conftest.$ac_objext
6262 if { (eval echo "$as_me:6262: \"$ac_compile\"") >&5
6263   (eval $ac_compile) 2>&5
6264   ac_status=$?
6265   echo "$as_me:6265: \$? = $ac_status" >&5
6266   (exit $ac_status); } &&
6267          { ac_try='test -s conftest.$ac_objext'
6268   { (eval echo "$as_me:6268: \"$ac_try\"") >&5
6269   (eval $ac_try) 2>&5
6270   ac_status=$?
6271   echo "$as_me:6271: \$? = $ac_status" >&5
6272   (exit $ac_status); }; }; then
6273   cf_cv_ncurses_header=$cf_header; break
6274 else
6275   echo "$as_me: failed program was:" >&5
6276 cat conftest.$ac_ext >&5
6277 fi
6278 rm -f conftest.$ac_objext conftest.$ac_ext
6279 done
6280
6281 fi
6282 echo "$as_me:6282: result: $cf_cv_ncurses_header" >&5
6283 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6284
6285 if test "$cf_cv_ncurses_header" = none ; then
6286         { { echo "$as_me:6286: error: No curses header-files found" >&5
6287 echo "$as_me: error: No curses header-files found" >&2;}
6288    { (exit 1); exit 1; }; }
6289 fi
6290
6291 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6292
6293 for ac_header in $cf_cv_ncurses_header
6294 do
6295 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6296 echo "$as_me:6296: checking for $ac_header" >&5
6297 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6298 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6299   echo $ECHO_N "(cached) $ECHO_C" >&6
6300 else
6301   cat >conftest.$ac_ext <<_ACEOF
6302 #line 6302 "configure"
6303 #include "confdefs.h"
6304 #include <$ac_header>
6305 _ACEOF
6306 if { (eval echo "$as_me:6306: \"$ac_cpp conftest.$ac_ext\"") >&5
6307   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6308   ac_status=$?
6309   egrep -v '^ *\+' conftest.er1 >conftest.err
6310   rm -f conftest.er1
6311   cat conftest.err >&5
6312   echo "$as_me:6312: \$? = $ac_status" >&5
6313   (exit $ac_status); } >/dev/null; then
6314   if test -s conftest.err; then
6315     ac_cpp_err=$ac_c_preproc_warn_flag
6316   else
6317     ac_cpp_err=
6318   fi
6319 else
6320   ac_cpp_err=yes
6321 fi
6322 if test -z "$ac_cpp_err"; then
6323   eval "$as_ac_Header=yes"
6324 else
6325   echo "$as_me: failed program was:" >&5
6326   cat conftest.$ac_ext >&5
6327   eval "$as_ac_Header=no"
6328 fi
6329 rm -f conftest.err conftest.$ac_ext
6330 fi
6331 echo "$as_me:6331: result: `eval echo '${'$as_ac_Header'}'`" >&5
6332 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6333 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6334   cat >>confdefs.h <<EOF
6335 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6336 EOF
6337
6338 fi
6339 done
6340
6341 cat >>confdefs.h <<\EOF
6342 #define NCURSES 1
6343 EOF
6344
6345 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6346
6347                 cat >>confdefs.h <<EOF
6348 #define $cf_nculib_ROOT 1
6349 EOF
6350
6351                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6352
6353         else
6354
6355 cf_ncuhdr_root=ncursesw
6356
6357 test -n "$cf_cv_curses_dir" && \
6358 test "$cf_cv_curses_dir" != "no" && { \
6359
6360 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6361   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6362   do
6363         while test $cf_add_incdir != /usr/include
6364         do
6365           if test -d $cf_add_incdir
6366           then
6367                 cf_have_incdir=no
6368                 if test -n "$CFLAGS$CPPFLAGS" ; then
6369                   # a loop is needed to ensure we can add subdirs of existing dirs
6370                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6371                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6372                           cf_have_incdir=yes; break
6373                         fi
6374                   done
6375                 fi
6376
6377                 if test "$cf_have_incdir" = no ; then
6378                   if test "$cf_add_incdir" = /usr/local/include ; then
6379                         if test "$GCC" = yes
6380                         then
6381                           cf_save_CPPFLAGS=$CPPFLAGS
6382                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6383                           cat >conftest.$ac_ext <<_ACEOF
6384 #line 6384 "configure"
6385 #include "confdefs.h"
6386 #include <stdio.h>
6387 int
6388 main (void)
6389 {
6390 printf("Hello")
6391   ;
6392   return 0;
6393 }
6394 _ACEOF
6395 rm -f conftest.$ac_objext
6396 if { (eval echo "$as_me:6396: \"$ac_compile\"") >&5
6397   (eval $ac_compile) 2>&5
6398   ac_status=$?
6399   echo "$as_me:6399: \$? = $ac_status" >&5
6400   (exit $ac_status); } &&
6401          { ac_try='test -s conftest.$ac_objext'
6402   { (eval echo "$as_me:6402: \"$ac_try\"") >&5
6403   (eval $ac_try) 2>&5
6404   ac_status=$?
6405   echo "$as_me:6405: \$? = $ac_status" >&5
6406   (exit $ac_status); }; }; then
6407   :
6408 else
6409   echo "$as_me: failed program was:" >&5
6410 cat conftest.$ac_ext >&5
6411 cf_have_incdir=yes
6412 fi
6413 rm -f conftest.$ac_objext conftest.$ac_ext
6414                           CPPFLAGS=$cf_save_CPPFLAGS
6415                         fi
6416                   fi
6417                 fi
6418
6419                 if test "$cf_have_incdir" = no ; then
6420                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6421
6422 echo "${as_me:-configure}:6422: testing adding $cf_add_incdir to include-path ..." 1>&5
6423
6424                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6425
6426                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6427                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6428                   cf_add_incdir="$cf_top_incdir"
6429                 else
6430                   break
6431                 fi
6432           else
6433                 break
6434           fi
6435         done
6436   done
6437 fi
6438
6439 }
6440
6441 echo "$as_me:6441: checking for $cf_ncuhdr_root header in include-path" >&5
6442 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6443 if test "${cf_cv_ncurses_h+set}" = set; then
6444   echo $ECHO_N "(cached) $ECHO_C" >&6
6445 else
6446
6447         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6448         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6449         for cf_header in $cf_header_list
6450         do
6451
6452         cat >conftest.$ac_ext <<_ACEOF
6453 #line 6453 "configure"
6454 #include "confdefs.h"
6455
6456 #define _XOPEN_SOURCE_EXTENDED
6457 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6458 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6459
6460 #include <$cf_header>
6461 int
6462 main (void)
6463 {
6464
6465 #ifdef NCURSES_VERSION
6466
6467 #ifndef WACS_BSSB
6468         make an error
6469 #endif
6470
6471 printf("%s\n", NCURSES_VERSION);
6472 #else
6473 #ifdef __NCURSES_H
6474 printf("old\n");
6475 #else
6476         make an error
6477 #endif
6478 #endif
6479
6480   ;
6481   return 0;
6482 }
6483 _ACEOF
6484 rm -f conftest.$ac_objext
6485 if { (eval echo "$as_me:6485: \"$ac_compile\"") >&5
6486   (eval $ac_compile) 2>&5
6487   ac_status=$?
6488   echo "$as_me:6488: \$? = $ac_status" >&5
6489   (exit $ac_status); } &&
6490          { ac_try='test -s conftest.$ac_objext'
6491   { (eval echo "$as_me:6491: \"$ac_try\"") >&5
6492   (eval $ac_try) 2>&5
6493   ac_status=$?
6494   echo "$as_me:6494: \$? = $ac_status" >&5
6495   (exit $ac_status); }; }; then
6496   cf_cv_ncurses_h=$cf_header
6497
6498 else
6499   echo "$as_me: failed program was:" >&5
6500 cat conftest.$ac_ext >&5
6501 cf_cv_ncurses_h=no
6502 fi
6503 rm -f conftest.$ac_objext conftest.$ac_ext
6504
6505                 test "$cf_cv_ncurses_h" != no && break
6506         done
6507
6508 fi
6509 echo "$as_me:6509: result: $cf_cv_ncurses_h" >&5
6510 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6511
6512 if test "$cf_cv_ncurses_h" != no ; then
6513         cf_cv_ncurses_header=$cf_cv_ncurses_h
6514 else
6515
6516 echo "$as_me:6516: checking for $cf_ncuhdr_root include-path" >&5
6517 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6518 if test "${cf_cv_ncurses_h2+set}" = set; then
6519   echo $ECHO_N "(cached) $ECHO_C" >&6
6520 else
6521
6522         test -n "$verbose" && echo
6523
6524 cf_search=
6525
6526 # collect the current set of include-directories from compiler flags
6527 cf_header_path_list=""
6528 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6529         for cf_header_path in $CPPFLAGS $CFLAGS
6530         do
6531                 case $cf_header_path in
6532                 (-I*)
6533                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6534
6535 test "x$cf_header_path" != "xNONE" && \
6536 test -d "$cf_header_path" && \
6537  {
6538         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6539         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6540         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6541         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6542         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6543         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"
6544 }
6545
6546                         cf_header_path_list="$cf_header_path_list $cf_search"
6547                         ;;
6548                 esac
6549         done
6550 fi
6551
6552 # add the variations for the package we are looking for
6553
6554 cf_search=
6555
6556 test "x$prefix" != "xNONE" && \
6557 test -d "$prefix" && \
6558  {
6559         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6560         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6561         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6562         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6563         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6564         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6565 }
6566
6567 for cf_subdir_prefix in \
6568         /usr \
6569         /usr/local \
6570         /usr/pkg \
6571         /opt \
6572         /opt/local \
6573         $HOME
6574 do
6575
6576 test "x$cf_subdir_prefix" != "x$prefix" && \
6577 test -d "$cf_subdir_prefix" && \
6578 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6579         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6580         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6581         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6582         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6583         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6584         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"
6585 }
6586
6587 done
6588
6589 test "$includedir" != NONE && \
6590 test "$includedir" != "/usr/include" && \
6591 test -d "$includedir" && {
6592         test -d $includedir &&    cf_search="$cf_search $includedir"
6593         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6594 }
6595
6596 test "$oldincludedir" != NONE && \
6597 test "$oldincludedir" != "/usr/include" && \
6598 test -d "$oldincludedir" && {
6599         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6600         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6601 }
6602
6603 cf_search="$cf_search $cf_header_path_list"
6604
6605         test -n "$verbose" && echo search path $cf_search
6606         cf_save2_CPPFLAGS="$CPPFLAGS"
6607         for cf_incdir in $cf_search
6608         do
6609
6610 if test -n "$cf_incdir" ; then
6611   for cf_add_incdir in $cf_incdir
6612   do
6613         while test $cf_add_incdir != /usr/include
6614         do
6615           if test -d $cf_add_incdir
6616           then
6617                 cf_have_incdir=no
6618                 if test -n "$CFLAGS$CPPFLAGS" ; then
6619                   # a loop is needed to ensure we can add subdirs of existing dirs
6620                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6621                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6622                           cf_have_incdir=yes; break
6623                         fi
6624                   done
6625                 fi
6626
6627                 if test "$cf_have_incdir" = no ; then
6628                   if test "$cf_add_incdir" = /usr/local/include ; then
6629                         if test "$GCC" = yes
6630                         then
6631                           cf_save_CPPFLAGS=$CPPFLAGS
6632                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6633                           cat >conftest.$ac_ext <<_ACEOF
6634 #line 6634 "configure"
6635 #include "confdefs.h"
6636 #include <stdio.h>
6637 int
6638 main (void)
6639 {
6640 printf("Hello")
6641   ;
6642   return 0;
6643 }
6644 _ACEOF
6645 rm -f conftest.$ac_objext
6646 if { (eval echo "$as_me:6646: \"$ac_compile\"") >&5
6647   (eval $ac_compile) 2>&5
6648   ac_status=$?
6649   echo "$as_me:6649: \$? = $ac_status" >&5
6650   (exit $ac_status); } &&
6651          { ac_try='test -s conftest.$ac_objext'
6652   { (eval echo "$as_me:6652: \"$ac_try\"") >&5
6653   (eval $ac_try) 2>&5
6654   ac_status=$?
6655   echo "$as_me:6655: \$? = $ac_status" >&5
6656   (exit $ac_status); }; }; then
6657   :
6658 else
6659   echo "$as_me: failed program was:" >&5
6660 cat conftest.$ac_ext >&5
6661 cf_have_incdir=yes
6662 fi
6663 rm -f conftest.$ac_objext conftest.$ac_ext
6664                           CPPFLAGS=$cf_save_CPPFLAGS
6665                         fi
6666                   fi
6667                 fi
6668
6669                 if test "$cf_have_incdir" = no ; then
6670                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6671
6672 echo "${as_me:-configure}:6672: testing adding $cf_add_incdir to include-path ..." 1>&5
6673
6674                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6675
6676                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6677                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6678                   cf_add_incdir="$cf_top_incdir"
6679                 else
6680                   break
6681                 fi
6682           else
6683                 break
6684           fi
6685         done
6686   done
6687 fi
6688
6689                 for cf_header in \
6690                         ncurses.h \
6691                         curses.h
6692                 do
6693
6694         cat >conftest.$ac_ext <<_ACEOF
6695 #line 6695 "configure"
6696 #include "confdefs.h"
6697
6698 #include <$cf_header>
6699 int
6700 main (void)
6701 {
6702
6703 #ifdef NCURSES_VERSION
6704
6705 printf("%s\n", NCURSES_VERSION);
6706 #else
6707 #ifdef __NCURSES_H
6708 printf("old\n");
6709 #else
6710         make an error
6711 #endif
6712 #endif
6713
6714   ;
6715   return 0;
6716 }
6717 _ACEOF
6718 rm -f conftest.$ac_objext
6719 if { (eval echo "$as_me:6719: \"$ac_compile\"") >&5
6720   (eval $ac_compile) 2>&5
6721   ac_status=$?
6722   echo "$as_me:6722: \$? = $ac_status" >&5
6723   (exit $ac_status); } &&
6724          { ac_try='test -s conftest.$ac_objext'
6725   { (eval echo "$as_me:6725: \"$ac_try\"") >&5
6726   (eval $ac_try) 2>&5
6727   ac_status=$?
6728   echo "$as_me:6728: \$? = $ac_status" >&5
6729   (exit $ac_status); }; }; then
6730   cf_cv_ncurses_h2=$cf_header
6731
6732 else
6733   echo "$as_me: failed program was:" >&5
6734 cat conftest.$ac_ext >&5
6735 cf_cv_ncurses_h2=no
6736 fi
6737 rm -f conftest.$ac_objext conftest.$ac_ext
6738
6739                         if test "$cf_cv_ncurses_h2" != no ; then
6740                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6741                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6742                                 break
6743                         fi
6744                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6745                 done
6746                 CPPFLAGS="$cf_save2_CPPFLAGS"
6747                 test "$cf_cv_ncurses_h2" != no && break
6748         done
6749         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6749: error: not found" >&5
6750 echo "$as_me: error: not found" >&2;}
6751    { (exit 1); exit 1; }; }
6752
6753 fi
6754 echo "$as_me:6754: result: $cf_cv_ncurses_h2" >&5
6755 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6756
6757         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6758         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6759         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6760                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6761         fi
6762
6763 if test -n "$cf_1st_incdir" ; then
6764   for cf_add_incdir in $cf_1st_incdir
6765   do
6766         while test $cf_add_incdir != /usr/include
6767         do
6768           if test -d $cf_add_incdir
6769           then
6770                 cf_have_incdir=no
6771                 if test -n "$CFLAGS$CPPFLAGS" ; then
6772                   # a loop is needed to ensure we can add subdirs of existing dirs
6773                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6774                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6775                           cf_have_incdir=yes; break
6776                         fi
6777                   done
6778                 fi
6779
6780                 if test "$cf_have_incdir" = no ; then
6781                   if test "$cf_add_incdir" = /usr/local/include ; then
6782                         if test "$GCC" = yes
6783                         then
6784                           cf_save_CPPFLAGS=$CPPFLAGS
6785                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6786                           cat >conftest.$ac_ext <<_ACEOF
6787 #line 6787 "configure"
6788 #include "confdefs.h"
6789 #include <stdio.h>
6790 int
6791 main (void)
6792 {
6793 printf("Hello")
6794   ;
6795   return 0;
6796 }
6797 _ACEOF
6798 rm -f conftest.$ac_objext
6799 if { (eval echo "$as_me:6799: \"$ac_compile\"") >&5
6800   (eval $ac_compile) 2>&5
6801   ac_status=$?
6802   echo "$as_me:6802: \$? = $ac_status" >&5
6803   (exit $ac_status); } &&
6804          { ac_try='test -s conftest.$ac_objext'
6805   { (eval echo "$as_me:6805: \"$ac_try\"") >&5
6806   (eval $ac_try) 2>&5
6807   ac_status=$?
6808   echo "$as_me:6808: \$? = $ac_status" >&5
6809   (exit $ac_status); }; }; then
6810   :
6811 else
6812   echo "$as_me: failed program was:" >&5
6813 cat conftest.$ac_ext >&5
6814 cf_have_incdir=yes
6815 fi
6816 rm -f conftest.$ac_objext conftest.$ac_ext
6817                           CPPFLAGS=$cf_save_CPPFLAGS
6818                         fi
6819                   fi
6820                 fi
6821
6822                 if test "$cf_have_incdir" = no ; then
6823                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6824
6825 echo "${as_me:-configure}:6825: testing adding $cf_add_incdir to include-path ..." 1>&5
6826
6827                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6828
6829                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6830                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6831                   cf_add_incdir="$cf_top_incdir"
6832                 else
6833                   break
6834                 fi
6835           else
6836                 break
6837           fi
6838         done
6839   done
6840 fi
6841
6842 fi
6843
6844 # Set definitions to allow ifdef'ing for ncurses.h
6845
6846 case $cf_cv_ncurses_header in
6847 (*ncurses.h)
6848
6849 cat >>confdefs.h <<\EOF
6850 #define HAVE_NCURSES_H 1
6851 EOF
6852
6853         ;;
6854 esac
6855
6856 case $cf_cv_ncurses_header in
6857 (ncurses/curses.h|ncurses/ncurses.h)
6858
6859 cat >>confdefs.h <<\EOF
6860 #define HAVE_NCURSES_NCURSES_H 1
6861 EOF
6862
6863         ;;
6864 (ncursesw/curses.h|ncursesw/ncurses.h)
6865
6866 cat >>confdefs.h <<\EOF
6867 #define HAVE_NCURSESW_NCURSES_H 1
6868 EOF
6869
6870         ;;
6871 esac
6872
6873 echo "$as_me:6873: checking for terminfo header" >&5
6874 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6875 if test "${cf_cv_term_header+set}" = set; then
6876   echo $ECHO_N "(cached) $ECHO_C" >&6
6877 else
6878
6879 case ${cf_cv_ncurses_header} in
6880 (*/ncurses.h|*/ncursesw.h)
6881         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6882         ;;
6883 (*)
6884         cf_term_header=term.h
6885         ;;
6886 esac
6887
6888 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6889 do
6890 cat >conftest.$ac_ext <<_ACEOF
6891 #line 6891 "configure"
6892 #include "confdefs.h"
6893 #include <stdio.h>
6894 #include <${cf_cv_ncurses_header:-curses.h}>
6895 #include <$cf_test>
6896
6897 int
6898 main (void)
6899 {
6900 int x = auto_left_margin
6901   ;
6902   return 0;
6903 }
6904 _ACEOF
6905 rm -f conftest.$ac_objext
6906 if { (eval echo "$as_me:6906: \"$ac_compile\"") >&5
6907   (eval $ac_compile) 2>&5
6908   ac_status=$?
6909   echo "$as_me:6909: \$? = $ac_status" >&5
6910   (exit $ac_status); } &&
6911          { ac_try='test -s conftest.$ac_objext'
6912   { (eval echo "$as_me:6912: \"$ac_try\"") >&5
6913   (eval $ac_try) 2>&5
6914   ac_status=$?
6915   echo "$as_me:6915: \$? = $ac_status" >&5
6916   (exit $ac_status); }; }; then
6917
6918         cf_cv_term_header="$cf_test"
6919 else
6920   echo "$as_me: failed program was:" >&5
6921 cat conftest.$ac_ext >&5
6922
6923         cf_cv_term_header=unknown
6924
6925 fi
6926 rm -f conftest.$ac_objext conftest.$ac_ext
6927         test "$cf_cv_term_header" != unknown && break
6928 done
6929
6930 fi
6931 echo "$as_me:6931: result: $cf_cv_term_header" >&5
6932 echo "${ECHO_T}$cf_cv_term_header" >&6
6933
6934 # Set definitions to allow ifdef'ing to accommodate subdirectories
6935
6936 case $cf_cv_term_header in
6937 (*term.h)
6938
6939 cat >>confdefs.h <<\EOF
6940 #define HAVE_TERM_H 1
6941 EOF
6942
6943         ;;
6944 esac
6945
6946 case $cf_cv_term_header in
6947 (ncurses/term.h)
6948
6949 cat >>confdefs.h <<\EOF
6950 #define HAVE_NCURSES_TERM_H 1
6951 EOF
6952
6953         ;;
6954 (ncursesw/term.h)
6955
6956 cat >>confdefs.h <<\EOF
6957 #define HAVE_NCURSESW_TERM_H 1
6958 EOF
6959
6960         ;;
6961 esac
6962
6963 # some applications need this, but should check for NCURSES_VERSION
6964
6965 cat >>confdefs.h <<\EOF
6966 #define NCURSES 1
6967 EOF
6968
6969 echo "$as_me:6969: checking for ncurses version" >&5
6970 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6971 if test "${cf_cv_ncurses_version+set}" = set; then
6972   echo $ECHO_N "(cached) $ECHO_C" >&6
6973 else
6974
6975         cf_cv_ncurses_version=no
6976         cf_tempfile=out$$
6977         rm -f $cf_tempfile
6978         if test "$cross_compiling" = yes; then
6979
6980         # This will not work if the preprocessor splits the line after the
6981         # Autoconf token.  The 'unproto' program does that.
6982         cat > conftest.$ac_ext <<EOF
6983 #include <${cf_cv_ncurses_header:-curses.h}>
6984 #undef Autoconf
6985 #ifdef NCURSES_VERSION
6986 Autoconf NCURSES_VERSION
6987 #else
6988 #ifdef __NCURSES_H
6989 Autoconf "old"
6990 #endif
6991 ;
6992 #endif
6993 EOF
6994         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6995         { (eval echo "$as_me:6995: \"$cf_try\"") >&5
6996   (eval $cf_try) 2>&5
6997   ac_status=$?
6998   echo "$as_me:6998: \$? = $ac_status" >&5
6999   (exit $ac_status); }
7000         if test -f conftest.out ; then
7001                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7002                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7003                 rm -f conftest.out
7004         fi
7005
7006 else
7007   cat >conftest.$ac_ext <<_ACEOF
7008 #line 7008 "configure"
7009 #include "confdefs.h"
7010
7011 #include <${cf_cv_ncurses_header:-curses.h}>
7012 #include <stdio.h>
7013 int main(void)
7014 {
7015         FILE *fp = fopen("$cf_tempfile", "w");
7016 #ifdef NCURSES_VERSION
7017 # ifdef NCURSES_VERSION_PATCH
7018         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7019 # else
7020         fprintf(fp, "%s\n", NCURSES_VERSION);
7021 # endif
7022 #else
7023 # ifdef __NCURSES_H
7024         fprintf(fp, "old\n");
7025 # else
7026         make an error
7027 # endif
7028 #endif
7029         ${cf_cv_main_return:-return}(0);
7030 }
7031 _ACEOF
7032 rm -f conftest$ac_exeext
7033 if { (eval echo "$as_me:7033: \"$ac_link\"") >&5
7034   (eval $ac_link) 2>&5
7035   ac_status=$?
7036   echo "$as_me:7036: \$? = $ac_status" >&5
7037   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7038   { (eval echo "$as_me:7038: \"$ac_try\"") >&5
7039   (eval $ac_try) 2>&5
7040   ac_status=$?
7041   echo "$as_me:7041: \$? = $ac_status" >&5
7042   (exit $ac_status); }; }; then
7043
7044         cf_cv_ncurses_version=`cat $cf_tempfile`
7045 else
7046   echo "$as_me: program exited with status $ac_status" >&5
7047 echo "$as_me: failed program was:" >&5
7048 cat conftest.$ac_ext >&5
7049 fi
7050 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7051 fi
7052         rm -f $cf_tempfile
7053
7054 fi
7055 echo "$as_me:7055: result: $cf_cv_ncurses_version" >&5
7056 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7057 test "$cf_cv_ncurses_version" = no ||
7058 cat >>confdefs.h <<\EOF
7059 #define NCURSES 1
7060 EOF
7061
7062 cf_nculib_root=ncursesw
7063         # This works, except for the special case where we find gpm, but
7064         # ncurses is in a nonstandard location via $LIBS, and we really want
7065         # to link gpm.
7066 cf_ncurses_LIBS=""
7067 cf_ncurses_SAVE="$LIBS"
7068 echo "$as_me:7068: checking for Gpm_Open in -lgpm" >&5
7069 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7070 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7071   echo $ECHO_N "(cached) $ECHO_C" >&6
7072 else
7073   ac_check_lib_save_LIBS=$LIBS
7074 LIBS="-lgpm  $LIBS"
7075 cat >conftest.$ac_ext <<_ACEOF
7076 #line 7076 "configure"
7077 #include "confdefs.h"
7078
7079 /* Override any gcc2 internal prototype to avoid an error.  */
7080 #ifdef __cplusplus
7081 extern "C"
7082 #endif
7083 /* We use char because int might match the return type of a gcc2
7084    builtin and then its argument prototype would still apply.  */
7085 char Gpm_Open ();
7086 int
7087 main (void)
7088 {
7089 Gpm_Open ();
7090   ;
7091   return 0;
7092 }
7093 _ACEOF
7094 rm -f conftest.$ac_objext conftest$ac_exeext
7095 if { (eval echo "$as_me:7095: \"$ac_link\"") >&5
7096   (eval $ac_link) 2>&5
7097   ac_status=$?
7098   echo "$as_me:7098: \$? = $ac_status" >&5
7099   (exit $ac_status); } &&
7100          { ac_try='test -s conftest$ac_exeext'
7101   { (eval echo "$as_me:7101: \"$ac_try\"") >&5
7102   (eval $ac_try) 2>&5
7103   ac_status=$?
7104   echo "$as_me:7104: \$? = $ac_status" >&5
7105   (exit $ac_status); }; }; then
7106   ac_cv_lib_gpm_Gpm_Open=yes
7107 else
7108   echo "$as_me: failed program was:" >&5
7109 cat conftest.$ac_ext >&5
7110 ac_cv_lib_gpm_Gpm_Open=no
7111 fi
7112 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7113 LIBS=$ac_check_lib_save_LIBS
7114 fi
7115 echo "$as_me:7115: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7116 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7117 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7118   echo "$as_me:7118: checking for initscr in -lgpm" >&5
7119 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7120 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7121   echo $ECHO_N "(cached) $ECHO_C" >&6
7122 else
7123   ac_check_lib_save_LIBS=$LIBS
7124 LIBS="-lgpm  $LIBS"
7125 cat >conftest.$ac_ext <<_ACEOF
7126 #line 7126 "configure"
7127 #include "confdefs.h"
7128
7129 /* Override any gcc2 internal prototype to avoid an error.  */
7130 #ifdef __cplusplus
7131 extern "C"
7132 #endif
7133 /* We use char because int might match the return type of a gcc2
7134    builtin and then its argument prototype would still apply.  */
7135 char initscr ();
7136 int
7137 main (void)
7138 {
7139 initscr ();
7140   ;
7141   return 0;
7142 }
7143 _ACEOF
7144 rm -f conftest.$ac_objext conftest$ac_exeext
7145 if { (eval echo "$as_me:7145: \"$ac_link\"") >&5
7146   (eval $ac_link) 2>&5
7147   ac_status=$?
7148   echo "$as_me:7148: \$? = $ac_status" >&5
7149   (exit $ac_status); } &&
7150          { ac_try='test -s conftest$ac_exeext'
7151   { (eval echo "$as_me:7151: \"$ac_try\"") >&5
7152   (eval $ac_try) 2>&5
7153   ac_status=$?
7154   echo "$as_me:7154: \$? = $ac_status" >&5
7155   (exit $ac_status); }; }; then
7156   ac_cv_lib_gpm_initscr=yes
7157 else
7158   echo "$as_me: failed program was:" >&5
7159 cat conftest.$ac_ext >&5
7160 ac_cv_lib_gpm_initscr=no
7161 fi
7162 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7163 LIBS=$ac_check_lib_save_LIBS
7164 fi
7165 echo "$as_me:7165: result: $ac_cv_lib_gpm_initscr" >&5
7166 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7167 if test $ac_cv_lib_gpm_initscr = yes; then
7168   LIBS="$cf_ncurses_SAVE"
7169 else
7170   cf_ncurses_LIBS="-lgpm"
7171 fi
7172
7173 fi
7174
7175 case $host_os in
7176 (freebsd*)
7177         # This is only necessary if you are linking against an obsolete
7178         # version of ncurses (but it should do no harm, since it's static).
7179         if test "$cf_nculib_root" = ncurses ; then
7180                 echo "$as_me:7180: checking for tgoto in -lmytinfo" >&5
7181 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7182 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7183   echo $ECHO_N "(cached) $ECHO_C" >&6
7184 else
7185   ac_check_lib_save_LIBS=$LIBS
7186 LIBS="-lmytinfo  $LIBS"
7187 cat >conftest.$ac_ext <<_ACEOF
7188 #line 7188 "configure"
7189 #include "confdefs.h"
7190
7191 /* Override any gcc2 internal prototype to avoid an error.  */
7192 #ifdef __cplusplus
7193 extern "C"
7194 #endif
7195 /* We use char because int might match the return type of a gcc2
7196    builtin and then its argument prototype would still apply.  */
7197 char tgoto ();
7198 int
7199 main (void)
7200 {
7201 tgoto ();
7202   ;
7203   return 0;
7204 }
7205 _ACEOF
7206 rm -f conftest.$ac_objext conftest$ac_exeext
7207 if { (eval echo "$as_me:7207: \"$ac_link\"") >&5
7208   (eval $ac_link) 2>&5
7209   ac_status=$?
7210   echo "$as_me:7210: \$? = $ac_status" >&5
7211   (exit $ac_status); } &&
7212          { ac_try='test -s conftest$ac_exeext'
7213   { (eval echo "$as_me:7213: \"$ac_try\"") >&5
7214   (eval $ac_try) 2>&5
7215   ac_status=$?
7216   echo "$as_me:7216: \$? = $ac_status" >&5
7217   (exit $ac_status); }; }; then
7218   ac_cv_lib_mytinfo_tgoto=yes
7219 else
7220   echo "$as_me: failed program was:" >&5
7221 cat conftest.$ac_ext >&5
7222 ac_cv_lib_mytinfo_tgoto=no
7223 fi
7224 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7225 LIBS=$ac_check_lib_save_LIBS
7226 fi
7227 echo "$as_me:7227: result: $ac_cv_lib_mytinfo_tgoto" >&5
7228 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7229 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7230   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7231 fi
7232
7233         fi
7234         ;;
7235 esac
7236
7237 cf_add_libs="$cf_ncurses_LIBS"
7238 # Filter out duplicates - this happens with badly-designed ".pc" files...
7239 for cf_add_1lib in $LIBS
7240 do
7241         for cf_add_2lib in $cf_add_libs
7242         do
7243                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7244                 then
7245                         cf_add_1lib=
7246                         break
7247                 fi
7248         done
7249         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7250 done
7251 LIBS="$cf_add_libs"
7252
7253 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7254 then
7255
7256 cf_add_libs="-l$cf_nculib_root"
7257 # Filter out duplicates - this happens with badly-designed ".pc" files...
7258 for cf_add_1lib in $LIBS
7259 do
7260         for cf_add_2lib in $cf_add_libs
7261         do
7262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7263                 then
7264                         cf_add_1lib=
7265                         break
7266                 fi
7267         done
7268         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7269 done
7270 LIBS="$cf_add_libs"
7271
7272 else
7273
7274         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7275         cf_libdir=""
7276         echo "$as_me:7276: checking for initscr" >&5
7277 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7278 if test "${ac_cv_func_initscr+set}" = set; then
7279   echo $ECHO_N "(cached) $ECHO_C" >&6
7280 else
7281   cat >conftest.$ac_ext <<_ACEOF
7282 #line 7282 "configure"
7283 #include "confdefs.h"
7284 /* System header to define __stub macros and hopefully few prototypes,
7285     which can conflict with char initscr (); below.  */
7286 #include <assert.h>
7287 /* Override any gcc2 internal prototype to avoid an error.  */
7288 #ifdef __cplusplus
7289 extern "C"
7290 #endif
7291 /* We use char because int might match the return type of a gcc2
7292    builtin and then its argument prototype would still apply.  */
7293 char initscr ();
7294 char (*f) ();
7295
7296 int
7297 main (void)
7298 {
7299 /* The GNU C library defines this for functions which it implements
7300     to always fail with ENOSYS.  Some functions are actually named
7301     something starting with __ and the normal name is an alias.  */
7302 #if defined (__stub_initscr) || defined (__stub___initscr)
7303 choke me
7304 #else
7305 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7306 #endif
7307
7308   ;
7309   return 0;
7310 }
7311 _ACEOF
7312 rm -f conftest.$ac_objext conftest$ac_exeext
7313 if { (eval echo "$as_me:7313: \"$ac_link\"") >&5
7314   (eval $ac_link) 2>&5
7315   ac_status=$?
7316   echo "$as_me:7316: \$? = $ac_status" >&5
7317   (exit $ac_status); } &&
7318          { ac_try='test -s conftest$ac_exeext'
7319   { (eval echo "$as_me:7319: \"$ac_try\"") >&5
7320   (eval $ac_try) 2>&5
7321   ac_status=$?
7322   echo "$as_me:7322: \$? = $ac_status" >&5
7323   (exit $ac_status); }; }; then
7324   ac_cv_func_initscr=yes
7325 else
7326   echo "$as_me: failed program was:" >&5
7327 cat conftest.$ac_ext >&5
7328 ac_cv_func_initscr=no
7329 fi
7330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7331 fi
7332 echo "$as_me:7332: result: $ac_cv_func_initscr" >&5
7333 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7334 if test $ac_cv_func_initscr = yes; then
7335   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7336 else
7337
7338                 cf_save_LIBS="$LIBS"
7339                 echo "$as_me:7339: checking for initscr in -l$cf_nculib_root" >&5
7340 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7341                 LIBS="-l$cf_nculib_root $LIBS"
7342                 cat >conftest.$ac_ext <<_ACEOF
7343 #line 7343 "configure"
7344 #include "confdefs.h"
7345 #include <${cf_cv_ncurses_header:-curses.h}>
7346 int
7347 main (void)
7348 {
7349 initscr()
7350   ;
7351   return 0;
7352 }
7353 _ACEOF
7354 rm -f conftest.$ac_objext conftest$ac_exeext
7355 if { (eval echo "$as_me:7355: \"$ac_link\"") >&5
7356   (eval $ac_link) 2>&5
7357   ac_status=$?
7358   echo "$as_me:7358: \$? = $ac_status" >&5
7359   (exit $ac_status); } &&
7360          { ac_try='test -s conftest$ac_exeext'
7361   { (eval echo "$as_me:7361: \"$ac_try\"") >&5
7362   (eval $ac_try) 2>&5
7363   ac_status=$?
7364   echo "$as_me:7364: \$? = $ac_status" >&5
7365   (exit $ac_status); }; }; then
7366   echo "$as_me:7366: result: yes" >&5
7367 echo "${ECHO_T}yes" >&6
7368                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7369
7370 else
7371   echo "$as_me: failed program was:" >&5
7372 cat conftest.$ac_ext >&5
7373 echo "$as_me:7373: result: no" >&5
7374 echo "${ECHO_T}no" >&6
7375
7376 cf_search=
7377 cf_library_path_list=""
7378 if test -n "${LDFLAGS}${LIBS}" ; then
7379         for cf_library_path in $LDFLAGS $LIBS
7380         do
7381                 case $cf_library_path in
7382                 (-L*)
7383                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7384
7385 test "x$cf_library_path" != "xNONE" && \
7386 test -d "$cf_library_path" && \
7387  {
7388         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7389         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7390         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7391         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7392         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7393         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"
7394 }
7395
7396                         cf_library_path_list="$cf_library_path_list $cf_search"
7397                         ;;
7398                 esac
7399         done
7400 fi
7401
7402 cf_search=
7403
7404 test "x$prefix" != "xNONE" && \
7405 test -d "$prefix" && \
7406  {
7407         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7408         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7409         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7410         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7411         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7412         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7413 }
7414
7415 for cf_subdir_prefix in \
7416         /usr \
7417         /usr/local \
7418         /usr/pkg \
7419         /opt \
7420         /opt/local \
7421         $HOME
7422 do
7423
7424 test "x$cf_subdir_prefix" != "x$prefix" && \
7425 test -d "$cf_subdir_prefix" && \
7426 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7427         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7428         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7429         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7430         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7431         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7432         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"
7433 }
7434
7435 done
7436
7437 cf_search="$cf_library_path_list $cf_search"
7438
7439                         for cf_libdir in $cf_search
7440                         do
7441                                 echo "$as_me:7441: checking for -l$cf_nculib_root in $cf_libdir" >&5
7442 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7443                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7444                                 cat >conftest.$ac_ext <<_ACEOF
7445 #line 7445 "configure"
7446 #include "confdefs.h"
7447 #include <${cf_cv_ncurses_header:-curses.h}>
7448 int
7449 main (void)
7450 {
7451 initscr()
7452   ;
7453   return 0;
7454 }
7455 _ACEOF
7456 rm -f conftest.$ac_objext conftest$ac_exeext
7457 if { (eval echo "$as_me:7457: \"$ac_link\"") >&5
7458   (eval $ac_link) 2>&5
7459   ac_status=$?
7460   echo "$as_me:7460: \$? = $ac_status" >&5
7461   (exit $ac_status); } &&
7462          { ac_try='test -s conftest$ac_exeext'
7463   { (eval echo "$as_me:7463: \"$ac_try\"") >&5
7464   (eval $ac_try) 2>&5
7465   ac_status=$?
7466   echo "$as_me:7466: \$? = $ac_status" >&5
7467   (exit $ac_status); }; }; then
7468   echo "$as_me:7468: result: yes" >&5
7469 echo "${ECHO_T}yes" >&6
7470                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7471                                          break
7472 else
7473   echo "$as_me: failed program was:" >&5
7474 cat conftest.$ac_ext >&5
7475 echo "$as_me:7475: result: no" >&5
7476 echo "${ECHO_T}no" >&6
7477                                          LIBS="$cf_save_LIBS"
7478 fi
7479 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7480                         done
7481
7482 fi
7483 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7484
7485 fi
7486
7487 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7488
7489 if test $cf_found_library = no ; then
7490         { { echo "$as_me:7490: error: Cannot link $cf_nculib_root library" >&5
7491 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7492    { (exit 1); exit 1; }; }
7493 fi
7494
7495 fi
7496
7497 if test -n "$cf_ncurses_LIBS" ; then
7498         echo "$as_me:7498: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7499 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7500         cf_ncurses_SAVE="$LIBS"
7501         for p in $cf_ncurses_LIBS ; do
7502                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7503                 if test "$q" != "$LIBS" ; then
7504                         LIBS="$q"
7505                 fi
7506         done
7507         cat >conftest.$ac_ext <<_ACEOF
7508 #line 7508 "configure"
7509 #include "confdefs.h"
7510 #include <${cf_cv_ncurses_header:-curses.h}>
7511 int
7512 main (void)
7513 {
7514 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7515   ;
7516   return 0;
7517 }
7518 _ACEOF
7519 rm -f conftest.$ac_objext conftest$ac_exeext
7520 if { (eval echo "$as_me:7520: \"$ac_link\"") >&5
7521   (eval $ac_link) 2>&5
7522   ac_status=$?
7523   echo "$as_me:7523: \$? = $ac_status" >&5
7524   (exit $ac_status); } &&
7525          { ac_try='test -s conftest$ac_exeext'
7526   { (eval echo "$as_me:7526: \"$ac_try\"") >&5
7527   (eval $ac_try) 2>&5
7528   ac_status=$?
7529   echo "$as_me:7529: \$? = $ac_status" >&5
7530   (exit $ac_status); }; }; then
7531   echo "$as_me:7531: result: yes" >&5
7532 echo "${ECHO_T}yes" >&6
7533 else
7534   echo "$as_me: failed program was:" >&5
7535 cat conftest.$ac_ext >&5
7536 echo "$as_me:7536: result: no" >&5
7537 echo "${ECHO_T}no" >&6
7538                  LIBS="$cf_ncurses_SAVE"
7539 fi
7540 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7541 fi
7542
7543 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7544
7545 cat >>confdefs.h <<EOF
7546 #define $cf_nculib_ROOT 1
7547 EOF
7548
7549         fi
7550 else
7551         NCURSES_CONFIG=none
7552 fi
7553
7554 else
7555
7556 cf_ncuconfig_root=ncurses
7557 cf_have_ncuconfig=no
7558
7559 if test "x${PKG_CONFIG:=none}" != xnone; then
7560         echo "$as_me:7560: checking pkg-config for $cf_ncuconfig_root" >&5
7561 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7562         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7563                 echo "$as_me:7563: result: yes" >&5
7564 echo "${ECHO_T}yes" >&6
7565
7566                 echo "$as_me:7566: checking if the $cf_ncuconfig_root package files work" >&5
7567 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7568                 cf_have_ncuconfig=unknown
7569
7570                 cf_save_CPPFLAGS="$CPPFLAGS"
7571                 cf_save_LIBS="$LIBS"
7572
7573                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7574
7575 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7576 # Filter out duplicates - this happens with badly-designed ".pc" files...
7577 for cf_add_1lib in $LIBS
7578 do
7579         for cf_add_2lib in $cf_add_libs
7580         do
7581                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7582                 then
7583                         cf_add_1lib=
7584                         break
7585                 fi
7586         done
7587         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7588 done
7589 LIBS="$cf_add_libs"
7590
7591                 cat >conftest.$ac_ext <<_ACEOF
7592 #line 7592 "configure"
7593 #include "confdefs.h"
7594 #include <${cf_cv_ncurses_header:-curses.h}>
7595 int
7596 main (void)
7597 {
7598 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7599   ;
7600   return 0;
7601 }
7602 _ACEOF
7603 rm -f conftest.$ac_objext conftest$ac_exeext
7604 if { (eval echo "$as_me:7604: \"$ac_link\"") >&5
7605   (eval $ac_link) 2>&5
7606   ac_status=$?
7607   echo "$as_me:7607: \$? = $ac_status" >&5
7608   (exit $ac_status); } &&
7609          { ac_try='test -s conftest$ac_exeext'
7610   { (eval echo "$as_me:7610: \"$ac_try\"") >&5
7611   (eval $ac_try) 2>&5
7612   ac_status=$?
7613   echo "$as_me:7613: \$? = $ac_status" >&5
7614   (exit $ac_status); }; }; then
7615   if test "$cross_compiling" = yes; then
7616   cf_have_ncuconfig=maybe
7617 else
7618   cat >conftest.$ac_ext <<_ACEOF
7619 #line 7619 "configure"
7620 #include "confdefs.h"
7621 #include <${cf_cv_ncurses_header:-curses.h}>
7622                                 int main(void)
7623                                 { char *xx = curses_version(); return (xx == 0); }
7624 _ACEOF
7625 rm -f conftest$ac_exeext
7626 if { (eval echo "$as_me:7626: \"$ac_link\"") >&5
7627   (eval $ac_link) 2>&5
7628   ac_status=$?
7629   echo "$as_me:7629: \$? = $ac_status" >&5
7630   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7631   { (eval echo "$as_me:7631: \"$ac_try\"") >&5
7632   (eval $ac_try) 2>&5
7633   ac_status=$?
7634   echo "$as_me:7634: \$? = $ac_status" >&5
7635   (exit $ac_status); }; }; then
7636   cf_have_ncuconfig=yes
7637 else
7638   echo "$as_me: program exited with status $ac_status" >&5
7639 echo "$as_me: failed program was:" >&5
7640 cat conftest.$ac_ext >&5
7641 cf_have_ncuconfig=no
7642 fi
7643 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7644 fi
7645 else
7646   echo "$as_me: failed program was:" >&5
7647 cat conftest.$ac_ext >&5
7648 cf_have_ncuconfig=no
7649 fi
7650 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7651                 echo "$as_me:7651: result: $cf_have_ncuconfig" >&5
7652 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7653                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7654                 if test "$cf_have_ncuconfig" != "yes"
7655                 then
7656                         CPPFLAGS="$cf_save_CPPFLAGS"
7657                         LIBS="$cf_save_LIBS"
7658                         NCURSES_CONFIG_PKG=none
7659                 else
7660
7661 cat >>confdefs.h <<\EOF
7662 #define NCURSES 1
7663 EOF
7664
7665                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7666                 fi
7667
7668 echo "$as_me:7668: checking for terminfo header" >&5
7669 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7670 if test "${cf_cv_term_header+set}" = set; then
7671   echo $ECHO_N "(cached) $ECHO_C" >&6
7672 else
7673
7674 case ${cf_cv_ncurses_header} in
7675 (*/ncurses.h|*/ncursesw.h)
7676         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7677         ;;
7678 (*)
7679         cf_term_header=term.h
7680         ;;
7681 esac
7682
7683 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7684 do
7685 cat >conftest.$ac_ext <<_ACEOF
7686 #line 7686 "configure"
7687 #include "confdefs.h"
7688 #include <stdio.h>
7689 #include <${cf_cv_ncurses_header:-curses.h}>
7690 #include <$cf_test>
7691
7692 int
7693 main (void)
7694 {
7695 int x = auto_left_margin
7696   ;
7697   return 0;
7698 }
7699 _ACEOF
7700 rm -f conftest.$ac_objext
7701 if { (eval echo "$as_me:7701: \"$ac_compile\"") >&5
7702   (eval $ac_compile) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit $ac_status); } &&
7706          { ac_try='test -s conftest.$ac_objext'
7707   { (eval echo "$as_me:7707: \"$ac_try\"") >&5
7708   (eval $ac_try) 2>&5
7709   ac_status=$?
7710   echo "$as_me:7710: \$? = $ac_status" >&5
7711   (exit $ac_status); }; }; then
7712
7713         cf_cv_term_header="$cf_test"
7714 else
7715   echo "$as_me: failed program was:" >&5
7716 cat conftest.$ac_ext >&5
7717
7718         cf_cv_term_header=unknown
7719
7720 fi
7721 rm -f conftest.$ac_objext conftest.$ac_ext
7722         test "$cf_cv_term_header" != unknown && break
7723 done
7724
7725 fi
7726 echo "$as_me:7726: result: $cf_cv_term_header" >&5
7727 echo "${ECHO_T}$cf_cv_term_header" >&6
7728
7729 # Set definitions to allow ifdef'ing to accommodate subdirectories
7730
7731 case $cf_cv_term_header in
7732 (*term.h)
7733
7734 cat >>confdefs.h <<\EOF
7735 #define HAVE_TERM_H 1
7736 EOF
7737
7738         ;;
7739 esac
7740
7741 case $cf_cv_term_header in
7742 (ncurses/term.h)
7743
7744 cat >>confdefs.h <<\EOF
7745 #define HAVE_NCURSES_TERM_H 1
7746 EOF
7747
7748         ;;
7749 (ncursesw/term.h)
7750
7751 cat >>confdefs.h <<\EOF
7752 #define HAVE_NCURSESW_TERM_H 1
7753 EOF
7754
7755         ;;
7756 esac
7757
7758         else
7759                 echo "$as_me:7759: result: no" >&5
7760 echo "${ECHO_T}no" >&6
7761                 NCURSES_CONFIG_PKG=none
7762         fi
7763 else
7764         NCURSES_CONFIG_PKG=none
7765 fi
7766
7767 if test "x$cf_have_ncuconfig" = "xno"; then
7768         echo "Looking for ${cf_ncuconfig_root}-config"
7769
7770 if test -n "$ac_tool_prefix"; then
7771   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7772   do
7773     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7774 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7775 echo "$as_me:7775: checking for $ac_word" >&5
7776 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7777 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7778   echo $ECHO_N "(cached) $ECHO_C" >&6
7779 else
7780   if test -n "$NCURSES_CONFIG"; then
7781   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7782 else
7783   ac_save_IFS=$IFS; IFS=$ac_path_separator
7784 ac_dummy="$PATH"
7785 for ac_dir in $ac_dummy; do
7786   IFS=$ac_save_IFS
7787   test -z "$ac_dir" && ac_dir=.
7788   $as_executable_p "$ac_dir/$ac_word" || continue
7789 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7790 echo "$as_me:7790: found $ac_dir/$ac_word" >&5
7791 break
7792 done
7793
7794 fi
7795 fi
7796 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7797 if test -n "$NCURSES_CONFIG"; then
7798   echo "$as_me:7798: result: $NCURSES_CONFIG" >&5
7799 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7800 else
7801   echo "$as_me:7801: result: no" >&5
7802 echo "${ECHO_T}no" >&6
7803 fi
7804
7805     test -n "$NCURSES_CONFIG" && break
7806   done
7807 fi
7808 if test -z "$NCURSES_CONFIG"; then
7809   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7810   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7811 do
7812   # Extract the first word of "$ac_prog", so it can be a program name with args.
7813 set dummy $ac_prog; ac_word=$2
7814 echo "$as_me:7814: checking for $ac_word" >&5
7815 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7816 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7817   echo $ECHO_N "(cached) $ECHO_C" >&6
7818 else
7819   if test -n "$ac_ct_NCURSES_CONFIG"; then
7820   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7821 else
7822   ac_save_IFS=$IFS; IFS=$ac_path_separator
7823 ac_dummy="$PATH"
7824 for ac_dir in $ac_dummy; do
7825   IFS=$ac_save_IFS
7826   test -z "$ac_dir" && ac_dir=.
7827   $as_executable_p "$ac_dir/$ac_word" || continue
7828 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7829 echo "$as_me:7829: found $ac_dir/$ac_word" >&5
7830 break
7831 done
7832
7833 fi
7834 fi
7835 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7836 if test -n "$ac_ct_NCURSES_CONFIG"; then
7837   echo "$as_me:7837: result: $ac_ct_NCURSES_CONFIG" >&5
7838 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7839 else
7840   echo "$as_me:7840: result: no" >&5
7841 echo "${ECHO_T}no" >&6
7842 fi
7843
7844   test -n "$ac_ct_NCURSES_CONFIG" && break
7845 done
7846 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7847
7848   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7849 fi
7850
7851         if test "$NCURSES_CONFIG" != none ; then
7852
7853                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7854
7855 cf_add_libs="`$NCURSES_CONFIG --libs`"
7856 # Filter out duplicates - this happens with badly-designed ".pc" files...
7857 for cf_add_1lib in $LIBS
7858 do
7859         for cf_add_2lib in $cf_add_libs
7860         do
7861                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7862                 then
7863                         cf_add_1lib=
7864                         break
7865                 fi
7866         done
7867         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7868 done
7869 LIBS="$cf_add_libs"
7870
7871                 # even with config script, some packages use no-override for curses.h
7872
7873 echo "$as_me:7873: checking if we have identified curses headers" >&5
7874 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7875 if test "${cf_cv_ncurses_header+set}" = set; then
7876   echo $ECHO_N "(cached) $ECHO_C" >&6
7877 else
7878
7879 cf_cv_ncurses_header=none
7880 for cf_header in \
7881         ncurses.h ncurses/ncurses.h \
7882         curses.h ncurses/curses.h
7883 do
7884 cat >conftest.$ac_ext <<_ACEOF
7885 #line 7885 "configure"
7886 #include "confdefs.h"
7887 #include <${cf_header}>
7888 int
7889 main (void)
7890 {
7891 initscr(); tgoto("?", 0,0)
7892   ;
7893   return 0;
7894 }
7895 _ACEOF
7896 rm -f conftest.$ac_objext
7897 if { (eval echo "$as_me:7897: \"$ac_compile\"") >&5
7898   (eval $ac_compile) 2>&5
7899   ac_status=$?
7900   echo "$as_me:7900: \$? = $ac_status" >&5
7901   (exit $ac_status); } &&
7902          { ac_try='test -s conftest.$ac_objext'
7903   { (eval echo "$as_me:7903: \"$ac_try\"") >&5
7904   (eval $ac_try) 2>&5
7905   ac_status=$?
7906   echo "$as_me:7906: \$? = $ac_status" >&5
7907   (exit $ac_status); }; }; then
7908   cf_cv_ncurses_header=$cf_header; break
7909 else
7910   echo "$as_me: failed program was:" >&5
7911 cat conftest.$ac_ext >&5
7912 fi
7913 rm -f conftest.$ac_objext conftest.$ac_ext
7914 done
7915
7916 fi
7917 echo "$as_me:7917: result: $cf_cv_ncurses_header" >&5
7918 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7919
7920 if test "$cf_cv_ncurses_header" = none ; then
7921         { { echo "$as_me:7921: error: No curses header-files found" >&5
7922 echo "$as_me: error: No curses header-files found" >&2;}
7923    { (exit 1); exit 1; }; }
7924 fi
7925
7926 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7927
7928 for ac_header in $cf_cv_ncurses_header
7929 do
7930 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7931 echo "$as_me:7931: checking for $ac_header" >&5
7932 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7933 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7934   echo $ECHO_N "(cached) $ECHO_C" >&6
7935 else
7936   cat >conftest.$ac_ext <<_ACEOF
7937 #line 7937 "configure"
7938 #include "confdefs.h"
7939 #include <$ac_header>
7940 _ACEOF
7941 if { (eval echo "$as_me:7941: \"$ac_cpp conftest.$ac_ext\"") >&5
7942   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7943   ac_status=$?
7944   egrep -v '^ *\+' conftest.er1 >conftest.err
7945   rm -f conftest.er1
7946   cat conftest.err >&5
7947   echo "$as_me:7947: \$? = $ac_status" >&5
7948   (exit $ac_status); } >/dev/null; then
7949   if test -s conftest.err; then
7950     ac_cpp_err=$ac_c_preproc_warn_flag
7951   else
7952     ac_cpp_err=
7953   fi
7954 else
7955   ac_cpp_err=yes
7956 fi
7957 if test -z "$ac_cpp_err"; then
7958   eval "$as_ac_Header=yes"
7959 else
7960   echo "$as_me: failed program was:" >&5
7961   cat conftest.$ac_ext >&5
7962   eval "$as_ac_Header=no"
7963 fi
7964 rm -f conftest.err conftest.$ac_ext
7965 fi
7966 echo "$as_me:7966: result: `eval echo '${'$as_ac_Header'}'`" >&5
7967 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7968 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7969   cat >>confdefs.h <<EOF
7970 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7971 EOF
7972
7973 fi
7974 done
7975
7976 cat >>confdefs.h <<\EOF
7977 #define NCURSES 1
7978 EOF
7979
7980 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7981
7982                 cat >>confdefs.h <<EOF
7983 #define $cf_nculib_ROOT 1
7984 EOF
7985
7986                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7987
7988         else
7989
7990 cf_ncuhdr_root=ncurses
7991
7992 test -n "$cf_cv_curses_dir" && \
7993 test "$cf_cv_curses_dir" != "no" && { \
7994
7995 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7996   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7997   do
7998         while test $cf_add_incdir != /usr/include
7999         do
8000           if test -d $cf_add_incdir
8001           then
8002                 cf_have_incdir=no
8003                 if test -n "$CFLAGS$CPPFLAGS" ; then
8004                   # a loop is needed to ensure we can add subdirs of existing dirs
8005                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8006                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8007                           cf_have_incdir=yes; break
8008                         fi
8009                   done
8010                 fi
8011
8012                 if test "$cf_have_incdir" = no ; then
8013                   if test "$cf_add_incdir" = /usr/local/include ; then
8014                         if test "$GCC" = yes
8015                         then
8016                           cf_save_CPPFLAGS=$CPPFLAGS
8017                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8018                           cat >conftest.$ac_ext <<_ACEOF
8019 #line 8019 "configure"
8020 #include "confdefs.h"
8021 #include <stdio.h>
8022 int
8023 main (void)
8024 {
8025 printf("Hello")
8026   ;
8027   return 0;
8028 }
8029 _ACEOF
8030 rm -f conftest.$ac_objext
8031 if { (eval echo "$as_me:8031: \"$ac_compile\"") >&5
8032   (eval $ac_compile) 2>&5
8033   ac_status=$?
8034   echo "$as_me:8034: \$? = $ac_status" >&5
8035   (exit $ac_status); } &&
8036          { ac_try='test -s conftest.$ac_objext'
8037   { (eval echo "$as_me:8037: \"$ac_try\"") >&5
8038   (eval $ac_try) 2>&5
8039   ac_status=$?
8040   echo "$as_me:8040: \$? = $ac_status" >&5
8041   (exit $ac_status); }; }; then
8042   :
8043 else
8044   echo "$as_me: failed program was:" >&5
8045 cat conftest.$ac_ext >&5
8046 cf_have_incdir=yes
8047 fi
8048 rm -f conftest.$ac_objext conftest.$ac_ext
8049                           CPPFLAGS=$cf_save_CPPFLAGS
8050                         fi
8051                   fi
8052                 fi
8053
8054                 if test "$cf_have_incdir" = no ; then
8055                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8056
8057 echo "${as_me:-configure}:8057: testing adding $cf_add_incdir to include-path ..." 1>&5
8058
8059                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8060
8061                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8062                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8063                   cf_add_incdir="$cf_top_incdir"
8064                 else
8065                   break
8066                 fi
8067           else
8068                 break
8069           fi
8070         done
8071   done
8072 fi
8073
8074 }
8075
8076 echo "$as_me:8076: checking for $cf_ncuhdr_root header in include-path" >&5
8077 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8078 if test "${cf_cv_ncurses_h+set}" = set; then
8079   echo $ECHO_N "(cached) $ECHO_C" >&6
8080 else
8081
8082         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8083         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8084         for cf_header in $cf_header_list
8085         do
8086
8087         cat >conftest.$ac_ext <<_ACEOF
8088 #line 8088 "configure"
8089 #include "confdefs.h"
8090
8091 #include <$cf_header>
8092 int
8093 main (void)
8094 {
8095
8096 #ifdef NCURSES_VERSION
8097
8098 printf("%s\n", NCURSES_VERSION);
8099 #else
8100 #ifdef __NCURSES_H
8101 printf("old\n");
8102 #else
8103         make an error
8104 #endif
8105 #endif
8106
8107   ;
8108   return 0;
8109 }
8110 _ACEOF
8111 rm -f conftest.$ac_objext
8112 if { (eval echo "$as_me:8112: \"$ac_compile\"") >&5
8113   (eval $ac_compile) 2>&5
8114   ac_status=$?
8115   echo "$as_me:8115: \$? = $ac_status" >&5
8116   (exit $ac_status); } &&
8117          { ac_try='test -s conftest.$ac_objext'
8118   { (eval echo "$as_me:8118: \"$ac_try\"") >&5
8119   (eval $ac_try) 2>&5
8120   ac_status=$?
8121   echo "$as_me:8121: \$? = $ac_status" >&5
8122   (exit $ac_status); }; }; then
8123   cf_cv_ncurses_h=$cf_header
8124
8125 else
8126   echo "$as_me: failed program was:" >&5
8127 cat conftest.$ac_ext >&5
8128 cf_cv_ncurses_h=no
8129 fi
8130 rm -f conftest.$ac_objext conftest.$ac_ext
8131
8132                 test "$cf_cv_ncurses_h" != no && break
8133         done
8134
8135 fi
8136 echo "$as_me:8136: result: $cf_cv_ncurses_h" >&5
8137 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8138
8139 if test "$cf_cv_ncurses_h" != no ; then
8140         cf_cv_ncurses_header=$cf_cv_ncurses_h
8141 else
8142
8143 echo "$as_me:8143: checking for $cf_ncuhdr_root include-path" >&5
8144 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8145 if test "${cf_cv_ncurses_h2+set}" = set; then
8146   echo $ECHO_N "(cached) $ECHO_C" >&6
8147 else
8148
8149         test -n "$verbose" && echo
8150
8151 cf_search=
8152
8153 # collect the current set of include-directories from compiler flags
8154 cf_header_path_list=""
8155 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8156         for cf_header_path in $CPPFLAGS $CFLAGS
8157         do
8158                 case $cf_header_path in
8159                 (-I*)
8160                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8161
8162 test "x$cf_header_path" != "xNONE" && \
8163 test -d "$cf_header_path" && \
8164  {
8165         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8166         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8167         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8168         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8169         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8170         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"
8171 }
8172
8173                         cf_header_path_list="$cf_header_path_list $cf_search"
8174                         ;;
8175                 esac
8176         done
8177 fi
8178
8179 # add the variations for the package we are looking for
8180
8181 cf_search=
8182
8183 test "x$prefix" != "xNONE" && \
8184 test -d "$prefix" && \
8185  {
8186         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8187         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8188         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8189         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8190         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8191         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8192 }
8193
8194 for cf_subdir_prefix in \
8195         /usr \
8196         /usr/local \
8197         /usr/pkg \
8198         /opt \
8199         /opt/local \
8200         $HOME
8201 do
8202
8203 test "x$cf_subdir_prefix" != "x$prefix" && \
8204 test -d "$cf_subdir_prefix" && \
8205 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8206         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8207         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8208         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8209         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8210         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8211         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"
8212 }
8213
8214 done
8215
8216 test "$includedir" != NONE && \
8217 test "$includedir" != "/usr/include" && \
8218 test -d "$includedir" && {
8219         test -d $includedir &&    cf_search="$cf_search $includedir"
8220         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8221 }
8222
8223 test "$oldincludedir" != NONE && \
8224 test "$oldincludedir" != "/usr/include" && \
8225 test -d "$oldincludedir" && {
8226         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8227         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8228 }
8229
8230 cf_search="$cf_search $cf_header_path_list"
8231
8232         test -n "$verbose" && echo search path $cf_search
8233         cf_save2_CPPFLAGS="$CPPFLAGS"
8234         for cf_incdir in $cf_search
8235         do
8236
8237 if test -n "$cf_incdir" ; then
8238   for cf_add_incdir in $cf_incdir
8239   do
8240         while test $cf_add_incdir != /usr/include
8241         do
8242           if test -d $cf_add_incdir
8243           then
8244                 cf_have_incdir=no
8245                 if test -n "$CFLAGS$CPPFLAGS" ; then
8246                   # a loop is needed to ensure we can add subdirs of existing dirs
8247                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8248                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8249                           cf_have_incdir=yes; break
8250                         fi
8251                   done
8252                 fi
8253
8254                 if test "$cf_have_incdir" = no ; then
8255                   if test "$cf_add_incdir" = /usr/local/include ; then
8256                         if test "$GCC" = yes
8257                         then
8258                           cf_save_CPPFLAGS=$CPPFLAGS
8259                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8260                           cat >conftest.$ac_ext <<_ACEOF
8261 #line 8261 "configure"
8262 #include "confdefs.h"
8263 #include <stdio.h>
8264 int
8265 main (void)
8266 {
8267 printf("Hello")
8268   ;
8269   return 0;
8270 }
8271 _ACEOF
8272 rm -f conftest.$ac_objext
8273 if { (eval echo "$as_me:8273: \"$ac_compile\"") >&5
8274   (eval $ac_compile) 2>&5
8275   ac_status=$?
8276   echo "$as_me:8276: \$? = $ac_status" >&5
8277   (exit $ac_status); } &&
8278          { ac_try='test -s conftest.$ac_objext'
8279   { (eval echo "$as_me:8279: \"$ac_try\"") >&5
8280   (eval $ac_try) 2>&5
8281   ac_status=$?
8282   echo "$as_me:8282: \$? = $ac_status" >&5
8283   (exit $ac_status); }; }; then
8284   :
8285 else
8286   echo "$as_me: failed program was:" >&5
8287 cat conftest.$ac_ext >&5
8288 cf_have_incdir=yes
8289 fi
8290 rm -f conftest.$ac_objext conftest.$ac_ext
8291                           CPPFLAGS=$cf_save_CPPFLAGS
8292                         fi
8293                   fi
8294                 fi
8295
8296                 if test "$cf_have_incdir" = no ; then
8297                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8298
8299 echo "${as_me:-configure}:8299: testing adding $cf_add_incdir to include-path ..." 1>&5
8300
8301                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8302
8303                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8304                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8305                   cf_add_incdir="$cf_top_incdir"
8306                 else
8307                   break
8308                 fi
8309           else
8310                 break
8311           fi
8312         done
8313   done
8314 fi
8315
8316                 for cf_header in \
8317                         ncurses.h \
8318                         curses.h
8319                 do
8320
8321         cat >conftest.$ac_ext <<_ACEOF
8322 #line 8322 "configure"
8323 #include "confdefs.h"
8324
8325 #include <$cf_header>
8326 int
8327 main (void)
8328 {
8329
8330 #ifdef NCURSES_VERSION
8331
8332 printf("%s\n", NCURSES_VERSION);
8333 #else
8334 #ifdef __NCURSES_H
8335 printf("old\n");
8336 #else
8337         make an error
8338 #endif
8339 #endif
8340
8341   ;
8342   return 0;
8343 }
8344 _ACEOF
8345 rm -f conftest.$ac_objext
8346 if { (eval echo "$as_me:8346: \"$ac_compile\"") >&5
8347   (eval $ac_compile) 2>&5
8348   ac_status=$?
8349   echo "$as_me:8349: \$? = $ac_status" >&5
8350   (exit $ac_status); } &&
8351          { ac_try='test -s conftest.$ac_objext'
8352   { (eval echo "$as_me:8352: \"$ac_try\"") >&5
8353   (eval $ac_try) 2>&5
8354   ac_status=$?
8355   echo "$as_me:8355: \$? = $ac_status" >&5
8356   (exit $ac_status); }; }; then
8357   cf_cv_ncurses_h2=$cf_header
8358
8359 else
8360   echo "$as_me: failed program was:" >&5
8361 cat conftest.$ac_ext >&5
8362 cf_cv_ncurses_h2=no
8363 fi
8364 rm -f conftest.$ac_objext conftest.$ac_ext
8365
8366                         if test "$cf_cv_ncurses_h2" != no ; then
8367                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8368                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8369                                 break
8370                         fi
8371                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8372                 done
8373                 CPPFLAGS="$cf_save2_CPPFLAGS"
8374                 test "$cf_cv_ncurses_h2" != no && break
8375         done
8376         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8376: error: not found" >&5
8377 echo "$as_me: error: not found" >&2;}
8378    { (exit 1); exit 1; }; }
8379
8380 fi
8381 echo "$as_me:8381: result: $cf_cv_ncurses_h2" >&5
8382 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8383
8384         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8385         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8386         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8387                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8388         fi
8389
8390 if test -n "$cf_1st_incdir" ; then
8391   for cf_add_incdir in $cf_1st_incdir
8392   do
8393         while test $cf_add_incdir != /usr/include
8394         do
8395           if test -d $cf_add_incdir
8396           then
8397                 cf_have_incdir=no
8398                 if test -n "$CFLAGS$CPPFLAGS" ; then
8399                   # a loop is needed to ensure we can add subdirs of existing dirs
8400                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8401                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8402                           cf_have_incdir=yes; break
8403                         fi
8404                   done
8405                 fi
8406
8407                 if test "$cf_have_incdir" = no ; then
8408                   if test "$cf_add_incdir" = /usr/local/include ; then
8409                         if test "$GCC" = yes
8410                         then
8411                           cf_save_CPPFLAGS=$CPPFLAGS
8412                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8413                           cat >conftest.$ac_ext <<_ACEOF
8414 #line 8414 "configure"
8415 #include "confdefs.h"
8416 #include <stdio.h>
8417 int
8418 main (void)
8419 {
8420 printf("Hello")
8421   ;
8422   return 0;
8423 }
8424 _ACEOF
8425 rm -f conftest.$ac_objext
8426 if { (eval echo "$as_me:8426: \"$ac_compile\"") >&5
8427   (eval $ac_compile) 2>&5
8428   ac_status=$?
8429   echo "$as_me:8429: \$? = $ac_status" >&5
8430   (exit $ac_status); } &&
8431          { ac_try='test -s conftest.$ac_objext'
8432   { (eval echo "$as_me:8432: \"$ac_try\"") >&5
8433   (eval $ac_try) 2>&5
8434   ac_status=$?
8435   echo "$as_me:8435: \$? = $ac_status" >&5
8436   (exit $ac_status); }; }; then
8437   :
8438 else
8439   echo "$as_me: failed program was:" >&5
8440 cat conftest.$ac_ext >&5
8441 cf_have_incdir=yes
8442 fi
8443 rm -f conftest.$ac_objext conftest.$ac_ext
8444                           CPPFLAGS=$cf_save_CPPFLAGS
8445                         fi
8446                   fi
8447                 fi
8448
8449                 if test "$cf_have_incdir" = no ; then
8450                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8451
8452 echo "${as_me:-configure}:8452: testing adding $cf_add_incdir to include-path ..." 1>&5
8453
8454                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8455
8456                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8457                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8458                   cf_add_incdir="$cf_top_incdir"
8459                 else
8460                   break
8461                 fi
8462           else
8463                 break
8464           fi
8465         done
8466   done
8467 fi
8468
8469 fi
8470
8471 # Set definitions to allow ifdef'ing for ncurses.h
8472
8473 case $cf_cv_ncurses_header in
8474 (*ncurses.h)
8475
8476 cat >>confdefs.h <<\EOF
8477 #define HAVE_NCURSES_H 1
8478 EOF
8479
8480         ;;
8481 esac
8482
8483 case $cf_cv_ncurses_header in
8484 (ncurses/curses.h|ncurses/ncurses.h)
8485
8486 cat >>confdefs.h <<\EOF
8487 #define HAVE_NCURSES_NCURSES_H 1
8488 EOF
8489
8490         ;;
8491 (ncursesw/curses.h|ncursesw/ncurses.h)
8492
8493 cat >>confdefs.h <<\EOF
8494 #define HAVE_NCURSESW_NCURSES_H 1
8495 EOF
8496
8497         ;;
8498 esac
8499
8500 echo "$as_me:8500: checking for terminfo header" >&5
8501 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8502 if test "${cf_cv_term_header+set}" = set; then
8503   echo $ECHO_N "(cached) $ECHO_C" >&6
8504 else
8505
8506 case ${cf_cv_ncurses_header} in
8507 (*/ncurses.h|*/ncursesw.h)
8508         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8509         ;;
8510 (*)
8511         cf_term_header=term.h
8512         ;;
8513 esac
8514
8515 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8516 do
8517 cat >conftest.$ac_ext <<_ACEOF
8518 #line 8518 "configure"
8519 #include "confdefs.h"
8520 #include <stdio.h>
8521 #include <${cf_cv_ncurses_header:-curses.h}>
8522 #include <$cf_test>
8523
8524 int
8525 main (void)
8526 {
8527 int x = auto_left_margin
8528   ;
8529   return 0;
8530 }
8531 _ACEOF
8532 rm -f conftest.$ac_objext
8533 if { (eval echo "$as_me:8533: \"$ac_compile\"") >&5
8534   (eval $ac_compile) 2>&5
8535   ac_status=$?
8536   echo "$as_me:8536: \$? = $ac_status" >&5
8537   (exit $ac_status); } &&
8538          { ac_try='test -s conftest.$ac_objext'
8539   { (eval echo "$as_me:8539: \"$ac_try\"") >&5
8540   (eval $ac_try) 2>&5
8541   ac_status=$?
8542   echo "$as_me:8542: \$? = $ac_status" >&5
8543   (exit $ac_status); }; }; then
8544
8545         cf_cv_term_header="$cf_test"
8546 else
8547   echo "$as_me: failed program was:" >&5
8548 cat conftest.$ac_ext >&5
8549
8550         cf_cv_term_header=unknown
8551
8552 fi
8553 rm -f conftest.$ac_objext conftest.$ac_ext
8554         test "$cf_cv_term_header" != unknown && break
8555 done
8556
8557 fi
8558 echo "$as_me:8558: result: $cf_cv_term_header" >&5
8559 echo "${ECHO_T}$cf_cv_term_header" >&6
8560
8561 # Set definitions to allow ifdef'ing to accommodate subdirectories
8562
8563 case $cf_cv_term_header in
8564 (*term.h)
8565
8566 cat >>confdefs.h <<\EOF
8567 #define HAVE_TERM_H 1
8568 EOF
8569
8570         ;;
8571 esac
8572
8573 case $cf_cv_term_header in
8574 (ncurses/term.h)
8575
8576 cat >>confdefs.h <<\EOF
8577 #define HAVE_NCURSES_TERM_H 1
8578 EOF
8579
8580         ;;
8581 (ncursesw/term.h)
8582
8583 cat >>confdefs.h <<\EOF
8584 #define HAVE_NCURSESW_TERM_H 1
8585 EOF
8586
8587         ;;
8588 esac
8589
8590 # some applications need this, but should check for NCURSES_VERSION
8591
8592 cat >>confdefs.h <<\EOF
8593 #define NCURSES 1
8594 EOF
8595
8596 echo "$as_me:8596: checking for ncurses version" >&5
8597 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8598 if test "${cf_cv_ncurses_version+set}" = set; then
8599   echo $ECHO_N "(cached) $ECHO_C" >&6
8600 else
8601
8602         cf_cv_ncurses_version=no
8603         cf_tempfile=out$$
8604         rm -f $cf_tempfile
8605         if test "$cross_compiling" = yes; then
8606
8607         # This will not work if the preprocessor splits the line after the
8608         # Autoconf token.  The 'unproto' program does that.
8609         cat > conftest.$ac_ext <<EOF
8610 #include <${cf_cv_ncurses_header:-curses.h}>
8611 #undef Autoconf
8612 #ifdef NCURSES_VERSION
8613 Autoconf NCURSES_VERSION
8614 #else
8615 #ifdef __NCURSES_H
8616 Autoconf "old"
8617 #endif
8618 ;
8619 #endif
8620 EOF
8621         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8622         { (eval echo "$as_me:8622: \"$cf_try\"") >&5
8623   (eval $cf_try) 2>&5
8624   ac_status=$?
8625   echo "$as_me:8625: \$? = $ac_status" >&5
8626   (exit $ac_status); }
8627         if test -f conftest.out ; then
8628                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8629                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8630                 rm -f conftest.out
8631         fi
8632
8633 else
8634   cat >conftest.$ac_ext <<_ACEOF
8635 #line 8635 "configure"
8636 #include "confdefs.h"
8637
8638 #include <${cf_cv_ncurses_header:-curses.h}>
8639 #include <stdio.h>
8640 int main(void)
8641 {
8642         FILE *fp = fopen("$cf_tempfile", "w");
8643 #ifdef NCURSES_VERSION
8644 # ifdef NCURSES_VERSION_PATCH
8645         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8646 # else
8647         fprintf(fp, "%s\n", NCURSES_VERSION);
8648 # endif
8649 #else
8650 # ifdef __NCURSES_H
8651         fprintf(fp, "old\n");
8652 # else
8653         make an error
8654 # endif
8655 #endif
8656         ${cf_cv_main_return:-return}(0);
8657 }
8658 _ACEOF
8659 rm -f conftest$ac_exeext
8660 if { (eval echo "$as_me:8660: \"$ac_link\"") >&5
8661   (eval $ac_link) 2>&5
8662   ac_status=$?
8663   echo "$as_me:8663: \$? = $ac_status" >&5
8664   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8665   { (eval echo "$as_me:8665: \"$ac_try\"") >&5
8666   (eval $ac_try) 2>&5
8667   ac_status=$?
8668   echo "$as_me:8668: \$? = $ac_status" >&5
8669   (exit $ac_status); }; }; then
8670
8671         cf_cv_ncurses_version=`cat $cf_tempfile`
8672 else
8673   echo "$as_me: program exited with status $ac_status" >&5
8674 echo "$as_me: failed program was:" >&5
8675 cat conftest.$ac_ext >&5
8676 fi
8677 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8678 fi
8679         rm -f $cf_tempfile
8680
8681 fi
8682 echo "$as_me:8682: result: $cf_cv_ncurses_version" >&5
8683 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8684 test "$cf_cv_ncurses_version" = no ||
8685 cat >>confdefs.h <<\EOF
8686 #define NCURSES 1
8687 EOF
8688
8689 cf_nculib_root=ncurses
8690         # This works, except for the special case where we find gpm, but
8691         # ncurses is in a nonstandard location via $LIBS, and we really want
8692         # to link gpm.
8693 cf_ncurses_LIBS=""
8694 cf_ncurses_SAVE="$LIBS"
8695 echo "$as_me:8695: checking for Gpm_Open in -lgpm" >&5
8696 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8697 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8698   echo $ECHO_N "(cached) $ECHO_C" >&6
8699 else
8700   ac_check_lib_save_LIBS=$LIBS
8701 LIBS="-lgpm  $LIBS"
8702 cat >conftest.$ac_ext <<_ACEOF
8703 #line 8703 "configure"
8704 #include "confdefs.h"
8705
8706 /* Override any gcc2 internal prototype to avoid an error.  */
8707 #ifdef __cplusplus
8708 extern "C"
8709 #endif
8710 /* We use char because int might match the return type of a gcc2
8711    builtin and then its argument prototype would still apply.  */
8712 char Gpm_Open ();
8713 int
8714 main (void)
8715 {
8716 Gpm_Open ();
8717   ;
8718   return 0;
8719 }
8720 _ACEOF
8721 rm -f conftest.$ac_objext conftest$ac_exeext
8722 if { (eval echo "$as_me:8722: \"$ac_link\"") >&5
8723   (eval $ac_link) 2>&5
8724   ac_status=$?
8725   echo "$as_me:8725: \$? = $ac_status" >&5
8726   (exit $ac_status); } &&
8727          { ac_try='test -s conftest$ac_exeext'
8728   { (eval echo "$as_me:8728: \"$ac_try\"") >&5
8729   (eval $ac_try) 2>&5
8730   ac_status=$?
8731   echo "$as_me:8731: \$? = $ac_status" >&5
8732   (exit $ac_status); }; }; then
8733   ac_cv_lib_gpm_Gpm_Open=yes
8734 else
8735   echo "$as_me: failed program was:" >&5
8736 cat conftest.$ac_ext >&5
8737 ac_cv_lib_gpm_Gpm_Open=no
8738 fi
8739 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8740 LIBS=$ac_check_lib_save_LIBS
8741 fi
8742 echo "$as_me:8742: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8743 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8744 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8745   echo "$as_me:8745: checking for initscr in -lgpm" >&5
8746 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8747 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8748   echo $ECHO_N "(cached) $ECHO_C" >&6
8749 else
8750   ac_check_lib_save_LIBS=$LIBS
8751 LIBS="-lgpm  $LIBS"
8752 cat >conftest.$ac_ext <<_ACEOF
8753 #line 8753 "configure"
8754 #include "confdefs.h"
8755
8756 /* Override any gcc2 internal prototype to avoid an error.  */
8757 #ifdef __cplusplus
8758 extern "C"
8759 #endif
8760 /* We use char because int might match the return type of a gcc2
8761    builtin and then its argument prototype would still apply.  */
8762 char initscr ();
8763 int
8764 main (void)
8765 {
8766 initscr ();
8767   ;
8768   return 0;
8769 }
8770 _ACEOF
8771 rm -f conftest.$ac_objext conftest$ac_exeext
8772 if { (eval echo "$as_me:8772: \"$ac_link\"") >&5
8773   (eval $ac_link) 2>&5
8774   ac_status=$?
8775   echo "$as_me:8775: \$? = $ac_status" >&5
8776   (exit $ac_status); } &&
8777          { ac_try='test -s conftest$ac_exeext'
8778   { (eval echo "$as_me:8778: \"$ac_try\"") >&5
8779   (eval $ac_try) 2>&5
8780   ac_status=$?
8781   echo "$as_me:8781: \$? = $ac_status" >&5
8782   (exit $ac_status); }; }; then
8783   ac_cv_lib_gpm_initscr=yes
8784 else
8785   echo "$as_me: failed program was:" >&5
8786 cat conftest.$ac_ext >&5
8787 ac_cv_lib_gpm_initscr=no
8788 fi
8789 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8790 LIBS=$ac_check_lib_save_LIBS
8791 fi
8792 echo "$as_me:8792: result: $ac_cv_lib_gpm_initscr" >&5
8793 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8794 if test $ac_cv_lib_gpm_initscr = yes; then
8795   LIBS="$cf_ncurses_SAVE"
8796 else
8797   cf_ncurses_LIBS="-lgpm"
8798 fi
8799
8800 fi
8801
8802 case $host_os in
8803 (freebsd*)
8804         # This is only necessary if you are linking against an obsolete
8805         # version of ncurses (but it should do no harm, since it's static).
8806         if test "$cf_nculib_root" = ncurses ; then
8807                 echo "$as_me:8807: checking for tgoto in -lmytinfo" >&5
8808 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8809 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8810   echo $ECHO_N "(cached) $ECHO_C" >&6
8811 else
8812   ac_check_lib_save_LIBS=$LIBS
8813 LIBS="-lmytinfo  $LIBS"
8814 cat >conftest.$ac_ext <<_ACEOF
8815 #line 8815 "configure"
8816 #include "confdefs.h"
8817
8818 /* Override any gcc2 internal prototype to avoid an error.  */
8819 #ifdef __cplusplus
8820 extern "C"
8821 #endif
8822 /* We use char because int might match the return type of a gcc2
8823    builtin and then its argument prototype would still apply.  */
8824 char tgoto ();
8825 int
8826 main (void)
8827 {
8828 tgoto ();
8829   ;
8830   return 0;
8831 }
8832 _ACEOF
8833 rm -f conftest.$ac_objext conftest$ac_exeext
8834 if { (eval echo "$as_me:8834: \"$ac_link\"") >&5
8835   (eval $ac_link) 2>&5
8836   ac_status=$?
8837   echo "$as_me:8837: \$? = $ac_status" >&5
8838   (exit $ac_status); } &&
8839          { ac_try='test -s conftest$ac_exeext'
8840   { (eval echo "$as_me:8840: \"$ac_try\"") >&5
8841   (eval $ac_try) 2>&5
8842   ac_status=$?
8843   echo "$as_me:8843: \$? = $ac_status" >&5
8844   (exit $ac_status); }; }; then
8845   ac_cv_lib_mytinfo_tgoto=yes
8846 else
8847   echo "$as_me: failed program was:" >&5
8848 cat conftest.$ac_ext >&5
8849 ac_cv_lib_mytinfo_tgoto=no
8850 fi
8851 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8852 LIBS=$ac_check_lib_save_LIBS
8853 fi
8854 echo "$as_me:8854: result: $ac_cv_lib_mytinfo_tgoto" >&5
8855 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8856 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8857   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8858 fi
8859
8860         fi
8861         ;;
8862 esac
8863
8864 cf_add_libs="$cf_ncurses_LIBS"
8865 # Filter out duplicates - this happens with badly-designed ".pc" files...
8866 for cf_add_1lib in $LIBS
8867 do
8868         for cf_add_2lib in $cf_add_libs
8869         do
8870                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8871                 then
8872                         cf_add_1lib=
8873                         break
8874                 fi
8875         done
8876         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8877 done
8878 LIBS="$cf_add_libs"
8879
8880 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8881 then
8882
8883 cf_add_libs="-l$cf_nculib_root"
8884 # Filter out duplicates - this happens with badly-designed ".pc" files...
8885 for cf_add_1lib in $LIBS
8886 do
8887         for cf_add_2lib in $cf_add_libs
8888         do
8889                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8890                 then
8891                         cf_add_1lib=
8892                         break
8893                 fi
8894         done
8895         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8896 done
8897 LIBS="$cf_add_libs"
8898
8899 else
8900
8901         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8902         cf_libdir=""
8903         echo "$as_me:8903: checking for initscr" >&5
8904 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8905 if test "${ac_cv_func_initscr+set}" = set; then
8906   echo $ECHO_N "(cached) $ECHO_C" >&6
8907 else
8908   cat >conftest.$ac_ext <<_ACEOF
8909 #line 8909 "configure"
8910 #include "confdefs.h"
8911 /* System header to define __stub macros and hopefully few prototypes,
8912     which can conflict with char initscr (); below.  */
8913 #include <assert.h>
8914 /* Override any gcc2 internal prototype to avoid an error.  */
8915 #ifdef __cplusplus
8916 extern "C"
8917 #endif
8918 /* We use char because int might match the return type of a gcc2
8919    builtin and then its argument prototype would still apply.  */
8920 char initscr ();
8921 char (*f) ();
8922
8923 int
8924 main (void)
8925 {
8926 /* The GNU C library defines this for functions which it implements
8927     to always fail with ENOSYS.  Some functions are actually named
8928     something starting with __ and the normal name is an alias.  */
8929 #if defined (__stub_initscr) || defined (__stub___initscr)
8930 choke me
8931 #else
8932 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8933 #endif
8934
8935   ;
8936   return 0;
8937 }
8938 _ACEOF
8939 rm -f conftest.$ac_objext conftest$ac_exeext
8940 if { (eval echo "$as_me:8940: \"$ac_link\"") >&5
8941   (eval $ac_link) 2>&5
8942   ac_status=$?
8943   echo "$as_me:8943: \$? = $ac_status" >&5
8944   (exit $ac_status); } &&
8945          { ac_try='test -s conftest$ac_exeext'
8946   { (eval echo "$as_me:8946: \"$ac_try\"") >&5
8947   (eval $ac_try) 2>&5
8948   ac_status=$?
8949   echo "$as_me:8949: \$? = $ac_status" >&5
8950   (exit $ac_status); }; }; then
8951   ac_cv_func_initscr=yes
8952 else
8953   echo "$as_me: failed program was:" >&5
8954 cat conftest.$ac_ext >&5
8955 ac_cv_func_initscr=no
8956 fi
8957 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8958 fi
8959 echo "$as_me:8959: result: $ac_cv_func_initscr" >&5
8960 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8961 if test $ac_cv_func_initscr = yes; then
8962   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8963 else
8964
8965                 cf_save_LIBS="$LIBS"
8966                 echo "$as_me:8966: checking for initscr in -l$cf_nculib_root" >&5
8967 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8968                 LIBS="-l$cf_nculib_root $LIBS"
8969                 cat >conftest.$ac_ext <<_ACEOF
8970 #line 8970 "configure"
8971 #include "confdefs.h"
8972 #include <${cf_cv_ncurses_header:-curses.h}>
8973 int
8974 main (void)
8975 {
8976 initscr()
8977   ;
8978   return 0;
8979 }
8980 _ACEOF
8981 rm -f conftest.$ac_objext conftest$ac_exeext
8982 if { (eval echo "$as_me:8982: \"$ac_link\"") >&5
8983   (eval $ac_link) 2>&5
8984   ac_status=$?
8985   echo "$as_me:8985: \$? = $ac_status" >&5
8986   (exit $ac_status); } &&
8987          { ac_try='test -s conftest$ac_exeext'
8988   { (eval echo "$as_me:8988: \"$ac_try\"") >&5
8989   (eval $ac_try) 2>&5
8990   ac_status=$?
8991   echo "$as_me:8991: \$? = $ac_status" >&5
8992   (exit $ac_status); }; }; then
8993   echo "$as_me:8993: result: yes" >&5
8994 echo "${ECHO_T}yes" >&6
8995                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8996
8997 else
8998   echo "$as_me: failed program was:" >&5
8999 cat conftest.$ac_ext >&5
9000 echo "$as_me:9000: result: no" >&5
9001 echo "${ECHO_T}no" >&6
9002
9003 cf_search=
9004 cf_library_path_list=""
9005 if test -n "${LDFLAGS}${LIBS}" ; then
9006         for cf_library_path in $LDFLAGS $LIBS
9007         do
9008                 case $cf_library_path in
9009                 (-L*)
9010                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9011
9012 test "x$cf_library_path" != "xNONE" && \
9013 test -d "$cf_library_path" && \
9014  {
9015         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9016         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9017         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9018         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9019         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9020         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"
9021 }
9022
9023                         cf_library_path_list="$cf_library_path_list $cf_search"
9024                         ;;
9025                 esac
9026         done
9027 fi
9028
9029 cf_search=
9030
9031 test "x$prefix" != "xNONE" && \
9032 test -d "$prefix" && \
9033  {
9034         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9035         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9036         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9037         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9038         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9039         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9040 }
9041
9042 for cf_subdir_prefix in \
9043         /usr \
9044         /usr/local \
9045         /usr/pkg \
9046         /opt \
9047         /opt/local \
9048         $HOME
9049 do
9050
9051 test "x$cf_subdir_prefix" != "x$prefix" && \
9052 test -d "$cf_subdir_prefix" && \
9053 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9054         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9055         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9056         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9057         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9058         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9059         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"
9060 }
9061
9062 done
9063
9064 cf_search="$cf_library_path_list $cf_search"
9065
9066                         for cf_libdir in $cf_search
9067                         do
9068                                 echo "$as_me:9068: checking for -l$cf_nculib_root in $cf_libdir" >&5
9069 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9070                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9071                                 cat >conftest.$ac_ext <<_ACEOF
9072 #line 9072 "configure"
9073 #include "confdefs.h"
9074 #include <${cf_cv_ncurses_header:-curses.h}>
9075 int
9076 main (void)
9077 {
9078 initscr()
9079   ;
9080   return 0;
9081 }
9082 _ACEOF
9083 rm -f conftest.$ac_objext conftest$ac_exeext
9084 if { (eval echo "$as_me:9084: \"$ac_link\"") >&5
9085   (eval $ac_link) 2>&5
9086   ac_status=$?
9087   echo "$as_me:9087: \$? = $ac_status" >&5
9088   (exit $ac_status); } &&
9089          { ac_try='test -s conftest$ac_exeext'
9090   { (eval echo "$as_me:9090: \"$ac_try\"") >&5
9091   (eval $ac_try) 2>&5
9092   ac_status=$?
9093   echo "$as_me:9093: \$? = $ac_status" >&5
9094   (exit $ac_status); }; }; then
9095   echo "$as_me:9095: result: yes" >&5
9096 echo "${ECHO_T}yes" >&6
9097                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9098                                          break
9099 else
9100   echo "$as_me: failed program was:" >&5
9101 cat conftest.$ac_ext >&5
9102 echo "$as_me:9102: result: no" >&5
9103 echo "${ECHO_T}no" >&6
9104                                          LIBS="$cf_save_LIBS"
9105 fi
9106 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9107                         done
9108
9109 fi
9110 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9111
9112 fi
9113
9114 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9115
9116 if test $cf_found_library = no ; then
9117         { { echo "$as_me:9117: error: Cannot link $cf_nculib_root library" >&5
9118 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9119    { (exit 1); exit 1; }; }
9120 fi
9121
9122 fi
9123
9124 if test -n "$cf_ncurses_LIBS" ; then
9125         echo "$as_me:9125: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9126 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9127         cf_ncurses_SAVE="$LIBS"
9128         for p in $cf_ncurses_LIBS ; do
9129                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9130                 if test "$q" != "$LIBS" ; then
9131                         LIBS="$q"
9132                 fi
9133         done
9134         cat >conftest.$ac_ext <<_ACEOF
9135 #line 9135 "configure"
9136 #include "confdefs.h"
9137 #include <${cf_cv_ncurses_header:-curses.h}>
9138 int
9139 main (void)
9140 {
9141 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9142   ;
9143   return 0;
9144 }
9145 _ACEOF
9146 rm -f conftest.$ac_objext conftest$ac_exeext
9147 if { (eval echo "$as_me:9147: \"$ac_link\"") >&5
9148   (eval $ac_link) 2>&5
9149   ac_status=$?
9150   echo "$as_me:9150: \$? = $ac_status" >&5
9151   (exit $ac_status); } &&
9152          { ac_try='test -s conftest$ac_exeext'
9153   { (eval echo "$as_me:9153: \"$ac_try\"") >&5
9154   (eval $ac_try) 2>&5
9155   ac_status=$?
9156   echo "$as_me:9156: \$? = $ac_status" >&5
9157   (exit $ac_status); }; }; then
9158   echo "$as_me:9158: result: yes" >&5
9159 echo "${ECHO_T}yes" >&6
9160 else
9161   echo "$as_me: failed program was:" >&5
9162 cat conftest.$ac_ext >&5
9163 echo "$as_me:9163: result: no" >&5
9164 echo "${ECHO_T}no" >&6
9165                  LIBS="$cf_ncurses_SAVE"
9166 fi
9167 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9168 fi
9169
9170 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9171
9172 cat >>confdefs.h <<EOF
9173 #define $cf_nculib_ROOT 1
9174 EOF
9175
9176         fi
9177 else
9178         NCURSES_CONFIG=none
9179 fi
9180
9181 fi
9182
9183 if test "$NCURSES_CONFIG_PKG" != none ; then
9184         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
9185
9186         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9187         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9188         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9189
9190         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
9191         if test -z "$cf_cv_abi_version"
9192         then
9193                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
9194         fi
9195
9196 elif test "$NCURSES_CONFIG" != none ; then
9197
9198         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
9199
9200         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9201         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9202         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9203
9204         # ABI version is not available from headers
9205         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
9206
9207 else
9208
9209         for cf_name in MAJOR MINOR PATCH
9210         do
9211         cat >conftest.$ac_ext <<CF_EOF
9212         #include <${cf_cv_ncurses_header:-curses.h}>
9213         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
9214 CF_EOF
9215                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
9216                 { (eval echo "$as_me:9216: \"$cf_try\"") >&5
9217   (eval $cf_try) 2>&5
9218   ac_status=$?
9219   echo "$as_me:9219: \$? = $ac_status" >&5
9220   (exit $ac_status); }
9221                 if test -f conftest.out ; then
9222                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
9223                         eval NCURSES_$cf_name=\"$cf_result\"
9224                         # cat conftest.$ac_ext
9225                         # cat conftest.out
9226                 fi
9227         done
9228
9229         cf_cv_abi_version=${NCURSES_MAJOR}
9230
9231 fi
9232
9233 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
9234
9235 cf_cv_timestamp=`date`
9236
9237 echo "$as_me:9237: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
9238 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
9239
9240 echo "$as_me:9240: checking if you want to have a library-prefix" >&5
9241 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
9242
9243 # Check whether --with-lib-prefix or --without-lib-prefix was given.
9244 if test "${with_lib_prefix+set}" = set; then
9245   withval="$with_lib_prefix"
9246   with_lib_prefix=$withval
9247 else
9248   with_lib_prefix=auto
9249 fi;
9250 echo "$as_me:9250: result: $with_lib_prefix" >&5
9251 echo "${ECHO_T}$with_lib_prefix" >&6
9252
9253 if test $with_lib_prefix = auto
9254 then
9255
9256         case $cf_cv_system_name in
9257         (OS/2*|os2*)
9258                 if test "$DFT_LWR_MODEL" = libtool; then
9259                         LIB_PREFIX='lib'
9260                 else
9261                         LIB_PREFIX=''
9262                 fi
9263                 ;;
9264         (*)     LIB_PREFIX='lib'
9265                 ;;
9266         esac
9267 cf_prefix=$LIB_PREFIX
9268
9269 elif test $with_lib_prefix = no
9270 then
9271         LIB_PREFIX=
9272 else
9273         LIB_PREFIX=$with_lib_prefix
9274 fi
9275
9276 LIB_SUFFIX=
9277
9278 ###############################################################################
9279
9280 if test X"$CC_G_OPT" = X"" ; then
9281         CC_G_OPT='-g'
9282         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
9283 fi
9284
9285 echo "$as_me:9285: checking for default loader flags" >&5
9286 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
9287 case $DFT_LWR_MODEL in
9288 (normal)  LD_MODEL=''   ;;
9289 (debug)   LD_MODEL=$CC_G_OPT ;;
9290 (profile) LD_MODEL='-pg';;
9291 (shared)  LD_MODEL=''   ;;
9292 esac
9293 echo "$as_me:9293: result: $LD_MODEL" >&5
9294 echo "${ECHO_T}$LD_MODEL" >&6
9295
9296 LD_RPATH_OPT=
9297 echo "$as_me:9297: checking for an rpath option" >&5
9298 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
9299 case $cf_cv_system_name in
9300 (irix*)
9301         if test "$GCC" = yes; then
9302                 LD_RPATH_OPT="-Wl,-rpath,"
9303         else
9304                 LD_RPATH_OPT="-rpath "
9305         fi
9306         ;;
9307 (linux*|gnu*|k*bsd*-gnu|freebsd*)
9308         LD_RPATH_OPT="-Wl,-rpath,"
9309         ;;
9310 (openbsd[2-9].*|mirbsd*)
9311         LD_RPATH_OPT="-Wl,-rpath,"
9312         ;;
9313 (dragonfly*)
9314         LD_RPATH_OPT="-rpath "
9315         ;;
9316 (netbsd*)
9317         LD_RPATH_OPT="-Wl,-rpath,"
9318         ;;
9319 (osf*|mls+*)
9320         LD_RPATH_OPT="-rpath "
9321         ;;
9322 (solaris2*)
9323         LD_RPATH_OPT="-R"
9324         ;;
9325 (*)
9326         ;;
9327 esac
9328 echo "$as_me:9328: result: $LD_RPATH_OPT" >&5
9329 echo "${ECHO_T}$LD_RPATH_OPT" >&6
9330
9331 case "x$LD_RPATH_OPT" in
9332 (x-R*)
9333         echo "$as_me:9333: checking if we need a space after rpath option" >&5
9334 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
9335         cf_save_LIBS="$LIBS"
9336
9337 cf_add_libs="${LD_RPATH_OPT}$libdir"
9338 # Filter out duplicates - this happens with badly-designed ".pc" files...
9339 for cf_add_1lib in $LIBS
9340 do
9341         for cf_add_2lib in $cf_add_libs
9342         do
9343                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9344                 then
9345                         cf_add_1lib=
9346                         break
9347                 fi
9348         done
9349         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9350 done
9351 LIBS="$cf_add_libs"
9352
9353         cat >conftest.$ac_ext <<_ACEOF
9354 #line 9354 "configure"
9355 #include "confdefs.h"
9356
9357 int
9358 main (void)
9359 {
9360
9361   ;
9362   return 0;
9363 }
9364 _ACEOF
9365 rm -f conftest.$ac_objext conftest$ac_exeext
9366 if { (eval echo "$as_me:9366: \"$ac_link\"") >&5
9367   (eval $ac_link) 2>&5
9368   ac_status=$?
9369   echo "$as_me:9369: \$? = $ac_status" >&5
9370   (exit $ac_status); } &&
9371          { ac_try='test -s conftest$ac_exeext'
9372   { (eval echo "$as_me:9372: \"$ac_try\"") >&5
9373   (eval $ac_try) 2>&5
9374   ac_status=$?
9375   echo "$as_me:9375: \$? = $ac_status" >&5
9376   (exit $ac_status); }; }; then
9377   cf_rpath_space=no
9378 else
9379   echo "$as_me: failed program was:" >&5
9380 cat conftest.$ac_ext >&5
9381 cf_rpath_space=yes
9382 fi
9383 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9384         LIBS="$cf_save_LIBS"
9385         echo "$as_me:9385: result: $cf_rpath_space" >&5
9386 echo "${ECHO_T}$cf_rpath_space" >&6
9387         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9388         ;;
9389 esac
9390
9391         RM_SHARED_OPTS=
9392         LOCAL_LDFLAGS=
9393         LOCAL_LDFLAGS2=
9394         LD_SHARED_OPTS=
9395         INSTALL_LIB="-m 644"
9396         : ${rel_builddir:=.}
9397
9398         shlibdir=$libdir
9399
9400         MAKE_DLLS="#"
9401
9402         cf_cv_do_symlinks=no
9403         cf_ld_rpath_opt=
9404         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9405
9406         echo "$as_me:9406: checking if release/abi version should be used for shared libs" >&5
9407 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9408
9409 # Check whether --with-shlib-version or --without-shlib-version was given.
9410 if test "${with_shlib_version+set}" = set; then
9411   withval="$with_shlib_version"
9412   test -z "$withval" && withval=auto
9413         case $withval in
9414         (yes)
9415                 cf_cv_shlib_version=auto
9416                 ;;
9417         (rel|abi|auto)
9418                 cf_cv_shlib_version=$withval
9419                 ;;
9420         (*)
9421                 echo "$as_me:9421: result: $withval" >&5
9422 echo "${ECHO_T}$withval" >&6
9423                 { { echo "$as_me:9423: error: option value must be one of: rel, abi, or auto" >&5
9424 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9425    { (exit 1); exit 1; }; }
9426                 ;;
9427         esac
9428
9429 else
9430   cf_cv_shlib_version=auto
9431 fi;
9432         echo "$as_me:9432: result: $cf_cv_shlib_version" >&5
9433 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9434
9435         cf_cv_rm_so_locs=no
9436         cf_try_cflags=
9437
9438         # Some less-capable ports of gcc support only -fpic
9439         CC_SHARED_OPTS=
9440
9441         cf_try_fPIC=no
9442         if test "$GCC" = yes
9443         then
9444                 cf_try_fPIC=yes
9445         else
9446                 case $cf_cv_system_name in
9447                 (*linux*)       # e.g., PGI compiler
9448                         cf_try_fPIC=yes
9449                         ;;
9450                 esac
9451         fi
9452
9453         if test "$cf_try_fPIC" = yes
9454         then
9455                 echo "$as_me:9455: checking which $CC option to use" >&5
9456 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9457                 cf_save_CFLAGS="$CFLAGS"
9458                 for CC_SHARED_OPTS in -fPIC -fpic ''
9459                 do
9460                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9461                         cat >conftest.$ac_ext <<_ACEOF
9462 #line 9462 "configure"
9463 #include "confdefs.h"
9464 #include <stdio.h>
9465 int
9466 main (void)
9467 {
9468 int x = 1
9469   ;
9470   return 0;
9471 }
9472 _ACEOF
9473 rm -f conftest.$ac_objext
9474 if { (eval echo "$as_me:9474: \"$ac_compile\"") >&5
9475   (eval $ac_compile) 2>&5
9476   ac_status=$?
9477   echo "$as_me:9477: \$? = $ac_status" >&5
9478   (exit $ac_status); } &&
9479          { ac_try='test -s conftest.$ac_objext'
9480   { (eval echo "$as_me:9480: \"$ac_try\"") >&5
9481   (eval $ac_try) 2>&5
9482   ac_status=$?
9483   echo "$as_me:9483: \$? = $ac_status" >&5
9484   (exit $ac_status); }; }; then
9485   break
9486 else
9487   echo "$as_me: failed program was:" >&5
9488 cat conftest.$ac_ext >&5
9489 fi
9490 rm -f conftest.$ac_objext conftest.$ac_ext
9491                 done
9492                 echo "$as_me:9492: result: $CC_SHARED_OPTS" >&5
9493 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9494                 CFLAGS="$cf_save_CFLAGS"
9495         fi
9496
9497         cf_cv_shlib_version_infix=no
9498
9499         case $cf_cv_system_name in
9500         (aix4.3-9*|aix[5-7]*)
9501                 if test "$GCC" = yes; then
9502                         CC_SHARED_OPTS='-Wl,-brtl'
9503                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9504                 else
9505                         CC_SHARED_OPTS='-brtl'
9506                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9507                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9508                 fi
9509                 ;;
9510         (beos*)
9511                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9512                 ;;
9513         (cygwin*)
9514                 CC_SHARED_OPTS=
9515                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9516                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9517                 cf_cv_shlib_version=cygdll
9518                 cf_cv_shlib_version_infix=cygdll
9519                 shlibdir=$bindir
9520                 MAKE_DLLS=
9521                 cat >mk_shared_lib.sh <<-CF_EOF
9522                 #!$SHELL
9523                 SHARED_LIB=\$1
9524                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9525                 shift
9526                 cat <<-EOF
9527                 Linking shared library
9528                 ** SHARED_LIB \$SHARED_LIB
9529                 ** IMPORT_LIB \$IMPORT_LIB
9530 EOF
9531                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9532 CF_EOF
9533                 chmod +x mk_shared_lib.sh
9534                 ;;
9535         (msys*)
9536                 CC_SHARED_OPTS=
9537                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9538                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9539                 cf_cv_shlib_version=msysdll
9540                 cf_cv_shlib_version_infix=msysdll
9541                 shlibdir=$bindir
9542                 MAKE_DLLS=
9543                 cat >mk_shared_lib.sh <<-CF_EOF
9544                 #!$SHELL
9545                 SHARED_LIB=\$1
9546                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9547                 shift
9548                 cat <<-EOF
9549                 Linking shared library
9550                 ** SHARED_LIB \$SHARED_LIB
9551                 ** IMPORT_LIB \$IMPORT_LIB
9552 EOF
9553                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9554 CF_EOF
9555                 chmod +x mk_shared_lib.sh
9556                 ;;
9557         (darwin*)
9558                 cf_try_cflags="no-cpp-precomp"
9559                 CC_SHARED_OPTS="-dynamic"
9560                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9561                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9562                 cf_cv_shlib_version_infix=yes
9563                 echo "$as_me:9563: checking if ld -search_paths_first works" >&5
9564 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9565 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9566   echo $ECHO_N "(cached) $ECHO_C" >&6
9567 else
9568
9569                         cf_save_LDFLAGS=$LDFLAGS
9570                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9571                         cat >conftest.$ac_ext <<_ACEOF
9572 #line 9572 "configure"
9573 #include "confdefs.h"
9574
9575 int
9576 main (void)
9577 {
9578 int i;
9579   ;
9580   return 0;
9581 }
9582 _ACEOF
9583 rm -f conftest.$ac_objext conftest$ac_exeext
9584 if { (eval echo "$as_me:9584: \"$ac_link\"") >&5
9585   (eval $ac_link) 2>&5
9586   ac_status=$?
9587   echo "$as_me:9587: \$? = $ac_status" >&5
9588   (exit $ac_status); } &&
9589          { ac_try='test -s conftest$ac_exeext'
9590   { (eval echo "$as_me:9590: \"$ac_try\"") >&5
9591   (eval $ac_try) 2>&5
9592   ac_status=$?
9593   echo "$as_me:9593: \$? = $ac_status" >&5
9594   (exit $ac_status); }; }; then
9595   cf_cv_ldflags_search_paths_first=yes
9596 else
9597   echo "$as_me: failed program was:" >&5
9598 cat conftest.$ac_ext >&5
9599 cf_cv_ldflags_search_paths_first=no
9600 fi
9601 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9602                                 LDFLAGS=$cf_save_LDFLAGS
9603 fi
9604 echo "$as_me:9604: result: $cf_cv_ldflags_search_paths_first" >&5
9605 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9606                 if test $cf_cv_ldflags_search_paths_first = yes; then
9607                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9608                 fi
9609                 ;;
9610         (hpux[7-8]*)
9611                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9612                 if test "$GCC" != yes; then
9613                         CC_SHARED_OPTS='+Z'
9614                 fi
9615                 MK_SHARED_LIB='${LD} -b -o $@'
9616                 INSTALL_LIB="-m 555"
9617                 ;;
9618         (hpux*)
9619                 # (tested with gcc 2.7.2 -- I don't have c89)
9620                 if test "$GCC" = yes; then
9621                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9622                 else
9623                         CC_SHARED_OPTS='+Z'
9624                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9625                 fi
9626                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
9627                 # HP-UX shared libraries must be executable, and should be
9628                 # readonly to exploit a quirk in the memory manager.
9629                 INSTALL_LIB="-m 555"
9630                 ;;
9631         (interix*)
9632                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9633                 if test "$cf_cv_shlib_version" = rel; then
9634                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
9635                 else
9636                         cf_shared_soname='`basename `'
9637                 fi
9638                 CC_SHARED_OPTS=
9639                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
9640                 ;;
9641         (irix*)
9642                 if test "$cf_cv_enable_rpath" = yes ; then
9643                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9644                 fi
9645                 # tested with IRIX 5.2 and 'cc'.
9646                 if test "$GCC" != yes; then
9647                         CC_SHARED_OPTS='-KPIC'
9648                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
9649                 else
9650                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
9651                 fi
9652                 cf_cv_rm_so_locs=yes
9653                 ;;
9654         (linux*|gnu*|k*bsd*-gnu)
9655                 if test "$DFT_LWR_MODEL" = "shared" ; then
9656                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9657                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9658                 fi
9659                 if test "$cf_cv_enable_rpath" = yes ; then
9660                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9661                 fi
9662
9663         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9664         if test "$cf_cv_shlib_version" = rel; then
9665                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9666         else
9667                 cf_cv_shared_soname='`basename $@`'
9668         fi
9669
9670                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9671                 ;;
9672         (mingw*)
9673                 cf_cv_shlib_version=mingw
9674                 cf_cv_shlib_version_infix=mingw
9675                 shlibdir=$bindir
9676                 MAKE_DLLS=
9677                 if test "$DFT_LWR_MODEL" = "shared" ; then
9678                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9679                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9680                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9681                 fi
9682                 CC_SHARED_OPTS=
9683                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9684                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9685                 cat >mk_shared_lib.sh <<-CF_EOF
9686                 #!$SHELL
9687                 SHARED_LIB=\$1
9688                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9689                 shift
9690                 cat <<-EOF
9691                 Linking shared library
9692                 ** SHARED_LIB \$SHARED_LIB
9693                 ** IMPORT_LIB \$IMPORT_LIB
9694 EOF
9695                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9696 CF_EOF
9697                 chmod +x mk_shared_lib.sh
9698                 ;;
9699         (openbsd[2-9].*|mirbsd*)
9700                 if test "$DFT_LWR_MODEL" = "shared" ; then
9701                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9702                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9703                 fi
9704                 if test "$cf_cv_enable_rpath" = yes ; then
9705                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9706                 fi
9707                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9708
9709         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9710         if test "$cf_cv_shlib_version" = rel; then
9711                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9712         else
9713                 cf_cv_shared_soname='`basename $@`'
9714         fi
9715
9716                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9717                 ;;
9718         (nto-qnx*|openbsd*|freebsd[12].*)
9719                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9720                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
9721                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9722                 ;;
9723         (dragonfly*|freebsd*)
9724                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9725                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9726                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9727                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9728                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9729                 fi
9730
9731         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9732         if test "$cf_cv_shlib_version" = rel; then
9733                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9734         else
9735                 cf_cv_shared_soname='`basename $@`'
9736         fi
9737
9738                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9739                 ;;
9740         (netbsd*)
9741                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9742                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9743                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9744                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9745                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9746                         if test "$cf_cv_shlib_version" = auto; then
9747                         if test -f /usr/libexec/ld.elf_so; then
9748                                 cf_cv_shlib_version=abi
9749                         else
9750                                 cf_cv_shlib_version=rel
9751                         fi
9752                         fi
9753
9754         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9755         if test "$cf_cv_shlib_version" = rel; then
9756                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9757         else
9758                 cf_cv_shared_soname='`basename $@`'
9759         fi
9760
9761                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9762                 else
9763                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
9764                 fi
9765                 ;;
9766         (osf*|mls+*)
9767                 # tested with OSF/1 V3.2 and 'cc'
9768                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9769                 # link with shared libs).
9770                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9771                 case $host_os in
9772                 (osf4*)
9773                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9774                         ;;
9775                 esac
9776                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9777                 if test "$DFT_LWR_MODEL" = "shared" ; then
9778                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9779                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9780                 fi
9781                 cf_cv_rm_so_locs=yes
9782                 ;;
9783         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9784                 # tested with osr5.0.5
9785                 if test "$GCC" != yes; then
9786                         CC_SHARED_OPTS='-belf -KPIC'
9787                 fi
9788                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9789                 if test "$cf_cv_enable_rpath" = yes ; then
9790                         # only way is to set LD_RUN_PATH but no switch for it
9791                         RUN_PATH=$libdir
9792                 fi
9793                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9794                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9795                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9796                 ;;
9797         (sunos4*)
9798                 # tested with SunOS 4.1.1 and gcc 2.7.0
9799                 if test "$GCC" != yes; then
9800                         CC_SHARED_OPTS='-KPIC'
9801                 fi
9802                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
9803                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9804                 ;;
9805         (solaris2*)
9806                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9807                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9808                 if test "$DFT_LWR_MODEL" = "shared" ; then
9809                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9810                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9811                 fi
9812                 if test "$cf_cv_enable_rpath" = yes ; then
9813                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9814                 fi
9815
9816         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9817         if test "$cf_cv_shlib_version" = rel; then
9818                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9819         else
9820                 cf_cv_shared_soname='`basename $@`'
9821         fi
9822
9823                 if test "$GCC" != yes; then
9824                         cf_save_CFLAGS="$CFLAGS"
9825                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9826                         do
9827                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9828                                 cat >conftest.$ac_ext <<_ACEOF
9829 #line 9829 "configure"
9830 #include "confdefs.h"
9831 #include <stdio.h>
9832 int
9833 main (void)
9834 {
9835 printf("Hello\n");
9836   ;
9837   return 0;
9838 }
9839 _ACEOF
9840 rm -f conftest.$ac_objext
9841 if { (eval echo "$as_me:9841: \"$ac_compile\"") >&5
9842   (eval $ac_compile) 2>&5
9843   ac_status=$?
9844   echo "$as_me:9844: \$? = $ac_status" >&5
9845   (exit $ac_status); } &&
9846          { ac_try='test -s conftest.$ac_objext'
9847   { (eval echo "$as_me:9847: \"$ac_try\"") >&5
9848   (eval $ac_try) 2>&5
9849   ac_status=$?
9850   echo "$as_me:9850: \$? = $ac_status" >&5
9851   (exit $ac_status); }; }; then
9852   break
9853 else
9854   echo "$as_me: failed program was:" >&5
9855 cat conftest.$ac_ext >&5
9856 fi
9857 rm -f conftest.$ac_objext conftest.$ac_ext
9858                         done
9859                         CFLAGS="$cf_save_CFLAGS"
9860                         CC_SHARED_OPTS=$cf_shared_opts
9861                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
9862                 else
9863                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9864                 fi
9865                 ;;
9866         (sysv5uw7*|unix_sv*)
9867                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9868                 if test "$GCC" != yes; then
9869                         CC_SHARED_OPTS='-KPIC'
9870                 fi
9871                 MK_SHARED_LIB='${LD} -d y -G -o $@'
9872                 ;;
9873         (*)
9874                 CC_SHARED_OPTS='unknown'
9875                 MK_SHARED_LIB='echo unknown'
9876                 ;;
9877         esac
9878
9879         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9880         case "$cf_cv_shlib_version" in
9881         (rel|abi)
9882                 case "$MK_SHARED_LIB" in
9883                 (*'-o $@')
9884                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9885                         ;;
9886                 (*)
9887                         { echo "$as_me:9887: WARNING: ignored --with-shlib-version" >&5
9888 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9889                         ;;
9890                 esac
9891                 ;;
9892         esac
9893
9894         if test -n "$cf_try_cflags"
9895         then
9896 cat > conftest.$ac_ext <<EOF
9897 #line 9897 "${as_me:-configure}"
9898 #include <stdio.h>
9899 int main(int argc, char *argv[])
9900 {
9901         printf("hello\n");
9902         return (argv[argc-1] == 0) ;
9903 }
9904 EOF
9905                 cf_save_CFLAGS="$CFLAGS"
9906                 for cf_opt in $cf_try_cflags
9907                 do
9908                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9909                         echo "$as_me:9909: checking if CFLAGS option -$cf_opt works" >&5
9910 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9911                         if { (eval echo "$as_me:9911: \"$ac_compile\"") >&5
9912   (eval $ac_compile) 2>&5
9913   ac_status=$?
9914   echo "$as_me:9914: \$? = $ac_status" >&5
9915   (exit $ac_status); }; then
9916                                 echo "$as_me:9916: result: yes" >&5
9917 echo "${ECHO_T}yes" >&6
9918                                 cf_save_CFLAGS="$CFLAGS"
9919                         else
9920                                 echo "$as_me:9920: result: no" >&5
9921 echo "${ECHO_T}no" >&6
9922                         fi
9923                 done
9924                 CFLAGS="$cf_save_CFLAGS"
9925         fi
9926
9927         # RPATH_LIST is a colon-separated list of directories
9928         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9929         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9930
9931         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9932
9933         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9934
9935 echo "${as_me:-configure}:9935: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9936
9937         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9938
9939 echo "${as_me:-configure}:9939: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9940
9941 # The test/sample programs in the original tree link using rpath option.
9942 # Make it optional for packagers.
9943 if test -n "$LOCAL_LDFLAGS"
9944 then
9945         echo "$as_me:9945: checking if you want to link sample programs with rpath option" >&5
9946 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9947
9948 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9949 if test "${enable_rpath_link+set}" = set; then
9950   enableval="$enable_rpath_link"
9951   with_rpath_link=$enableval
9952 else
9953   with_rpath_link=yes
9954 fi;
9955         echo "$as_me:9955: result: $with_rpath_link" >&5
9956 echo "${ECHO_T}$with_rpath_link" >&6
9957         if test "$with_rpath_link" = no
9958         then
9959                 LOCAL_LDFLAGS=
9960                 LOCAL_LDFLAGS2=
9961         fi
9962 fi
9963
9964 ###############################################################################
9965
9966 ###   use option --enable-broken-linker to force on use of broken-linker support
9967 echo "$as_me:9967: checking if you want broken-linker support code" >&5
9968 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9969
9970 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9971 if test "${enable_broken_linker+set}" = set; then
9972   enableval="$enable_broken_linker"
9973   with_broken_linker=$enableval
9974 else
9975   with_broken_linker=${BROKEN_LINKER:-no}
9976 fi;
9977 echo "$as_me:9977: result: $with_broken_linker" >&5
9978 echo "${ECHO_T}$with_broken_linker" >&6
9979
9980 BROKEN_LINKER=0
9981 if test "$with_broken_linker" = yes ; then
9982         cat >>confdefs.h <<\EOF
9983 #define BROKEN_LINKER 1
9984 EOF
9985
9986         BROKEN_LINKER=1
9987 elif test "$DFT_LWR_MODEL" = shared ; then
9988         case $cf_cv_system_name in
9989         (cygwin*)
9990                 cat >>confdefs.h <<\EOF
9991 #define BROKEN_LINKER 1
9992 EOF
9993
9994                 BROKEN_LINKER=1
9995                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9996
9997 echo "${as_me:-configure}:9997: testing cygwin linker is broken anyway ..." 1>&5
9998
9999                 ;;
10000         esac
10001 fi
10002
10003 # Check to define _XOPEN_SOURCE "automatically"
10004
10005 cf_XOPEN_SOURCE=500
10006 cf_POSIX_C_SOURCE=199506L
10007 cf_xopen_source=
10008
10009 case $host_os in
10010 (aix[4-7]*)
10011         cf_xopen_source="-D_ALL_SOURCE"
10012         ;;
10013 (msys)
10014         cf_XOPEN_SOURCE=600
10015         ;;
10016 (darwin[0-8].*)
10017         cf_xopen_source="-D_APPLE_C_SOURCE"
10018         ;;
10019 (darwin*)
10020         cf_xopen_source="-D_DARWIN_C_SOURCE"
10021         cf_XOPEN_SOURCE=
10022         ;;
10023 (freebsd*|dragonfly*)
10024         # 5.x headers associate
10025         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
10026         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
10027         cf_POSIX_C_SOURCE=200112L
10028         cf_XOPEN_SOURCE=600
10029         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10030         ;;
10031 (hpux11*)
10032         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
10033         ;;
10034 (hpux*)
10035         cf_xopen_source="-D_HPUX_SOURCE"
10036         ;;
10037 (irix[56].*)
10038         cf_xopen_source="-D_SGI_SOURCE"
10039         cf_XOPEN_SOURCE=
10040         ;;
10041 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
10042
10043 echo "$as_me:10043: checking if we must define _GNU_SOURCE" >&5
10044 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
10045 if test "${cf_cv_gnu_source+set}" = set; then
10046   echo $ECHO_N "(cached) $ECHO_C" >&6
10047 else
10048
10049 cat >conftest.$ac_ext <<_ACEOF
10050 #line 10050 "configure"
10051 #include "confdefs.h"
10052 #include <sys/types.h>
10053 int
10054 main (void)
10055 {
10056
10057 #ifndef _XOPEN_SOURCE
10058 make an error
10059 #endif
10060   ;
10061   return 0;
10062 }
10063 _ACEOF
10064 rm -f conftest.$ac_objext
10065 if { (eval echo "$as_me:10065: \"$ac_compile\"") >&5
10066   (eval $ac_compile) 2>&5
10067   ac_status=$?
10068   echo "$as_me:10068: \$? = $ac_status" >&5
10069   (exit $ac_status); } &&
10070          { ac_try='test -s conftest.$ac_objext'
10071   { (eval echo "$as_me:10071: \"$ac_try\"") >&5
10072   (eval $ac_try) 2>&5
10073   ac_status=$?
10074   echo "$as_me:10074: \$? = $ac_status" >&5
10075   (exit $ac_status); }; }; then
10076   cf_cv_gnu_source=no
10077 else
10078   echo "$as_me: failed program was:" >&5
10079 cat conftest.$ac_ext >&5
10080 cf_save="$CPPFLAGS"
10081          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
10082          cat >conftest.$ac_ext <<_ACEOF
10083 #line 10083 "configure"
10084 #include "confdefs.h"
10085 #include <sys/types.h>
10086 int
10087 main (void)
10088 {
10089
10090 #ifdef _XOPEN_SOURCE
10091 make an error
10092 #endif
10093   ;
10094   return 0;
10095 }
10096 _ACEOF
10097 rm -f conftest.$ac_objext
10098 if { (eval echo "$as_me:10098: \"$ac_compile\"") >&5
10099   (eval $ac_compile) 2>&5
10100   ac_status=$?
10101   echo "$as_me:10101: \$? = $ac_status" >&5
10102   (exit $ac_status); } &&
10103          { ac_try='test -s conftest.$ac_objext'
10104   { (eval echo "$as_me:10104: \"$ac_try\"") >&5
10105   (eval $ac_try) 2>&5
10106   ac_status=$?
10107   echo "$as_me:10107: \$? = $ac_status" >&5
10108   (exit $ac_status); }; }; then
10109   cf_cv_gnu_source=no
10110 else
10111   echo "$as_me: failed program was:" >&5
10112 cat conftest.$ac_ext >&5
10113 cf_cv_gnu_source=yes
10114 fi
10115 rm -f conftest.$ac_objext conftest.$ac_ext
10116         CPPFLAGS="$cf_save"
10117
10118 fi
10119 rm -f conftest.$ac_objext conftest.$ac_ext
10120
10121 fi
10122 echo "$as_me:10122: result: $cf_cv_gnu_source" >&5
10123 echo "${ECHO_T}$cf_cv_gnu_source" >&6
10124
10125 if test "$cf_cv_gnu_source" = yes
10126 then
10127 echo "$as_me:10127: checking if we should also define _DEFAULT_SOURCE" >&5
10128 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
10129 if test "${cf_cv_default_source+set}" = set; then
10130   echo $ECHO_N "(cached) $ECHO_C" >&6
10131 else
10132
10133 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
10134         cat >conftest.$ac_ext <<_ACEOF
10135 #line 10135 "configure"
10136 #include "confdefs.h"
10137 #include <sys/types.h>
10138 int
10139 main (void)
10140 {
10141
10142 #ifdef _DEFAULT_SOURCE
10143 make an error
10144 #endif
10145   ;
10146   return 0;
10147 }
10148 _ACEOF
10149 rm -f conftest.$ac_objext
10150 if { (eval echo "$as_me:10150: \"$ac_compile\"") >&5
10151   (eval $ac_compile) 2>&5
10152   ac_status=$?
10153   echo "$as_me:10153: \$? = $ac_status" >&5
10154   (exit $ac_status); } &&
10155          { ac_try='test -s conftest.$ac_objext'
10156   { (eval echo "$as_me:10156: \"$ac_try\"") >&5
10157   (eval $ac_try) 2>&5
10158   ac_status=$?
10159   echo "$as_me:10159: \$? = $ac_status" >&5
10160   (exit $ac_status); }; }; then
10161   cf_cv_default_source=no
10162 else
10163   echo "$as_me: failed program was:" >&5
10164 cat conftest.$ac_ext >&5
10165 cf_cv_default_source=yes
10166 fi
10167 rm -f conftest.$ac_objext conftest.$ac_ext
10168
10169 fi
10170 echo "$as_me:10170: result: $cf_cv_default_source" >&5
10171 echo "${ECHO_T}$cf_cv_default_source" >&6
10172 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
10173 fi
10174
10175         ;;
10176 (minix*)
10177         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
10178         ;;
10179 (mirbsd*)
10180         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
10181         cf_XOPEN_SOURCE=
10182
10183 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10184
10185 cf_save_CFLAGS="$CFLAGS"
10186 cf_save_CPPFLAGS="$CPPFLAGS"
10187
10188 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10189         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10190                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10191
10192 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10193         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10194                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10195
10196 echo "$as_me:10196: checking if we should define _POSIX_C_SOURCE" >&5
10197 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10198 if test "${cf_cv_posix_c_source+set}" = set; then
10199   echo $ECHO_N "(cached) $ECHO_C" >&6
10200 else
10201
10202 echo "${as_me:-configure}:10202: testing if the symbol is already defined go no further ..." 1>&5
10203
10204         cat >conftest.$ac_ext <<_ACEOF
10205 #line 10205 "configure"
10206 #include "confdefs.h"
10207 #include <sys/types.h>
10208 int
10209 main (void)
10210 {
10211
10212 #ifndef _POSIX_C_SOURCE
10213 make an error
10214 #endif
10215   ;
10216   return 0;
10217 }
10218 _ACEOF
10219 rm -f conftest.$ac_objext
10220 if { (eval echo "$as_me:10220: \"$ac_compile\"") >&5
10221   (eval $ac_compile) 2>&5
10222   ac_status=$?
10223   echo "$as_me:10223: \$? = $ac_status" >&5
10224   (exit $ac_status); } &&
10225          { ac_try='test -s conftest.$ac_objext'
10226   { (eval echo "$as_me:10226: \"$ac_try\"") >&5
10227   (eval $ac_try) 2>&5
10228   ac_status=$?
10229   echo "$as_me:10229: \$? = $ac_status" >&5
10230   (exit $ac_status); }; }; then
10231   cf_cv_posix_c_source=no
10232 else
10233   echo "$as_me: failed program was:" >&5
10234 cat conftest.$ac_ext >&5
10235 cf_want_posix_source=no
10236          case .$cf_POSIX_C_SOURCE in
10237          (.[12]??*)
10238                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10239                 ;;
10240          (.2)
10241                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10242                 cf_want_posix_source=yes
10243                 ;;
10244          (.*)
10245                 cf_want_posix_source=yes
10246                 ;;
10247          esac
10248          if test "$cf_want_posix_source" = yes ; then
10249                 cat >conftest.$ac_ext <<_ACEOF
10250 #line 10250 "configure"
10251 #include "confdefs.h"
10252 #include <sys/types.h>
10253 int
10254 main (void)
10255 {
10256
10257 #ifdef _POSIX_SOURCE
10258 make an error
10259 #endif
10260   ;
10261   return 0;
10262 }
10263 _ACEOF
10264 rm -f conftest.$ac_objext
10265 if { (eval echo "$as_me:10265: \"$ac_compile\"") >&5
10266   (eval $ac_compile) 2>&5
10267   ac_status=$?
10268   echo "$as_me:10268: \$? = $ac_status" >&5
10269   (exit $ac_status); } &&
10270          { ac_try='test -s conftest.$ac_objext'
10271   { (eval echo "$as_me:10271: \"$ac_try\"") >&5
10272   (eval $ac_try) 2>&5
10273   ac_status=$?
10274   echo "$as_me:10274: \$? = $ac_status" >&5
10275   (exit $ac_status); }; }; then
10276   :
10277 else
10278   echo "$as_me: failed program was:" >&5
10279 cat conftest.$ac_ext >&5
10280 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10281 fi
10282 rm -f conftest.$ac_objext conftest.$ac_ext
10283          fi
10284
10285 echo "${as_me:-configure}:10285: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10286
10287          CFLAGS="$cf_trim_CFLAGS"
10288          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10289
10290 echo "${as_me:-configure}:10290: testing if the second compile does not leave our definition intact error ..." 1>&5
10291
10292          cat >conftest.$ac_ext <<_ACEOF
10293 #line 10293 "configure"
10294 #include "confdefs.h"
10295 #include <sys/types.h>
10296 int
10297 main (void)
10298 {
10299
10300 #ifndef _POSIX_C_SOURCE
10301 make an error
10302 #endif
10303   ;
10304   return 0;
10305 }
10306 _ACEOF
10307 rm -f conftest.$ac_objext
10308 if { (eval echo "$as_me:10308: \"$ac_compile\"") >&5
10309   (eval $ac_compile) 2>&5
10310   ac_status=$?
10311   echo "$as_me:10311: \$? = $ac_status" >&5
10312   (exit $ac_status); } &&
10313          { ac_try='test -s conftest.$ac_objext'
10314   { (eval echo "$as_me:10314: \"$ac_try\"") >&5
10315   (eval $ac_try) 2>&5
10316   ac_status=$?
10317   echo "$as_me:10317: \$? = $ac_status" >&5
10318   (exit $ac_status); }; }; then
10319   :
10320 else
10321   echo "$as_me: failed program was:" >&5
10322 cat conftest.$ac_ext >&5
10323 cf_cv_posix_c_source=no
10324 fi
10325 rm -f conftest.$ac_objext conftest.$ac_ext
10326          CFLAGS="$cf_save_CFLAGS"
10327          CPPFLAGS="$cf_save_CPPFLAGS"
10328
10329 fi
10330 rm -f conftest.$ac_objext conftest.$ac_ext
10331
10332 fi
10333 echo "$as_me:10333: result: $cf_cv_posix_c_source" >&5
10334 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10335
10336 if test "$cf_cv_posix_c_source" != no ; then
10337         CFLAGS="$cf_trim_CFLAGS"
10338         CPPFLAGS="$cf_trim_CPPFLAGS"
10339
10340 cf_fix_cppflags=no
10341 cf_new_cflags=
10342 cf_new_cppflags=
10343 cf_new_extra_cppflags=
10344
10345 for cf_add_cflags in $cf_cv_posix_c_source
10346 do
10347 case $cf_fix_cppflags in
10348 (no)
10349         case $cf_add_cflags in
10350         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10351                 case $cf_add_cflags in
10352                 (-D*)
10353                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10354
10355                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10356                                 && test -z "${cf_tst_cflags}" \
10357                                 && cf_fix_cppflags=yes
10358
10359                         if test $cf_fix_cppflags = yes ; then
10360
10361         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10362         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10363
10364                                 continue
10365                         elif test "${cf_tst_cflags}" = "\"'" ; then
10366
10367         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10368         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10369
10370                                 continue
10371                         fi
10372                         ;;
10373                 esac
10374                 case "$CPPFLAGS" in
10375                 (*$cf_add_cflags)
10376                         ;;
10377                 (*)
10378                         case $cf_add_cflags in
10379                         (-D*)
10380                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10381
10382 CPPFLAGS=`echo "$CPPFLAGS" | \
10383         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10384                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10385
10386                                 ;;
10387                         esac
10388
10389         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10390         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10391
10392                         ;;
10393                 esac
10394                 ;;
10395         (*)
10396
10397         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10398         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10399
10400                 ;;
10401         esac
10402         ;;
10403 (yes)
10404
10405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10407
10408         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10409
10410         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10411                 && test -z "${cf_tst_cflags}" \
10412                 && cf_fix_cppflags=no
10413         ;;
10414 esac
10415 done
10416
10417 if test -n "$cf_new_cflags" ; then
10418
10419         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10420         CFLAGS="${CFLAGS}$cf_new_cflags"
10421
10422 fi
10423
10424 if test -n "$cf_new_cppflags" ; then
10425
10426         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10427         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10428
10429 fi
10430
10431 if test -n "$cf_new_extra_cppflags" ; then
10432
10433         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10434         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10435
10436 fi
10437
10438 fi
10439
10440         ;;
10441 (netbsd*)
10442         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10443         ;;
10444 (openbsd[4-9]*)
10445         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10446         cf_xopen_source="-D_BSD_SOURCE"
10447         cf_XOPEN_SOURCE=600
10448         ;;
10449 (openbsd*)
10450         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10451         ;;
10452 (osf[45]*)
10453         cf_xopen_source="-D_OSF_SOURCE"
10454         ;;
10455 (nto-qnx*)
10456         cf_xopen_source="-D_QNX_SOURCE"
10457         ;;
10458 (sco*)
10459         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10460         ;;
10461 (solaris2.*)
10462         cf_xopen_source="-D__EXTENSIONS__"
10463         cf_cv_xopen_source=broken
10464         ;;
10465 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10466         cf_XOPEN_SOURCE=
10467         cf_POSIX_C_SOURCE=
10468         ;;
10469 (*)
10470
10471 echo "$as_me:10471: checking if we should define _XOPEN_SOURCE" >&5
10472 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10473 if test "${cf_cv_xopen_source+set}" = set; then
10474   echo $ECHO_N "(cached) $ECHO_C" >&6
10475 else
10476
10477         cat >conftest.$ac_ext <<_ACEOF
10478 #line 10478 "configure"
10479 #include "confdefs.h"
10480
10481 #include <stdlib.h>
10482 #include <string.h>
10483 #include <sys/types.h>
10484
10485 int
10486 main (void)
10487 {
10488
10489 #ifndef _XOPEN_SOURCE
10490 make an error
10491 #endif
10492   ;
10493   return 0;
10494 }
10495 _ACEOF
10496 rm -f conftest.$ac_objext
10497 if { (eval echo "$as_me:10497: \"$ac_compile\"") >&5
10498   (eval $ac_compile) 2>&5
10499   ac_status=$?
10500   echo "$as_me:10500: \$? = $ac_status" >&5
10501   (exit $ac_status); } &&
10502          { ac_try='test -s conftest.$ac_objext'
10503   { (eval echo "$as_me:10503: \"$ac_try\"") >&5
10504   (eval $ac_try) 2>&5
10505   ac_status=$?
10506   echo "$as_me:10506: \$? = $ac_status" >&5
10507   (exit $ac_status); }; }; then
10508   cf_cv_xopen_source=no
10509 else
10510   echo "$as_me: failed program was:" >&5
10511 cat conftest.$ac_ext >&5
10512 cf_save="$CPPFLAGS"
10513          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10514          cat >conftest.$ac_ext <<_ACEOF
10515 #line 10515 "configure"
10516 #include "confdefs.h"
10517
10518 #include <stdlib.h>
10519 #include <string.h>
10520 #include <sys/types.h>
10521
10522 int
10523 main (void)
10524 {
10525
10526 #ifdef _XOPEN_SOURCE
10527 make an error
10528 #endif
10529   ;
10530   return 0;
10531 }
10532 _ACEOF
10533 rm -f conftest.$ac_objext
10534 if { (eval echo "$as_me:10534: \"$ac_compile\"") >&5
10535   (eval $ac_compile) 2>&5
10536   ac_status=$?
10537   echo "$as_me:10537: \$? = $ac_status" >&5
10538   (exit $ac_status); } &&
10539          { ac_try='test -s conftest.$ac_objext'
10540   { (eval echo "$as_me:10540: \"$ac_try\"") >&5
10541   (eval $ac_try) 2>&5
10542   ac_status=$?
10543   echo "$as_me:10543: \$? = $ac_status" >&5
10544   (exit $ac_status); }; }; then
10545   cf_cv_xopen_source=no
10546 else
10547   echo "$as_me: failed program was:" >&5
10548 cat conftest.$ac_ext >&5
10549 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10550 fi
10551 rm -f conftest.$ac_objext conftest.$ac_ext
10552         CPPFLAGS="$cf_save"
10553
10554 fi
10555 rm -f conftest.$ac_objext conftest.$ac_ext
10556
10557 fi
10558 echo "$as_me:10558: result: $cf_cv_xopen_source" >&5
10559 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10560
10561 if test "$cf_cv_xopen_source" != no ; then
10562
10563 CFLAGS=`echo "$CFLAGS" | \
10564         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10565                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10566
10567 CPPFLAGS=`echo "$CPPFLAGS" | \
10568         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10569                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10570
10571         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10572
10573 cf_fix_cppflags=no
10574 cf_new_cflags=
10575 cf_new_cppflags=
10576 cf_new_extra_cppflags=
10577
10578 for cf_add_cflags in $cf_temp_xopen_source
10579 do
10580 case $cf_fix_cppflags in
10581 (no)
10582         case $cf_add_cflags in
10583         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10584                 case $cf_add_cflags in
10585                 (-D*)
10586                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10587
10588                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10589                                 && test -z "${cf_tst_cflags}" \
10590                                 && cf_fix_cppflags=yes
10591
10592                         if test $cf_fix_cppflags = yes ; then
10593
10594         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10595         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10596
10597                                 continue
10598                         elif test "${cf_tst_cflags}" = "\"'" ; then
10599
10600         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10601         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10602
10603                                 continue
10604                         fi
10605                         ;;
10606                 esac
10607                 case "$CPPFLAGS" in
10608                 (*$cf_add_cflags)
10609                         ;;
10610                 (*)
10611                         case $cf_add_cflags in
10612                         (-D*)
10613                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10614
10615 CPPFLAGS=`echo "$CPPFLAGS" | \
10616         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10617                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10618
10619                                 ;;
10620                         esac
10621
10622         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10623         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10624
10625                         ;;
10626                 esac
10627                 ;;
10628         (*)
10629
10630         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10631         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10632
10633                 ;;
10634         esac
10635         ;;
10636 (yes)
10637
10638         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10639         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10640
10641         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10642
10643         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10644                 && test -z "${cf_tst_cflags}" \
10645                 && cf_fix_cppflags=no
10646         ;;
10647 esac
10648 done
10649
10650 if test -n "$cf_new_cflags" ; then
10651
10652         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10653         CFLAGS="${CFLAGS}$cf_new_cflags"
10654
10655 fi
10656
10657 if test -n "$cf_new_cppflags" ; then
10658
10659         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10660         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10661
10662 fi
10663
10664 if test -n "$cf_new_extra_cppflags" ; then
10665
10666         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10667         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10668
10669 fi
10670
10671 fi
10672
10673 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10674
10675 cf_save_CFLAGS="$CFLAGS"
10676 cf_save_CPPFLAGS="$CPPFLAGS"
10677
10678 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10679         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10680                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10681
10682 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10683         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10684                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10685
10686 echo "$as_me:10686: checking if we should define _POSIX_C_SOURCE" >&5
10687 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10688 if test "${cf_cv_posix_c_source+set}" = set; then
10689   echo $ECHO_N "(cached) $ECHO_C" >&6
10690 else
10691
10692 echo "${as_me:-configure}:10692: testing if the symbol is already defined go no further ..." 1>&5
10693
10694         cat >conftest.$ac_ext <<_ACEOF
10695 #line 10695 "configure"
10696 #include "confdefs.h"
10697 #include <sys/types.h>
10698 int
10699 main (void)
10700 {
10701
10702 #ifndef _POSIX_C_SOURCE
10703 make an error
10704 #endif
10705   ;
10706   return 0;
10707 }
10708 _ACEOF
10709 rm -f conftest.$ac_objext
10710 if { (eval echo "$as_me:10710: \"$ac_compile\"") >&5
10711   (eval $ac_compile) 2>&5
10712   ac_status=$?
10713   echo "$as_me:10713: \$? = $ac_status" >&5
10714   (exit $ac_status); } &&
10715          { ac_try='test -s conftest.$ac_objext'
10716   { (eval echo "$as_me:10716: \"$ac_try\"") >&5
10717   (eval $ac_try) 2>&5
10718   ac_status=$?
10719   echo "$as_me:10719: \$? = $ac_status" >&5
10720   (exit $ac_status); }; }; then
10721   cf_cv_posix_c_source=no
10722 else
10723   echo "$as_me: failed program was:" >&5
10724 cat conftest.$ac_ext >&5
10725 cf_want_posix_source=no
10726          case .$cf_POSIX_C_SOURCE in
10727          (.[12]??*)
10728                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10729                 ;;
10730          (.2)
10731                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10732                 cf_want_posix_source=yes
10733                 ;;
10734          (.*)
10735                 cf_want_posix_source=yes
10736                 ;;
10737          esac
10738          if test "$cf_want_posix_source" = yes ; then
10739                 cat >conftest.$ac_ext <<_ACEOF
10740 #line 10740 "configure"
10741 #include "confdefs.h"
10742 #include <sys/types.h>
10743 int
10744 main (void)
10745 {
10746
10747 #ifdef _POSIX_SOURCE
10748 make an error
10749 #endif
10750   ;
10751   return 0;
10752 }
10753 _ACEOF
10754 rm -f conftest.$ac_objext
10755 if { (eval echo "$as_me:10755: \"$ac_compile\"") >&5
10756   (eval $ac_compile) 2>&5
10757   ac_status=$?
10758   echo "$as_me:10758: \$? = $ac_status" >&5
10759   (exit $ac_status); } &&
10760          { ac_try='test -s conftest.$ac_objext'
10761   { (eval echo "$as_me:10761: \"$ac_try\"") >&5
10762   (eval $ac_try) 2>&5
10763   ac_status=$?
10764   echo "$as_me:10764: \$? = $ac_status" >&5
10765   (exit $ac_status); }; }; then
10766   :
10767 else
10768   echo "$as_me: failed program was:" >&5
10769 cat conftest.$ac_ext >&5
10770 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10771 fi
10772 rm -f conftest.$ac_objext conftest.$ac_ext
10773          fi
10774
10775 echo "${as_me:-configure}:10775: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10776
10777          CFLAGS="$cf_trim_CFLAGS"
10778          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10779
10780 echo "${as_me:-configure}:10780: testing if the second compile does not leave our definition intact error ..." 1>&5
10781
10782          cat >conftest.$ac_ext <<_ACEOF
10783 #line 10783 "configure"
10784 #include "confdefs.h"
10785 #include <sys/types.h>
10786 int
10787 main (void)
10788 {
10789
10790 #ifndef _POSIX_C_SOURCE
10791 make an error
10792 #endif
10793   ;
10794   return 0;
10795 }
10796 _ACEOF
10797 rm -f conftest.$ac_objext
10798 if { (eval echo "$as_me:10798: \"$ac_compile\"") >&5
10799   (eval $ac_compile) 2>&5
10800   ac_status=$?
10801   echo "$as_me:10801: \$? = $ac_status" >&5
10802   (exit $ac_status); } &&
10803          { ac_try='test -s conftest.$ac_objext'
10804   { (eval echo "$as_me:10804: \"$ac_try\"") >&5
10805   (eval $ac_try) 2>&5
10806   ac_status=$?
10807   echo "$as_me:10807: \$? = $ac_status" >&5
10808   (exit $ac_status); }; }; then
10809   :
10810 else
10811   echo "$as_me: failed program was:" >&5
10812 cat conftest.$ac_ext >&5
10813 cf_cv_posix_c_source=no
10814 fi
10815 rm -f conftest.$ac_objext conftest.$ac_ext
10816          CFLAGS="$cf_save_CFLAGS"
10817          CPPFLAGS="$cf_save_CPPFLAGS"
10818
10819 fi
10820 rm -f conftest.$ac_objext conftest.$ac_ext
10821
10822 fi
10823 echo "$as_me:10823: result: $cf_cv_posix_c_source" >&5
10824 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10825
10826 if test "$cf_cv_posix_c_source" != no ; then
10827         CFLAGS="$cf_trim_CFLAGS"
10828         CPPFLAGS="$cf_trim_CPPFLAGS"
10829
10830 cf_fix_cppflags=no
10831 cf_new_cflags=
10832 cf_new_cppflags=
10833 cf_new_extra_cppflags=
10834
10835 for cf_add_cflags in $cf_cv_posix_c_source
10836 do
10837 case $cf_fix_cppflags in
10838 (no)
10839         case $cf_add_cflags in
10840         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10841                 case $cf_add_cflags in
10842                 (-D*)
10843                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10844
10845                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10846                                 && test -z "${cf_tst_cflags}" \
10847                                 && cf_fix_cppflags=yes
10848
10849                         if test $cf_fix_cppflags = yes ; then
10850
10851         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10852         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10853
10854                                 continue
10855                         elif test "${cf_tst_cflags}" = "\"'" ; then
10856
10857         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10858         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10859
10860                                 continue
10861                         fi
10862                         ;;
10863                 esac
10864                 case "$CPPFLAGS" in
10865                 (*$cf_add_cflags)
10866                         ;;
10867                 (*)
10868                         case $cf_add_cflags in
10869                         (-D*)
10870                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10871
10872 CPPFLAGS=`echo "$CPPFLAGS" | \
10873         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10874                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10875
10876                                 ;;
10877                         esac
10878
10879         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10880         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10881
10882                         ;;
10883                 esac
10884                 ;;
10885         (*)
10886
10887         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10888         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10889
10890                 ;;
10891         esac
10892         ;;
10893 (yes)
10894
10895         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10896         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10897
10898         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10899
10900         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10901                 && test -z "${cf_tst_cflags}" \
10902                 && cf_fix_cppflags=no
10903         ;;
10904 esac
10905 done
10906
10907 if test -n "$cf_new_cflags" ; then
10908
10909         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10910         CFLAGS="${CFLAGS}$cf_new_cflags"
10911
10912 fi
10913
10914 if test -n "$cf_new_cppflags" ; then
10915
10916         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10917         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10918
10919 fi
10920
10921 if test -n "$cf_new_extra_cppflags" ; then
10922
10923         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10924         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10925
10926 fi
10927
10928 fi
10929
10930         ;;
10931 esac
10932
10933 if test -n "$cf_xopen_source" ; then
10934
10935 cf_fix_cppflags=no
10936 cf_new_cflags=
10937 cf_new_cppflags=
10938 cf_new_extra_cppflags=
10939
10940 for cf_add_cflags in $cf_xopen_source
10941 do
10942 case $cf_fix_cppflags in
10943 (no)
10944         case $cf_add_cflags in
10945         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10946                 case $cf_add_cflags in
10947                 (-D*)
10948                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10949
10950                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10951                                 && test -z "${cf_tst_cflags}" \
10952                                 && cf_fix_cppflags=yes
10953
10954                         if test $cf_fix_cppflags = yes ; then
10955
10956         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10957         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10958
10959                                 continue
10960                         elif test "${cf_tst_cflags}" = "\"'" ; then
10961
10962         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10963         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10964
10965                                 continue
10966                         fi
10967                         ;;
10968                 esac
10969                 case "$CPPFLAGS" in
10970                 (*$cf_add_cflags)
10971                         ;;
10972                 (*)
10973                         case $cf_add_cflags in
10974                         (-D*)
10975                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10976
10977 CPPFLAGS=`echo "$CPPFLAGS" | \
10978         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10979                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10980
10981                                 ;;
10982                         esac
10983
10984         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10985         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10986
10987                         ;;
10988                 esac
10989                 ;;
10990         (*)
10991
10992         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10993         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10994
10995                 ;;
10996         esac
10997         ;;
10998 (yes)
10999
11000         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11001         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11002
11003         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11004
11005         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11006                 && test -z "${cf_tst_cflags}" \
11007                 && cf_fix_cppflags=no
11008         ;;
11009 esac
11010 done
11011
11012 if test -n "$cf_new_cflags" ; then
11013         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11014
11015 echo "${as_me:-configure}:11015: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11016
11017         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11018         CFLAGS="${CFLAGS}$cf_new_cflags"
11019
11020 fi
11021
11022 if test -n "$cf_new_cppflags" ; then
11023         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11024
11025 echo "${as_me:-configure}:11025: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11026
11027         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11028         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11029
11030 fi
11031
11032 if test -n "$cf_new_extra_cppflags" ; then
11033         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11034
11035 echo "${as_me:-configure}:11035: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11036
11037         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11038         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11039
11040 fi
11041
11042 fi
11043
11044 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
11045         echo "$as_me:11045: checking if _XOPEN_SOURCE really is set" >&5
11046 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
11047         cat >conftest.$ac_ext <<_ACEOF
11048 #line 11048 "configure"
11049 #include "confdefs.h"
11050 #include <stdlib.h>
11051 int
11052 main (void)
11053 {
11054
11055 #ifndef _XOPEN_SOURCE
11056 make an error
11057 #endif
11058   ;
11059   return 0;
11060 }
11061 _ACEOF
11062 rm -f conftest.$ac_objext
11063 if { (eval echo "$as_me:11063: \"$ac_compile\"") >&5
11064   (eval $ac_compile) 2>&5
11065   ac_status=$?
11066   echo "$as_me:11066: \$? = $ac_status" >&5
11067   (exit $ac_status); } &&
11068          { ac_try='test -s conftest.$ac_objext'
11069   { (eval echo "$as_me:11069: \"$ac_try\"") >&5
11070   (eval $ac_try) 2>&5
11071   ac_status=$?
11072   echo "$as_me:11072: \$? = $ac_status" >&5
11073   (exit $ac_status); }; }; then
11074   cf_XOPEN_SOURCE_set=yes
11075 else
11076   echo "$as_me: failed program was:" >&5
11077 cat conftest.$ac_ext >&5
11078 cf_XOPEN_SOURCE_set=no
11079 fi
11080 rm -f conftest.$ac_objext conftest.$ac_ext
11081         echo "$as_me:11081: result: $cf_XOPEN_SOURCE_set" >&5
11082 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
11083         if test $cf_XOPEN_SOURCE_set = yes
11084         then
11085                 cat >conftest.$ac_ext <<_ACEOF
11086 #line 11086 "configure"
11087 #include "confdefs.h"
11088 #include <stdlib.h>
11089 int
11090 main (void)
11091 {
11092
11093 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
11094 make an error
11095 #endif
11096   ;
11097   return 0;
11098 }
11099 _ACEOF
11100 rm -f conftest.$ac_objext
11101 if { (eval echo "$as_me:11101: \"$ac_compile\"") >&5
11102   (eval $ac_compile) 2>&5
11103   ac_status=$?
11104   echo "$as_me:11104: \$? = $ac_status" >&5
11105   (exit $ac_status); } &&
11106          { ac_try='test -s conftest.$ac_objext'
11107   { (eval echo "$as_me:11107: \"$ac_try\"") >&5
11108   (eval $ac_try) 2>&5
11109   ac_status=$?
11110   echo "$as_me:11110: \$? = $ac_status" >&5
11111   (exit $ac_status); }; }; then
11112   cf_XOPEN_SOURCE_set_ok=yes
11113 else
11114   echo "$as_me: failed program was:" >&5
11115 cat conftest.$ac_ext >&5
11116 cf_XOPEN_SOURCE_set_ok=no
11117 fi
11118 rm -f conftest.$ac_objext conftest.$ac_ext
11119                 if test $cf_XOPEN_SOURCE_set_ok = no
11120                 then
11121                         { echo "$as_me:11121: WARNING: _XOPEN_SOURCE is lower than requested" >&5
11122 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
11123                 fi
11124         else
11125
11126 echo "$as_me:11126: checking if we should define _XOPEN_SOURCE" >&5
11127 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11128 if test "${cf_cv_xopen_source+set}" = set; then
11129   echo $ECHO_N "(cached) $ECHO_C" >&6
11130 else
11131
11132         cat >conftest.$ac_ext <<_ACEOF
11133 #line 11133 "configure"
11134 #include "confdefs.h"
11135
11136 #include <stdlib.h>
11137 #include <string.h>
11138 #include <sys/types.h>
11139
11140 int
11141 main (void)
11142 {
11143
11144 #ifndef _XOPEN_SOURCE
11145 make an error
11146 #endif
11147   ;
11148   return 0;
11149 }
11150 _ACEOF
11151 rm -f conftest.$ac_objext
11152 if { (eval echo "$as_me:11152: \"$ac_compile\"") >&5
11153   (eval $ac_compile) 2>&5
11154   ac_status=$?
11155   echo "$as_me:11155: \$? = $ac_status" >&5
11156   (exit $ac_status); } &&
11157          { ac_try='test -s conftest.$ac_objext'
11158   { (eval echo "$as_me:11158: \"$ac_try\"") >&5
11159   (eval $ac_try) 2>&5
11160   ac_status=$?
11161   echo "$as_me:11161: \$? = $ac_status" >&5
11162   (exit $ac_status); }; }; then
11163   cf_cv_xopen_source=no
11164 else
11165   echo "$as_me: failed program was:" >&5
11166 cat conftest.$ac_ext >&5
11167 cf_save="$CPPFLAGS"
11168          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11169          cat >conftest.$ac_ext <<_ACEOF
11170 #line 11170 "configure"
11171 #include "confdefs.h"
11172
11173 #include <stdlib.h>
11174 #include <string.h>
11175 #include <sys/types.h>
11176
11177 int
11178 main (void)
11179 {
11180
11181 #ifdef _XOPEN_SOURCE
11182 make an error
11183 #endif
11184   ;
11185   return 0;
11186 }
11187 _ACEOF
11188 rm -f conftest.$ac_objext
11189 if { (eval echo "$as_me:11189: \"$ac_compile\"") >&5
11190   (eval $ac_compile) 2>&5
11191   ac_status=$?
11192   echo "$as_me:11192: \$? = $ac_status" >&5
11193   (exit $ac_status); } &&
11194          { ac_try='test -s conftest.$ac_objext'
11195   { (eval echo "$as_me:11195: \"$ac_try\"") >&5
11196   (eval $ac_try) 2>&5
11197   ac_status=$?
11198   echo "$as_me:11198: \$? = $ac_status" >&5
11199   (exit $ac_status); }; }; then
11200   cf_cv_xopen_source=no
11201 else
11202   echo "$as_me: failed program was:" >&5
11203 cat conftest.$ac_ext >&5
11204 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11205 fi
11206 rm -f conftest.$ac_objext conftest.$ac_ext
11207         CPPFLAGS="$cf_save"
11208
11209 fi
11210 rm -f conftest.$ac_objext conftest.$ac_ext
11211
11212 fi
11213 echo "$as_me:11213: result: $cf_cv_xopen_source" >&5
11214 echo "${ECHO_T}$cf_cv_xopen_source" >&6
11215
11216 if test "$cf_cv_xopen_source" != no ; then
11217
11218 CFLAGS=`echo "$CFLAGS" | \
11219         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11220                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11221
11222 CPPFLAGS=`echo "$CPPFLAGS" | \
11223         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11224                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11225
11226         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
11227
11228 cf_fix_cppflags=no
11229 cf_new_cflags=
11230 cf_new_cppflags=
11231 cf_new_extra_cppflags=
11232
11233 for cf_add_cflags in $cf_temp_xopen_source
11234 do
11235 case $cf_fix_cppflags in
11236 (no)
11237         case $cf_add_cflags in
11238         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11239                 case $cf_add_cflags in
11240                 (-D*)
11241                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11242
11243                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11244                                 && test -z "${cf_tst_cflags}" \
11245                                 && cf_fix_cppflags=yes
11246
11247                         if test $cf_fix_cppflags = yes ; then
11248
11249         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11250         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11251
11252                                 continue
11253                         elif test "${cf_tst_cflags}" = "\"'" ; then
11254
11255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11257
11258                                 continue
11259                         fi
11260                         ;;
11261                 esac
11262                 case "$CPPFLAGS" in
11263                 (*$cf_add_cflags)
11264                         ;;
11265                 (*)
11266                         case $cf_add_cflags in
11267                         (-D*)
11268                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11269
11270 CPPFLAGS=`echo "$CPPFLAGS" | \
11271         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11272                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11273
11274                                 ;;
11275                         esac
11276
11277         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11278         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11279
11280                         ;;
11281                 esac
11282                 ;;
11283         (*)
11284
11285         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11286         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11287
11288                 ;;
11289         esac
11290         ;;
11291 (yes)
11292
11293         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11294         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11295
11296         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11297
11298         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11299                 && test -z "${cf_tst_cflags}" \
11300                 && cf_fix_cppflags=no
11301         ;;
11302 esac
11303 done
11304
11305 if test -n "$cf_new_cflags" ; then
11306
11307         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11308         CFLAGS="${CFLAGS}$cf_new_cflags"
11309
11310 fi
11311
11312 if test -n "$cf_new_cppflags" ; then
11313
11314         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11315         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11316
11317 fi
11318
11319 if test -n "$cf_new_extra_cppflags" ; then
11320
11321         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11322         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11323
11324 fi
11325
11326 fi
11327
11328         fi
11329 fi
11330
11331 # Check whether --enable-largefile or --disable-largefile was given.
11332 if test "${enable_largefile+set}" = set; then
11333   enableval="$enable_largefile"
11334
11335 fi;
11336 if test "$enable_largefile" != no; then
11337
11338   echo "$as_me:11338: checking for special C compiler options needed for large files" >&5
11339 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
11340 if test "${ac_cv_sys_largefile_CC+set}" = set; then
11341   echo $ECHO_N "(cached) $ECHO_C" >&6
11342 else
11343   ac_cv_sys_largefile_CC=no
11344      if test "$GCC" != yes; then
11345        ac_save_CC=$CC
11346        while :; do
11347          # IRIX 6.2 and later do not support large files by default,
11348          # so use the C compiler's -n32 option if that helps.
11349          cat >conftest.$ac_ext <<_ACEOF
11350 #line 11350 "configure"
11351 #include "confdefs.h"
11352 #include <sys/types.h>
11353  /* Check that off_t can represent 2**63 - 1 correctly.
11354     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11355     since some C++ compilers masquerading as C compilers
11356     incorrectly reject 9223372036854775807.  */
11357 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11358   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11359                        && LARGE_OFF_T % 2147483647 == 1)
11360                       ? 1 : -1];
11361 int
11362 main (void)
11363 {
11364
11365   ;
11366   return 0;
11367 }
11368 _ACEOF
11369          rm -f conftest.$ac_objext
11370 if { (eval echo "$as_me:11370: \"$ac_compile\"") >&5
11371   (eval $ac_compile) 2>&5
11372   ac_status=$?
11373   echo "$as_me:11373: \$? = $ac_status" >&5
11374   (exit $ac_status); } &&
11375          { ac_try='test -s conftest.$ac_objext'
11376   { (eval echo "$as_me:11376: \"$ac_try\"") >&5
11377   (eval $ac_try) 2>&5
11378   ac_status=$?
11379   echo "$as_me:11379: \$? = $ac_status" >&5
11380   (exit $ac_status); }; }; then
11381   break
11382 else
11383   echo "$as_me: failed program was:" >&5
11384 cat conftest.$ac_ext >&5
11385 fi
11386 rm -f conftest.$ac_objext
11387          CC="$CC -n32"
11388          rm -f conftest.$ac_objext
11389 if { (eval echo "$as_me:11389: \"$ac_compile\"") >&5
11390   (eval $ac_compile) 2>&5
11391   ac_status=$?
11392   echo "$as_me:11392: \$? = $ac_status" >&5
11393   (exit $ac_status); } &&
11394          { ac_try='test -s conftest.$ac_objext'
11395   { (eval echo "$as_me:11395: \"$ac_try\"") >&5
11396   (eval $ac_try) 2>&5
11397   ac_status=$?
11398   echo "$as_me:11398: \$? = $ac_status" >&5
11399   (exit $ac_status); }; }; then
11400   ac_cv_sys_largefile_CC=' -n32'; break
11401 else
11402   echo "$as_me: failed program was:" >&5
11403 cat conftest.$ac_ext >&5
11404 fi
11405 rm -f conftest.$ac_objext
11406          break
11407        done
11408        CC=$ac_save_CC
11409        rm -f conftest.$ac_ext
11410     fi
11411 fi
11412 echo "$as_me:11412: result: $ac_cv_sys_largefile_CC" >&5
11413 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
11414   if test "$ac_cv_sys_largefile_CC" != no; then
11415     CC=$CC$ac_cv_sys_largefile_CC
11416   fi
11417
11418   echo "$as_me:11418: checking for _FILE_OFFSET_BITS value needed for large files" >&5
11419 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
11420 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
11421   echo $ECHO_N "(cached) $ECHO_C" >&6
11422 else
11423   while :; do
11424   ac_cv_sys_file_offset_bits=no
11425   cat >conftest.$ac_ext <<_ACEOF
11426 #line 11426 "configure"
11427 #include "confdefs.h"
11428 #include <sys/types.h>
11429  /* Check that off_t can represent 2**63 - 1 correctly.
11430     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11431     since some C++ compilers masquerading as C compilers
11432     incorrectly reject 9223372036854775807.  */
11433 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11434   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11435                        && LARGE_OFF_T % 2147483647 == 1)
11436                       ? 1 : -1];
11437 int
11438 main (void)
11439 {
11440
11441   ;
11442   return 0;
11443 }
11444 _ACEOF
11445 rm -f conftest.$ac_objext
11446 if { (eval echo "$as_me:11446: \"$ac_compile\"") >&5
11447   (eval $ac_compile) 2>&5
11448   ac_status=$?
11449   echo "$as_me:11449: \$? = $ac_status" >&5
11450   (exit $ac_status); } &&
11451          { ac_try='test -s conftest.$ac_objext'
11452   { (eval echo "$as_me:11452: \"$ac_try\"") >&5
11453   (eval $ac_try) 2>&5
11454   ac_status=$?
11455   echo "$as_me:11455: \$? = $ac_status" >&5
11456   (exit $ac_status); }; }; then
11457   break
11458 else
11459   echo "$as_me: failed program was:" >&5
11460 cat conftest.$ac_ext >&5
11461 fi
11462 rm -f conftest.$ac_objext conftest.$ac_ext
11463   cat >conftest.$ac_ext <<_ACEOF
11464 #line 11464 "configure"
11465 #include "confdefs.h"
11466 #define _FILE_OFFSET_BITS 64
11467 #include <sys/types.h>
11468  /* Check that off_t can represent 2**63 - 1 correctly.
11469     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11470     since some C++ compilers masquerading as C compilers
11471     incorrectly reject 9223372036854775807.  */
11472 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11473   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11474                        && LARGE_OFF_T % 2147483647 == 1)
11475                       ? 1 : -1];
11476 int
11477 main (void)
11478 {
11479
11480   ;
11481   return 0;
11482 }
11483 _ACEOF
11484 rm -f conftest.$ac_objext
11485 if { (eval echo "$as_me:11485: \"$ac_compile\"") >&5
11486   (eval $ac_compile) 2>&5
11487   ac_status=$?
11488   echo "$as_me:11488: \$? = $ac_status" >&5
11489   (exit $ac_status); } &&
11490          { ac_try='test -s conftest.$ac_objext'
11491   { (eval echo "$as_me:11491: \"$ac_try\"") >&5
11492   (eval $ac_try) 2>&5
11493   ac_status=$?
11494   echo "$as_me:11494: \$? = $ac_status" >&5
11495   (exit $ac_status); }; }; then
11496   ac_cv_sys_file_offset_bits=64; break
11497 else
11498   echo "$as_me: failed program was:" >&5
11499 cat conftest.$ac_ext >&5
11500 fi
11501 rm -f conftest.$ac_objext conftest.$ac_ext
11502   break
11503 done
11504 fi
11505 echo "$as_me:11505: result: $ac_cv_sys_file_offset_bits" >&5
11506 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11507 if test "$ac_cv_sys_file_offset_bits" != no; then
11508
11509 cat >>confdefs.h <<EOF
11510 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11511 EOF
11512
11513 fi
11514 rm -rf conftest*
11515   echo "$as_me:11515: checking for _LARGE_FILES value needed for large files" >&5
11516 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11517 if test "${ac_cv_sys_large_files+set}" = set; then
11518   echo $ECHO_N "(cached) $ECHO_C" >&6
11519 else
11520   while :; do
11521   ac_cv_sys_large_files=no
11522   cat >conftest.$ac_ext <<_ACEOF
11523 #line 11523 "configure"
11524 #include "confdefs.h"
11525 #include <sys/types.h>
11526  /* Check that off_t can represent 2**63 - 1 correctly.
11527     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11528     since some C++ compilers masquerading as C compilers
11529     incorrectly reject 9223372036854775807.  */
11530 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11531   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11532                        && LARGE_OFF_T % 2147483647 == 1)
11533                       ? 1 : -1];
11534 int
11535 main (void)
11536 {
11537
11538   ;
11539   return 0;
11540 }
11541 _ACEOF
11542 rm -f conftest.$ac_objext
11543 if { (eval echo "$as_me:11543: \"$ac_compile\"") >&5
11544   (eval $ac_compile) 2>&5
11545   ac_status=$?
11546   echo "$as_me:11546: \$? = $ac_status" >&5
11547   (exit $ac_status); } &&
11548          { ac_try='test -s conftest.$ac_objext'
11549   { (eval echo "$as_me:11549: \"$ac_try\"") >&5
11550   (eval $ac_try) 2>&5
11551   ac_status=$?
11552   echo "$as_me:11552: \$? = $ac_status" >&5
11553   (exit $ac_status); }; }; then
11554   break
11555 else
11556   echo "$as_me: failed program was:" >&5
11557 cat conftest.$ac_ext >&5
11558 fi
11559 rm -f conftest.$ac_objext conftest.$ac_ext
11560   cat >conftest.$ac_ext <<_ACEOF
11561 #line 11561 "configure"
11562 #include "confdefs.h"
11563 #define _LARGE_FILES 1
11564 #include <sys/types.h>
11565  /* Check that off_t can represent 2**63 - 1 correctly.
11566     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11567     since some C++ compilers masquerading as C compilers
11568     incorrectly reject 9223372036854775807.  */
11569 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11570   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11571                        && LARGE_OFF_T % 2147483647 == 1)
11572                       ? 1 : -1];
11573 int
11574 main (void)
11575 {
11576
11577   ;
11578   return 0;
11579 }
11580 _ACEOF
11581 rm -f conftest.$ac_objext
11582 if { (eval echo "$as_me:11582: \"$ac_compile\"") >&5
11583   (eval $ac_compile) 2>&5
11584   ac_status=$?
11585   echo "$as_me:11585: \$? = $ac_status" >&5
11586   (exit $ac_status); } &&
11587          { ac_try='test -s conftest.$ac_objext'
11588   { (eval echo "$as_me:11588: \"$ac_try\"") >&5
11589   (eval $ac_try) 2>&5
11590   ac_status=$?
11591   echo "$as_me:11591: \$? = $ac_status" >&5
11592   (exit $ac_status); }; }; then
11593   ac_cv_sys_large_files=1; break
11594 else
11595   echo "$as_me: failed program was:" >&5
11596 cat conftest.$ac_ext >&5
11597 fi
11598 rm -f conftest.$ac_objext conftest.$ac_ext
11599   break
11600 done
11601 fi
11602 echo "$as_me:11602: result: $ac_cv_sys_large_files" >&5
11603 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11604 if test "$ac_cv_sys_large_files" != no; then
11605
11606 cat >>confdefs.h <<EOF
11607 #define _LARGE_FILES $ac_cv_sys_large_files
11608 EOF
11609
11610 fi
11611 rm -rf conftest*
11612 fi
11613
11614         if test "$enable_largefile" != no ; then
11615         echo "$as_me:11615: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11616 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11617 if test "${ac_cv_sys_largefile_source+set}" = set; then
11618   echo $ECHO_N "(cached) $ECHO_C" >&6
11619 else
11620   while :; do
11621   ac_cv_sys_largefile_source=no
11622   cat >conftest.$ac_ext <<_ACEOF
11623 #line 11623 "configure"
11624 #include "confdefs.h"
11625 #include <stdio.h>
11626 int
11627 main (void)
11628 {
11629 return !fseeko;
11630   ;
11631   return 0;
11632 }
11633 _ACEOF
11634 rm -f conftest.$ac_objext
11635 if { (eval echo "$as_me:11635: \"$ac_compile\"") >&5
11636   (eval $ac_compile) 2>&5
11637   ac_status=$?
11638   echo "$as_me:11638: \$? = $ac_status" >&5
11639   (exit $ac_status); } &&
11640          { ac_try='test -s conftest.$ac_objext'
11641   { (eval echo "$as_me:11641: \"$ac_try\"") >&5
11642   (eval $ac_try) 2>&5
11643   ac_status=$?
11644   echo "$as_me:11644: \$? = $ac_status" >&5
11645   (exit $ac_status); }; }; then
11646   break
11647 else
11648   echo "$as_me: failed program was:" >&5
11649 cat conftest.$ac_ext >&5
11650 fi
11651 rm -f conftest.$ac_objext conftest.$ac_ext
11652   cat >conftest.$ac_ext <<_ACEOF
11653 #line 11653 "configure"
11654 #include "confdefs.h"
11655 #define _LARGEFILE_SOURCE 1
11656 #include <stdio.h>
11657 int
11658 main (void)
11659 {
11660 return !fseeko;
11661   ;
11662   return 0;
11663 }
11664 _ACEOF
11665 rm -f conftest.$ac_objext
11666 if { (eval echo "$as_me:11666: \"$ac_compile\"") >&5
11667   (eval $ac_compile) 2>&5
11668   ac_status=$?
11669   echo "$as_me:11669: \$? = $ac_status" >&5
11670   (exit $ac_status); } &&
11671          { ac_try='test -s conftest.$ac_objext'
11672   { (eval echo "$as_me:11672: \"$ac_try\"") >&5
11673   (eval $ac_try) 2>&5
11674   ac_status=$?
11675   echo "$as_me:11675: \$? = $ac_status" >&5
11676   (exit $ac_status); }; }; then
11677   ac_cv_sys_largefile_source=1; break
11678 else
11679   echo "$as_me: failed program was:" >&5
11680 cat conftest.$ac_ext >&5
11681 fi
11682 rm -f conftest.$ac_objext conftest.$ac_ext
11683   break
11684 done
11685 fi
11686 echo "$as_me:11686: result: $ac_cv_sys_largefile_source" >&5
11687 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11688 if test "$ac_cv_sys_largefile_source" != no; then
11689
11690 cat >>confdefs.h <<EOF
11691 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11692 EOF
11693
11694 fi
11695 rm -rf conftest*
11696
11697 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11698 # in glibc 2.1.3, but that breaks too many other things.
11699 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11700 echo "$as_me:11700: checking for fseeko" >&5
11701 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11702 if test "${ac_cv_func_fseeko+set}" = set; then
11703   echo $ECHO_N "(cached) $ECHO_C" >&6
11704 else
11705   cat >conftest.$ac_ext <<_ACEOF
11706 #line 11706 "configure"
11707 #include "confdefs.h"
11708 #include <stdio.h>
11709 int
11710 main (void)
11711 {
11712 return fseeko && fseeko (stdin, 0, 0);
11713   ;
11714   return 0;
11715 }
11716 _ACEOF
11717 rm -f conftest.$ac_objext conftest$ac_exeext
11718 if { (eval echo "$as_me:11718: \"$ac_link\"") >&5
11719   (eval $ac_link) 2>&5
11720   ac_status=$?
11721   echo "$as_me:11721: \$? = $ac_status" >&5
11722   (exit $ac_status); } &&
11723          { ac_try='test -s conftest$ac_exeext'
11724   { (eval echo "$as_me:11724: \"$ac_try\"") >&5
11725   (eval $ac_try) 2>&5
11726   ac_status=$?
11727   echo "$as_me:11727: \$? = $ac_status" >&5
11728   (exit $ac_status); }; }; then
11729   ac_cv_func_fseeko=yes
11730 else
11731   echo "$as_me: failed program was:" >&5
11732 cat conftest.$ac_ext >&5
11733 ac_cv_func_fseeko=no
11734 fi
11735 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11736 fi
11737 echo "$as_me:11737: result: $ac_cv_func_fseeko" >&5
11738 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11739 if test $ac_cv_func_fseeko = yes; then
11740
11741 cat >>confdefs.h <<\EOF
11742 #define HAVE_FSEEKO 1
11743 EOF
11744
11745 fi
11746
11747         # Normally we would collect these definitions in the config.h,
11748         # but (like _XOPEN_SOURCE), some environments rely on having these
11749         # defined before any of the system headers are included.  Another
11750         # case comes up with C++, e.g., on AIX the compiler compiles the
11751         # header files by themselves before looking at the body files it is
11752         # told to compile.  For ncurses, those header files do not include
11753         # the config.h
11754         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11755         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11756         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11757
11758         echo "$as_me:11758: checking whether to use struct dirent64" >&5
11759 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11760 if test "${cf_cv_struct_dirent64+set}" = set; then
11761   echo $ECHO_N "(cached) $ECHO_C" >&6
11762 else
11763
11764                 cat >conftest.$ac_ext <<_ACEOF
11765 #line 11765 "configure"
11766 #include "confdefs.h"
11767
11768 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
11769 #include <sys/types.h>
11770 #include <dirent.h>
11771
11772 int
11773 main (void)
11774 {
11775
11776                 /* if transitional largefile support is setup, this is true */
11777                 extern struct dirent64 * readdir(DIR *);
11778                 struct dirent64 *x = readdir((DIR *)0);
11779                 struct dirent *y = readdir((DIR *)0);
11780                 int z = x - y;
11781
11782   ;
11783   return 0;
11784 }
11785 _ACEOF
11786 rm -f conftest.$ac_objext
11787 if { (eval echo "$as_me:11787: \"$ac_compile\"") >&5
11788   (eval $ac_compile) 2>&5
11789   ac_status=$?
11790   echo "$as_me:11790: \$? = $ac_status" >&5
11791   (exit $ac_status); } &&
11792          { ac_try='test -s conftest.$ac_objext'
11793   { (eval echo "$as_me:11793: \"$ac_try\"") >&5
11794   (eval $ac_try) 2>&5
11795   ac_status=$?
11796   echo "$as_me:11796: \$? = $ac_status" >&5
11797   (exit $ac_status); }; }; then
11798   cf_cv_struct_dirent64=yes
11799 else
11800   echo "$as_me: failed program was:" >&5
11801 cat conftest.$ac_ext >&5
11802 cf_cv_struct_dirent64=no
11803 fi
11804 rm -f conftest.$ac_objext conftest.$ac_ext
11805
11806 fi
11807 echo "$as_me:11807: result: $cf_cv_struct_dirent64" >&5
11808 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11809         test "$cf_cv_struct_dirent64" = yes &&
11810 cat >>confdefs.h <<\EOF
11811 #define HAVE_STRUCT_DIRENT64 1
11812 EOF
11813
11814         fi
11815
11816 ### Enable compiling-in rcs id's
11817 echo "$as_me:11817: checking if RCS identifiers should be compiled-in" >&5
11818 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11819
11820 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11821 if test "${with_rcs_ids+set}" = set; then
11822   withval="$with_rcs_ids"
11823   with_rcs_ids=$withval
11824 else
11825   with_rcs_ids=no
11826 fi;
11827 echo "$as_me:11827: result: $with_rcs_ids" >&5
11828 echo "${ECHO_T}$with_rcs_ids" >&6
11829 test "$with_rcs_ids" = yes &&
11830 cat >>confdefs.h <<\EOF
11831 #define USE_RCS_IDS 1
11832 EOF
11833
11834 ###############################################################################
11835
11836 ### Note that some functions (such as const) are normally disabled anyway.
11837 echo "$as_me:11837: checking if you want to build with function extensions" >&5
11838 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11839
11840 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11841 if test "${enable_ext_funcs+set}" = set; then
11842   enableval="$enable_ext_funcs"
11843   with_ext_funcs=$enableval
11844 else
11845   with_ext_funcs=yes
11846 fi;
11847 echo "$as_me:11847: result: $with_ext_funcs" >&5
11848 echo "${ECHO_T}$with_ext_funcs" >&6
11849 if test "$with_ext_funcs" = yes ; then
11850         NCURSES_EXT_FUNCS=1
11851
11852 cat >>confdefs.h <<\EOF
11853 #define HAVE_USE_DEFAULT_COLORS 1
11854 EOF
11855
11856 cat >>confdefs.h <<\EOF
11857 #define NCURSES_EXT_FUNCS 1
11858 EOF
11859
11860 else
11861         NCURSES_EXT_FUNCS=0
11862 fi
11863
11864 ###   use option --enable-const to turn on use of const beyond that in XSI.
11865 echo "$as_me:11865: checking for extended use of const keyword" >&5
11866 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11867
11868 # Check whether --enable-const or --disable-const was given.
11869 if test "${enable_const+set}" = set; then
11870   enableval="$enable_const"
11871   with_ext_const=$enableval
11872 else
11873   with_ext_const=no
11874 fi;
11875 echo "$as_me:11875: result: $with_ext_const" >&5
11876 echo "${ECHO_T}$with_ext_const" >&6
11877 NCURSES_CONST='/*nothing*/'
11878 if test "$with_ext_const" = yes ; then
11879         NCURSES_CONST=const
11880 fi
11881
11882 ###############################################################################
11883 # These options are relatively safe to experiment with.
11884
11885 echo "$as_me:11885: checking if you want all development code" >&5
11886 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11887
11888 # Check whether --with-develop or --without-develop was given.
11889 if test "${with_develop+set}" = set; then
11890   withval="$with_develop"
11891   with_develop=$withval
11892 else
11893   with_develop=no
11894 fi;
11895 echo "$as_me:11895: result: $with_develop" >&5
11896 echo "${ECHO_T}$with_develop" >&6
11897
11898 ###############################################################################
11899 # These are just experimental, probably should not be in a package:
11900
11901 # This is still experimental (20080329), but should ultimately be moved to
11902 # the script-block --with-normal, etc.
11903
11904 echo "$as_me:11904: checking if you want to link with the pthread library" >&5
11905 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11906
11907 # Check whether --with-pthread or --without-pthread was given.
11908 if test "${with_pthread+set}" = set; then
11909   withval="$with_pthread"
11910   with_pthread=$withval
11911 else
11912   with_pthread=no
11913 fi;
11914 echo "$as_me:11914: result: $with_pthread" >&5
11915 echo "${ECHO_T}$with_pthread" >&6
11916
11917 if test "$with_pthread" != no ; then
11918         echo "$as_me:11918: checking for pthread.h" >&5
11919 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11920 if test "${ac_cv_header_pthread_h+set}" = set; then
11921   echo $ECHO_N "(cached) $ECHO_C" >&6
11922 else
11923   cat >conftest.$ac_ext <<_ACEOF
11924 #line 11924 "configure"
11925 #include "confdefs.h"
11926 #include <pthread.h>
11927 _ACEOF
11928 if { (eval echo "$as_me:11928: \"$ac_cpp conftest.$ac_ext\"") >&5
11929   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11930   ac_status=$?
11931   egrep -v '^ *\+' conftest.er1 >conftest.err
11932   rm -f conftest.er1
11933   cat conftest.err >&5
11934   echo "$as_me:11934: \$? = $ac_status" >&5
11935   (exit $ac_status); } >/dev/null; then
11936   if test -s conftest.err; then
11937     ac_cpp_err=$ac_c_preproc_warn_flag
11938   else
11939     ac_cpp_err=
11940   fi
11941 else
11942   ac_cpp_err=yes
11943 fi
11944 if test -z "$ac_cpp_err"; then
11945   ac_cv_header_pthread_h=yes
11946 else
11947   echo "$as_me: failed program was:" >&5
11948   cat conftest.$ac_ext >&5
11949   ac_cv_header_pthread_h=no
11950 fi
11951 rm -f conftest.err conftest.$ac_ext
11952 fi
11953 echo "$as_me:11953: result: $ac_cv_header_pthread_h" >&5
11954 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11955 if test $ac_cv_header_pthread_h = yes; then
11956
11957 cat >>confdefs.h <<\EOF
11958 #define HAVE_PTHREADS_H 1
11959 EOF
11960
11961         for cf_lib_pthread in pthread c_r
11962         do
11963             echo "$as_me:11963: checking if we can link with the $cf_lib_pthread library" >&5
11964 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11965             cf_save_LIBS="$LIBS"
11966
11967 cf_add_libs="-l$cf_lib_pthread"
11968 # Filter out duplicates - this happens with badly-designed ".pc" files...
11969 for cf_add_1lib in $LIBS
11970 do
11971         for cf_add_2lib in $cf_add_libs
11972         do
11973                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11974                 then
11975                         cf_add_1lib=
11976                         break
11977                 fi
11978         done
11979         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11980 done
11981 LIBS="$cf_add_libs"
11982
11983             cat >conftest.$ac_ext <<_ACEOF
11984 #line 11984 "configure"
11985 #include "confdefs.h"
11986
11987 #include <pthread.h>
11988
11989 int
11990 main (void)
11991 {
11992
11993                 int rc = pthread_create(0,0,0,0);
11994                 int r2 = pthread_mutexattr_settype(0, 0);
11995
11996   ;
11997   return 0;
11998 }
11999 _ACEOF
12000 rm -f conftest.$ac_objext conftest$ac_exeext
12001 if { (eval echo "$as_me:12001: \"$ac_link\"") >&5
12002   (eval $ac_link) 2>&5
12003   ac_status=$?
12004   echo "$as_me:12004: \$? = $ac_status" >&5
12005   (exit $ac_status); } &&
12006          { ac_try='test -s conftest$ac_exeext'
12007   { (eval echo "$as_me:12007: \"$ac_try\"") >&5
12008   (eval $ac_try) 2>&5
12009   ac_status=$?
12010   echo "$as_me:12010: \$? = $ac_status" >&5
12011   (exit $ac_status); }; }; then
12012   with_pthread=yes
12013 else
12014   echo "$as_me: failed program was:" >&5
12015 cat conftest.$ac_ext >&5
12016 with_pthread=no
12017 fi
12018 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12019             LIBS="$cf_save_LIBS"
12020             echo "$as_me:12020: result: $with_pthread" >&5
12021 echo "${ECHO_T}$with_pthread" >&6
12022             test "$with_pthread" = yes && break
12023         done
12024
12025         if test "$with_pthread" = yes ; then
12026
12027 cf_add_libs="-l$cf_lib_pthread"
12028 # Filter out duplicates - this happens with badly-designed ".pc" files...
12029 for cf_add_1lib in $LIBS
12030 do
12031         for cf_add_2lib in $cf_add_libs
12032         do
12033                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12034                 then
12035                         cf_add_1lib=
12036                         break
12037                 fi
12038         done
12039         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12040 done
12041 LIBS="$cf_add_libs"
12042
12043 cat >>confdefs.h <<\EOF
12044 #define HAVE_LIBPTHREADS 1
12045 EOF
12046
12047         else
12048             { { echo "$as_me:12048: error: Cannot link with pthread library" >&5
12049 echo "$as_me: error: Cannot link with pthread library" >&2;}
12050    { (exit 1); exit 1; }; }
12051         fi
12052
12053 fi
12054
12055 fi
12056
12057 echo "$as_me:12057: checking if you want to use weak-symbols for pthreads" >&5
12058 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
12059
12060 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
12061 if test "${enable_weak_symbols+set}" = set; then
12062   enableval="$enable_weak_symbols"
12063   use_weak_symbols=$withval
12064 else
12065   use_weak_symbols=no
12066 fi;
12067 echo "$as_me:12067: result: $use_weak_symbols" >&5
12068 echo "${ECHO_T}$use_weak_symbols" >&6
12069 if test "$use_weak_symbols" = yes ; then
12070
12071 echo "$as_me:12071: checking if $CC supports weak symbols" >&5
12072 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
12073 if test "${cf_cv_weak_symbols+set}" = set; then
12074   echo $ECHO_N "(cached) $ECHO_C" >&6
12075 else
12076
12077 cat >conftest.$ac_ext <<_ACEOF
12078 #line 12078 "configure"
12079 #include "confdefs.h"
12080
12081 #include <stdio.h>
12082 int
12083 main (void)
12084 {
12085
12086 #if defined(__GNUC__)
12087 #  if defined __USE_ISOC99
12088 #    define _cat_pragma(exp)    _Pragma(#exp)
12089 #    define _weak_pragma(exp)   _cat_pragma(weak name)
12090 #  else
12091 #    define _weak_pragma(exp)
12092 #  endif
12093 #  define _declare(name)        __extension__ extern __typeof__(name) name
12094 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
12095 #endif
12096
12097 weak_symbol(fopen);
12098
12099   ;
12100   return 0;
12101 }
12102 _ACEOF
12103 rm -f conftest.$ac_objext
12104 if { (eval echo "$as_me:12104: \"$ac_compile\"") >&5
12105   (eval $ac_compile) 2>&5
12106   ac_status=$?
12107   echo "$as_me:12107: \$? = $ac_status" >&5
12108   (exit $ac_status); } &&
12109          { ac_try='test -s conftest.$ac_objext'
12110   { (eval echo "$as_me:12110: \"$ac_try\"") >&5
12111   (eval $ac_try) 2>&5
12112   ac_status=$?
12113   echo "$as_me:12113: \$? = $ac_status" >&5
12114   (exit $ac_status); }; }; then
12115   cf_cv_weak_symbols=yes
12116 else
12117   echo "$as_me: failed program was:" >&5
12118 cat conftest.$ac_ext >&5
12119 cf_cv_weak_symbols=no
12120 fi
12121 rm -f conftest.$ac_objext conftest.$ac_ext
12122
12123 fi
12124 echo "$as_me:12124: result: $cf_cv_weak_symbols" >&5
12125 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
12126
12127 else
12128         cf_cv_weak_symbols=no
12129 fi
12130
12131 if test $cf_cv_weak_symbols = yes ; then
12132
12133 cat >>confdefs.h <<\EOF
12134 #define USE_WEAK_SYMBOLS 1
12135 EOF
12136
12137 fi
12138
12139 PTHREAD=
12140 if test "$with_pthread" = "yes" ; then
12141
12142 cat >>confdefs.h <<\EOF
12143 #define USE_PTHREADS 1
12144 EOF
12145
12146         enable_reentrant=yes
12147         if test $cf_cv_weak_symbols = yes ; then
12148                 PTHREAD=-lpthread
12149         fi
12150 fi
12151
12152 # OpenSUSE is installing ncurses6, using reentrant option.
12153 echo "$as_me:12153: checking for _nc_TABSIZE" >&5
12154 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
12155 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
12156   echo $ECHO_N "(cached) $ECHO_C" >&6
12157 else
12158   cat >conftest.$ac_ext <<_ACEOF
12159 #line 12159 "configure"
12160 #include "confdefs.h"
12161 /* System header to define __stub macros and hopefully few prototypes,
12162     which can conflict with char _nc_TABSIZE (); below.  */
12163 #include <assert.h>
12164 /* Override any gcc2 internal prototype to avoid an error.  */
12165 #ifdef __cplusplus
12166 extern "C"
12167 #endif
12168 /* We use char because int might match the return type of a gcc2
12169    builtin and then its argument prototype would still apply.  */
12170 char _nc_TABSIZE ();
12171 char (*f) ();
12172
12173 int
12174 main (void)
12175 {
12176 /* The GNU C library defines this for functions which it implements
12177     to always fail with ENOSYS.  Some functions are actually named
12178     something starting with __ and the normal name is an alias.  */
12179 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
12180 choke me
12181 #else
12182 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12183 #endif
12184
12185   ;
12186   return 0;
12187 }
12188 _ACEOF
12189 rm -f conftest.$ac_objext conftest$ac_exeext
12190 if { (eval echo "$as_me:12190: \"$ac_link\"") >&5
12191   (eval $ac_link) 2>&5
12192   ac_status=$?
12193   echo "$as_me:12193: \$? = $ac_status" >&5
12194   (exit $ac_status); } &&
12195          { ac_try='test -s conftest$ac_exeext'
12196   { (eval echo "$as_me:12196: \"$ac_try\"") >&5
12197   (eval $ac_try) 2>&5
12198   ac_status=$?
12199   echo "$as_me:12199: \$? = $ac_status" >&5
12200   (exit $ac_status); }; }; then
12201   ac_cv_func__nc_TABSIZE=yes
12202 else
12203   echo "$as_me: failed program was:" >&5
12204 cat conftest.$ac_ext >&5
12205 ac_cv_func__nc_TABSIZE=no
12206 fi
12207 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12208 fi
12209 echo "$as_me:12209: result: $ac_cv_func__nc_TABSIZE" >&5
12210 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
12211 if test $ac_cv_func__nc_TABSIZE = yes; then
12212   assume_reentrant=yes
12213 else
12214   assume_reentrant=no
12215 fi
12216
12217 # Reentrant code has to be opaque; there's little advantage to making ncurses
12218 # opaque outside of that, so there is no --enable-opaque option.  We can use
12219 # this option without --with-pthreads, but this will be always set for
12220 # pthreads.
12221 echo "$as_me:12221: checking if you want experimental reentrant code" >&5
12222 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
12223
12224 # Check whether --enable-reentrant or --disable-reentrant was given.
12225 if test "${enable_reentrant+set}" = set; then
12226   enableval="$enable_reentrant"
12227   with_reentrant=$enableval
12228 else
12229   with_reentrant=$assume_reentrant
12230 fi;
12231 echo "$as_me:12231: result: $with_reentrant" >&5
12232 echo "${ECHO_T}$with_reentrant" >&6
12233 if test "$with_reentrant" = yes ; then
12234         cf_cv_enable_reentrant=1
12235         if test $cf_cv_weak_symbols = yes ; then
12236
12237 # remove pthread library from $LIBS
12238 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
12239
12240         elif test "$assume_reentrant" = no ; then
12241                 LIB_SUFFIX="t${LIB_SUFFIX}"
12242         fi
12243
12244 cat >>confdefs.h <<\EOF
12245 #define USE_REENTRANT 1
12246 EOF
12247
12248 else
12249         cf_cv_enable_reentrant=0
12250 fi
12251
12252 ### Allow using a different wrap-prefix
12253 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
12254         echo "$as_me:12254: checking for prefix used to wrap public variables" >&5
12255 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
12256
12257 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
12258 if test "${with_wrap_prefix+set}" = set; then
12259   withval="$with_wrap_prefix"
12260   NCURSES_WRAP_PREFIX=$withval
12261 else
12262   NCURSES_WRAP_PREFIX=_nc_
12263 fi;
12264         echo "$as_me:12264: result: $NCURSES_WRAP_PREFIX" >&5
12265 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
12266 else
12267         NCURSES_WRAP_PREFIX=_nc_
12268 fi
12269
12270 cat >>confdefs.h <<EOF
12271 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
12272 EOF
12273
12274 ###############################################################################
12275
12276 ###     use option --disable-echo to suppress full display compiling commands
12277
12278 echo "$as_me:12278: checking if you want to see long compiling messages" >&5
12279 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
12280
12281 # Check whether --enable-echo or --disable-echo was given.
12282 if test "${enable_echo+set}" = set; then
12283   enableval="$enable_echo"
12284   test "$enableval" != no && enableval=yes
12285         if test "$enableval" != "yes" ; then
12286
12287         ECHO_LT='--silent'
12288         ECHO_LD='@echo linking $@;'
12289         RULE_CC='@echo compiling $<'
12290         SHOW_CC='@echo compiling $@'
12291         ECHO_CC='@'
12292
12293         else
12294
12295         ECHO_LT=''
12296         ECHO_LD=''
12297         RULE_CC=''
12298         SHOW_CC=''
12299         ECHO_CC=''
12300
12301         fi
12302 else
12303   enableval=yes
12304
12305         ECHO_LT=''
12306         ECHO_LD=''
12307         RULE_CC=''
12308         SHOW_CC=''
12309         ECHO_CC=''
12310
12311 fi;
12312 echo "$as_me:12312: result: $enableval" >&5
12313 echo "${ECHO_T}$enableval" >&6
12314
12315 ###     use option --enable-warnings to turn on all gcc warnings
12316 echo "$as_me:12316: checking if you want to see compiler warnings" >&5
12317 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
12318
12319 # Check whether --enable-warnings or --disable-warnings was given.
12320 if test "${enable_warnings+set}" = set; then
12321   enableval="$enable_warnings"
12322   with_warnings=$enableval
12323 fi;
12324 echo "$as_me:12324: result: $with_warnings" >&5
12325 echo "${ECHO_T}$with_warnings" >&6
12326
12327 if test "x$with_warnings" = "xyes"; then
12328
12329         ADAFLAGS="$ADAFLAGS -gnatg"
12330
12331 INTEL_COMPILER=no
12332
12333 if test "$GCC" = yes ; then
12334         case $host_os in
12335         (linux*|gnu*)
12336                 echo "$as_me:12336: checking if this is really Intel C compiler" >&5
12337 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
12338                 cf_save_CFLAGS="$CFLAGS"
12339                 CFLAGS="$CFLAGS -no-gcc"
12340                 cat >conftest.$ac_ext <<_ACEOF
12341 #line 12341 "configure"
12342 #include "confdefs.h"
12343
12344 int
12345 main (void)
12346 {
12347
12348 #ifdef __INTEL_COMPILER
12349 #else
12350 make an error
12351 #endif
12352
12353   ;
12354   return 0;
12355 }
12356 _ACEOF
12357 rm -f conftest.$ac_objext
12358 if { (eval echo "$as_me:12358: \"$ac_compile\"") >&5
12359   (eval $ac_compile) 2>&5
12360   ac_status=$?
12361   echo "$as_me:12361: \$? = $ac_status" >&5
12362   (exit $ac_status); } &&
12363          { ac_try='test -s conftest.$ac_objext'
12364   { (eval echo "$as_me:12364: \"$ac_try\"") >&5
12365   (eval $ac_try) 2>&5
12366   ac_status=$?
12367   echo "$as_me:12367: \$? = $ac_status" >&5
12368   (exit $ac_status); }; }; then
12369   INTEL_COMPILER=yes
12370 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
12371
12372 else
12373   echo "$as_me: failed program was:" >&5
12374 cat conftest.$ac_ext >&5
12375 fi
12376 rm -f conftest.$ac_objext conftest.$ac_ext
12377                 CFLAGS="$cf_save_CFLAGS"
12378                 echo "$as_me:12378: result: $INTEL_COMPILER" >&5
12379 echo "${ECHO_T}$INTEL_COMPILER" >&6
12380                 ;;
12381         esac
12382 fi
12383
12384 CLANG_COMPILER=no
12385
12386 if test "$GCC" = yes ; then
12387         echo "$as_me:12387: checking if this is really Clang C compiler" >&5
12388 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
12389         cf_save_CFLAGS="$CFLAGS"
12390         CFLAGS="$CFLAGS -Qunused-arguments"
12391         cat >conftest.$ac_ext <<_ACEOF
12392 #line 12392 "configure"
12393 #include "confdefs.h"
12394
12395 int
12396 main (void)
12397 {
12398
12399 #ifdef __clang__
12400 #else
12401 make an error
12402 #endif
12403
12404   ;
12405   return 0;
12406 }
12407 _ACEOF
12408 rm -f conftest.$ac_objext
12409 if { (eval echo "$as_me:12409: \"$ac_compile\"") >&5
12410   (eval $ac_compile) 2>&5
12411   ac_status=$?
12412   echo "$as_me:12412: \$? = $ac_status" >&5
12413   (exit $ac_status); } &&
12414          { ac_try='test -s conftest.$ac_objext'
12415   { (eval echo "$as_me:12415: \"$ac_try\"") >&5
12416   (eval $ac_try) 2>&5
12417   ac_status=$?
12418   echo "$as_me:12418: \$? = $ac_status" >&5
12419   (exit $ac_status); }; }; then
12420   CLANG_COMPILER=yes
12421 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
12422
12423 else
12424   echo "$as_me: failed program was:" >&5
12425 cat conftest.$ac_ext >&5
12426 fi
12427 rm -f conftest.$ac_objext conftest.$ac_ext
12428         CFLAGS="$cf_save_CFLAGS"
12429         echo "$as_me:12429: result: $CLANG_COMPILER" >&5
12430 echo "${ECHO_T}$CLANG_COMPILER" >&6
12431 fi
12432
12433 cat > conftest.$ac_ext <<EOF
12434 #line 12434 "${as_me:-configure}"
12435 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
12436 EOF
12437
12438 if test "$INTEL_COMPILER" = yes
12439 then
12440 # The "-wdXXX" options suppress warnings:
12441 # remark #1419: external declaration in primary source file
12442 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
12443 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
12444 # remark #193: zero used for undefined preprocessing identifier
12445 # remark #593: variable "curs_sb_left_arrow" was set but never used
12446 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
12447 # remark #869: parameter "tw" was never referenced
12448 # remark #981: operands are evaluated in unspecified order
12449 # warning #279: controlling expression is constant
12450
12451         { echo "$as_me:12451: checking for $CC warning options..." >&5
12452 echo "$as_me: checking for $CC warning options..." >&6;}
12453         cf_save_CFLAGS="$CFLAGS"
12454         EXTRA_CFLAGS="-Wall"
12455         for cf_opt in \
12456                 wd1419 \
12457                 wd1683 \
12458                 wd1684 \
12459                 wd193 \
12460                 wd593 \
12461                 wd279 \
12462                 wd810 \
12463                 wd869 \
12464                 wd981
12465         do
12466                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12467                 if { (eval echo "$as_me:12467: \"$ac_compile\"") >&5
12468   (eval $ac_compile) 2>&5
12469   ac_status=$?
12470   echo "$as_me:12470: \$? = $ac_status" >&5
12471   (exit $ac_status); }; then
12472                         test -n "$verbose" && echo "$as_me:12472: result: ... -$cf_opt" >&5
12473 echo "${ECHO_T}... -$cf_opt" >&6
12474                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12475                 fi
12476         done
12477         CFLAGS="$cf_save_CFLAGS"
12478
12479 elif test "$GCC" = yes
12480 then
12481         { echo "$as_me:12481: checking for $CC warning options..." >&5
12482 echo "$as_me: checking for $CC warning options..." >&6;}
12483         cf_save_CFLAGS="$CFLAGS"
12484         EXTRA_CFLAGS=
12485         cf_warn_CONST=""
12486         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12487         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12488         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12489         for cf_opt in W Wall \
12490                 Wbad-function-cast \
12491                 Wcast-align \
12492                 Wcast-qual \
12493                 Wdeclaration-after-statement \
12494                 Wextra \
12495                 Winline \
12496                 Wmissing-declarations \
12497                 Wmissing-prototypes \
12498                 Wnested-externs \
12499                 Wpointer-arith \
12500                 Wshadow \
12501                 Wstrict-prototypes \
12502                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12503         do
12504                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12505                 if { (eval echo "$as_me:12505: \"$ac_compile\"") >&5
12506   (eval $ac_compile) 2>&5
12507   ac_status=$?
12508   echo "$as_me:12508: \$? = $ac_status" >&5
12509   (exit $ac_status); }; then
12510                         test -n "$verbose" && echo "$as_me:12510: result: ... -$cf_opt" >&5
12511 echo "${ECHO_T}... -$cf_opt" >&6
12512                         case $cf_opt in
12513                         (Wcast-qual)
12514                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12515                                 ;;
12516                         (Winline)
12517                                 case $GCC_VERSION in
12518                                 ([34].*)
12519                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12520
12521 echo "${as_me:-configure}:12521: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12522
12523                                         continue;;
12524                                 esac
12525                                 ;;
12526                         (Wpointer-arith)
12527                                 case $GCC_VERSION in
12528                                 ([12].*)
12529                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12530
12531 echo "${as_me:-configure}:12531: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12532
12533                                         continue;;
12534                                 esac
12535                                 ;;
12536                         esac
12537                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12538                 fi
12539         done
12540         CFLAGS="$cf_save_CFLAGS"
12541 fi
12542 rm -rf conftest*
12543
12544 fi
12545
12546 if test "$GCC" = yes
12547 then
12548 cat > conftest.i <<EOF
12549 #ifndef GCC_PRINTF
12550 #define GCC_PRINTF 0
12551 #endif
12552 #ifndef GCC_SCANF
12553 #define GCC_SCANF 0
12554 #endif
12555 #ifndef GCC_NORETURN
12556 #define GCC_NORETURN /* nothing */
12557 #endif
12558 #ifndef GCC_UNUSED
12559 #define GCC_UNUSED /* nothing */
12560 #endif
12561 EOF
12562 if test "$GCC" = yes
12563 then
12564         { echo "$as_me:12564: checking for $CC __attribute__ directives..." >&5
12565 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12566 cat > conftest.$ac_ext <<EOF
12567 #line 12567 "${as_me:-configure}"
12568 #include "confdefs.h"
12569 #include "conftest.h"
12570 #include "conftest.i"
12571 #if     GCC_PRINTF
12572 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12573 #else
12574 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12575 #endif
12576 #if     GCC_SCANF
12577 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12578 #else
12579 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12580 #endif
12581 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12582 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12583 extern void foo(void) GCC_NORETURN;
12584 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12585 EOF
12586         cf_printf_attribute=no
12587         cf_scanf_attribute=no
12588         for cf_attribute in scanf printf unused noreturn
12589         do
12590
12591 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12592
12593                 cf_directive="__attribute__(($cf_attribute))"
12594                 echo "checking for $CC $cf_directive" 1>&5
12595
12596                 case $cf_attribute in
12597                 (printf)
12598                         cf_printf_attribute=yes
12599                         cat >conftest.h <<EOF
12600 #define GCC_$cf_ATTRIBUTE 1
12601 EOF
12602                         ;;
12603                 (scanf)
12604                         cf_scanf_attribute=yes
12605                         cat >conftest.h <<EOF
12606 #define GCC_$cf_ATTRIBUTE 1
12607 EOF
12608                         ;;
12609                 (*)
12610                         cat >conftest.h <<EOF
12611 #define GCC_$cf_ATTRIBUTE $cf_directive
12612 EOF
12613                         ;;
12614                 esac
12615
12616                 if { (eval echo "$as_me:12616: \"$ac_compile\"") >&5
12617   (eval $ac_compile) 2>&5
12618   ac_status=$?
12619   echo "$as_me:12619: \$? = $ac_status" >&5
12620   (exit $ac_status); }; then
12621                         test -n "$verbose" && echo "$as_me:12621: result: ... $cf_attribute" >&5
12622 echo "${ECHO_T}... $cf_attribute" >&6
12623                         cat conftest.h >>confdefs.h
12624                         case $cf_attribute in
12625                         (noreturn)
12626
12627 cat >>confdefs.h <<EOF
12628 #define GCC_NORETURN $cf_directive
12629 EOF
12630
12631                                 ;;
12632                         (printf)
12633                                 cf_value='/* nothing */'
12634                                 if test "$cf_printf_attribute" != no ; then
12635                                         cf_value='__attribute__((format(printf,fmt,var)))'
12636
12637 cat >>confdefs.h <<\EOF
12638 #define GCC_PRINTF 1
12639 EOF
12640
12641                                 fi
12642
12643 cat >>confdefs.h <<EOF
12644 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12645 EOF
12646
12647                                 ;;
12648                         (scanf)
12649                                 cf_value='/* nothing */'
12650                                 if test "$cf_scanf_attribute" != no ; then
12651                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12652
12653 cat >>confdefs.h <<\EOF
12654 #define GCC_SCANF 1
12655 EOF
12656
12657                                 fi
12658
12659 cat >>confdefs.h <<EOF
12660 #define GCC_SCANFLIKE(fmt,var) $cf_value
12661 EOF
12662
12663                                 ;;
12664                         (unused)
12665
12666 cat >>confdefs.h <<EOF
12667 #define GCC_UNUSED $cf_directive
12668 EOF
12669
12670                                 ;;
12671                         esac
12672                 fi
12673         done
12674 else
12675         fgrep define conftest.i >>confdefs.h
12676 fi
12677 rm -rf conftest*
12678 fi
12679
12680 ###     use option --enable-assertions to turn on generation of assertion code
12681 echo "$as_me:12681: checking if you want to enable runtime assertions" >&5
12682 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12683
12684 # Check whether --enable-assertions or --disable-assertions was given.
12685 if test "${enable_assertions+set}" = set; then
12686   enableval="$enable_assertions"
12687   with_assertions=$enableval
12688 else
12689   with_assertions=no
12690 fi;
12691 echo "$as_me:12691: result: $with_assertions" >&5
12692 echo "${ECHO_T}$with_assertions" >&6
12693 if test -n "$GCC"
12694 then
12695         if test "$with_assertions" = no
12696         then
12697                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12698         else
12699
12700         ADAFLAGS="$ADAFLAGS -gnata"
12701
12702         fi
12703 fi
12704
12705 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12706
12707 cat >>confdefs.h <<\EOF
12708 #define HAVE_NC_ALLOC_H 1
12709 EOF
12710
12711 ###     use option --enable-expanded to generate certain macros as functions
12712
12713 # Check whether --enable-expanded or --disable-expanded was given.
12714 if test "${enable_expanded+set}" = set; then
12715   enableval="$enable_expanded"
12716   test "$enableval" = yes &&
12717 cat >>confdefs.h <<\EOF
12718 #define NCURSES_EXPANDED 1
12719 EOF
12720
12721 fi;
12722
12723 ###     use option --disable-macros to suppress macros in favor of functions
12724
12725 # Check whether --enable-macros or --disable-macros was given.
12726 if test "${enable_macros+set}" = set; then
12727   enableval="$enable_macros"
12728   test "$enableval" = no &&
12729 cat >>confdefs.h <<\EOF
12730 #define NCURSES_NOMACROS 1
12731 EOF
12732
12733 fi;
12734
12735 # Normally we only add trace() to the debug-library.  Allow this to be
12736 # extended to all models of the ncurses library:
12737 cf_all_traces=no
12738 case "$CFLAGS $CPPFLAGS" in
12739 (*-DTRACE*)
12740         cf_all_traces=yes
12741         ;;
12742 esac
12743
12744 echo "$as_me:12744: checking whether to add trace feature to all models" >&5
12745 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12746
12747 # Check whether --with-trace or --without-trace was given.
12748 if test "${with_trace+set}" = set; then
12749   withval="$with_trace"
12750   cf_with_trace=$withval
12751 else
12752   cf_with_trace=$cf_all_traces
12753 fi;
12754 echo "$as_me:12754: result: $cf_with_trace" >&5
12755 echo "${ECHO_T}$cf_with_trace" >&6
12756
12757 if test "$cf_with_trace" = yes ; then
12758         ADA_TRACE=TRUE
12759
12760 cf_fix_cppflags=no
12761 cf_new_cflags=
12762 cf_new_cppflags=
12763 cf_new_extra_cppflags=
12764
12765 for cf_add_cflags in -DTRACE
12766 do
12767 case $cf_fix_cppflags in
12768 (no)
12769         case $cf_add_cflags in
12770         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12771                 case $cf_add_cflags in
12772                 (-D*)
12773                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12774
12775                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12776                                 && test -z "${cf_tst_cflags}" \
12777                                 && cf_fix_cppflags=yes
12778
12779                         if test $cf_fix_cppflags = yes ; then
12780
12781         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12782         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12783
12784                                 continue
12785                         elif test "${cf_tst_cflags}" = "\"'" ; then
12786
12787         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12788         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12789
12790                                 continue
12791                         fi
12792                         ;;
12793                 esac
12794                 case "$CPPFLAGS" in
12795                 (*$cf_add_cflags)
12796                         ;;
12797                 (*)
12798                         case $cf_add_cflags in
12799                         (-D*)
12800                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12801
12802 CPPFLAGS=`echo "$CPPFLAGS" | \
12803         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12804                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12805
12806                                 ;;
12807                         esac
12808
12809         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12810         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12811
12812                         ;;
12813                 esac
12814                 ;;
12815         (*)
12816
12817         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12818         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12819
12820                 ;;
12821         esac
12822         ;;
12823 (yes)
12824
12825         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12826         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12827
12828         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12829
12830         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12831                 && test -z "${cf_tst_cflags}" \
12832                 && cf_fix_cppflags=no
12833         ;;
12834 esac
12835 done
12836
12837 if test -n "$cf_new_cflags" ; then
12838
12839         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12840         CFLAGS="${CFLAGS}$cf_new_cflags"
12841
12842 fi
12843
12844 if test -n "$cf_new_cppflags" ; then
12845
12846         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12847         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12848
12849 fi
12850
12851 if test -n "$cf_new_extra_cppflags" ; then
12852
12853         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12854         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12855
12856 fi
12857
12858 else
12859         ADA_TRACE=FALSE
12860 fi
12861
12862 echo "$as_me:12862: checking if we want to use GNAT projects" >&5
12863 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12864
12865 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12866 if test "${enable_gnat_projects+set}" = set; then
12867   enableval="$enable_gnat_projects"
12868   test "$enableval" != no && enableval=yes
12869         if test "$enableval" != "yes" ; then
12870     enable_gnat_projects=no
12871         else
12872                 enable_gnat_projects=yes
12873         fi
12874 else
12875   enableval=yes
12876         enable_gnat_projects=yes
12877
12878 fi;
12879 echo "$as_me:12879: result: $enable_gnat_projects" >&5
12880 echo "${ECHO_T}$enable_gnat_projects" >&6
12881
12882 ###     Checks for libraries.
12883 case $cf_cv_system_name in
12884 (*mingw32*)
12885         ;;
12886 (*)
12887 echo "$as_me:12887: checking for gettimeofday" >&5
12888 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12889 if test "${ac_cv_func_gettimeofday+set}" = set; then
12890   echo $ECHO_N "(cached) $ECHO_C" >&6
12891 else
12892   cat >conftest.$ac_ext <<_ACEOF
12893 #line 12893 "configure"
12894 #include "confdefs.h"
12895 /* System header to define __stub macros and hopefully few prototypes,
12896     which can conflict with char gettimeofday (); below.  */
12897 #include <assert.h>
12898 /* Override any gcc2 internal prototype to avoid an error.  */
12899 #ifdef __cplusplus
12900 extern "C"
12901 #endif
12902 /* We use char because int might match the return type of a gcc2
12903    builtin and then its argument prototype would still apply.  */
12904 char gettimeofday ();
12905 char (*f) ();
12906
12907 int
12908 main (void)
12909 {
12910 /* The GNU C library defines this for functions which it implements
12911     to always fail with ENOSYS.  Some functions are actually named
12912     something starting with __ and the normal name is an alias.  */
12913 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12914 choke me
12915 #else
12916 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12917 #endif
12918
12919   ;
12920   return 0;
12921 }
12922 _ACEOF
12923 rm -f conftest.$ac_objext conftest$ac_exeext
12924 if { (eval echo "$as_me:12924: \"$ac_link\"") >&5
12925   (eval $ac_link) 2>&5
12926   ac_status=$?
12927   echo "$as_me:12927: \$? = $ac_status" >&5
12928   (exit $ac_status); } &&
12929          { ac_try='test -s conftest$ac_exeext'
12930   { (eval echo "$as_me:12930: \"$ac_try\"") >&5
12931   (eval $ac_try) 2>&5
12932   ac_status=$?
12933   echo "$as_me:12933: \$? = $ac_status" >&5
12934   (exit $ac_status); }; }; then
12935   ac_cv_func_gettimeofday=yes
12936 else
12937   echo "$as_me: failed program was:" >&5
12938 cat conftest.$ac_ext >&5
12939 ac_cv_func_gettimeofday=no
12940 fi
12941 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12942 fi
12943 echo "$as_me:12943: result: $ac_cv_func_gettimeofday" >&5
12944 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12945 if test $ac_cv_func_gettimeofday = yes; then
12946   cat >>confdefs.h <<\EOF
12947 #define HAVE_GETTIMEOFDAY 1
12948 EOF
12949
12950 else
12951
12952 echo "$as_me:12952: checking for gettimeofday in -lbsd" >&5
12953 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12954 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12955   echo $ECHO_N "(cached) $ECHO_C" >&6
12956 else
12957   ac_check_lib_save_LIBS=$LIBS
12958 LIBS="-lbsd  $LIBS"
12959 cat >conftest.$ac_ext <<_ACEOF
12960 #line 12960 "configure"
12961 #include "confdefs.h"
12962
12963 /* Override any gcc2 internal prototype to avoid an error.  */
12964 #ifdef __cplusplus
12965 extern "C"
12966 #endif
12967 /* We use char because int might match the return type of a gcc2
12968    builtin and then its argument prototype would still apply.  */
12969 char gettimeofday ();
12970 int
12971 main (void)
12972 {
12973 gettimeofday ();
12974   ;
12975   return 0;
12976 }
12977 _ACEOF
12978 rm -f conftest.$ac_objext conftest$ac_exeext
12979 if { (eval echo "$as_me:12979: \"$ac_link\"") >&5
12980   (eval $ac_link) 2>&5
12981   ac_status=$?
12982   echo "$as_me:12982: \$? = $ac_status" >&5
12983   (exit $ac_status); } &&
12984          { ac_try='test -s conftest$ac_exeext'
12985   { (eval echo "$as_me:12985: \"$ac_try\"") >&5
12986   (eval $ac_try) 2>&5
12987   ac_status=$?
12988   echo "$as_me:12988: \$? = $ac_status" >&5
12989   (exit $ac_status); }; }; then
12990   ac_cv_lib_bsd_gettimeofday=yes
12991 else
12992   echo "$as_me: failed program was:" >&5
12993 cat conftest.$ac_ext >&5
12994 ac_cv_lib_bsd_gettimeofday=no
12995 fi
12996 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12997 LIBS=$ac_check_lib_save_LIBS
12998 fi
12999 echo "$as_me:12999: result: $ac_cv_lib_bsd_gettimeofday" >&5
13000 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
13001 if test $ac_cv_lib_bsd_gettimeofday = yes; then
13002
13003 cat >>confdefs.h <<\EOF
13004 #define HAVE_GETTIMEOFDAY 1
13005 EOF
13006
13007         LIBS="$LIBS -lbsd"
13008 fi
13009
13010 fi
13011         ;;
13012 esac
13013
13014 ###     Checks for header files.
13015 echo "$as_me:13015: checking for ANSI C header files" >&5
13016 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13017 if test "${ac_cv_header_stdc+set}" = set; then
13018   echo $ECHO_N "(cached) $ECHO_C" >&6
13019 else
13020   cat >conftest.$ac_ext <<_ACEOF
13021 #line 13021 "configure"
13022 #include "confdefs.h"
13023 #include <stdlib.h>
13024 #include <stdarg.h>
13025 #include <string.h>
13026 #include <float.h>
13027
13028 _ACEOF
13029 if { (eval echo "$as_me:13029: \"$ac_cpp conftest.$ac_ext\"") >&5
13030   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13031   ac_status=$?
13032   egrep -v '^ *\+' conftest.er1 >conftest.err
13033   rm -f conftest.er1
13034   cat conftest.err >&5
13035   echo "$as_me:13035: \$? = $ac_status" >&5
13036   (exit $ac_status); } >/dev/null; then
13037   if test -s conftest.err; then
13038     ac_cpp_err=$ac_c_preproc_warn_flag
13039   else
13040     ac_cpp_err=
13041   fi
13042 else
13043   ac_cpp_err=yes
13044 fi
13045 if test -z "$ac_cpp_err"; then
13046   ac_cv_header_stdc=yes
13047 else
13048   echo "$as_me: failed program was:" >&5
13049   cat conftest.$ac_ext >&5
13050   ac_cv_header_stdc=no
13051 fi
13052 rm -f conftest.err conftest.$ac_ext
13053
13054 if test $ac_cv_header_stdc = yes; then
13055   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13056   cat >conftest.$ac_ext <<_ACEOF
13057 #line 13057 "configure"
13058 #include "confdefs.h"
13059 #include <string.h>
13060
13061 _ACEOF
13062 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13063   egrep "memchr" >/dev/null 2>&1; then
13064   :
13065 else
13066   ac_cv_header_stdc=no
13067 fi
13068 rm -rf conftest*
13069
13070 fi
13071
13072 if test $ac_cv_header_stdc = yes; then
13073   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13074   cat >conftest.$ac_ext <<_ACEOF
13075 #line 13075 "configure"
13076 #include "confdefs.h"
13077 #include <stdlib.h>
13078
13079 _ACEOF
13080 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13081   egrep "free" >/dev/null 2>&1; then
13082   :
13083 else
13084   ac_cv_header_stdc=no
13085 fi
13086 rm -rf conftest*
13087
13088 fi
13089
13090 if test $ac_cv_header_stdc = yes; then
13091   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13092   if test "$cross_compiling" = yes; then
13093   :
13094 else
13095   cat >conftest.$ac_ext <<_ACEOF
13096 #line 13096 "configure"
13097 #include "confdefs.h"
13098 #include <ctype.h>
13099 #if ((' ' & 0x0FF) == 0x020)
13100 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13101 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13102 #else
13103 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13104                      || ('j' <= (c) && (c) <= 'r') \
13105                      || ('s' <= (c) && (c) <= 'z'))
13106 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13107 #endif
13108
13109 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13110 int
13111 main (void)
13112 {
13113   int i;
13114   for (i = 0; i < 256; i++)
13115     if (XOR (islower (i), ISLOWER (i))
13116         || toupper (i) != TOUPPER (i))
13117       $ac_main_return(2);
13118   $ac_main_return (0);
13119 }
13120 _ACEOF
13121 rm -f conftest$ac_exeext
13122 if { (eval echo "$as_me:13122: \"$ac_link\"") >&5
13123   (eval $ac_link) 2>&5
13124   ac_status=$?
13125   echo "$as_me:13125: \$? = $ac_status" >&5
13126   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13127   { (eval echo "$as_me:13127: \"$ac_try\"") >&5
13128   (eval $ac_try) 2>&5
13129   ac_status=$?
13130   echo "$as_me:13130: \$? = $ac_status" >&5
13131   (exit $ac_status); }; }; then
13132   :
13133 else
13134   echo "$as_me: program exited with status $ac_status" >&5
13135 echo "$as_me: failed program was:" >&5
13136 cat conftest.$ac_ext >&5
13137 ac_cv_header_stdc=no
13138 fi
13139 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13140 fi
13141 fi
13142 fi
13143 echo "$as_me:13143: result: $ac_cv_header_stdc" >&5
13144 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13145 if test $ac_cv_header_stdc = yes; then
13146
13147 cat >>confdefs.h <<\EOF
13148 #define STDC_HEADERS 1
13149 EOF
13150
13151 fi
13152
13153 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
13154
13155 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
13156                   inttypes.h stdint.h unistd.h
13157 do
13158 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13159 echo "$as_me:13159: checking for $ac_header" >&5
13160 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13161 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13162   echo $ECHO_N "(cached) $ECHO_C" >&6
13163 else
13164   cat >conftest.$ac_ext <<_ACEOF
13165 #line 13165 "configure"
13166 #include "confdefs.h"
13167 $ac_includes_default
13168 #include <$ac_header>
13169 _ACEOF
13170 rm -f conftest.$ac_objext
13171 if { (eval echo "$as_me:13171: \"$ac_compile\"") >&5
13172   (eval $ac_compile) 2>&5
13173   ac_status=$?
13174   echo "$as_me:13174: \$? = $ac_status" >&5
13175   (exit $ac_status); } &&
13176          { ac_try='test -s conftest.$ac_objext'
13177   { (eval echo "$as_me:13177: \"$ac_try\"") >&5
13178   (eval $ac_try) 2>&5
13179   ac_status=$?
13180   echo "$as_me:13180: \$? = $ac_status" >&5
13181   (exit $ac_status); }; }; then
13182   eval "$as_ac_Header=yes"
13183 else
13184   echo "$as_me: failed program was:" >&5
13185 cat conftest.$ac_ext >&5
13186 eval "$as_ac_Header=no"
13187 fi
13188 rm -f conftest.$ac_objext conftest.$ac_ext
13189 fi
13190 echo "$as_me:13190: result: `eval echo '${'$as_ac_Header'}'`" >&5
13191 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13192 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13193   cat >>confdefs.h <<EOF
13194 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13195 EOF
13196
13197 fi
13198 done
13199
13200 echo "$as_me:13200: checking for signed char" >&5
13201 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
13202 if test "${ac_cv_type_signed_char+set}" = set; then
13203   echo $ECHO_N "(cached) $ECHO_C" >&6
13204 else
13205   cat >conftest.$ac_ext <<_ACEOF
13206 #line 13206 "configure"
13207 #include "confdefs.h"
13208 $ac_includes_default
13209 int
13210 main (void)
13211 {
13212 if ((signed char *) 0)
13213   return 0;
13214 if (sizeof (signed char))
13215   return 0;
13216   ;
13217   return 0;
13218 }
13219 _ACEOF
13220 rm -f conftest.$ac_objext
13221 if { (eval echo "$as_me:13221: \"$ac_compile\"") >&5
13222   (eval $ac_compile) 2>&5
13223   ac_status=$?
13224   echo "$as_me:13224: \$? = $ac_status" >&5
13225   (exit $ac_status); } &&
13226          { ac_try='test -s conftest.$ac_objext'
13227   { (eval echo "$as_me:13227: \"$ac_try\"") >&5
13228   (eval $ac_try) 2>&5
13229   ac_status=$?
13230   echo "$as_me:13230: \$? = $ac_status" >&5
13231   (exit $ac_status); }; }; then
13232   ac_cv_type_signed_char=yes
13233 else
13234   echo "$as_me: failed program was:" >&5
13235 cat conftest.$ac_ext >&5
13236 ac_cv_type_signed_char=no
13237 fi
13238 rm -f conftest.$ac_objext conftest.$ac_ext
13239 fi
13240 echo "$as_me:13240: result: $ac_cv_type_signed_char" >&5
13241 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
13242
13243 echo "$as_me:13243: checking size of signed char" >&5
13244 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
13245 if test "${ac_cv_sizeof_signed_char+set}" = set; then
13246   echo $ECHO_N "(cached) $ECHO_C" >&6
13247 else
13248   if test "$ac_cv_type_signed_char" = yes; then
13249   if test "$cross_compiling" = yes; then
13250   # Depending upon the size, compute the lo and hi bounds.
13251 cat >conftest.$ac_ext <<_ACEOF
13252 #line 13252 "configure"
13253 #include "confdefs.h"
13254 $ac_includes_default
13255 int
13256 main (void)
13257 {
13258 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
13259   ;
13260   return 0;
13261 }
13262 _ACEOF
13263 rm -f conftest.$ac_objext
13264 if { (eval echo "$as_me:13264: \"$ac_compile\"") >&5
13265   (eval $ac_compile) 2>&5
13266   ac_status=$?
13267   echo "$as_me:13267: \$? = $ac_status" >&5
13268   (exit $ac_status); } &&
13269          { ac_try='test -s conftest.$ac_objext'
13270   { (eval echo "$as_me:13270: \"$ac_try\"") >&5
13271   (eval $ac_try) 2>&5
13272   ac_status=$?
13273   echo "$as_me:13273: \$? = $ac_status" >&5
13274   (exit $ac_status); }; }; then
13275   ac_lo=0 ac_mid=0
13276   while :; do
13277     cat >conftest.$ac_ext <<_ACEOF
13278 #line 13278 "configure"
13279 #include "confdefs.h"
13280 $ac_includes_default
13281 int
13282 main (void)
13283 {
13284 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13285   ;
13286   return 0;
13287 }
13288 _ACEOF
13289 rm -f conftest.$ac_objext
13290 if { (eval echo "$as_me:13290: \"$ac_compile\"") >&5
13291   (eval $ac_compile) 2>&5
13292   ac_status=$?
13293   echo "$as_me:13293: \$? = $ac_status" >&5
13294   (exit $ac_status); } &&
13295          { ac_try='test -s conftest.$ac_objext'
13296   { (eval echo "$as_me:13296: \"$ac_try\"") >&5
13297   (eval $ac_try) 2>&5
13298   ac_status=$?
13299   echo "$as_me:13299: \$? = $ac_status" >&5
13300   (exit $ac_status); }; }; then
13301   ac_hi=$ac_mid; break
13302 else
13303   echo "$as_me: failed program was:" >&5
13304 cat conftest.$ac_ext >&5
13305 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
13306 fi
13307 rm -f conftest.$ac_objext conftest.$ac_ext
13308   done
13309 else
13310   echo "$as_me: failed program was:" >&5
13311 cat conftest.$ac_ext >&5
13312 ac_hi=-1 ac_mid=-1
13313   while :; do
13314     cat >conftest.$ac_ext <<_ACEOF
13315 #line 13315 "configure"
13316 #include "confdefs.h"
13317 $ac_includes_default
13318 int
13319 main (void)
13320 {
13321 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
13322   ;
13323   return 0;
13324 }
13325 _ACEOF
13326 rm -f conftest.$ac_objext
13327 if { (eval echo "$as_me:13327: \"$ac_compile\"") >&5
13328   (eval $ac_compile) 2>&5
13329   ac_status=$?
13330   echo "$as_me:13330: \$? = $ac_status" >&5
13331   (exit $ac_status); } &&
13332          { ac_try='test -s conftest.$ac_objext'
13333   { (eval echo "$as_me:13333: \"$ac_try\"") >&5
13334   (eval $ac_try) 2>&5
13335   ac_status=$?
13336   echo "$as_me:13336: \$? = $ac_status" >&5
13337   (exit $ac_status); }; }; then
13338   ac_lo=$ac_mid; break
13339 else
13340   echo "$as_me: failed program was:" >&5
13341 cat conftest.$ac_ext >&5
13342 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
13343 fi
13344 rm -f conftest.$ac_objext conftest.$ac_ext
13345   done
13346 fi
13347 rm -f conftest.$ac_objext conftest.$ac_ext
13348 # Binary search between lo and hi bounds.
13349 while test "x$ac_lo" != "x$ac_hi"; do
13350   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
13351   cat >conftest.$ac_ext <<_ACEOF
13352 #line 13352 "configure"
13353 #include "confdefs.h"
13354 $ac_includes_default
13355 int
13356 main (void)
13357 {
13358 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13359   ;
13360   return 0;
13361 }
13362 _ACEOF
13363 rm -f conftest.$ac_objext
13364 if { (eval echo "$as_me:13364: \"$ac_compile\"") >&5
13365   (eval $ac_compile) 2>&5
13366   ac_status=$?
13367   echo "$as_me:13367: \$? = $ac_status" >&5
13368   (exit $ac_status); } &&
13369          { ac_try='test -s conftest.$ac_objext'
13370   { (eval echo "$as_me:13370: \"$ac_try\"") >&5
13371   (eval $ac_try) 2>&5
13372   ac_status=$?
13373   echo "$as_me:13373: \$? = $ac_status" >&5
13374   (exit $ac_status); }; }; then
13375   ac_hi=$ac_mid
13376 else
13377   echo "$as_me: failed program was:" >&5
13378 cat conftest.$ac_ext >&5
13379 ac_lo=`expr $ac_mid + 1`
13380 fi
13381 rm -f conftest.$ac_objext conftest.$ac_ext
13382 done
13383 ac_cv_sizeof_signed_char=$ac_lo
13384 else
13385   if test "$cross_compiling" = yes; then
13386   { { echo "$as_me:13386: error: cannot run test program while cross compiling" >&5
13387 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
13388    { (exit 1); exit 1; }; }
13389 else
13390   cat >conftest.$ac_ext <<_ACEOF
13391 #line 13391 "configure"
13392 #include "confdefs.h"
13393 $ac_includes_default
13394 int
13395 main (void)
13396 {
13397 FILE *f = fopen ("conftest.val", "w");
13398 if (!f)
13399   $ac_main_return (1);
13400 fprintf (f, "%d", (sizeof (signed char)));
13401 fclose (f);
13402   ;
13403   return 0;
13404 }
13405 _ACEOF
13406 rm -f conftest$ac_exeext
13407 if { (eval echo "$as_me:13407: \"$ac_link\"") >&5
13408   (eval $ac_link) 2>&5
13409   ac_status=$?
13410   echo "$as_me:13410: \$? = $ac_status" >&5
13411   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13412   { (eval echo "$as_me:13412: \"$ac_try\"") >&5
13413   (eval $ac_try) 2>&5
13414   ac_status=$?
13415   echo "$as_me:13415: \$? = $ac_status" >&5
13416   (exit $ac_status); }; }; then
13417   ac_cv_sizeof_signed_char=`cat conftest.val`
13418 else
13419   echo "$as_me: program exited with status $ac_status" >&5
13420 echo "$as_me: failed program was:" >&5
13421 cat conftest.$ac_ext >&5
13422 fi
13423 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13424 fi
13425 fi
13426 rm -f conftest.val
13427 else
13428   ac_cv_sizeof_signed_char=0
13429 fi
13430 fi
13431 echo "$as_me:13431: result: $ac_cv_sizeof_signed_char" >&5
13432 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
13433 cat >>confdefs.h <<EOF
13434 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
13435 EOF
13436
13437 echo "$as_me:13437: checking for ANSI C header files" >&5
13438 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13439 if test "${ac_cv_header_stdc+set}" = set; then
13440   echo $ECHO_N "(cached) $ECHO_C" >&6
13441 else
13442   cat >conftest.$ac_ext <<_ACEOF
13443 #line 13443 "configure"
13444 #include "confdefs.h"
13445 #include <stdlib.h>
13446 #include <stdarg.h>
13447 #include <string.h>
13448 #include <float.h>
13449
13450 _ACEOF
13451 if { (eval echo "$as_me:13451: \"$ac_cpp conftest.$ac_ext\"") >&5
13452   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13453   ac_status=$?
13454   egrep -v '^ *\+' conftest.er1 >conftest.err
13455   rm -f conftest.er1
13456   cat conftest.err >&5
13457   echo "$as_me:13457: \$? = $ac_status" >&5
13458   (exit $ac_status); } >/dev/null; then
13459   if test -s conftest.err; then
13460     ac_cpp_err=$ac_c_preproc_warn_flag
13461   else
13462     ac_cpp_err=
13463   fi
13464 else
13465   ac_cpp_err=yes
13466 fi
13467 if test -z "$ac_cpp_err"; then
13468   ac_cv_header_stdc=yes
13469 else
13470   echo "$as_me: failed program was:" >&5
13471   cat conftest.$ac_ext >&5
13472   ac_cv_header_stdc=no
13473 fi
13474 rm -f conftest.err conftest.$ac_ext
13475
13476 if test $ac_cv_header_stdc = yes; then
13477   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13478   cat >conftest.$ac_ext <<_ACEOF
13479 #line 13479 "configure"
13480 #include "confdefs.h"
13481 #include <string.h>
13482
13483 _ACEOF
13484 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13485   egrep "memchr" >/dev/null 2>&1; then
13486   :
13487 else
13488   ac_cv_header_stdc=no
13489 fi
13490 rm -rf conftest*
13491
13492 fi
13493
13494 if test $ac_cv_header_stdc = yes; then
13495   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13496   cat >conftest.$ac_ext <<_ACEOF
13497 #line 13497 "configure"
13498 #include "confdefs.h"
13499 #include <stdlib.h>
13500
13501 _ACEOF
13502 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13503   egrep "free" >/dev/null 2>&1; then
13504   :
13505 else
13506   ac_cv_header_stdc=no
13507 fi
13508 rm -rf conftest*
13509
13510 fi
13511
13512 if test $ac_cv_header_stdc = yes; then
13513   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13514   if test "$cross_compiling" = yes; then
13515   :
13516 else
13517   cat >conftest.$ac_ext <<_ACEOF
13518 #line 13518 "configure"
13519 #include "confdefs.h"
13520 #include <ctype.h>
13521 #if ((' ' & 0x0FF) == 0x020)
13522 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13523 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13524 #else
13525 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13526                      || ('j' <= (c) && (c) <= 'r') \
13527                      || ('s' <= (c) && (c) <= 'z'))
13528 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13529 #endif
13530
13531 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13532 int
13533 main (void)
13534 {
13535   int i;
13536   for (i = 0; i < 256; i++)
13537     if (XOR (islower (i), ISLOWER (i))
13538         || toupper (i) != TOUPPER (i))
13539       $ac_main_return(2);
13540   $ac_main_return (0);
13541 }
13542 _ACEOF
13543 rm -f conftest$ac_exeext
13544 if { (eval echo "$as_me:13544: \"$ac_link\"") >&5
13545   (eval $ac_link) 2>&5
13546   ac_status=$?
13547   echo "$as_me:13547: \$? = $ac_status" >&5
13548   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13549   { (eval echo "$as_me:13549: \"$ac_try\"") >&5
13550   (eval $ac_try) 2>&5
13551   ac_status=$?
13552   echo "$as_me:13552: \$? = $ac_status" >&5
13553   (exit $ac_status); }; }; then
13554   :
13555 else
13556   echo "$as_me: program exited with status $ac_status" >&5
13557 echo "$as_me: failed program was:" >&5
13558 cat conftest.$ac_ext >&5
13559 ac_cv_header_stdc=no
13560 fi
13561 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13562 fi
13563 fi
13564 fi
13565 echo "$as_me:13565: result: $ac_cv_header_stdc" >&5
13566 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13567 if test $ac_cv_header_stdc = yes; then
13568
13569 cat >>confdefs.h <<\EOF
13570 #define STDC_HEADERS 1
13571 EOF
13572
13573 fi
13574
13575 ac_header_dirent=no
13576 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13577   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13578 echo "$as_me:13578: checking for $ac_hdr that defines DIR" >&5
13579 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13580 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13581   echo $ECHO_N "(cached) $ECHO_C" >&6
13582 else
13583   cat >conftest.$ac_ext <<_ACEOF
13584 #line 13584 "configure"
13585 #include "confdefs.h"
13586 #include <sys/types.h>
13587 #include <$ac_hdr>
13588
13589 int
13590 main (void)
13591 {
13592 if ((DIR *) 0)
13593 return 0;
13594   ;
13595   return 0;
13596 }
13597 _ACEOF
13598 rm -f conftest.$ac_objext
13599 if { (eval echo "$as_me:13599: \"$ac_compile\"") >&5
13600   (eval $ac_compile) 2>&5
13601   ac_status=$?
13602   echo "$as_me:13602: \$? = $ac_status" >&5
13603   (exit $ac_status); } &&
13604          { ac_try='test -s conftest.$ac_objext'
13605   { (eval echo "$as_me:13605: \"$ac_try\"") >&5
13606   (eval $ac_try) 2>&5
13607   ac_status=$?
13608   echo "$as_me:13608: \$? = $ac_status" >&5
13609   (exit $ac_status); }; }; then
13610   eval "$as_ac_Header=yes"
13611 else
13612   echo "$as_me: failed program was:" >&5
13613 cat conftest.$ac_ext >&5
13614 eval "$as_ac_Header=no"
13615 fi
13616 rm -f conftest.$ac_objext conftest.$ac_ext
13617 fi
13618 echo "$as_me:13618: result: `eval echo '${'$as_ac_Header'}'`" >&5
13619 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13620 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13621   cat >>confdefs.h <<EOF
13622 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13623 EOF
13624
13625 ac_header_dirent=$ac_hdr; break
13626 fi
13627
13628 done
13629 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13630 if test $ac_header_dirent = dirent.h; then
13631   echo "$as_me:13631: checking for opendir in -ldir" >&5
13632 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13633 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13634   echo $ECHO_N "(cached) $ECHO_C" >&6
13635 else
13636   ac_check_lib_save_LIBS=$LIBS
13637 LIBS="-ldir  $LIBS"
13638 cat >conftest.$ac_ext <<_ACEOF
13639 #line 13639 "configure"
13640 #include "confdefs.h"
13641
13642 /* Override any gcc2 internal prototype to avoid an error.  */
13643 #ifdef __cplusplus
13644 extern "C"
13645 #endif
13646 /* We use char because int might match the return type of a gcc2
13647    builtin and then its argument prototype would still apply.  */
13648 char opendir ();
13649 int
13650 main (void)
13651 {
13652 opendir ();
13653   ;
13654   return 0;
13655 }
13656 _ACEOF
13657 rm -f conftest.$ac_objext conftest$ac_exeext
13658 if { (eval echo "$as_me:13658: \"$ac_link\"") >&5
13659   (eval $ac_link) 2>&5
13660   ac_status=$?
13661   echo "$as_me:13661: \$? = $ac_status" >&5
13662   (exit $ac_status); } &&
13663          { ac_try='test -s conftest$ac_exeext'
13664   { (eval echo "$as_me:13664: \"$ac_try\"") >&5
13665   (eval $ac_try) 2>&5
13666   ac_status=$?
13667   echo "$as_me:13667: \$? = $ac_status" >&5
13668   (exit $ac_status); }; }; then
13669   ac_cv_lib_dir_opendir=yes
13670 else
13671   echo "$as_me: failed program was:" >&5
13672 cat conftest.$ac_ext >&5
13673 ac_cv_lib_dir_opendir=no
13674 fi
13675 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13676 LIBS=$ac_check_lib_save_LIBS
13677 fi
13678 echo "$as_me:13678: result: $ac_cv_lib_dir_opendir" >&5
13679 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13680 if test $ac_cv_lib_dir_opendir = yes; then
13681   LIBS="$LIBS -ldir"
13682 fi
13683
13684 else
13685   echo "$as_me:13685: checking for opendir in -lx" >&5
13686 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13687 if test "${ac_cv_lib_x_opendir+set}" = set; then
13688   echo $ECHO_N "(cached) $ECHO_C" >&6
13689 else
13690   ac_check_lib_save_LIBS=$LIBS
13691 LIBS="-lx  $LIBS"
13692 cat >conftest.$ac_ext <<_ACEOF
13693 #line 13693 "configure"
13694 #include "confdefs.h"
13695
13696 /* Override any gcc2 internal prototype to avoid an error.  */
13697 #ifdef __cplusplus
13698 extern "C"
13699 #endif
13700 /* We use char because int might match the return type of a gcc2
13701    builtin and then its argument prototype would still apply.  */
13702 char opendir ();
13703 int
13704 main (void)
13705 {
13706 opendir ();
13707   ;
13708   return 0;
13709 }
13710 _ACEOF
13711 rm -f conftest.$ac_objext conftest$ac_exeext
13712 if { (eval echo "$as_me:13712: \"$ac_link\"") >&5
13713   (eval $ac_link) 2>&5
13714   ac_status=$?
13715   echo "$as_me:13715: \$? = $ac_status" >&5
13716   (exit $ac_status); } &&
13717          { ac_try='test -s conftest$ac_exeext'
13718   { (eval echo "$as_me:13718: \"$ac_try\"") >&5
13719   (eval $ac_try) 2>&5
13720   ac_status=$?
13721   echo "$as_me:13721: \$? = $ac_status" >&5
13722   (exit $ac_status); }; }; then
13723   ac_cv_lib_x_opendir=yes
13724 else
13725   echo "$as_me: failed program was:" >&5
13726 cat conftest.$ac_ext >&5
13727 ac_cv_lib_x_opendir=no
13728 fi
13729 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13730 LIBS=$ac_check_lib_save_LIBS
13731 fi
13732 echo "$as_me:13732: result: $ac_cv_lib_x_opendir" >&5
13733 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
13734 if test $ac_cv_lib_x_opendir = yes; then
13735   LIBS="$LIBS -lx"
13736 fi
13737
13738 fi
13739
13740 echo "$as_me:13740: checking whether time.h and sys/time.h may both be included" >&5
13741 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13742 if test "${ac_cv_header_time+set}" = set; then
13743   echo $ECHO_N "(cached) $ECHO_C" >&6
13744 else
13745   cat >conftest.$ac_ext <<_ACEOF
13746 #line 13746 "configure"
13747 #include "confdefs.h"
13748 #include <sys/types.h>
13749 #include <sys/time.h>
13750 #include <time.h>
13751
13752 int
13753 main (void)
13754 {
13755 if ((struct tm *) 0)
13756 return 0;
13757   ;
13758   return 0;
13759 }
13760 _ACEOF
13761 rm -f conftest.$ac_objext
13762 if { (eval echo "$as_me:13762: \"$ac_compile\"") >&5
13763   (eval $ac_compile) 2>&5
13764   ac_status=$?
13765   echo "$as_me:13765: \$? = $ac_status" >&5
13766   (exit $ac_status); } &&
13767          { ac_try='test -s conftest.$ac_objext'
13768   { (eval echo "$as_me:13768: \"$ac_try\"") >&5
13769   (eval $ac_try) 2>&5
13770   ac_status=$?
13771   echo "$as_me:13771: \$? = $ac_status" >&5
13772   (exit $ac_status); }; }; then
13773   ac_cv_header_time=yes
13774 else
13775   echo "$as_me: failed program was:" >&5
13776 cat conftest.$ac_ext >&5
13777 ac_cv_header_time=no
13778 fi
13779 rm -f conftest.$ac_objext conftest.$ac_ext
13780 fi
13781 echo "$as_me:13781: result: $ac_cv_header_time" >&5
13782 echo "${ECHO_T}$ac_cv_header_time" >&6
13783 if test $ac_cv_header_time = yes; then
13784
13785 cat >>confdefs.h <<\EOF
13786 #define TIME_WITH_SYS_TIME 1
13787 EOF
13788
13789 fi
13790
13791 ###     checks for compiler characteristics
13792 ac_ext=c
13793 ac_cpp='$CPP $CPPFLAGS'
13794 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13795 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13796 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13797 ac_main_return=return
13798
13799 echo "$as_me:13799: checking for an ANSI C-conforming const" >&5
13800 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
13801 if test "${ac_cv_c_const+set}" = set; then
13802   echo $ECHO_N "(cached) $ECHO_C" >&6
13803 else
13804   cat >conftest.$ac_ext <<_ACEOF
13805 #line 13805 "configure"
13806 #include "confdefs.h"
13807
13808 int
13809 main (void)
13810 {
13811 /* FIXME: Include the comments suggested by Paul. */
13812 #ifndef __cplusplus
13813   /* Ultrix mips cc rejects this.  */
13814   typedef int charset[2];
13815   const charset x;
13816   /* SunOS 4.1.1 cc rejects this.  */
13817   char const *const *ccp;
13818   char **p;
13819   /* NEC SVR4.0.2 mips cc rejects this.  */
13820   struct point {int x, y;};
13821   static struct point const zero = {0,0};
13822   /* AIX XL C 1.02.0.0 rejects this.
13823      It does not let you subtract one const X* pointer from another in
13824      an arm of an if-expression whose if-part is not a constant
13825      expression */
13826   const char *g = "string";
13827   ccp = &g + (g ? g-g : 0);
13828   /* HPUX 7.0 cc rejects these. */
13829   ++ccp;
13830   p = (char**) ccp;
13831   ccp = (char const *const *) p;
13832   { /* SCO 3.2v4 cc rejects this.  */
13833     char *t;
13834     char const *s = 0 ? (char *) 0 : (char const *) 0;
13835
13836     *t++ = 0;
13837   }
13838   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13839     int x[] = {25, 17};
13840     const int *foo = &x[0];
13841     ++foo;
13842   }
13843   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13844     typedef const int *iptr;
13845     iptr p = 0;
13846     ++p;
13847   }
13848   { /* AIX XL C 1.02.0.0 rejects this saying
13849        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13850     struct s { int j; const int *ap[3]; };
13851     struct s *b; b->j = 5;
13852   }
13853   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13854     const int foo = 10;
13855   }
13856 #endif
13857
13858   ;
13859   return 0;
13860 }
13861 _ACEOF
13862 rm -f conftest.$ac_objext
13863 if { (eval echo "$as_me:13863: \"$ac_compile\"") >&5
13864   (eval $ac_compile) 2>&5
13865   ac_status=$?
13866   echo "$as_me:13866: \$? = $ac_status" >&5
13867   (exit $ac_status); } &&
13868          { ac_try='test -s conftest.$ac_objext'
13869   { (eval echo "$as_me:13869: \"$ac_try\"") >&5
13870   (eval $ac_try) 2>&5
13871   ac_status=$?
13872   echo "$as_me:13872: \$? = $ac_status" >&5
13873   (exit $ac_status); }; }; then
13874   ac_cv_c_const=yes
13875 else
13876   echo "$as_me: failed program was:" >&5
13877 cat conftest.$ac_ext >&5
13878 ac_cv_c_const=no
13879 fi
13880 rm -f conftest.$ac_objext conftest.$ac_ext
13881 fi
13882 echo "$as_me:13882: result: $ac_cv_c_const" >&5
13883 echo "${ECHO_T}$ac_cv_c_const" >&6
13884 if test $ac_cv_c_const = no; then
13885
13886 cat >>confdefs.h <<\EOF
13887 #define const
13888 EOF
13889
13890 fi
13891
13892 ###     Checks for external-data
13893
13894 echo "$as_me:13894: checking if data-only library module links" >&5
13895 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
13896 if test "${cf_cv_link_dataonly+set}" = set; then
13897   echo $ECHO_N "(cached) $ECHO_C" >&6
13898 else
13899
13900         rm -f conftest.a
13901         cat >conftest.$ac_ext <<EOF
13902 #line 13902 "configure"
13903 int     testdata[3] = { 123, 456, 789 };
13904 EOF
13905         if { (eval echo "$as_me:13905: \"$ac_compile\"") >&5
13906   (eval $ac_compile) 2>&5
13907   ac_status=$?
13908   echo "$as_me:13908: \$? = $ac_status" >&5
13909   (exit $ac_status); } ; then
13910                 mv conftest.o data.o && \
13911                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
13912         fi
13913         rm -f conftest.$ac_ext data.o
13914         cat >conftest.$ac_ext <<EOF
13915 #line 13915 "configure"
13916 int     testfunc(void)
13917 {
13918 #if defined(NeXT)
13919         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
13920 #else
13921         extern int testdata[3];
13922         return testdata[0] == 123
13923            &&  testdata[1] == 456
13924            &&  testdata[2] == 789;
13925 #endif
13926 }
13927 EOF
13928         if { (eval echo "$as_me:13928: \"$ac_compile\"") >&5
13929   (eval $ac_compile) 2>&5
13930   ac_status=$?
13931   echo "$as_me:13931: \$? = $ac_status" >&5
13932   (exit $ac_status); }; then
13933                 mv conftest.o func.o && \
13934                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
13935         fi
13936         rm -f conftest.$ac_ext func.o
13937         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
13938         cf_saveLIBS="$LIBS"
13939         LIBS="conftest.a $LIBS"
13940         if test "$cross_compiling" = yes; then
13941   cf_cv_link_dataonly=unknown
13942 else
13943   cat >conftest.$ac_ext <<_ACEOF
13944 #line 13944 "configure"
13945 #include "confdefs.h"
13946
13947         int main(void)
13948         {
13949                 extern int testfunc();
13950                 ${cf_cv_main_return:-return} (!testfunc());
13951         }
13952
13953 _ACEOF
13954 rm -f conftest$ac_exeext
13955 if { (eval echo "$as_me:13955: \"$ac_link\"") >&5
13956   (eval $ac_link) 2>&5
13957   ac_status=$?
13958   echo "$as_me:13958: \$? = $ac_status" >&5
13959   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13960   { (eval echo "$as_me:13960: \"$ac_try\"") >&5
13961   (eval $ac_try) 2>&5
13962   ac_status=$?
13963   echo "$as_me:13963: \$? = $ac_status" >&5
13964   (exit $ac_status); }; }; then
13965   cf_cv_link_dataonly=yes
13966 else
13967   echo "$as_me: program exited with status $ac_status" >&5
13968 echo "$as_me: failed program was:" >&5
13969 cat conftest.$ac_ext >&5
13970 cf_cv_link_dataonly=no
13971 fi
13972 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13973 fi
13974         LIBS="$cf_saveLIBS"
13975
13976 fi
13977
13978 echo "$as_me:13978: result: $cf_cv_link_dataonly" >&5
13979 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13980
13981 if test "$cf_cv_link_dataonly" = no ; then
13982
13983 cat >>confdefs.h <<\EOF
13984 #define BROKEN_LINKER 1
13985 EOF
13986
13987         BROKEN_LINKER=1
13988 fi
13989
13990 ###     Checks for library functions.
13991
13992 for ac_header in \
13993 unistd.h \
13994
13995 do
13996 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13997 echo "$as_me:13997: checking for $ac_header" >&5
13998 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13999 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14000   echo $ECHO_N "(cached) $ECHO_C" >&6
14001 else
14002   cat >conftest.$ac_ext <<_ACEOF
14003 #line 14003 "configure"
14004 #include "confdefs.h"
14005 #include <$ac_header>
14006 _ACEOF
14007 if { (eval echo "$as_me:14007: \"$ac_cpp conftest.$ac_ext\"") >&5
14008   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14009   ac_status=$?
14010   egrep -v '^ *\+' conftest.er1 >conftest.err
14011   rm -f conftest.er1
14012   cat conftest.err >&5
14013   echo "$as_me:14013: \$? = $ac_status" >&5
14014   (exit $ac_status); } >/dev/null; then
14015   if test -s conftest.err; then
14016     ac_cpp_err=$ac_c_preproc_warn_flag
14017   else
14018     ac_cpp_err=
14019   fi
14020 else
14021   ac_cpp_err=yes
14022 fi
14023 if test -z "$ac_cpp_err"; then
14024   eval "$as_ac_Header=yes"
14025 else
14026   echo "$as_me: failed program was:" >&5
14027   cat conftest.$ac_ext >&5
14028   eval "$as_ac_Header=no"
14029 fi
14030 rm -f conftest.err conftest.$ac_ext
14031 fi
14032 echo "$as_me:14032: result: `eval echo '${'$as_ac_Header'}'`" >&5
14033 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14034 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14035   cat >>confdefs.h <<EOF
14036 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14037 EOF
14038
14039 fi
14040 done
14041
14042 echo "$as_me:14042: checking for working mkstemp" >&5
14043 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
14044 if test "${cf_cv_func_mkstemp+set}" = set; then
14045   echo $ECHO_N "(cached) $ECHO_C" >&6
14046 else
14047
14048 rm -rf conftest*
14049 if test "$cross_compiling" = yes; then
14050   cf_cv_func_mkstemp=maybe
14051 else
14052   cat >conftest.$ac_ext <<_ACEOF
14053 #line 14053 "configure"
14054 #include "confdefs.h"
14055
14056 #include <sys/types.h>
14057 #ifdef HAVE_UNISTD_H
14058 #include <unistd.h>
14059 #endif
14060 #include <stdlib.h>
14061 #include <stdio.h>
14062 #include <string.h>
14063 #include <sys/stat.h>
14064 int main(void)
14065 {
14066         char *tmpl = "conftestXXXXXX";
14067         char name[2][80];
14068         int n;
14069         int result = 0;
14070         int fd;
14071         struct stat sb;
14072
14073         umask(077);
14074         for (n = 0; n < 2; ++n) {
14075                 strcpy(name[n], tmpl);
14076                 if ((fd = mkstemp(name[n])) >= 0) {
14077                         if (!strcmp(name[n], tmpl)
14078                          || stat(name[n], &sb) != 0
14079                          || (sb.st_mode & S_IFMT) != S_IFREG
14080                          || (sb.st_mode & 077) != 0) {
14081                                 result = 1;
14082                         }
14083                         close(fd);
14084                 }
14085         }
14086         if (result == 0
14087          && !strcmp(name[0], name[1]))
14088                 result = 1;
14089         ${cf_cv_main_return:-return}(result);
14090 }
14091
14092 _ACEOF
14093 rm -f conftest$ac_exeext
14094 if { (eval echo "$as_me:14094: \"$ac_link\"") >&5
14095   (eval $ac_link) 2>&5
14096   ac_status=$?
14097   echo "$as_me:14097: \$? = $ac_status" >&5
14098   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14099   { (eval echo "$as_me:14099: \"$ac_try\"") >&5
14100   (eval $ac_try) 2>&5
14101   ac_status=$?
14102   echo "$as_me:14102: \$? = $ac_status" >&5
14103   (exit $ac_status); }; }; then
14104   cf_cv_func_mkstemp=yes
14105
14106 else
14107   echo "$as_me: program exited with status $ac_status" >&5
14108 echo "$as_me: failed program was:" >&5
14109 cat conftest.$ac_ext >&5
14110 cf_cv_func_mkstemp=no
14111
14112 fi
14113 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14114 fi
14115
14116 fi
14117 echo "$as_me:14117: result: $cf_cv_func_mkstemp" >&5
14118 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
14119 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
14120         echo "$as_me:14120: checking for mkstemp" >&5
14121 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
14122 if test "${ac_cv_func_mkstemp+set}" = set; then
14123   echo $ECHO_N "(cached) $ECHO_C" >&6
14124 else
14125   cat >conftest.$ac_ext <<_ACEOF
14126 #line 14126 "configure"
14127 #include "confdefs.h"
14128 /* System header to define __stub macros and hopefully few prototypes,
14129     which can conflict with char mkstemp (); below.  */
14130 #include <assert.h>
14131 /* Override any gcc2 internal prototype to avoid an error.  */
14132 #ifdef __cplusplus
14133 extern "C"
14134 #endif
14135 /* We use char because int might match the return type of a gcc2
14136    builtin and then its argument prototype would still apply.  */
14137 char mkstemp ();
14138 char (*f) ();
14139
14140 int
14141 main (void)
14142 {
14143 /* The GNU C library defines this for functions which it implements
14144     to always fail with ENOSYS.  Some functions are actually named
14145     something starting with __ and the normal name is an alias.  */
14146 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
14147 choke me
14148 #else
14149 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14150 #endif
14151
14152   ;
14153   return 0;
14154 }
14155 _ACEOF
14156 rm -f conftest.$ac_objext conftest$ac_exeext
14157 if { (eval echo "$as_me:14157: \"$ac_link\"") >&5
14158   (eval $ac_link) 2>&5
14159   ac_status=$?
14160   echo "$as_me:14160: \$? = $ac_status" >&5
14161   (exit $ac_status); } &&
14162          { ac_try='test -s conftest$ac_exeext'
14163   { (eval echo "$as_me:14163: \"$ac_try\"") >&5
14164   (eval $ac_try) 2>&5
14165   ac_status=$?
14166   echo "$as_me:14166: \$? = $ac_status" >&5
14167   (exit $ac_status); }; }; then
14168   ac_cv_func_mkstemp=yes
14169 else
14170   echo "$as_me: failed program was:" >&5
14171 cat conftest.$ac_ext >&5
14172 ac_cv_func_mkstemp=no
14173 fi
14174 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14175 fi
14176 echo "$as_me:14176: result: $ac_cv_func_mkstemp" >&5
14177 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
14178
14179 fi
14180 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
14181
14182 cat >>confdefs.h <<\EOF
14183 #define HAVE_MKSTEMP 1
14184 EOF
14185
14186 fi
14187
14188 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
14189         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
14190         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
14191 fi
14192
14193 cf_with_ada=yes
14194 if test "$cf_with_ada" != "no" ; then
14195
14196 cf_ada_make=gnatmake
14197 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
14198 set dummy $cf_ada_make; ac_word=$2
14199 echo "$as_me:14199: checking for $ac_word" >&5
14200 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14201 if test "${ac_cv_prog_gnat_exists+set}" = set; then
14202   echo $ECHO_N "(cached) $ECHO_C" >&6
14203 else
14204   if test -n "$gnat_exists"; then
14205   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
14206 else
14207   ac_save_IFS=$IFS; IFS=$ac_path_separator
14208 ac_dummy="$PATH"
14209 for ac_dir in $ac_dummy; do
14210   IFS=$ac_save_IFS
14211   test -z "$ac_dir" && ac_dir=.
14212   $as_executable_p "$ac_dir/$ac_word" || continue
14213 ac_cv_prog_gnat_exists="yes"
14214 echo "$as_me:14214: found $ac_dir/$ac_word" >&5
14215 break
14216 done
14217
14218   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
14219 fi
14220 fi
14221 gnat_exists=$ac_cv_prog_gnat_exists
14222 if test -n "$gnat_exists"; then
14223   echo "$as_me:14223: result: $gnat_exists" >&5
14224 echo "${ECHO_T}$gnat_exists" >&6
14225 else
14226   echo "$as_me:14226: result: no" >&5
14227 echo "${ECHO_T}no" >&6
14228 fi
14229
14230 if test "$ac_cv_prog_gnat_exists" = no; then
14231         cf_ada_make=
14232         cf_cv_prog_gnat_correct=no
14233 else
14234
14235 echo "$as_me:14235: checking for gnat version" >&5
14236 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
14237 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
14238         grep '[0-9].[0-9][0-9]*' |\
14239         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
14240 echo "$as_me:14240: result: $cf_gnat_version" >&5
14241 echo "${ECHO_T}$cf_gnat_version" >&6
14242
14243 case $cf_gnat_version in
14244 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
14245         cf_cv_prog_gnat_correct=yes
14246         ;;
14247 (*)
14248         { echo "$as_me:14248: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
14249 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
14250         cf_cv_prog_gnat_correct=no
14251         ;;
14252 esac
14253
14254         # Extract the first word of "m4", so it can be a program name with args.
14255 set dummy m4; ac_word=$2
14256 echo "$as_me:14256: checking for $ac_word" >&5
14257 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14258 if test "${ac_cv_prog_M4_exists+set}" = set; then
14259   echo $ECHO_N "(cached) $ECHO_C" >&6
14260 else
14261   if test -n "$M4_exists"; then
14262   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
14263 else
14264   ac_save_IFS=$IFS; IFS=$ac_path_separator
14265 ac_dummy="$PATH"
14266 for ac_dir in $ac_dummy; do
14267   IFS=$ac_save_IFS
14268   test -z "$ac_dir" && ac_dir=.
14269   $as_executable_p "$ac_dir/$ac_word" || continue
14270 ac_cv_prog_M4_exists="yes"
14271 echo "$as_me:14271: found $ac_dir/$ac_word" >&5
14272 break
14273 done
14274
14275   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
14276 fi
14277 fi
14278 M4_exists=$ac_cv_prog_M4_exists
14279 if test -n "$M4_exists"; then
14280   echo "$as_me:14280: result: $M4_exists" >&5
14281 echo "${ECHO_T}$M4_exists" >&6
14282 else
14283   echo "$as_me:14283: result: no" >&5
14284 echo "${ECHO_T}no" >&6
14285 fi
14286
14287         if test "$ac_cv_prog_M4_exists" = no; then
14288                 cf_cv_prog_gnat_correct=no
14289                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
14290         fi
14291         if test "$cf_cv_prog_gnat_correct" = yes; then
14292                 echo "$as_me:14292: checking if GNAT works" >&5
14293 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
14294
14295 rm -rf conftest* *~conftest*
14296 cat >>conftest.ads <<CF_EOF
14297 procedure conftest;
14298 CF_EOF
14299 cat >>conftest.adb <<CF_EOF
14300 with Text_IO;
14301 with GNAT.OS_Lib;
14302 procedure conftest is
14303 begin
14304    Text_IO.Put ("Hello World");
14305    Text_IO.New_Line;
14306    GNAT.OS_Lib.OS_Exit (0);
14307 end conftest;
14308 CF_EOF
14309 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14310    if ( ./conftest 1>&5 2>&1 ) ; then
14311       cf_cv_prog_gnat_correct=yes
14312    else
14313       cf_cv_prog_gnat_correct=no
14314    fi
14315 else
14316    cf_cv_prog_gnat_correct=no
14317 fi
14318 rm -rf conftest* *~conftest*
14319
14320                 echo "$as_me:14320: result: $cf_cv_prog_gnat_correct" >&5
14321 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
14322         fi
14323 fi
14324
14325         if test "$cf_cv_prog_gnat_correct" = yes; then
14326
14327         echo "$as_me:14327: checking optimization options for ADAFLAGS" >&5
14328 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
14329         case "$CFLAGS" in
14330         (*-g*)
14331
14332         ADAFLAGS="$ADAFLAGS -g"
14333
14334                 ;;
14335         esac
14336         case "$CFLAGS" in
14337         (*-O*)
14338                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
14339
14340         ADAFLAGS="$ADAFLAGS $cf_O_flag"
14341
14342                 ;;
14343         esac
14344         echo "$as_me:14344: result: $ADAFLAGS" >&5
14345 echo "${ECHO_T}$ADAFLAGS" >&6
14346
14347 echo "$as_me:14347: checking if GNATPREP supports -T option" >&5
14348 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
14349 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
14350   echo $ECHO_N "(cached) $ECHO_C" >&6
14351 else
14352
14353 cf_cv_gnatprep_opt_t=no
14354 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
14355
14356 fi
14357 echo "$as_me:14357: result: $cf_cv_gnatprep_opt_t" >&5
14358 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
14359 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
14360
14361 echo "$as_me:14361: checking if GNAT supports generics" >&5
14362 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
14363 case $cf_gnat_version in
14364 (3.[1-9]*|[4-9].*)
14365         cf_gnat_generics=yes
14366         ;;
14367 (*)
14368         cf_gnat_generics=no
14369         ;;
14370 esac
14371 echo "$as_me:14371: result: $cf_gnat_generics" >&5
14372 echo "${ECHO_T}$cf_gnat_generics" >&6
14373
14374 if test "$cf_gnat_generics" = yes
14375 then
14376         cf_compile_generics=generics
14377         cf_generic_objects="\${GENOBJS}"
14378 else
14379         cf_compile_generics=
14380         cf_generic_objects=
14381 fi
14382
14383 echo "$as_me:14383: checking if GNAT supports SIGINT" >&5
14384 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
14385 if test "${cf_cv_gnat_sigint+set}" = set; then
14386   echo $ECHO_N "(cached) $ECHO_C" >&6
14387 else
14388
14389 rm -rf conftest* *~conftest*
14390 cat >>conftest.ads <<CF_EOF
14391 with Ada.Interrupts.Names;
14392
14393 package ConfTest is
14394
14395    pragma Warnings (Off);  --  the next pragma exists since 3.11p
14396    pragma Unreserve_All_Interrupts;
14397    pragma Warnings (On);
14398
14399    protected Process is
14400       procedure Stop;
14401       function Continue return Boolean;
14402       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
14403    private
14404       Done : Boolean := False;
14405    end Process;
14406
14407 end ConfTest;
14408 CF_EOF
14409 cat >>conftest.adb <<CF_EOF
14410 package body ConfTest is
14411    protected body Process is
14412       procedure Stop is
14413       begin
14414          Done := True;
14415       end Stop;
14416       function Continue return Boolean is
14417       begin
14418          return not Done;
14419       end Continue;
14420    end Process;
14421 end ConfTest;
14422 CF_EOF
14423 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14424       cf_cv_gnat_sigint=yes
14425 else
14426    cf_cv_gnat_sigint=no
14427 fi
14428 rm -rf conftest* *~conftest*
14429
14430 fi
14431 echo "$as_me:14431: result: $cf_cv_gnat_sigint" >&5
14432 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
14433
14434 if test $cf_cv_gnat_sigint = yes ; then
14435         USE_GNAT_SIGINT=""
14436 else
14437         USE_GNAT_SIGINT="#"
14438 fi
14439
14440 cf_gnat_libraries=no
14441 cf_gnat_projects=no
14442
14443 if test "$enable_gnat_projects" != no ; then
14444 echo "$as_me:14444: checking if GNAT supports project files" >&5
14445 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
14446 case $cf_gnat_version in
14447 (3.[0-9]*)
14448         ;;
14449 (*)
14450         case $cf_cv_system_name in
14451         (cygwin*|msys*)
14452                 ;;
14453         (*)
14454                 mkdir conftest.src conftest.bin conftest.lib
14455                 cd conftest.src
14456                 rm -rf conftest* *~conftest*
14457                 cat >>library.gpr <<CF_EOF
14458 project Library is
14459   Kind := External ("LIB_KIND");
14460   for Library_Name use "ConfTest";
14461   for Object_Dir use ".";
14462   for Library_ALI_Dir use External("LIBRARY_DIR");
14463   for Library_Version use External ("SONAME");
14464   for Library_Kind use Kind;
14465   for Library_Dir use External("BUILD_DIR");
14466   Source_Dir := External ("SOURCE_DIR");
14467   for Source_Dirs use (Source_Dir);
14468 end Library;
14469 CF_EOF
14470                 cat >>confpackage.ads <<CF_EOF
14471 package ConfPackage is
14472    procedure conftest;
14473 end ConfPackage;
14474 CF_EOF
14475                 cat >>confpackage.adb <<CF_EOF
14476 with Text_IO;
14477 package body ConfPackage is
14478    procedure conftest is
14479    begin
14480       Text_IO.Put ("Hello World");
14481       Text_IO.New_Line;
14482    end conftest;
14483 end ConfPackage;
14484 CF_EOF
14485                 if ( $cf_ada_make $ADAFLAGS \
14486                                 -Plibrary.gpr \
14487                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
14488                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
14489                                 -XSOURCE_DIR=`pwd` \
14490                                 -XSONAME=libConfTest.so.1 \
14491                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
14492                         cf_gnat_projects=yes
14493                 fi
14494                 cd ..
14495                 if test -f conftest.lib/confpackage.ali
14496                 then
14497                         cf_gnat_libraries=yes
14498                 fi
14499                 rm -rf conftest* *~conftest*
14500                 ;;
14501         esac
14502         ;;
14503 esac
14504 echo "$as_me:14504: result: $cf_gnat_projects" >&5
14505 echo "${ECHO_T}$cf_gnat_projects" >&6
14506 fi # enable_gnat_projects
14507
14508 if test $cf_gnat_projects = yes
14509 then
14510         echo "$as_me:14510: checking if GNAT supports libraries" >&5
14511 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
14512         echo "$as_me:14512: result: $cf_gnat_libraries" >&5
14513 echo "${ECHO_T}$cf_gnat_libraries" >&6
14514 fi
14515
14516 if test "$cf_gnat_projects" = yes
14517 then
14518         USE_OLD_MAKERULES="#"
14519         USE_GNAT_PROJECTS=""
14520 else
14521         USE_OLD_MAKERULES=""
14522         USE_GNAT_PROJECTS="#"
14523 fi
14524
14525 if test "$cf_gnat_libraries" = yes
14526 then
14527         USE_GNAT_LIBRARIES=""
14528 else
14529         USE_GNAT_LIBRARIES="#"
14530 fi
14531
14532 echo "$as_me:14532: checking for ada-compiler" >&5
14533 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
14534
14535 # Check whether --with-ada-compiler or --without-ada-compiler was given.
14536 if test "${with_ada_compiler+set}" = set; then
14537   withval="$with_ada_compiler"
14538   cf_ada_compiler=$withval
14539 else
14540   cf_ada_compiler=gnatmake
14541 fi;
14542
14543 echo "$as_me:14543: result: $cf_ada_compiler" >&5
14544 echo "${ECHO_T}$cf_ada_compiler" >&6
14545
14546                 cf_ada_package=terminal_interface
14547
14548 echo "$as_me:14548: checking for ada-include" >&5
14549 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14550
14551 # Check whether --with-ada-include or --without-ada-include was given.
14552 if test "${with_ada_include+set}" = set; then
14553   withval="$with_ada_include"
14554
14555 else
14556   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14557 fi; if test -n "$prefix/share/ada/adainclude" ; then
14558
14559 if test "x$prefix" != xNONE; then
14560         cf_path_syntax="$prefix"
14561 else
14562         cf_path_syntax="$ac_default_prefix"
14563 fi
14564
14565 case ".$withval" in
14566 (.\$\(*\)*|.\'*\'*)
14567         ;;
14568 (..|./*|.\\*)
14569         ;;
14570 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14571         ;;
14572 (.\${*prefix}*|.\${*dir}*)
14573         eval withval="$withval"
14574         case ".$withval" in
14575         (.NONE/*)
14576                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14577                 ;;
14578         esac
14579         ;;
14580 (.no|.NONE/*)
14581         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14582         ;;
14583 (*)
14584         { { echo "$as_me:14584: error: expected a pathname, not \"$withval\"" >&5
14585 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14586    { (exit 1); exit 1; }; }
14587         ;;
14588 esac
14589
14590 fi
14591 eval ADA_INCLUDE="$withval"
14592
14593 echo "$as_me:14593: result: $ADA_INCLUDE" >&5
14594 echo "${ECHO_T}$ADA_INCLUDE" >&6
14595
14596 echo "$as_me:14596: checking for ada-objects" >&5
14597 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14598
14599 # Check whether --with-ada-objects or --without-ada-objects was given.
14600 if test "${with_ada_objects+set}" = set; then
14601   withval="$with_ada_objects"
14602
14603 else
14604   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14605 fi; if test -n "$prefix/lib/ada/adalib" ; then
14606
14607 if test "x$prefix" != xNONE; then
14608         cf_path_syntax="$prefix"
14609 else
14610         cf_path_syntax="$ac_default_prefix"
14611 fi
14612
14613 case ".$withval" in
14614 (.\$\(*\)*|.\'*\'*)
14615         ;;
14616 (..|./*|.\\*)
14617         ;;
14618 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14619         ;;
14620 (.\${*prefix}*|.\${*dir}*)
14621         eval withval="$withval"
14622         case ".$withval" in
14623         (.NONE/*)
14624                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14625                 ;;
14626         esac
14627         ;;
14628 (.no|.NONE/*)
14629         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14630         ;;
14631 (*)
14632         { { echo "$as_me:14632: error: expected a pathname, not \"$withval\"" >&5
14633 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14634    { (exit 1); exit 1; }; }
14635         ;;
14636 esac
14637
14638 fi
14639 eval ADA_OBJECTS="$withval"
14640
14641 echo "$as_me:14641: result: $ADA_OBJECTS" >&5
14642 echo "${ECHO_T}$ADA_OBJECTS" >&6
14643
14644 echo "$as_me:14644: checking if an Ada95 shared-library should be built" >&5
14645 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
14646
14647 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
14648 if test "${with_ada_sharedlib+set}" = set; then
14649   withval="$with_ada_sharedlib"
14650   with_ada_sharedlib=$withval
14651 else
14652   with_ada_sharedlib=no
14653 fi;
14654 echo "$as_me:14654: result: $with_ada_sharedlib" >&5
14655 echo "${ECHO_T}$with_ada_sharedlib" >&6
14656
14657 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
14658 MAKE_ADA_SHAREDLIB="#"
14659
14660 if test "x$with_ada_sharedlib" != xno
14661 then
14662         MAKE_ADA_SHAREDLIB=
14663         if test "x$with_ada_sharedlib" != xyes
14664         then
14665                 ADA_SHAREDLIB="$with_ada_sharedlib"
14666         fi
14667 fi
14668
14669         else
14670                 { { echo "$as_me:14670: error: No usable Ada compiler found" >&5
14671 echo "$as_me: error: No usable Ada compiler found" >&2;}
14672    { (exit 1); exit 1; }; }
14673         fi
14674 else
14675         { { echo "$as_me:14675: error: The Ada compiler is needed for this package" >&5
14676 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
14677    { (exit 1); exit 1; }; }
14678 fi
14679
14680 ################################################################################
14681
14682 # not needed
14683 TINFO_LDFLAGS2=
14684
14685 TINFO_LIBS=
14686
14687 ### Construct the list of include-directories to be generated
14688
14689 if test "$srcdir" != "."; then
14690         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
14691 fi
14692 CPPFLAGS="-I../include $CPPFLAGS"
14693 if test "$srcdir" != "."; then
14694         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
14695 fi
14696 CPPFLAGS="-I. $CPPFLAGS"
14697
14698 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
14699 if test "$srcdir" != "."; then
14700         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
14701 fi
14702 if test "$GCC" != yes; then
14703         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14704 elif test "$includedir" != "/usr/include"; then
14705         if test "$includedir" = '${prefix}/include' ; then
14706                 if test x$prefix != x/usr ; then
14707                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14708                 fi
14709         else
14710                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14711         fi
14712 fi
14713
14714 ### Build up pieces for makefile rules
14715 echo "$as_me:14715: checking default library suffix" >&5
14716 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
14717
14718         case $DFT_LWR_MODEL in
14719         (libtool) DFT_ARG_SUFFIX=''   ;;
14720         (normal)  DFT_ARG_SUFFIX=''   ;;
14721         (debug)   DFT_ARG_SUFFIX='_g' ;;
14722         (profile) DFT_ARG_SUFFIX='_p' ;;
14723         (shared)  DFT_ARG_SUFFIX=''   ;;
14724         esac
14725         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
14726 echo "$as_me:14726: result: $DFT_ARG_SUFFIX" >&5
14727 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
14728
14729 echo "$as_me:14729: checking default library-dependency suffix" >&5
14730 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
14731
14732         case X$DFT_LWR_MODEL in
14733         (Xlibtool)
14734                 DFT_LIB_SUFFIX='.la'
14735                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14736                 ;;
14737         (Xdebug)
14738                 DFT_LIB_SUFFIX='_g.a'
14739                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14740                 ;;
14741         (Xprofile)
14742                 DFT_LIB_SUFFIX='_p.a'
14743                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14744                 ;;
14745         (Xshared)
14746                 case $cf_cv_system_name in
14747                 (aix[5-7]*)
14748                         DFT_LIB_SUFFIX='.so'
14749                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14750                         ;;
14751                 (cygwin*|msys*|mingw*)
14752                         DFT_LIB_SUFFIX='.dll'
14753                         DFT_DEP_SUFFIX='.dll.a'
14754                         ;;
14755                 (darwin*)
14756                         DFT_LIB_SUFFIX='.dylib'
14757                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14758                         ;;
14759                 (hpux*)
14760                         case $target in
14761                         (ia64*)
14762                                 DFT_LIB_SUFFIX='.so'
14763                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14764                                 ;;
14765                         (*)
14766                                 DFT_LIB_SUFFIX='.sl'
14767                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14768                                 ;;
14769                         esac
14770                         ;;
14771                 (*)
14772                         DFT_LIB_SUFFIX='.so'
14773                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14774                         ;;
14775                 esac
14776                 ;;
14777         (*)
14778                 DFT_LIB_SUFFIX='.a'
14779                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14780                 ;;
14781         esac
14782         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
14783         then
14784                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
14785                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
14786         fi
14787 echo "$as_me:14787: result: $DFT_DEP_SUFFIX" >&5
14788 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
14789
14790 echo "$as_me:14790: checking default object directory" >&5
14791 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
14792
14793         case $DFT_LWR_MODEL in
14794         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
14795         (normal)  DFT_OBJ_SUBDIR='objects' ;;
14796         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
14797         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
14798         (shared)
14799                 case $cf_cv_system_name in
14800                 (cygwin|msys)
14801                         DFT_OBJ_SUBDIR='objects' ;;
14802                 (*)
14803                         DFT_OBJ_SUBDIR='obj_s' ;;
14804                 esac
14805         esac
14806 echo "$as_me:14806: result: $DFT_OBJ_SUBDIR" >&5
14807 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
14808
14809 ### Set up low-level terminfo dependencies for makefiles.
14810
14811 if test "$DFT_LWR_MODEL" = shared ; then
14812         case $cf_cv_system_name in
14813         (cygwin*)
14814                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
14815                 ;;
14816         (msys*)
14817                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
14818                 ;;
14819         esac
14820 fi
14821
14822 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
14823
14824 ### Construct the list of subdirectories for which we'll customize makefiles
14825 ### with the appropriate compile-rules.
14826
14827 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
14828
14829 cat >>confdefs.h <<EOF
14830 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
14831 EOF
14832
14833 ### Now that we're done running tests, add the compiler-warnings, if any
14834
14835 cf_fix_cppflags=no
14836 cf_new_cflags=
14837 cf_new_cppflags=
14838 cf_new_extra_cppflags=
14839
14840 for cf_add_cflags in $EXTRA_CFLAGS
14841 do
14842 case $cf_fix_cppflags in
14843 (no)
14844         case $cf_add_cflags in
14845         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14846                 case $cf_add_cflags in
14847                 (-D*)
14848                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14849
14850                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14851                                 && test -z "${cf_tst_cflags}" \
14852                                 && cf_fix_cppflags=yes
14853
14854                         if test $cf_fix_cppflags = yes ; then
14855
14856         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14857         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14858
14859                                 continue
14860                         elif test "${cf_tst_cflags}" = "\"'" ; then
14861
14862         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14863         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14864
14865                                 continue
14866                         fi
14867                         ;;
14868                 esac
14869                 case "$CPPFLAGS" in
14870                 (*$cf_add_cflags)
14871                         ;;
14872                 (*)
14873                         case $cf_add_cflags in
14874                         (-D*)
14875                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14876
14877 CPPFLAGS=`echo "$CPPFLAGS" | \
14878         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14879                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14880
14881                                 ;;
14882                         esac
14883
14884         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14885         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14886
14887                         ;;
14888                 esac
14889                 ;;
14890         (*)
14891
14892         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14893         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14894
14895                 ;;
14896         esac
14897         ;;
14898 (yes)
14899
14900         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14901         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14902
14903         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14904
14905         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14906                 && test -z "${cf_tst_cflags}" \
14907                 && cf_fix_cppflags=no
14908         ;;
14909 esac
14910 done
14911
14912 if test -n "$cf_new_cflags" ; then
14913
14914         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14915         CFLAGS="${CFLAGS}$cf_new_cflags"
14916
14917 fi
14918
14919 if test -n "$cf_new_cppflags" ; then
14920
14921         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14922         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14923
14924 fi
14925
14926 if test -n "$cf_new_extra_cppflags" ; then
14927
14928         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14929         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14930
14931 fi
14932
14933 ################################################################################
14934
14935 TEST_ARG2=
14936
14937 TEST_LIBS2=
14938
14939 NCURSES_SHLIB2="sh -c"
14940
14941 ADA_SUBDIRS="include gen src doc"
14942 if test "x$cf_with_tests" != "xno" ; then
14943         ADA_SUBDIRS="$ADA_SUBDIRS samples"
14944 fi
14945 for cf_dir in $ADA_SUBDIRS
14946 do
14947         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
14948 done
14949
14950 NCURSES_TREE="#"
14951
14952 EXTERNAL_TREE=
14953
14954 # match layout used by make-tar.sh
14955 ADAHTML_DIR=../doc/ada
14956
14957 if test "x$cross_compiling" = xyes ; then
14958         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
14959 else
14960         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
14961 fi
14962
14963 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
14964 ac_config_commands="$ac_config_commands default"
14965 cat >confcache <<\_ACEOF
14966 # This file is a shell script that caches the results of configure
14967 # tests run on this system so they can be shared between configure
14968 # scripts and configure runs, see configure's option --config-cache.
14969 # It is not useful on other systems.  If it contains results you don't
14970 # want to keep, you may remove or edit it.
14971 #
14972 # config.status only pays attention to the cache file if you give it
14973 # the --recheck option to rerun configure.
14974 #
14975 # `ac_cv_env_foo' variables (set or unset) will be overriden when
14976 # loading this file, other *unset* `ac_cv_foo' will be assigned the
14977 # following values.
14978
14979 _ACEOF
14980
14981 # The following way of writing the cache mishandles newlines in values,
14982 # but we know of no workaround that is simple, portable, and efficient.
14983 # So, don't put newlines in cache variables' values.
14984 # Ultrix sh set writes to stderr and can't be redirected directly,
14985 # and sets the high bit in the cache file unless we assign to the vars.
14986 {
14987   (set) 2>&1 |
14988     case `(ac_space=' '; set | grep ac_space) 2>&1` in
14989     *ac_space=\ *)
14990       # `set' does not quote correctly, so add quotes (double-quote
14991       # substitution turns \\\\ into \\, and sed turns \\ into \).
14992       sed -n \
14993         "s/'/'\\\\''/g;
14994           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14995       ;;
14996     *)
14997       # `set' quotes correctly as required by POSIX, so do not add quotes.
14998       sed -n \
14999         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
15000       ;;
15001     esac;
15002 } |
15003   sed '
15004      t clear
15005      : clear
15006      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
15007      t end
15008      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
15009      : end' >>confcache
15010 if cmp -s $cache_file confcache; then :; else
15011   if test -w $cache_file; then
15012     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
15013     cat confcache >$cache_file
15014   else
15015     echo "not updating unwritable cache $cache_file"
15016   fi
15017 fi
15018 rm -f confcache
15019
15020 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15021 # Let make expand exec_prefix.
15022 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15023
15024 # VPATH may cause trouble with some makes, so we remove $(srcdir),
15025 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
15026 # trailing colons and then remove the whole line if VPATH becomes empty
15027 # (actually we leave an empty line to preserve line numbers).
15028 if test "x$srcdir" = x.; then
15029   ac_vpsub='/^[         ]*VPATH[        ]*=/{
15030 s/:*\$(srcdir):*/:/;
15031 s/:*\${srcdir}:*/:/;
15032 s/:*@srcdir@:*/:/;
15033 s/^\([^=]*=[    ]*\):*/\1/;
15034 s/:*$//;
15035 s/^[^=]*=[      ]*$//;
15036 }'
15037 fi
15038
15039 DEFS=-DHAVE_CONFIG_H
15040
15041 : ${CONFIG_STATUS=./config.status}
15042 ac_clean_files_save=$ac_clean_files
15043 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
15044 { echo "$as_me:15044: creating $CONFIG_STATUS" >&5
15045 echo "$as_me: creating $CONFIG_STATUS" >&6;}
15046 cat >$CONFIG_STATUS <<_ACEOF
15047 #! $SHELL
15048 # Generated automatically by configure.
15049 # Run this file to recreate the current configuration.
15050 # Compiler output produced by configure, useful for debugging
15051 # configure, is in config.log if it exists.
15052
15053 debug=false
15054 SHELL=\${CONFIG_SHELL-$SHELL}
15055 ac_cs_invocation="\$0 \$@"
15056
15057 _ACEOF
15058
15059 cat >>$CONFIG_STATUS <<\_ACEOF
15060 # Be Bourne compatible
15061 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
15062   emulate sh
15063   NULLCMD=:
15064 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
15065   set -o posix
15066 fi
15067
15068 # Name of the executable.
15069 as_me=`echo "$0" |sed 's,.*[\\/],,'`
15070
15071 if expr a : '\(a\)' >/dev/null 2>&1; then
15072   as_expr=expr
15073 else
15074   as_expr=false
15075 fi
15076
15077 rm -f conf$$ conf$$.exe conf$$.file
15078 echo >conf$$.file
15079 if ln -s conf$$.file conf$$ 2>/dev/null; then
15080   # We could just check for DJGPP; but this test a) works b) is more generic
15081   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
15082   if test -f conf$$.exe; then
15083     # Don't use ln at all; we don't have any links
15084     as_ln_s='cp -p'
15085   else
15086     as_ln_s='ln -s'
15087   fi
15088 elif ln conf$$.file conf$$ 2>/dev/null; then
15089   as_ln_s=ln
15090 else
15091   as_ln_s='cp -p'
15092 fi
15093 rm -f conf$$ conf$$.exe conf$$.file
15094
15095 as_executable_p="test -f"
15096
15097 # Support unset when possible.
15098 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
15099   as_unset=unset
15100 else
15101   as_unset=false
15102 fi
15103
15104 # NLS nuisances.
15105 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
15106 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
15107 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
15108 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
15109 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
15110 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
15111 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
15112 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
15113
15114 # IFS
15115 # We need space, tab and new line, in precisely that order.
15116 as_nl='
15117 '
15118 IFS="   $as_nl"
15119
15120 # CDPATH.
15121 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
15122
15123 exec 6>&1
15124
15125 _ACEOF
15126
15127 # Files that config.status was made for.
15128 if test -n "$ac_config_files"; then
15129   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
15130 fi
15131
15132 if test -n "$ac_config_headers"; then
15133   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
15134 fi
15135
15136 if test -n "$ac_config_links"; then
15137   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
15138 fi
15139
15140 if test -n "$ac_config_commands"; then
15141   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
15142 fi
15143
15144 cat >>$CONFIG_STATUS <<\EOF
15145
15146 ac_cs_usage="\
15147 \`$as_me' instantiates files from templates according to the
15148 current configuration.
15149
15150 Usage: $0 [OPTIONS] [FILE]...
15151
15152   -h, --help       print this help, then exit
15153   -V, --version    print version number, then exit
15154   -d, --debug      don't remove temporary files
15155       --recheck    update $as_me by reconfiguring in the same conditions
15156   --file=FILE[:TEMPLATE]
15157                    instantiate the configuration file FILE
15158   --header=FILE[:TEMPLATE]
15159                    instantiate the configuration header FILE
15160
15161 Configuration files:
15162 $config_files
15163
15164 Configuration headers:
15165 $config_headers
15166
15167 Configuration commands:
15168 $config_commands
15169
15170 Report bugs to <dickey@invisible-island.net>."
15171 EOF
15172
15173 cat >>$CONFIG_STATUS <<EOF
15174 ac_cs_version="\\
15175 config.status
15176 configured by $0, generated by GNU Autoconf 2.52.20170501,
15177   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
15178
15179 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
15180 Free Software Foundation, Inc.
15181 This config.status script is free software; the Free Software Foundation
15182 gives unlimited permission to copy, distribute and modify it."
15183 srcdir=$srcdir
15184 INSTALL="$INSTALL"
15185 EOF
15186
15187 cat >>$CONFIG_STATUS <<\EOF
15188 # If no file are specified by the user, then we need to provide default
15189 # value.  By we need to know if files were specified by the user.
15190 ac_need_defaults=:
15191 while test $# != 0
15192 do
15193   case $1 in
15194   --*=*)
15195     ac_option=`expr "x$1" : 'x\([^=]*\)='`
15196     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
15197     shift
15198     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
15199     shift
15200     ;;
15201   -*);;
15202   *) # This is not an option, so the user has probably given explicit
15203      # arguments.
15204      ac_need_defaults=false;;
15205   esac
15206
15207   case $1 in
15208   # Handling of the options.
15209 EOF
15210 cat >>$CONFIG_STATUS <<EOF
15211   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15212     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
15213     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
15214 EOF
15215 cat >>$CONFIG_STATUS <<\EOF
15216   --version | --vers* | -V )
15217     echo "$ac_cs_version"; exit 0 ;;
15218   --he | --h)
15219     # Conflict between --help and --header
15220     { { echo "$as_me:15220: error: ambiguous option: $1
15221 Try \`$0 --help' for more information." >&5
15222 echo "$as_me: error: ambiguous option: $1
15223 Try \`$0 --help' for more information." >&2;}
15224    { (exit 1); exit 1; }; };;
15225   --help | --hel | -h )
15226     echo "$ac_cs_usage"; exit 0 ;;
15227   --debug | --d* | -d )
15228     debug=: ;;
15229   --file | --fil | --fi | --f )
15230     shift
15231     CONFIG_FILES="$CONFIG_FILES $1"
15232     ac_need_defaults=false;;
15233   --header | --heade | --head | --hea )
15234     shift
15235     CONFIG_HEADERS="$CONFIG_HEADERS $1"
15236     ac_need_defaults=false;;
15237
15238   # This is an error.
15239   -*) { { echo "$as_me:15239: error: unrecognized option: $1
15240 Try \`$0 --help' for more information." >&5
15241 echo "$as_me: error: unrecognized option: $1
15242 Try \`$0 --help' for more information." >&2;}
15243    { (exit 1); exit 1; }; } ;;
15244
15245   *) ac_config_targets="$ac_config_targets $1" ;;
15246
15247   esac
15248   shift
15249 done
15250
15251 exec 5>>config.log
15252 cat >&5 << _ACEOF
15253
15254 ## ----------------------- ##
15255 ## Running config.status.  ##
15256 ## ----------------------- ##
15257
15258 This file was extended by $as_me 2.52.20170501, executed with
15259   CONFIG_FILES    = $CONFIG_FILES
15260   CONFIG_HEADERS  = $CONFIG_HEADERS
15261   CONFIG_LINKS    = $CONFIG_LINKS
15262   CONFIG_COMMANDS = $CONFIG_COMMANDS
15263   > $ac_cs_invocation
15264 on `(hostname || uname -n) 2>/dev/null | sed 1q`
15265
15266 _ACEOF
15267 EOF
15268
15269 cat >>$CONFIG_STATUS <<EOF
15270 #
15271 # INIT-COMMANDS section.
15272 #
15273
15274 ### Special initialization commands, used to pass information from the
15275 ### configuration-run into config.status
15276
15277 AWK="$AWK"
15278 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
15279 DFT_LWR_MODEL="$DFT_LWR_MODEL"
15280 LIB_NAME="$LIB_NAME"
15281 LIB_PREFIX="$LIB_PREFIX"
15282 LIB_SUFFIX="$LIB_SUFFIX"
15283 LN_S="$LN_S"
15284 NCURSES_MAJOR="$NCURSES_MAJOR"
15285 NCURSES_MINOR="$NCURSES_MINOR"
15286 NCURSES_PATCH="$NCURSES_PATCH"
15287 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
15288 cf_cv_abi_version="$cf_cv_abi_version"
15289 cf_cv_rel_version="$cf_cv_rel_version"
15290 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
15291 cf_cv_shared_soname='$cf_cv_shared_soname'
15292 cf_cv_shlib_version="$cf_cv_shlib_version"
15293 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
15294 cf_cv_system_name="$cf_cv_system_name"
15295 host="$host"
15296 target="$target"
15297
15298 EOF
15299
15300 cat >>$CONFIG_STATUS <<\EOF
15301 for ac_config_target in $ac_config_targets
15302 do
15303   case "$ac_config_target" in
15304   # Handling of arguments.
15305   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
15306   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
15307   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
15308   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
15309   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
15310   *) { { echo "$as_me:15310: error: invalid argument: $ac_config_target" >&5
15311 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
15312    { (exit 1); exit 1; }; };;
15313   esac
15314 done
15315
15316 # If the user did not use the arguments to specify the items to instantiate,
15317 # then the envvar interface is used.  Set only those that are not.
15318 # We use the long form for the default assignment because of an extremely
15319 # bizarre bug on SunOS 4.1.3.
15320 if $ac_need_defaults; then
15321   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
15322   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
15323   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
15324 fi
15325
15326 # Create a temporary directory, and hook for its removal unless debugging.
15327 $debug ||
15328 {
15329   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
15330   trap '{ (exit 1); exit 1; }' 1 2 13 15
15331 }
15332
15333 # Create a (secure) tmp directory for tmp files.
15334 : ${TMPDIR=/tmp}
15335 {
15336   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
15337   test -n "$tmp" && test -d "$tmp"
15338 }  ||
15339 {
15340   tmp=$TMPDIR/cs$$-$RANDOM
15341   (umask 077 && mkdir $tmp)
15342 } ||
15343 {
15344    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
15345    { (exit 1); exit 1; }
15346 }
15347
15348 EOF
15349
15350 cat >>$CONFIG_STATUS <<EOF
15351
15352 #
15353 # CONFIG_FILES section.
15354 #
15355
15356 # No need to generate the scripts if there are no CONFIG_FILES.
15357 # This happens for instance when ./config.status config.h
15358 if test -n "\$CONFIG_FILES"; then
15359   # Protect against being on the right side of a sed subst in config.status.
15360   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
15361    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
15362 s,@SHELL@,$SHELL,;t t
15363 s,@exec_prefix@,$exec_prefix,;t t
15364 s,@prefix@,$prefix,;t t
15365 s,@program_transform_name@,$program_transform_name,;t t
15366 s,@bindir@,$bindir,;t t
15367 s,@sbindir@,$sbindir,;t t
15368 s,@libexecdir@,$libexecdir,;t t
15369 s,@datarootdir@,$datarootdir,;t t
15370 s,@datadir@,$datadir,;t t
15371 s,@sysconfdir@,$sysconfdir,;t t
15372 s,@sharedstatedir@,$sharedstatedir,;t t
15373 s,@localstatedir@,$localstatedir,;t t
15374 s,@libdir@,$libdir,;t t
15375 s,@includedir@,$includedir,;t t
15376 s,@oldincludedir@,$oldincludedir,;t t
15377 s,@infodir@,$infodir,;t t
15378 s,@mandir@,$mandir,;t t
15379 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
15380 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
15381 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
15382 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
15383 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
15384 s,@build_alias@,$build_alias,;t t
15385 s,@host_alias@,$host_alias,;t t
15386 s,@target_alias@,$target_alias,;t t
15387 s,@ECHO_C@,$ECHO_C,;t t
15388 s,@ECHO_N@,$ECHO_N,;t t
15389 s,@ECHO_T@,$ECHO_T,;t t
15390 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
15391 s,@DEFS@,$DEFS,;t t
15392 s,@LIBS@,$LIBS,;t t
15393 s,@top_builddir@,$top_builddir,;t t
15394 s,@build@,$build,;t t
15395 s,@build_cpu@,$build_cpu,;t t
15396 s,@build_vendor@,$build_vendor,;t t
15397 s,@build_os@,$build_os,;t t
15398 s,@host@,$host,;t t
15399 s,@host_cpu@,$host_cpu,;t t
15400 s,@host_vendor@,$host_vendor,;t t
15401 s,@host_os@,$host_os,;t t
15402 s,@target@,$target,;t t
15403 s,@target_cpu@,$target_cpu,;t t
15404 s,@target_vendor@,$target_vendor,;t t
15405 s,@target_os@,$target_os,;t t
15406 s,@CC@,$CC,;t t
15407 s,@CFLAGS@,$CFLAGS,;t t
15408 s,@LDFLAGS@,$LDFLAGS,;t t
15409 s,@CPPFLAGS@,$CPPFLAGS,;t t
15410 s,@ac_ct_CC@,$ac_ct_CC,;t t
15411 s,@EXEEXT@,$EXEEXT,;t t
15412 s,@OBJEXT@,$OBJEXT,;t t
15413 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
15414 s,@CPP@,$CPP,;t t
15415 s,@AWK@,$AWK,;t t
15416 s,@EGREP@,$EGREP,;t t
15417 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
15418 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
15419 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
15420 s,@LN_S@,$LN_S,;t t
15421 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
15422 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
15423 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
15424 s,@SET_MAKE@,$SET_MAKE,;t t
15425 s,@CTAGS@,$CTAGS,;t t
15426 s,@ETAGS@,$ETAGS,;t t
15427 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
15428 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
15429 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
15430 s,@RANLIB@,$RANLIB,;t t
15431 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
15432 s,@LD@,$LD,;t t
15433 s,@ac_ct_LD@,$ac_ct_LD,;t t
15434 s,@AR@,$AR,;t t
15435 s,@ac_ct_AR@,$ac_ct_AR,;t t
15436 s,@ARFLAGS@,$ARFLAGS,;t t
15437 s,@DESTDIR@,$DESTDIR,;t t
15438 s,@BUILD_CC@,$BUILD_CC,;t t
15439 s,@BUILD_CPP@,$BUILD_CPP,;t t
15440 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
15441 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
15442 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
15443 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
15444 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
15445 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
15446 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
15447 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
15448 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
15449 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
15450 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
15451 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
15452 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
15453 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
15454 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
15455 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
15456 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
15457 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
15458 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
15459 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
15460 s,@CC_G_OPT@,$CC_G_OPT,;t t
15461 s,@LD_MODEL@,$LD_MODEL,;t t
15462 s,@shlibdir@,$shlibdir,;t t
15463 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
15464 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
15465 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
15466 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
15467 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
15468 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
15469 s,@LINK_PROGS@,$LINK_PROGS,;t t
15470 s,@LINK_TESTS@,$LINK_TESTS,;t t
15471 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
15472 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
15473 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
15474 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
15475 s,@RPATH_LIST@,$RPATH_LIST,;t t
15476 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
15477 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
15478 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
15479 s,@PTHREAD@,$PTHREAD,;t t
15480 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
15481 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
15482 s,@ECHO_LT@,$ECHO_LT,;t t
15483 s,@ECHO_LD@,$ECHO_LD,;t t
15484 s,@RULE_CC@,$RULE_CC,;t t
15485 s,@SHOW_CC@,$SHOW_CC,;t t
15486 s,@ECHO_CC@,$ECHO_CC,;t t
15487 s,@ADAFLAGS@,$ADAFLAGS,;t t
15488 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
15489 s,@ADA_TRACE@,$ADA_TRACE,;t t
15490 s,@gnat_exists@,$gnat_exists,;t t
15491 s,@M4_exists@,$M4_exists,;t t
15492 s,@cf_ada_make@,$cf_ada_make,;t t
15493 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
15494 s,@cf_compile_generics@,$cf_compile_generics,;t t
15495 s,@cf_generic_objects@,$cf_generic_objects,;t t
15496 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
15497 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
15498 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
15499 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
15500 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
15501 s,@cf_ada_package@,$cf_ada_package,;t t
15502 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
15503 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
15504 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
15505 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
15506 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
15507 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
15508 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
15509 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
15510 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15511 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15512 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
15513 s,@TEST_ARG2@,$TEST_ARG2,;t t
15514 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
15515 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
15516 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
15517 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
15518 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
15519 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
15520 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
15521 CEOF
15522
15523 EOF
15524
15525   cat >>$CONFIG_STATUS <<\EOF
15526   # Split the substitutions into bite-sized pieces for seds with
15527   # small command number limits, like on Digital OSF/1 and HP-UX.
15528   ac_max_sed_lines=48
15529   ac_sed_frag=1 # Number of current file.
15530   ac_beg=1 # First line for current file.
15531   ac_end=$ac_max_sed_lines # Line after last line for current file.
15532   ac_more_lines=:
15533   ac_sed_cmds=
15534   while $ac_more_lines; do
15535     if test $ac_beg -gt 1; then
15536       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15537     else
15538       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15539     fi
15540     if test ! -s $tmp/subs.frag; then
15541       ac_more_lines=false
15542     else
15543       # The purpose of the label and of the branching condition is to
15544       # speed up the sed processing (if there are no `@' at all, there
15545       # is no need to browse any of the substitutions).
15546       # These are the two extra sed commands mentioned above.
15547       (echo ':t
15548   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15549       # It is possible to make a multiline substitution using escaped newlines.
15550       # Ensure that we do not split the substitution between script fragments.
15551       ac_BEG=$ac_end
15552       ac_END=`expr $ac_end + $ac_max_sed_lines`
15553       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
15554       if test -s $tmp/subs.next; then
15555         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
15556         if test ! -s $tmp/subs.edit; then
15557           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
15558           if test ! -s $tmp/subs.edit; then
15559             if test $ac_beg -gt 1; then
15560               ac_end=`expr $ac_end - 1`
15561               continue
15562             fi
15563           fi
15564         fi
15565       fi
15566
15567       if test -z "$ac_sed_cmds"; then
15568         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15569       else
15570         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15571       fi
15572       ac_sed_frag=`expr $ac_sed_frag + 1`
15573       ac_beg=$ac_end
15574       ac_end=`expr $ac_end + $ac_max_sed_lines`
15575     fi
15576   done
15577   if test -z "$ac_sed_cmds"; then
15578     ac_sed_cmds=cat
15579   fi
15580 fi # test -n "$CONFIG_FILES"
15581
15582 EOF
15583 cat >>$CONFIG_STATUS <<\EOF
15584 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15585   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15586   case $ac_file in
15587   - | *:- | *:-:* ) # input from stdin
15588         cat >$tmp/stdin
15589         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15590         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15591   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15592         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15593   * )   ac_file_in=$ac_file.in ;;
15594   esac
15595
15596   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15597   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15598          X"$ac_file" : 'X\(//\)[^/]' \| \
15599          X"$ac_file" : 'X\(//\)$' \| \
15600          X"$ac_file" : 'X\(/\)' \| \
15601          .     : '\(.\)' 2>/dev/null ||
15602 echo X"$ac_file" |
15603     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15604           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15605           /^X\(\/\/\)$/{ s//\1/; q; }
15606           /^X\(\/\).*/{ s//\1/; q; }
15607           s/.*/./; q'`
15608   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15609     { case "$ac_dir" in
15610   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15611   *)                      as_incr_dir=.;;
15612 esac
15613 as_dummy="$ac_dir"
15614 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15615   case $as_mkdir_dir in
15616     # Skip DOS drivespec
15617     ?:) as_incr_dir=$as_mkdir_dir ;;
15618     *)
15619       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15620       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15621     ;;
15622   esac
15623 done; }
15624
15625     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15626     # A "../" for each directory in $ac_dir_suffix.
15627     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15628   else
15629     ac_dir_suffix= ac_dots=
15630   fi
15631
15632   case $srcdir in
15633   .)  ac_srcdir=.
15634       if test -z "$ac_dots"; then
15635          ac_top_srcdir=.
15636       else
15637          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15638       fi ;;
15639   [\\/]* | ?:[\\/]* )
15640       ac_srcdir=$srcdir$ac_dir_suffix;
15641       ac_top_srcdir=$srcdir ;;
15642   *) # Relative path.
15643     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15644     ac_top_srcdir=$ac_dots$srcdir ;;
15645   esac
15646
15647   case $INSTALL in
15648   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15649   *) ac_INSTALL=$ac_dots$INSTALL ;;
15650   esac
15651
15652   if test x"$ac_file" != x-; then
15653     { echo "$as_me:15653: creating $ac_file" >&5
15654 echo "$as_me: creating $ac_file" >&6;}
15655     rm -f "$ac_file"
15656   fi
15657   # Let's still pretend it is `configure' which instantiates (i.e., don't
15658   # use $as_me), people would be surprised to read:
15659   #    /* config.h.  Generated automatically by config.status.  */
15660   configure_input="Generated automatically from `echo $ac_file_in |
15661                                                  sed 's,.*/,,'` by configure."
15662
15663   # First look for the input files in the build tree, otherwise in the
15664   # src tree.
15665   ac_file_inputs=`IFS=:
15666     for f in $ac_file_in; do
15667       case $f in
15668       -) echo $tmp/stdin ;;
15669       [\\/$]*)
15670          # Absolute (can't be DOS-style, as IFS=:)
15671          test -f "$f" || { { echo "$as_me:15671: error: cannot find input file: $f" >&5
15672 echo "$as_me: error: cannot find input file: $f" >&2;}
15673    { (exit 1); exit 1; }; }
15674          echo $f;;
15675       *) # Relative
15676          if test -f "$f"; then
15677            # Build tree
15678            echo $f
15679          elif test -f "$srcdir/$f"; then
15680            # Source tree
15681            echo $srcdir/$f
15682          else
15683            # /dev/null tree
15684            { { echo "$as_me:15684: error: cannot find input file: $f" >&5
15685 echo "$as_me: error: cannot find input file: $f" >&2;}
15686    { (exit 1); exit 1; }; }
15687          fi;;
15688       esac
15689     done` || { (exit 1); exit 1; }
15690 EOF
15691 cat >>$CONFIG_STATUS <<\EOF
15692   ac_warn_datarootdir=no
15693   if test x"$ac_file" != x-; then
15694     for ac_item in $ac_file_inputs
15695     do
15696       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
15697       if test -n "$ac_seen"; then
15698         ac_used=`grep '@datarootdir@' $ac_item`
15699         if test -z "$ac_used"; then
15700           { echo "$as_me:15700: WARNING: datarootdir was used implicitly but not set:
15701 $ac_seen" >&5
15702 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
15703 $ac_seen" >&2;}
15704           ac_warn_datarootdir=yes
15705         fi
15706       fi
15707       ac_seen=`grep '${datarootdir}' $ac_item`
15708       if test -n "$ac_seen"; then
15709         { echo "$as_me:15709: WARNING: datarootdir was used explicitly but not set:
15710 $ac_seen" >&5
15711 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
15712 $ac_seen" >&2;}
15713         ac_warn_datarootdir=yes
15714       fi
15715     done
15716   fi
15717
15718 if test "x$ac_warn_datarootdir" = xyes; then
15719   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
15720 fi
15721
15722 EOF
15723 cat >>$CONFIG_STATUS <<EOF
15724   sed "$ac_vpsub
15725 $extrasub
15726 EOF
15727 cat >>$CONFIG_STATUS <<\EOF
15728 :t
15729 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15730 s,@configure_input@,$configure_input,;t t
15731 s,@srcdir@,$ac_srcdir,;t t
15732 s,@top_srcdir@,$ac_top_srcdir,;t t
15733 s,@INSTALL@,$ac_INSTALL,;t t
15734 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15735   rm -f $tmp/stdin
15736   if test x"$ac_file" != x-; then
15737     cp $tmp/out $ac_file
15738
15739     for ac_name in prefix exec_prefix datarootdir
15740     do
15741         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
15742         if test -n "$ac_seen"; then
15743             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
15744             if test -z "$ac_init"; then
15745               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
15746               { echo "$as_me:15746: WARNING: Variable $ac_name is used but was not set:
15747 $ac_seen" >&5
15748 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
15749 $ac_seen" >&2;}
15750             fi
15751         fi
15752     done
15753     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
15754     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
15755     if test -s $tmp/out; then
15756       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
15757       { echo "$as_me:15757: WARNING: Some variables may not be substituted:
15758 $ac_seen" >&5
15759 echo "$as_me: WARNING: Some variables may not be substituted:
15760 $ac_seen" >&2;}
15761     fi
15762   else
15763     cat $tmp/out
15764   fi
15765   rm -f $tmp/out
15766
15767 done
15768 EOF
15769 cat >>$CONFIG_STATUS <<\EOF
15770
15771 #
15772 # CONFIG_HEADER section.
15773 #
15774
15775 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15776 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15777 #
15778 # ac_d sets the value in "#define NAME VALUE" lines.
15779 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15780 ac_dB='[        ].*$,\1#\2'
15781 ac_dC=' '
15782 ac_dD=',;t'
15783 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15784 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15785 ac_iB='\([      ]\),\1#\2define\3'
15786 ac_iC=' '
15787 ac_iD='\4,;t'
15788 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15789 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15790 ac_uB='$,\1#\2define\3'
15791 ac_uC=' '
15792 ac_uD=',;t'
15793
15794 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15795   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15796   case $ac_file in
15797   - | *:- | *:-:* ) # input from stdin
15798         cat >$tmp/stdin
15799         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15800         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15801   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15802         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15803   * )   ac_file_in=$ac_file.in ;;
15804   esac
15805
15806   test x"$ac_file" != x- && { echo "$as_me:15806: creating $ac_file" >&5
15807 echo "$as_me: creating $ac_file" >&6;}
15808
15809   # First look for the input files in the build tree, otherwise in the
15810   # src tree.
15811   ac_file_inputs=`IFS=:
15812     for f in $ac_file_in; do
15813       case $f in
15814       -) echo $tmp/stdin ;;
15815       [\\/$]*)
15816          # Absolute (can't be DOS-style, as IFS=:)
15817          test -f "$f" || { { echo "$as_me:15817: error: cannot find input file: $f" >&5
15818 echo "$as_me: error: cannot find input file: $f" >&2;}
15819    { (exit 1); exit 1; }; }
15820          echo $f;;
15821       *) # Relative
15822          if test -f "$f"; then
15823            # Build tree
15824            echo $f
15825          elif test -f "$srcdir/$f"; then
15826            # Source tree
15827            echo $srcdir/$f
15828          else
15829            # /dev/null tree
15830            { { echo "$as_me:15830: error: cannot find input file: $f" >&5
15831 echo "$as_me: error: cannot find input file: $f" >&2;}
15832    { (exit 1); exit 1; }; }
15833          fi;;
15834       esac
15835     done` || { (exit 1); exit 1; }
15836   # Remove the trailing spaces.
15837   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15838
15839 EOF
15840
15841 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15842 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15843 # be either 'cat' or 'sort'.
15844 cat confdefs.h | uniq >conftest.vals
15845
15846 # Break up conftest.vals because some shells have a limit on
15847 # the size of here documents, and old seds have small limits too.
15848
15849 rm -f conftest.tail
15850 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15851 while grep . conftest.vals >/dev/null
15852 do
15853   # Write chunks of a limited-size here document to conftest.frag.
15854   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15855   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15856   echo 'CEOF' >> $CONFIG_STATUS
15857   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15858   rm -f conftest.vals
15859   mv conftest.tail conftest.vals
15860 done
15861 rm -f conftest.vals
15862
15863 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15864 # marker @DEFS@.
15865 echo '  cat >> conftest.edit <<CEOF
15866 /@DEFS@/r conftest.frag
15867 /@DEFS@/d
15868 CEOF
15869 sed -f conftest.edit $tmp/in > $tmp/out
15870 rm -f $tmp/in
15871 mv $tmp/out $tmp/in
15872 rm -f conftest.edit conftest.frag
15873 ' >> $CONFIG_STATUS
15874
15875 cat >>$CONFIG_STATUS <<\EOF
15876   # Let's still pretend it is `configure' which instantiates (i.e., don't
15877   # use $as_me), people would be surprised to read:
15878   #    /* config.h.  Generated automatically by config.status.  */
15879   if test x"$ac_file" = x-; then
15880     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15881   else
15882     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15883   fi
15884   cat $tmp/in >>$tmp/config.h
15885   rm -f $tmp/in
15886   if test x"$ac_file" != x-; then
15887     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15888       { echo "$as_me:15888: $ac_file is unchanged" >&5
15889 echo "$as_me: $ac_file is unchanged" >&6;}
15890     else
15891       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15892          X"$ac_file" : 'X\(//\)[^/]' \| \
15893          X"$ac_file" : 'X\(//\)$' \| \
15894          X"$ac_file" : 'X\(/\)' \| \
15895          .     : '\(.\)' 2>/dev/null ||
15896 echo X"$ac_file" |
15897     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15898           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15899           /^X\(\/\/\)$/{ s//\1/; q; }
15900           /^X\(\/\).*/{ s//\1/; q; }
15901           s/.*/./; q'`
15902       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15903         { case "$ac_dir" in
15904   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15905   *)                      as_incr_dir=.;;
15906 esac
15907 as_dummy="$ac_dir"
15908 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15909   case $as_mkdir_dir in
15910     # Skip DOS drivespec
15911     ?:) as_incr_dir=$as_mkdir_dir ;;
15912     *)
15913       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15914       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15915     ;;
15916   esac
15917 done; }
15918
15919       fi
15920       rm -f $ac_file
15921       mv $tmp/config.h $ac_file
15922     fi
15923   else
15924     cat $tmp/config.h
15925     rm -f $tmp/config.h
15926   fi
15927 done
15928 EOF
15929 cat >>$CONFIG_STATUS <<\EOF
15930 #
15931 # CONFIG_COMMANDS section.
15932 #
15933 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15934   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15935   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15936
15937   case $ac_dest in
15938     default )
15939 if test -z "$USE_OLD_MAKERULES" ; then
15940         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
15941 fi
15942  ;;
15943   esac
15944 done
15945 EOF
15946
15947 cat >>$CONFIG_STATUS <<\EOF
15948
15949 { (exit 0); exit 0; }
15950 EOF
15951 chmod +x $CONFIG_STATUS
15952 ac_clean_files=$ac_clean_files_save
15953
15954 # configure is writing to config.log, and then calls config.status.
15955 # config.status does its own redirection, appending to config.log.
15956 # Unfortunately, on DOS this fails, as config.log is still kept open
15957 # by configure, so config.status won't be able to write to it; its
15958 # output is simply discarded.  So we exec the FD to /dev/null,
15959 # effectively closing config.log, so it can be properly (re)opened and
15960 # appended to by config.status.  When coming back to configure, we
15961 # need to make the FD available again.
15962 if test "$no_create" != yes; then
15963   ac_cs_success=:
15964   exec 5>/dev/null
15965   $SHELL $CONFIG_STATUS || ac_cs_success=false
15966   exec 5>>config.log
15967   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15968   # would make configure fail if this is the last instruction.
15969   $ac_cs_success || { (exit 1); exit 1; }
15970 fi
15971 ${MAKE:-make} preinstall