]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
73432e66ae599c1236a05df8244b664a55725b7d
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.66 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20170501.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109 # Factoring default headers for most tests.
110 ac_includes_default="\
111 #include <stdio.h>
112 #if HAVE_SYS_TYPES_H
113 # include <sys/types.h>
114 #endif
115 #if HAVE_SYS_STAT_H
116 # include <sys/stat.h>
117 #endif
118 #if STDC_HEADERS
119 # include <stdlib.h>
120 # include <stddef.h>
121 #else
122 # if HAVE_STDLIB_H
123 #  include <stdlib.h>
124 # endif
125 #endif
126 #if HAVE_STRING_H
127 # if !STDC_HEADERS && HAVE_MEMORY_H
128 #  include <memory.h>
129 # endif
130 # include <string.h>
131 #endif
132 #if HAVE_STRINGS_H
133 # include <strings.h>
134 #endif
135 #if HAVE_INTTYPES_H
136 # include <inttypes.h>
137 #else
138 # if HAVE_STDINT_H
139 #  include <stdint.h>
140 # endif
141 #endif
142 #if HAVE_UNISTD_H
143 # include <unistd.h>
144 #endif"
145
146 # Initialize some variables set by options.
147 ac_init_help=
148 ac_init_version=false
149 # The variables have the same names as the options, with
150 # dashes changed to underlines.
151 cache_file=/dev/null
152 exec_prefix=NONE
153 no_create=
154 no_recursion=
155 prefix=NONE
156 program_prefix=NONE
157 program_suffix=NONE
158 program_transform_name=s,x,x,
159 silent=
160 site=
161 srcdir=
162 verbose=
163 x_includes=NONE
164 x_libraries=NONE
165
166 # Installation directory options.
167 # These are left unexpanded so users can "make install exec_prefix=/foo"
168 # and all the variables that are supposed to be based on exec_prefix
169 # by default will actually change.
170 # Use braces instead of parens because sh, perl, etc. also accept them.
171 bindir='${exec_prefix}/bin'
172 sbindir='${exec_prefix}/sbin'
173 libexecdir='${exec_prefix}/libexec'
174 datarootdir='${prefix}/share'
175 datadir='${datarootdir}'
176 sysconfdir='${prefix}/etc'
177 sharedstatedir='${prefix}/com'
178 localstatedir='${prefix}/var'
179 libdir='${exec_prefix}/lib'
180 includedir='${prefix}/include'
181 oldincludedir='/usr/include'
182 infodir='${datarootdir}/info'
183 mandir='${datarootdir}/man'
184
185 # Identity of this package.
186 PACKAGE_NAME=
187 PACKAGE_TARNAME=
188 PACKAGE_VERSION=
189 PACKAGE_STRING=
190 PACKAGE_BUGREPORT=
191
192 ac_prev=
193 for ac_option
194 do
195   # If the previous option needs an argument, assign it.
196   if test -n "$ac_prev"; then
197     eval "$ac_prev=\$ac_option"
198     ac_prev=
199     continue
200   fi
201
202   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
203
204   # Accept the important Cygnus configure options, so we can diagnose typos.
205
206   case $ac_option in
207
208   -bindir | --bindir | --bindi | --bind | --bin | --bi)
209     ac_prev=bindir ;;
210   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
211     bindir=$ac_optarg ;;
212
213   -build | --build | --buil | --bui | --bu)
214     ac_prev=build_alias ;;
215   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
216     build_alias=$ac_optarg ;;
217
218   -cache-file | --cache-file | --cache-fil | --cache-fi \
219   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
220     ac_prev=cache_file ;;
221   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
222   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
223     cache_file=$ac_optarg ;;
224
225   --config-cache | -C)
226     cache_file=config.cache ;;
227
228   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
229     ac_prev=datadir ;;
230   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
231   | --da=*)
232     datadir=$ac_optarg ;;
233
234   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
235   | --dataroo | --dataro | --datar)
236     ac_prev=datarootdir ;;
237   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
238   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
239     datarootdir=$ac_optarg ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
243     # Reject names that are not valid shell variable names.
244     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
245       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
246    { (exit 1); exit 1; }; }
247     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
248     eval "enable_$ac_feature=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
252     # Reject names that are not valid shell variable names.
253     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
254       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
255    { (exit 1); exit 1; }; }
256     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
257     case $ac_option in
258       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_$ac_feature='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix=$ac_optarg ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he | -h)
277     ac_init_help=long ;;
278   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
279     ac_init_help=recursive ;;
280   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
281     ac_init_help=short ;;
282
283   -host | --host | --hos | --ho)
284     ac_prev=host_alias ;;
285   -host=* | --host=* | --hos=* | --ho=*)
286     host_alias=$ac_optarg ;;
287
288   -includedir | --includedir | --includedi | --included | --include \
289   | --includ | --inclu | --incl | --inc)
290     ac_prev=includedir ;;
291   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
292   | --includ=* | --inclu=* | --incl=* | --inc=*)
293     includedir=$ac_optarg ;;
294
295   -infodir | --infodir | --infodi | --infod | --info | --inf)
296     ac_prev=infodir ;;
297   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
298     infodir=$ac_optarg ;;
299
300   -libdir | --libdir | --libdi | --libd)
301     ac_prev=libdir ;;
302   -libdir=* | --libdir=* | --libdi=* | --libd=*)
303     libdir=$ac_optarg ;;
304
305   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
306   | --libexe | --libex | --libe)
307     ac_prev=libexecdir ;;
308   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
309   | --libexe=* | --libex=* | --libe=*)
310     libexecdir=$ac_optarg ;;
311
312   -localstatedir | --localstatedir | --localstatedi | --localstated \
313   | --localstate | --localstat | --localsta | --localst \
314   | --locals | --local | --loca | --loc | --lo)
315     ac_prev=localstatedir ;;
316   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
317   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
318   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
319     localstatedir=$ac_optarg ;;
320
321   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
322     ac_prev=mandir ;;
323   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
324     mandir=$ac_optarg ;;
325
326   -nfp | --nfp | --nf)
327     # Obsolete; use --without-fp.
328     with_fp=no ;;
329
330   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
331   | --no-cr | --no-c)
332     no_create=yes ;;
333
334   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
335   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
336     no_recursion=yes ;;
337
338   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
339   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
340   | --oldin | --oldi | --old | --ol | --o)
341     ac_prev=oldincludedir ;;
342   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
343   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
344   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
345     oldincludedir=$ac_optarg ;;
346
347   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
348     ac_prev=prefix ;;
349   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
350     prefix=$ac_optarg ;;
351
352   -program-prefix | --program-prefix | --program-prefi | --program-pref \
353   | --program-pre | --program-pr | --program-p)
354     ac_prev=program_prefix ;;
355   -program-prefix=* | --program-prefix=* | --program-prefi=* \
356   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
357     program_prefix=$ac_optarg ;;
358
359   -program-suffix | --program-suffix | --program-suffi | --program-suff \
360   | --program-suf | --program-su | --program-s)
361     ac_prev=program_suffix ;;
362   -program-suffix=* | --program-suffix=* | --program-suffi=* \
363   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
364     program_suffix=$ac_optarg ;;
365
366   -program-transform-name | --program-transform-name \
367   | --program-transform-nam | --program-transform-na \
368   | --program-transform-n | --program-transform- \
369   | --program-transform | --program-transfor \
370   | --program-transfo | --program-transf \
371   | --program-trans | --program-tran \
372   | --progr-tra | --program-tr | --program-t)
373     ac_prev=program_transform_name ;;
374   -program-transform-name=* | --program-transform-name=* \
375   | --program-transform-nam=* | --program-transform-na=* \
376   | --program-transform-n=* | --program-transform-=* \
377   | --program-transform=* | --program-transfor=* \
378   | --program-transfo=* | --program-transf=* \
379   | --program-trans=* | --program-tran=* \
380   | --progr-tra=* | --program-tr=* | --program-t=*)
381     program_transform_name=$ac_optarg ;;
382
383   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
384   | -silent | --silent | --silen | --sile | --sil)
385     silent=yes ;;
386
387   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
388     ac_prev=sbindir ;;
389   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
390   | --sbi=* | --sb=*)
391     sbindir=$ac_optarg ;;
392
393   -sharedstatedir | --sharedstatedir | --sharedstatedi \
394   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
395   | --sharedst | --shareds | --shared | --share | --shar \
396   | --sha | --sh)
397     ac_prev=sharedstatedir ;;
398   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
399   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
400   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
401   | --sha=* | --sh=*)
402     sharedstatedir=$ac_optarg ;;
403
404   -site | --site | --sit)
405     ac_prev=site ;;
406   -site=* | --site=* | --sit=*)
407     site=$ac_optarg ;;
408
409   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
410     ac_prev=srcdir ;;
411   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
412     srcdir=$ac_optarg ;;
413
414   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
415   | --syscon | --sysco | --sysc | --sys | --sy)
416     ac_prev=sysconfdir ;;
417   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
418   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
419     sysconfdir=$ac_optarg ;;
420
421   -target | --target | --targe | --targ | --tar | --ta | --t)
422     ac_prev=target_alias ;;
423   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
424     target_alias=$ac_optarg ;;
425
426   -v | -verbose | --verbose | --verbos | --verbo | --verb)
427     verbose=yes ;;
428
429   -version | --version | --versio | --versi | --vers | -V)
430     ac_init_version=: ;;
431
432   -with-* | --with-*)
433     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
434     # Reject names that are not valid shell variable names.
435     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
436       { echo "$as_me: error: invalid package name: $ac_package" >&2
437    { (exit 1); exit 1; }; }
438     ac_package=`echo $ac_package| sed 's/-/_/g'`
439     case $ac_option in
440       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
441       *) ac_optarg=yes ;;
442     esac
443     eval "with_$ac_package='$ac_optarg'" ;;
444
445   -without-* | --without-*)
446     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
447     # Reject names that are not valid shell variable names.
448     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
449       { echo "$as_me: error: invalid package name: $ac_package" >&2
450    { (exit 1); exit 1; }; }
451     ac_package=`echo $ac_package | sed 's/-/_/g'`
452     eval "with_$ac_package=no" ;;
453
454   --x)
455     # Obsolete; use --with-x.
456     with_x=yes ;;
457
458   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
459   | --x-incl | --x-inc | --x-in | --x-i)
460     ac_prev=x_includes ;;
461   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
462   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
463     x_includes=$ac_optarg ;;
464
465   -x-libraries | --x-libraries | --x-librarie | --x-librari \
466   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
467     ac_prev=x_libraries ;;
468   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
469   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
470     x_libraries=$ac_optarg ;;
471
472   -*) { echo "$as_me: error: unrecognized option: $ac_option
473 Try \`$0 --help' for more information." >&2
474    { (exit 1); exit 1; }; }
475     ;;
476
477   *=*)
478     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
479     # Reject names that are not valid shell variable names.
480     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
481       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
482    { (exit 1); exit 1; }; }
483     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
484     eval "$ac_envvar='$ac_optarg'"
485     export $ac_envvar ;;
486
487   *)
488     # FIXME: should be removed in autoconf 3.0.
489     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
490     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
491       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
492     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
493     ;;
494
495   esac
496 done
497
498 if test -n "$ac_prev"; then
499   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
500   { echo "$as_me: error: missing argument to $ac_option" >&2
501    { (exit 1); exit 1; }; }
502 fi
503
504 # Be sure to have absolute paths.
505 for ac_var in exec_prefix prefix
506 do
507   eval ac_val=$`echo $ac_var`
508   case $ac_val in
509     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
510     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
511    { (exit 1); exit 1; }; };;
512   esac
513 done
514
515 # Be sure to have absolute paths.
516 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
517               localstatedir libdir includedir oldincludedir infodir mandir
518 do
519   eval ac_val=$`echo $ac_var`
520   case $ac_val in
521     [\\/$]* | ?:[\\/]* ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # There might be people who depend on the old broken behavior: `$host'
528 # used to hold the argument of --host etc.
529 build=$build_alias
530 host=$host_alias
531 target=$target_alias
532
533 # FIXME: should be removed in autoconf 3.0.
534 if test "x$host_alias" != x; then
535   if test "x$build_alias" = x; then
536     cross_compiling=maybe
537     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
538     If a cross compiler is detected then cross compile mode will be used." >&2
539   elif test "x$build_alias" != "x$host_alias"; then
540     cross_compiling=yes
541   fi
542 fi
543
544 ac_tool_prefix=
545 test -n "$host_alias" && ac_tool_prefix=$host_alias-
546
547 test "$silent" = yes && exec 6>/dev/null
548
549 # Find the source files, if location was not specified.
550 if test -z "$srcdir"; then
551   ac_srcdir_defaulted=yes
552   # Try the directory containing this script, then its parent.
553   ac_prog=$0
554   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
555   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
556   srcdir=$ac_confdir
557   if test ! -r $srcdir/$ac_unique_file; then
558     srcdir=..
559   fi
560 else
561   ac_srcdir_defaulted=no
562 fi
563 if test ! -r $srcdir/$ac_unique_file; then
564   if test "$ac_srcdir_defaulted" = yes; then
565     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
566    { (exit 1); exit 1; }; }
567   else
568     { echo "$as_me: error: cannot find sources in $srcdir" >&2
569    { (exit 1); exit 1; }; }
570   fi
571 fi
572 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
573 ac_env_build_alias_set=${build_alias+set}
574 ac_env_build_alias_value=$build_alias
575 ac_cv_env_build_alias_set=${build_alias+set}
576 ac_cv_env_build_alias_value=$build_alias
577 ac_env_host_alias_set=${host_alias+set}
578 ac_env_host_alias_value=$host_alias
579 ac_cv_env_host_alias_set=${host_alias+set}
580 ac_cv_env_host_alias_value=$host_alias
581 ac_env_target_alias_set=${target_alias+set}
582 ac_env_target_alias_value=$target_alias
583 ac_cv_env_target_alias_set=${target_alias+set}
584 ac_cv_env_target_alias_value=$target_alias
585 ac_env_CC_set=${CC+set}
586 ac_env_CC_value=$CC
587 ac_cv_env_CC_set=${CC+set}
588 ac_cv_env_CC_value=$CC
589 ac_env_CFLAGS_set=${CFLAGS+set}
590 ac_env_CFLAGS_value=$CFLAGS
591 ac_cv_env_CFLAGS_set=${CFLAGS+set}
592 ac_cv_env_CFLAGS_value=$CFLAGS
593 ac_env_LDFLAGS_set=${LDFLAGS+set}
594 ac_env_LDFLAGS_value=$LDFLAGS
595 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
596 ac_cv_env_LDFLAGS_value=$LDFLAGS
597 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
598 ac_env_CPPFLAGS_value=$CPPFLAGS
599 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
600 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
601 ac_env_CPP_set=${CPP+set}
602 ac_env_CPP_value=$CPP
603 ac_cv_env_CPP_set=${CPP+set}
604 ac_cv_env_CPP_value=$CPP
605
606 #
607 # Report the --help message.
608 #
609 if test "$ac_init_help" = "long"; then
610   # Omit some internal or obsolete options to make the list less imposing.
611   # This message is too long to be a string in the A/UX 3.1 sh.
612   cat <<EOF
613 \`configure' configures this package to adapt to many kinds of systems.
614
615 Usage: $0 [OPTION]... [VAR=VALUE]...
616
617 To assign environment variables (e.g., CC, CFLAGS...), specify them as
618 VAR=VALUE.  See below for descriptions of some of the useful variables.
619
620 Defaults for the options are specified in brackets.
621
622 Configuration:
623   -h, --help              display this help and exit
624       --help=short        display options specific to this package
625       --help=recursive    display the short help of all the included packages
626   -V, --version           display version information and exit
627   -q, --quiet, --silent   do not print \`checking...' messages
628       --cache-file=FILE   cache test results in FILE [disabled]
629   -C, --config-cache      alias for \`--cache-file=config.cache'
630   -n, --no-create         do not create output files
631       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
632
633 EOF
634
635   cat <<EOF
636 Installation directories:
637   --prefix=PREFIX         install architecture-independent files in PREFIX
638                           [$ac_default_prefix]
639   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
640                           [PREFIX]
641
642 By default, \`make install' will install all the files in
643 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
644 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
645 for instance \`--prefix=\$HOME'.
646
647 For better control, use the options below.
648
649 Fine tuning of the installation directories:
650   --bindir=DIR            user executables [EPREFIX/bin]
651   --sbindir=DIR           system admin executables [EPREFIX/sbin]
652   --libexecdir=DIR        program executables [EPREFIX/libexec]
653   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
654   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
655   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
656   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
657   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
658   --libdir=DIR            object code libraries [EPREFIX/lib]
659   --includedir=DIR        C header files [PREFIX/include]
660   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
661   --infodir=DIR           info documentation [DATAROOTDIR/info]
662   --mandir=DIR            man documentation [DATAROOTDIR/man]
663 EOF
664
665   cat <<\EOF
666
667 Program names:
668   --program-prefix=PREFIX            prepend PREFIX to installed program names
669   --program-suffix=SUFFIX            append SUFFIX to installed program names
670   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
671
672 System types:
673   --build=BUILD           configure for building on BUILD [guessed]
674   --host=HOST       build programs to run on HOST [BUILD]
675   --target=TARGET   configure for building compilers for TARGET [HOST]
676 EOF
677 fi
678
679 if test -n "$ac_init_help"; then
680
681   cat <<\EOF
682
683 Optional Packages:
684   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
685   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
686
687 Optional Features:
688   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
689   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
690
691 General Options:
692   --with-system-type=XXX  test: override derived host system-type
693   --disable-stripping     do not strip installed executables
694   --with-pkg-config{=path} enable/disable use of pkg-config
695   --with-pkg-config-libdir=XXX use given directory for installing pc-files
696   --without-tests         suppress build with test-programs
697   --enable-mixed-case     tic should assume mixed-case filenames
698   --with-install-prefix   prefixes actual install-location ($DESTDIR)
699 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
700   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
701   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
702   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
703   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
704   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
705   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
706 Options to Specify the Libraries Built/Used:
707   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
708   --with-curses-dir=DIR   directory in which (n)curses is installed
709   --enable-widec          compile with wide-char/UTF-8 code
710   --with-lib-prefix       override library-prefix
711   --with-shlib-version=X  Specify rel or abi version for shared libs
712   --enable-rpath-link     link sample programs with rpath option
713 Fine-Tuning Your Configuration:
714   --enable-broken_linker  compile with broken-linker support code
715   --disable-largefile     omit support for large files
716   --with-rcs-ids          compile-in RCS identifiers
717 Extensions:
718   --disable-ext-funcs     disable function-extensions
719   --enable-const          compile with extra/non-standard const
720 Development Code:
721   --without-develop       disable development options
722 Experimental Code:
723   --with-pthread          use POSIX thread library
724   --enable-weak-symbols   enable weak-symbols for pthreads
725   --enable-reentrant      compile with experimental reentrant code
726   --with-wrap-prefix=XXX  override prefix used for public variables
727 Testing/development Options:
728   --disable-echo          do not display "compiling" commands
729   --enable-warnings       build: turn on GCC compiler warnings
730   --enable-assertions     test: turn on generation of assertion code
731   --enable-expanded       test: generate functions for certain macros
732   --disable-macros        test: use functions rather than macros
733   --with-trace            test: add trace() function to all models of ncurses
734   --disable-gnat-projects test: disable GNAT projects even if usable
735 Ada95 Binding Options:
736   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
737   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
738   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
739   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
740
741 Some influential environment variables:
742   CC          C compiler command
743   CFLAGS      C compiler flags
744   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
745               nonstandard directory <lib dir>
746   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
747               headers in a nonstandard directory <include dir>
748   CPP         C preprocessor
749
750 Use these variables to override the choices made by `configure' or to help
751 it to find libraries and programs with nonstandard names/locations.
752
753 EOF
754 fi
755
756 if test "$ac_init_help" = "recursive"; then
757   # If there are subdirs, report their specific --help.
758   ac_popdir=`pwd`
759   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
760     cd $ac_subdir
761     # A "../" for each directory in /$ac_subdir.
762     ac_dots=`echo $ac_subdir |
763              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
764
765     case $srcdir in
766     .) # No --srcdir option.  We are building in place.
767       ac_sub_srcdir=$srcdir ;;
768     [\\/]* | ?:[\\/]* ) # Absolute path.
769       ac_sub_srcdir=$srcdir/$ac_subdir ;;
770     *) # Relative path.
771       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
772     esac
773
774     # Check for guested configure; otherwise get Cygnus style configure.
775     if test -f $ac_sub_srcdir/configure.gnu; then
776       echo
777       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
778     elif test -f $ac_sub_srcdir/configure; then
779       echo
780       $SHELL $ac_sub_srcdir/configure  --help=recursive
781     elif test -f $ac_sub_srcdir/configure.ac ||
782            test -f $ac_sub_srcdir/configure.in; then
783       echo
784       $ac_configure --help
785     else
786       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
787     fi
788     cd $ac_popdir
789   done
790 fi
791
792 test -n "$ac_init_help" && exit 0
793 if $ac_init_version; then
794   cat <<\EOF
795
796 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
797 Free Software Foundation, Inc.
798 This configure script is free software; the Free Software Foundation
799 gives unlimited permission to copy, distribute and modify it.
800 EOF
801   exit 0
802 fi
803 exec 5>config.log
804 cat >&5 <<EOF
805 This file contains any messages produced by compilers while
806 running configure, to aid debugging if configure makes a mistake.
807
808 It was created by $as_me, which was
809 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
810
811   $ $0 $@
812
813 EOF
814 {
815 cat <<_ASUNAME
816 ## ---------- ##
817 ## Platform.  ##
818 ## ---------- ##
819
820 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
821 uname -m = `(uname -m) 2>/dev/null || echo unknown`
822 uname -r = `(uname -r) 2>/dev/null || echo unknown`
823 uname -s = `(uname -s) 2>/dev/null || echo unknown`
824 uname -v = `(uname -v) 2>/dev/null || echo unknown`
825
826 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
827 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
828
829 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
830 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
831 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
832 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
833 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
834 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
835 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
836
837 PATH = $PATH
838
839 _ASUNAME
840 } >&5
841
842 cat >&5 <<EOF
843 ## ------------ ##
844 ## Core tests.  ##
845 ## ------------ ##
846
847 EOF
848
849 # Keep a trace of the command line.
850 # Strip out --no-create and --no-recursion so they do not pile up.
851 # Also quote any args containing shell meta-characters.
852 ac_configure_args=
853 ac_sep=
854 for ac_arg
855 do
856   case $ac_arg in
857   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
858   | --no-cr | --no-c) ;;
859   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
860   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
861   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
862     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
863     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
864     ac_sep=" " ;;
865   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
866      ac_sep=" " ;;
867   esac
868   # Get rid of the leading space.
869 done
870
871 # When interrupted or exit'd, cleanup temporary files, and complete
872 # config.log.  We remove comments because anyway the quotes in there
873 # would cause problems or look ugly.
874 trap 'exit_status=$?
875   # Save into config.log some information that might help in debugging.
876   echo >&5
877   echo "## ----------------- ##" >&5
878   echo "## Cache variables.  ##" >&5
879   echo "## ----------------- ##" >&5
880   echo >&5
881   # The following way of writing the cache mishandles newlines in values,
882 {
883   (set) 2>&1 |
884     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
885     *ac_space=\ *)
886       sed -n \
887         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
888           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
889       ;;
890     *)
891       sed -n \
892         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
893       ;;
894     esac;
895 } >&5
896   sed "/^$/d" confdefs.h >conftest.log
897   if test -s conftest.log; then
898     echo >&5
899     echo "## ------------ ##" >&5
900     echo "## confdefs.h.  ##" >&5
901     echo "## ------------ ##" >&5
902     echo >&5
903     cat conftest.log >&5
904   fi
905   (echo; echo) >&5
906   test "$ac_signal" != 0 &&
907     echo "$as_me: caught signal $ac_signal" >&5
908   echo "$as_me: exit $exit_status" >&5
909   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
910     exit $exit_status
911      ' 0
912 for ac_signal in 1 2 13 15; do
913   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
914 done
915 ac_signal=0
916
917 # confdefs.h avoids OS command line length limits that DEFS can exceed.
918 rm -rf conftest* confdefs.h
919 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
920 echo >confdefs.h
921
922 # Let the site file select an alternate cache file if it wants to.
923 # Prefer explicitly selected file to automatically selected ones.
924 if test -z "$CONFIG_SITE"; then
925   if test "x$prefix" != xNONE; then
926     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
927   else
928     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
929   fi
930 fi
931 for ac_site_file in $CONFIG_SITE; do
932   if test -r "$ac_site_file"; then
933     { echo "$as_me:933: loading site script $ac_site_file" >&5
934 echo "$as_me: loading site script $ac_site_file" >&6;}
935     cat "$ac_site_file" >&5
936     . "$ac_site_file"
937   fi
938 done
939
940 if test -r "$cache_file"; then
941   # Some versions of bash will fail to source /dev/null (special
942   # files actually), so we avoid doing that.
943   if test -f "$cache_file"; then
944     { echo "$as_me:944: loading cache $cache_file" >&5
945 echo "$as_me: loading cache $cache_file" >&6;}
946     case $cache_file in
947       [\\/]* | ?:[\\/]* ) . $cache_file;;
948       *)                      . ./$cache_file;;
949     esac
950   fi
951 else
952   { echo "$as_me:952: creating cache $cache_file" >&5
953 echo "$as_me: creating cache $cache_file" >&6;}
954   >$cache_file
955 fi
956
957 # Check that the precious variables saved in the cache have kept the same
958 # value.
959 ac_cache_corrupted=false
960 for ac_var in `(set) 2>&1 |
961                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
962   eval ac_old_set=\$ac_cv_env_${ac_var}_set
963   eval ac_new_set=\$ac_env_${ac_var}_set
964   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
965   eval ac_new_val="\$ac_env_${ac_var}_value"
966   case $ac_old_set,$ac_new_set in
967     set,)
968       { echo "$as_me:968: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
969 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
970       ac_cache_corrupted=: ;;
971     ,set)
972       { echo "$as_me:972: error: \`$ac_var' was not set in the previous run" >&5
973 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
974       ac_cache_corrupted=: ;;
975     ,);;
976     *)
977       if test "x$ac_old_val" != "x$ac_new_val"; then
978         { echo "$as_me:978: error: \`$ac_var' has changed since the previous run:" >&5
979 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
980         { echo "$as_me:980:   former value:  $ac_old_val" >&5
981 echo "$as_me:   former value:  $ac_old_val" >&2;}
982         { echo "$as_me:982:   current value: $ac_new_val" >&5
983 echo "$as_me:   current value: $ac_new_val" >&2;}
984         ac_cache_corrupted=:
985       fi;;
986   esac
987   # Pass precious variables to config.status.  It doesn't matter if
988   # we pass some twice (in addition to the command line arguments).
989   if test "$ac_new_set" = set; then
990     case $ac_new_val in
991     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
992       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
993       ac_configure_args="$ac_configure_args '$ac_arg'"
994       ;;
995     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
996        ;;
997     esac
998   fi
999 done
1000 if $ac_cache_corrupted; then
1001   { echo "$as_me:1001: error: changes in the environment can compromise the build" >&5
1002 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1003   { { echo "$as_me:1003: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1004 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1005    { (exit 1); exit 1; }; }
1006 fi
1007
1008 ac_ext=c
1009 ac_cpp='$CPP $CPPFLAGS'
1010 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1011 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1012 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1013 ac_main_return=return
1014
1015 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1016   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1017                    ECHO_T='     ' ;;
1018   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1019   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1020 esac
1021 echo "#! $SHELL" >conftest.sh
1022 echo  "exit 0"   >>conftest.sh
1023 chmod +x conftest.sh
1024 if { (echo "$as_me:1024: PATH=\".;.\"; conftest.sh") >&5
1025   (PATH=".;."; conftest.sh) 2>&5
1026   ac_status=$?
1027   echo "$as_me:1027: \$? = $ac_status" >&5
1028   (exit $ac_status); }; then
1029   ac_path_separator=';'
1030 else
1031   ac_path_separator=:
1032 fi
1033 PATH_SEPARATOR="$ac_path_separator"
1034 rm -f conftest.sh
1035
1036 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1037
1038 top_builddir=`pwd`
1039
1040 ac_aux_dir=
1041 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1042   if test -f $ac_dir/install-sh; then
1043     ac_aux_dir=$ac_dir
1044     ac_install_sh="$ac_aux_dir/install-sh -c"
1045     break
1046   elif test -f $ac_dir/install.sh; then
1047     ac_aux_dir=$ac_dir
1048     ac_install_sh="$ac_aux_dir/install.sh -c"
1049     break
1050   elif test -f $ac_dir/shtool; then
1051     ac_aux_dir=$ac_dir
1052     ac_install_sh="$ac_aux_dir/shtool install -c"
1053     break
1054   fi
1055 done
1056 if test -z "$ac_aux_dir"; then
1057   { { echo "$as_me:1057: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1058 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1059    { (exit 1); exit 1; }; }
1060 fi
1061 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1062 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1063 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1064
1065 # Make sure we can run config.sub.
1066 $ac_config_sub sun4 >/dev/null 2>&1 ||
1067   { { echo "$as_me:1067: error: cannot run $ac_config_sub" >&5
1068 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 echo "$as_me:1071: checking build system type" >&5
1072 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1073 if test "${ac_cv_build+set}" = set; then
1074   echo $ECHO_N "(cached) $ECHO_C" >&6
1075 else
1076   ac_cv_build_alias=$build_alias
1077 test -z "$ac_cv_build_alias" &&
1078   ac_cv_build_alias=`$ac_config_guess`
1079 test -z "$ac_cv_build_alias" &&
1080   { { echo "$as_me:1080: error: cannot guess build type; you must specify one" >&5
1081 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1082    { (exit 1); exit 1; }; }
1083 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1084   { { echo "$as_me:1084: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1085 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1086    { (exit 1); exit 1; }; }
1087
1088 fi
1089 echo "$as_me:1089: result: $ac_cv_build" >&5
1090 echo "${ECHO_T}$ac_cv_build" >&6
1091 build=$ac_cv_build
1092 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1093 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1094 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1095
1096 echo "$as_me:1096: checking host system type" >&5
1097 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1098 if test "${ac_cv_host+set}" = set; then
1099   echo $ECHO_N "(cached) $ECHO_C" >&6
1100 else
1101   ac_cv_host_alias=$host_alias
1102 test -z "$ac_cv_host_alias" &&
1103   ac_cv_host_alias=$ac_cv_build_alias
1104 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1105   { { echo "$as_me:1105: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1106 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1107    { (exit 1); exit 1; }; }
1108
1109 fi
1110 echo "$as_me:1110: result: $ac_cv_host" >&5
1111 echo "${ECHO_T}$ac_cv_host" >&6
1112 host=$ac_cv_host
1113 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1114 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1115 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1116
1117 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1118         echo "$as_me:1118: checking target system type" >&5
1119 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1120 if test "${ac_cv_target+set}" = set; then
1121   echo $ECHO_N "(cached) $ECHO_C" >&6
1122 else
1123   ac_cv_target_alias=$target_alias
1124 test "x$ac_cv_target_alias" = "x" &&
1125   ac_cv_target_alias=$ac_cv_host_alias
1126 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1127   { { echo "$as_me:1127: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1128 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1129    { (exit 1); exit 1; }; }
1130
1131 fi
1132 echo "$as_me:1132: result: $ac_cv_target" >&5
1133 echo "${ECHO_T}$ac_cv_target" >&6
1134 target=$ac_cv_target
1135 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1136 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1137 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1138
1139 # The aliases save the names the user supplied, while $host etc.
1140 # will get canonicalized.
1141 test -n "$target_alias" &&
1142   test "$program_prefix$program_suffix$program_transform_name" = \
1143     NONENONEs,x,x, &&
1144   program_prefix=${target_alias}-
1145         system_name="$host_os"
1146 else
1147         system_name="`(uname -s -r) 2>/dev/null`"
1148         if test -z "$system_name" ; then
1149                 system_name="`(hostname) 2>/dev/null`"
1150         fi
1151 fi
1152 test -n "$system_name" &&
1153 cat >>confdefs.h <<EOF
1154 #define SYSTEM_NAME "$system_name"
1155 EOF
1156
1157 if test "${cf_cv_system_name+set}" = set; then
1158   echo $ECHO_N "(cached) $ECHO_C" >&6
1159 else
1160   cf_cv_system_name="$system_name"
1161 fi
1162
1163 test -z "$system_name" && system_name="$cf_cv_system_name"
1164 test -n "$cf_cv_system_name" && echo "$as_me:1164: result: Configuring for $cf_cv_system_name" >&5
1165 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1166
1167 if test ".$system_name" != ".$cf_cv_system_name" ; then
1168         echo "$as_me:1168: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1169 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1170         { { echo "$as_me:1170: error: \"Please remove config.cache and try again.\"" >&5
1171 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1172    { (exit 1); exit 1; }; }
1173 fi
1174
1175 # Check whether --with-system-type or --without-system-type was given.
1176 if test "${with_system_type+set}" = set; then
1177   withval="$with_system_type"
1178   { echo "$as_me:1178: WARNING: overriding system type to $withval" >&5
1179 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1180         cf_cv_system_name=$withval
1181         host_os=$withval
1182
1183 fi;
1184
1185 ###     Save the given $CFLAGS to allow user-override.
1186 cf_user_CFLAGS="$CFLAGS"
1187
1188 ###     Default install-location
1189
1190 echo "$as_me:1190: checking for prefix" >&5
1191 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1192 if test "x$prefix" = "xNONE" ; then
1193         case "$cf_cv_system_name" in
1194                 # non-vendor systems don't have a conflict
1195         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1196                 prefix=/usr
1197                 ;;
1198         (*)     prefix=$ac_default_prefix
1199                 ;;
1200         esac
1201 fi
1202 echo "$as_me:1202: result: $prefix" >&5
1203 echo "${ECHO_T}$prefix" >&6
1204
1205 if test "x$prefix" = "xNONE" ; then
1206 echo "$as_me:1206: checking for default include-directory" >&5
1207 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1208 test -n "$verbose" && echo 1>&6
1209 for cf_symbol in \
1210         $includedir \
1211         $includedir/ncurses \
1212         $prefix/include \
1213         $prefix/include/ncurses \
1214         /usr/local/include \
1215         /usr/local/include/ncurses \
1216         /usr/include \
1217         /usr/include/ncurses
1218 do
1219         cf_dir=`eval echo $cf_symbol`
1220         if test -f $cf_dir/curses.h ; then
1221         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1222                 includedir="$cf_symbol"
1223                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1224                 break
1225         fi
1226         fi
1227         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1228 done
1229 echo "$as_me:1229: result: $includedir" >&5
1230 echo "${ECHO_T}$includedir" >&6
1231 fi
1232
1233 ###     Checks for programs.
1234
1235 ac_ext=c
1236 ac_cpp='$CPP $CPPFLAGS'
1237 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1238 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1239 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1240 ac_main_return=return
1241 if test -n "$ac_tool_prefix"; then
1242   for ac_prog in gnatgcc gcc cc
1243   do
1244     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1245 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1246 echo "$as_me:1246: checking for $ac_word" >&5
1247 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1248 if test "${ac_cv_prog_CC+set}" = set; then
1249   echo $ECHO_N "(cached) $ECHO_C" >&6
1250 else
1251   if test -n "$CC"; then
1252   ac_cv_prog_CC="$CC" # Let the user override the test.
1253 else
1254   ac_save_IFS=$IFS; IFS=$ac_path_separator
1255 ac_dummy="$PATH"
1256 for ac_dir in $ac_dummy; do
1257   IFS=$ac_save_IFS
1258   test -z "$ac_dir" && ac_dir=.
1259   $as_executable_p "$ac_dir/$ac_word" || continue
1260 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1261 echo "$as_me:1261: found $ac_dir/$ac_word" >&5
1262 break
1263 done
1264
1265 fi
1266 fi
1267 CC=$ac_cv_prog_CC
1268 if test -n "$CC"; then
1269   echo "$as_me:1269: result: $CC" >&5
1270 echo "${ECHO_T}$CC" >&6
1271 else
1272   echo "$as_me:1272: result: no" >&5
1273 echo "${ECHO_T}no" >&6
1274 fi
1275
1276     test -n "$CC" && break
1277   done
1278 fi
1279 if test -z "$CC"; then
1280   ac_ct_CC=$CC
1281   for ac_prog in gnatgcc gcc cc
1282 do
1283   # Extract the first word of "$ac_prog", so it can be a program name with args.
1284 set dummy $ac_prog; ac_word=$2
1285 echo "$as_me:1285: checking for $ac_word" >&5
1286 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1287 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1288   echo $ECHO_N "(cached) $ECHO_C" >&6
1289 else
1290   if test -n "$ac_ct_CC"; then
1291   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1292 else
1293   ac_save_IFS=$IFS; IFS=$ac_path_separator
1294 ac_dummy="$PATH"
1295 for ac_dir in $ac_dummy; do
1296   IFS=$ac_save_IFS
1297   test -z "$ac_dir" && ac_dir=.
1298   $as_executable_p "$ac_dir/$ac_word" || continue
1299 ac_cv_prog_ac_ct_CC="$ac_prog"
1300 echo "$as_me:1300: found $ac_dir/$ac_word" >&5
1301 break
1302 done
1303
1304 fi
1305 fi
1306 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1307 if test -n "$ac_ct_CC"; then
1308   echo "$as_me:1308: result: $ac_ct_CC" >&5
1309 echo "${ECHO_T}$ac_ct_CC" >&6
1310 else
1311   echo "$as_me:1311: result: no" >&5
1312 echo "${ECHO_T}no" >&6
1313 fi
1314
1315   test -n "$ac_ct_CC" && break
1316 done
1317
1318   CC=$ac_ct_CC
1319 fi
1320
1321 test -z "$CC" && { { echo "$as_me:1321: error: no acceptable cc found in \$PATH" >&5
1322 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1323    { (exit 1); exit 1; }; }
1324
1325 # Provide some information about the compiler.
1326 echo "$as_me:1326:" \
1327      "checking for C compiler version" >&5
1328 ac_compiler=`set X $ac_compile; echo $2`
1329 { (eval echo "$as_me:1329: \"$ac_compiler --version </dev/null >&5\"") >&5
1330   (eval $ac_compiler --version </dev/null >&5) 2>&5
1331   ac_status=$?
1332   echo "$as_me:1332: \$? = $ac_status" >&5
1333   (exit $ac_status); }
1334 { (eval echo "$as_me:1334: \"$ac_compiler -v </dev/null >&5\"") >&5
1335   (eval $ac_compiler -v </dev/null >&5) 2>&5
1336   ac_status=$?
1337   echo "$as_me:1337: \$? = $ac_status" >&5
1338   (exit $ac_status); }
1339 { (eval echo "$as_me:1339: \"$ac_compiler -V </dev/null >&5\"") >&5
1340   (eval $ac_compiler -V </dev/null >&5) 2>&5
1341   ac_status=$?
1342   echo "$as_me:1342: \$? = $ac_status" >&5
1343   (exit $ac_status); }
1344
1345 cat >conftest.$ac_ext <<_ACEOF
1346 #line 1346 "configure"
1347 #include "confdefs.h"
1348
1349 int
1350 main (void)
1351 {
1352
1353   ;
1354   return 0;
1355 }
1356 _ACEOF
1357 ac_clean_files_save=$ac_clean_files
1358 ac_clean_files="$ac_clean_files a.out a.exe"
1359 # Try to create an executable without -o first, disregard a.out.
1360 # It will help us diagnose broken compilers, and finding out an intuition
1361 # of exeext.
1362 echo "$as_me:1362: checking for C compiler default output" >&5
1363 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1364 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1365 if { (eval echo "$as_me:1365: \"$ac_link_default\"") >&5
1366   (eval $ac_link_default) 2>&5
1367   ac_status=$?
1368   echo "$as_me:1368: \$? = $ac_status" >&5
1369   (exit $ac_status); }; then
1370   # Find the output, starting from the most likely.  This scheme is
1371 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1372 # resort.
1373 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1374                 ls a.out conftest 2>/dev/null;
1375                 ls a.* conftest.* 2>/dev/null`; do
1376   case $ac_file in
1377     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1378     a.out ) # We found the default executable, but exeext='' is most
1379             # certainly right.
1380             break;;
1381     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1382           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1383           export ac_cv_exeext
1384           break;;
1385     * ) break;;
1386   esac
1387 done
1388 else
1389   echo "$as_me: failed program was:" >&5
1390 cat conftest.$ac_ext >&5
1391 { { echo "$as_me:1391: error: C compiler cannot create executables" >&5
1392 echo "$as_me: error: C compiler cannot create executables" >&2;}
1393    { (exit 77); exit 77; }; }
1394 fi
1395
1396 ac_exeext=$ac_cv_exeext
1397 echo "$as_me:1397: result: $ac_file" >&5
1398 echo "${ECHO_T}$ac_file" >&6
1399
1400 # Check the compiler produces executables we can run.  If not, either
1401 # the compiler is broken, or we cross compile.
1402 echo "$as_me:1402: checking whether the C compiler works" >&5
1403 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1404 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1405 # If not cross compiling, check that we can run a simple program.
1406 if test "$cross_compiling" != yes; then
1407   if { ac_try='./$ac_file'
1408   { (eval echo "$as_me:1408: \"$ac_try\"") >&5
1409   (eval $ac_try) 2>&5
1410   ac_status=$?
1411   echo "$as_me:1411: \$? = $ac_status" >&5
1412   (exit $ac_status); }; }; then
1413     cross_compiling=no
1414   else
1415     if test "$cross_compiling" = maybe; then
1416         cross_compiling=yes
1417     else
1418         { { echo "$as_me:1418: error: cannot run C compiled programs.
1419 If you meant to cross compile, use \`--host'." >&5
1420 echo "$as_me: error: cannot run C compiled programs.
1421 If you meant to cross compile, use \`--host'." >&2;}
1422    { (exit 1); exit 1; }; }
1423     fi
1424   fi
1425 fi
1426 echo "$as_me:1426: result: yes" >&5
1427 echo "${ECHO_T}yes" >&6
1428
1429 rm -f a.out a.exe conftest$ac_cv_exeext
1430 ac_clean_files=$ac_clean_files_save
1431 # Check the compiler produces executables we can run.  If not, either
1432 # the compiler is broken, or we cross compile.
1433 echo "$as_me:1433: checking whether we are cross compiling" >&5
1434 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1435 echo "$as_me:1435: result: $cross_compiling" >&5
1436 echo "${ECHO_T}$cross_compiling" >&6
1437
1438 echo "$as_me:1438: checking for executable suffix" >&5
1439 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1440 if { (eval echo "$as_me:1440: \"$ac_link\"") >&5
1441   (eval $ac_link) 2>&5
1442   ac_status=$?
1443   echo "$as_me:1443: \$? = $ac_status" >&5
1444   (exit $ac_status); }; then
1445   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1446 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1447 # work properly (i.e., refer to `conftest.exe'), while it won't with
1448 # `rm'.
1449 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1450   case $ac_file in
1451     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1452     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1453           export ac_cv_exeext
1454           break;;
1455     * ) break;;
1456   esac
1457 done
1458 else
1459   { { echo "$as_me:1459: error: cannot compute EXEEXT: cannot compile and link" >&5
1460 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1461    { (exit 1); exit 1; }; }
1462 fi
1463
1464 rm -f conftest$ac_cv_exeext
1465 echo "$as_me:1465: result: $ac_cv_exeext" >&5
1466 echo "${ECHO_T}$ac_cv_exeext" >&6
1467
1468 rm -f conftest.$ac_ext
1469 EXEEXT=$ac_cv_exeext
1470 ac_exeext=$EXEEXT
1471 echo "$as_me:1471: checking for object suffix" >&5
1472 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1473 if test "${ac_cv_objext+set}" = set; then
1474   echo $ECHO_N "(cached) $ECHO_C" >&6
1475 else
1476   cat >conftest.$ac_ext <<_ACEOF
1477 #line 1477 "configure"
1478 #include "confdefs.h"
1479
1480 int
1481 main (void)
1482 {
1483
1484   ;
1485   return 0;
1486 }
1487 _ACEOF
1488 rm -f conftest.o conftest.obj
1489 if { (eval echo "$as_me:1489: \"$ac_compile\"") >&5
1490   (eval $ac_compile) 2>&5
1491   ac_status=$?
1492   echo "$as_me:1492: \$? = $ac_status" >&5
1493   (exit $ac_status); }; then
1494   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1495   case $ac_file in
1496     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1497     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1498        break;;
1499   esac
1500 done
1501 else
1502   echo "$as_me: failed program was:" >&5
1503 cat conftest.$ac_ext >&5
1504 { { echo "$as_me:1504: error: cannot compute OBJEXT: cannot compile" >&5
1505 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1506    { (exit 1); exit 1; }; }
1507 fi
1508
1509 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1510 fi
1511 echo "$as_me:1511: result: $ac_cv_objext" >&5
1512 echo "${ECHO_T}$ac_cv_objext" >&6
1513 OBJEXT=$ac_cv_objext
1514 ac_objext=$OBJEXT
1515 echo "$as_me:1515: checking whether we are using the GNU C compiler" >&5
1516 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1517 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1518   echo $ECHO_N "(cached) $ECHO_C" >&6
1519 else
1520   cat >conftest.$ac_ext <<_ACEOF
1521 #line 1521 "configure"
1522 #include "confdefs.h"
1523
1524 int
1525 main (void)
1526 {
1527 #ifndef __GNUC__
1528        choke me
1529 #endif
1530
1531   ;
1532   return 0;
1533 }
1534 _ACEOF
1535 rm -f conftest.$ac_objext
1536 if { (eval echo "$as_me:1536: \"$ac_compile\"") >&5
1537   (eval $ac_compile) 2>&5
1538   ac_status=$?
1539   echo "$as_me:1539: \$? = $ac_status" >&5
1540   (exit $ac_status); } &&
1541          { ac_try='test -s conftest.$ac_objext'
1542   { (eval echo "$as_me:1542: \"$ac_try\"") >&5
1543   (eval $ac_try) 2>&5
1544   ac_status=$?
1545   echo "$as_me:1545: \$? = $ac_status" >&5
1546   (exit $ac_status); }; }; then
1547   ac_compiler_gnu=yes
1548 else
1549   echo "$as_me: failed program was:" >&5
1550 cat conftest.$ac_ext >&5
1551 ac_compiler_gnu=no
1552 fi
1553 rm -f conftest.$ac_objext conftest.$ac_ext
1554 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1555
1556 fi
1557 echo "$as_me:1557: result: $ac_cv_c_compiler_gnu" >&5
1558 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1559 GCC=`test $ac_compiler_gnu = yes && echo yes`
1560 ac_test_CFLAGS=${CFLAGS+set}
1561 ac_save_CFLAGS=$CFLAGS
1562 CFLAGS="-g"
1563 echo "$as_me:1563: checking whether $CC accepts -g" >&5
1564 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1565 if test "${ac_cv_prog_cc_g+set}" = set; then
1566   echo $ECHO_N "(cached) $ECHO_C" >&6
1567 else
1568   cat >conftest.$ac_ext <<_ACEOF
1569 #line 1569 "configure"
1570 #include "confdefs.h"
1571
1572 int
1573 main (void)
1574 {
1575
1576   ;
1577   return 0;
1578 }
1579 _ACEOF
1580 rm -f conftest.$ac_objext
1581 if { (eval echo "$as_me:1581: \"$ac_compile\"") >&5
1582   (eval $ac_compile) 2>&5
1583   ac_status=$?
1584   echo "$as_me:1584: \$? = $ac_status" >&5
1585   (exit $ac_status); } &&
1586          { ac_try='test -s conftest.$ac_objext'
1587   { (eval echo "$as_me:1587: \"$ac_try\"") >&5
1588   (eval $ac_try) 2>&5
1589   ac_status=$?
1590   echo "$as_me:1590: \$? = $ac_status" >&5
1591   (exit $ac_status); }; }; then
1592   ac_cv_prog_cc_g=yes
1593 else
1594   echo "$as_me: failed program was:" >&5
1595 cat conftest.$ac_ext >&5
1596 ac_cv_prog_cc_g=no
1597 fi
1598 rm -f conftest.$ac_objext conftest.$ac_ext
1599 fi
1600 echo "$as_me:1600: result: $ac_cv_prog_cc_g" >&5
1601 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1602 if test "$ac_test_CFLAGS" = set; then
1603   CFLAGS=$ac_save_CFLAGS
1604 elif test $ac_cv_prog_cc_g = yes; then
1605   if test "$GCC" = yes; then
1606     CFLAGS="-g -O2"
1607   else
1608     CFLAGS="-g"
1609   fi
1610 else
1611   if test "$GCC" = yes; then
1612     CFLAGS="-O2"
1613   else
1614     CFLAGS=
1615   fi
1616 fi
1617 # Some people use a C++ compiler to compile C.  Since we use `exit',
1618 # in C++ we need to declare it.  In case someone uses the same compiler
1619 # for both compiling C and C++ we need to have the C++ compiler decide
1620 # the declaration of exit, since it's the most demanding environment.
1621 cat >conftest.$ac_ext <<_ACEOF
1622 #ifndef __cplusplus
1623   choke me
1624 #endif
1625 _ACEOF
1626 rm -f conftest.$ac_objext
1627 if { (eval echo "$as_me:1627: \"$ac_compile\"") >&5
1628   (eval $ac_compile) 2>&5
1629   ac_status=$?
1630   echo "$as_me:1630: \$? = $ac_status" >&5
1631   (exit $ac_status); } &&
1632          { ac_try='test -s conftest.$ac_objext'
1633   { (eval echo "$as_me:1633: \"$ac_try\"") >&5
1634   (eval $ac_try) 2>&5
1635   ac_status=$?
1636   echo "$as_me:1636: \$? = $ac_status" >&5
1637   (exit $ac_status); }; }; then
1638   for ac_declaration in \
1639    ''\
1640    '#include <stdlib.h>' \
1641    'extern "C" void std::exit (int) throw (); using std::exit;' \
1642    'extern "C" void std::exit (int); using std::exit;' \
1643    'extern "C" void exit (int) throw ();' \
1644    'extern "C" void exit (int);' \
1645    'void exit (int);'
1646 do
1647   cat >conftest.$ac_ext <<_ACEOF
1648 #line 1648 "configure"
1649 #include "confdefs.h"
1650 #include <stdlib.h>
1651 $ac_declaration
1652 int
1653 main (void)
1654 {
1655 exit (42);
1656   ;
1657   return 0;
1658 }
1659 _ACEOF
1660 rm -f conftest.$ac_objext
1661 if { (eval echo "$as_me:1661: \"$ac_compile\"") >&5
1662   (eval $ac_compile) 2>&5
1663   ac_status=$?
1664   echo "$as_me:1664: \$? = $ac_status" >&5
1665   (exit $ac_status); } &&
1666          { ac_try='test -s conftest.$ac_objext'
1667   { (eval echo "$as_me:1667: \"$ac_try\"") >&5
1668   (eval $ac_try) 2>&5
1669   ac_status=$?
1670   echo "$as_me:1670: \$? = $ac_status" >&5
1671   (exit $ac_status); }; }; then
1672   :
1673 else
1674   echo "$as_me: failed program was:" >&5
1675 cat conftest.$ac_ext >&5
1676 continue
1677 fi
1678 rm -f conftest.$ac_objext conftest.$ac_ext
1679   cat >conftest.$ac_ext <<_ACEOF
1680 #line 1680 "configure"
1681 #include "confdefs.h"
1682 $ac_declaration
1683 int
1684 main (void)
1685 {
1686 exit (42);
1687   ;
1688   return 0;
1689 }
1690 _ACEOF
1691 rm -f conftest.$ac_objext
1692 if { (eval echo "$as_me:1692: \"$ac_compile\"") >&5
1693   (eval $ac_compile) 2>&5
1694   ac_status=$?
1695   echo "$as_me:1695: \$? = $ac_status" >&5
1696   (exit $ac_status); } &&
1697          { ac_try='test -s conftest.$ac_objext'
1698   { (eval echo "$as_me:1698: \"$ac_try\"") >&5
1699   (eval $ac_try) 2>&5
1700   ac_status=$?
1701   echo "$as_me:1701: \$? = $ac_status" >&5
1702   (exit $ac_status); }; }; then
1703   break
1704 else
1705   echo "$as_me: failed program was:" >&5
1706 cat conftest.$ac_ext >&5
1707 fi
1708 rm -f conftest.$ac_objext conftest.$ac_ext
1709 done
1710 rm -rf conftest*
1711 if test -n "$ac_declaration"; then
1712   echo '#ifdef __cplusplus' >>confdefs.h
1713   echo $ac_declaration      >>confdefs.h
1714   echo '#endif'             >>confdefs.h
1715 fi
1716
1717 else
1718   echo "$as_me: failed program was:" >&5
1719 cat conftest.$ac_ext >&5
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 ac_ext=c
1723 ac_cpp='$CPP $CPPFLAGS'
1724 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1725 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1726 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1727 ac_main_return=return
1728
1729 GCC_VERSION=none
1730 if test "$GCC" = yes ; then
1731         echo "$as_me:1731: checking version of $CC" >&5
1732 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1733         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1734         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1735         echo "$as_me:1735: result: $GCC_VERSION" >&5
1736 echo "${ECHO_T}$GCC_VERSION" >&6
1737 fi
1738
1739 echo "$as_me:1739: checking for $CC option to accept ANSI C" >&5
1740 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1741 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1742   echo $ECHO_N "(cached) $ECHO_C" >&6
1743 else
1744   ac_cv_prog_cc_stdc=no
1745 ac_save_CC=$CC
1746 cat >conftest.$ac_ext <<_ACEOF
1747 #line 1747 "configure"
1748 #include "confdefs.h"
1749 #include <stdarg.h>
1750 #include <stdio.h>
1751 #include <sys/types.h>
1752 #include <sys/stat.h>
1753 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1754 struct buf { int x; };
1755 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1756 static char *e (p, i)
1757      char **p;
1758      int i;
1759 {
1760   return p[i];
1761 }
1762 static char *f (char * (*g) (char **, int), char **p, ...)
1763 {
1764   char *s;
1765   va_list v;
1766   va_start (v,p);
1767   s = g (p, va_arg (v,int));
1768   va_end (v);
1769   return s;
1770 }
1771 int test (int i, double x);
1772 struct s1 {int (*f) (int a);};
1773 struct s2 {int (*f) (double a);};
1774 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1775 int argc;
1776 char **argv;
1777 int
1778 main (void)
1779 {
1780 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1781   ;
1782   return 0;
1783 }
1784 _ACEOF
1785 # Don't try gcc -ansi; that turns off useful extensions and
1786 # breaks some systems' header files.
1787 # AIX                   -qlanglvl=ansi
1788 # Ultrix and OSF/1      -std1
1789 # HP-UX 10.20 and later -Ae
1790 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1791 # SVR4                  -Xc -D__EXTENSIONS__
1792 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1793 do
1794   CC="$ac_save_CC $ac_arg"
1795   rm -f conftest.$ac_objext
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit $ac_status); } &&
1801          { ac_try='test -s conftest.$ac_objext'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit $ac_status); }; }; then
1807   ac_cv_prog_cc_stdc=$ac_arg
1808 break
1809 else
1810   echo "$as_me: failed program was:" >&5
1811 cat conftest.$ac_ext >&5
1812 fi
1813 rm -f conftest.$ac_objext
1814 done
1815 rm -f conftest.$ac_ext conftest.$ac_objext
1816 CC=$ac_save_CC
1817
1818 fi
1819
1820 case "x$ac_cv_prog_cc_stdc" in
1821   x|xno)
1822     echo "$as_me:1822: result: none needed" >&5
1823 echo "${ECHO_T}none needed" >&6 ;;
1824   *)
1825     echo "$as_me:1825: result: $ac_cv_prog_cc_stdc" >&5
1826 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1827     CC="$CC $ac_cv_prog_cc_stdc" ;;
1828 esac
1829
1830 # This should have been defined by AC_PROG_CC
1831 : ${CC:=cc}
1832
1833 echo "$as_me:1833: checking \$CC variable" >&5
1834 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1835 case "$CC" in
1836 (*[\ \  ]-*)
1837         echo "$as_me:1837: result: broken" >&5
1838 echo "${ECHO_T}broken" >&6
1839         { echo "$as_me:1839: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1840 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1841         # humor him...
1842         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1843         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1844         CC="$cf_prog"
1845         for cf_arg in $cf_flags
1846         do
1847                 case "x$cf_arg" in
1848                 (x-[IUDfgOW]*)
1849
1850 cf_fix_cppflags=no
1851 cf_new_cflags=
1852 cf_new_cppflags=
1853 cf_new_extra_cppflags=
1854
1855 for cf_add_cflags in $cf_arg
1856 do
1857 case $cf_fix_cppflags in
1858 (no)
1859         case $cf_add_cflags in
1860         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1861                 case $cf_add_cflags in
1862                 (-D*)
1863                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1864
1865                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1866                                 && test -z "${cf_tst_cflags}" \
1867                                 && cf_fix_cppflags=yes
1868
1869                         if test $cf_fix_cppflags = yes ; then
1870
1871         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1872         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1873
1874                                 continue
1875                         elif test "${cf_tst_cflags}" = "\"'" ; then
1876
1877         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1878         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1879
1880                                 continue
1881                         fi
1882                         ;;
1883                 esac
1884                 case "$CPPFLAGS" in
1885                 (*$cf_add_cflags)
1886                         ;;
1887                 (*)
1888                         case $cf_add_cflags in
1889                         (-D*)
1890                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1891
1892 CPPFLAGS=`echo "$CPPFLAGS" | \
1893         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1894                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1895
1896                                 ;;
1897                         esac
1898
1899         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
1900         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
1901
1902                         ;;
1903                 esac
1904                 ;;
1905         (*)
1906
1907         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
1908         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
1909
1910                 ;;
1911         esac
1912         ;;
1913 (yes)
1914
1915         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1916         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1917
1918         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1919
1920         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1921                 && test -z "${cf_tst_cflags}" \
1922                 && cf_fix_cppflags=no
1923         ;;
1924 esac
1925 done
1926
1927 if test -n "$cf_new_cflags" ; then
1928
1929         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1930         CFLAGS="${CFLAGS}$cf_new_cflags"
1931
1932 fi
1933
1934 if test -n "$cf_new_cppflags" ; then
1935
1936         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
1937         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
1938
1939 fi
1940
1941 if test -n "$cf_new_extra_cppflags" ; then
1942
1943         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
1944         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
1945
1946 fi
1947
1948                         ;;
1949                 (*)
1950                         CC="$CC $cf_arg"
1951                         ;;
1952                 esac
1953         done
1954         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
1955
1956 echo "${as_me:-configure}:1956: testing resulting CC: '$CC' ..." 1>&5
1957
1958         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
1959
1960 echo "${as_me:-configure}:1960: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
1961
1962         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
1963
1964 echo "${as_me:-configure}:1964: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
1965
1966         ;;
1967 (*)
1968         echo "$as_me:1968: result: ok" >&5
1969 echo "${ECHO_T}ok" >&6
1970         ;;
1971 esac
1972
1973 ac_ext=c
1974 ac_cpp='$CPP $CPPFLAGS'
1975 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1976 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1977 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1978 ac_main_return=return
1979 echo "$as_me:1979: checking how to run the C preprocessor" >&5
1980 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1981 # On Suns, sometimes $CPP names a directory.
1982 if test -n "$CPP" && test -d "$CPP"; then
1983   CPP=
1984 fi
1985 if test -z "$CPP"; then
1986   if test "${ac_cv_prog_CPP+set}" = set; then
1987   echo $ECHO_N "(cached) $ECHO_C" >&6
1988 else
1989       # Double quotes because CPP needs to be expanded
1990     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1991     do
1992       ac_preproc_ok=false
1993 for ac_c_preproc_warn_flag in '' yes
1994 do
1995   # Use a header file that comes with gcc, so configuring glibc
1996   # with a fresh cross-compiler works.
1997   # On the NeXT, cc -E runs the code through the compiler's parser,
1998   # not just through cpp. "Syntax error" is here to catch this case.
1999   cat >conftest.$ac_ext <<_ACEOF
2000 #line 2000 "configure"
2001 #include "confdefs.h"
2002 #include <assert.h>
2003                      Syntax error
2004 _ACEOF
2005 if { (eval echo "$as_me:2005: \"$ac_cpp conftest.$ac_ext\"") >&5
2006   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2007   ac_status=$?
2008   egrep -v '^ *\+' conftest.er1 >conftest.err
2009   rm -f conftest.er1
2010   cat conftest.err >&5
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit $ac_status); } >/dev/null; then
2013   if test -s conftest.err; then
2014     ac_cpp_err=$ac_c_preproc_warn_flag
2015   else
2016     ac_cpp_err=
2017   fi
2018 else
2019   ac_cpp_err=yes
2020 fi
2021 if test -z "$ac_cpp_err"; then
2022   :
2023 else
2024   echo "$as_me: failed program was:" >&5
2025   cat conftest.$ac_ext >&5
2026   # Broken: fails on valid input.
2027 continue
2028 fi
2029 rm -f conftest.err conftest.$ac_ext
2030
2031   # OK, works on sane cases.  Now check whether non-existent headers
2032   # can be detected and how.
2033   cat >conftest.$ac_ext <<_ACEOF
2034 #line 2034 "configure"
2035 #include "confdefs.h"
2036 #include <ac_nonexistent.h>
2037 _ACEOF
2038 if { (eval echo "$as_me:2038: \"$ac_cpp conftest.$ac_ext\"") >&5
2039   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2040   ac_status=$?
2041   egrep -v '^ *\+' conftest.er1 >conftest.err
2042   rm -f conftest.er1
2043   cat conftest.err >&5
2044   echo "$as_me:2044: \$? = $ac_status" >&5
2045   (exit $ac_status); } >/dev/null; then
2046   if test -s conftest.err; then
2047     ac_cpp_err=$ac_c_preproc_warn_flag
2048   else
2049     ac_cpp_err=
2050   fi
2051 else
2052   ac_cpp_err=yes
2053 fi
2054 if test -z "$ac_cpp_err"; then
2055   # Broken: success on invalid input.
2056 continue
2057 else
2058   echo "$as_me: failed program was:" >&5
2059   cat conftest.$ac_ext >&5
2060   # Passes both tests.
2061 ac_preproc_ok=:
2062 break
2063 fi
2064 rm -f conftest.err conftest.$ac_ext
2065
2066 done
2067 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2068 rm -f conftest.err conftest.$ac_ext
2069 if $ac_preproc_ok; then
2070   break
2071 fi
2072
2073     done
2074     ac_cv_prog_CPP=$CPP
2075
2076 fi
2077   CPP=$ac_cv_prog_CPP
2078 else
2079   ac_cv_prog_CPP=$CPP
2080 fi
2081 echo "$as_me:2081: result: $CPP" >&5
2082 echo "${ECHO_T}$CPP" >&6
2083 ac_preproc_ok=false
2084 for ac_c_preproc_warn_flag in '' yes
2085 do
2086   # Use a header file that comes with gcc, so configuring glibc
2087   # with a fresh cross-compiler works.
2088   # On the NeXT, cc -E runs the code through the compiler's parser,
2089   # not just through cpp. "Syntax error" is here to catch this case.
2090   cat >conftest.$ac_ext <<_ACEOF
2091 #line 2091 "configure"
2092 #include "confdefs.h"
2093 #include <assert.h>
2094                      Syntax error
2095 _ACEOF
2096 if { (eval echo "$as_me:2096: \"$ac_cpp conftest.$ac_ext\"") >&5
2097   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2098   ac_status=$?
2099   egrep -v '^ *\+' conftest.er1 >conftest.err
2100   rm -f conftest.er1
2101   cat conftest.err >&5
2102   echo "$as_me:2102: \$? = $ac_status" >&5
2103   (exit $ac_status); } >/dev/null; then
2104   if test -s conftest.err; then
2105     ac_cpp_err=$ac_c_preproc_warn_flag
2106   else
2107     ac_cpp_err=
2108   fi
2109 else
2110   ac_cpp_err=yes
2111 fi
2112 if test -z "$ac_cpp_err"; then
2113   :
2114 else
2115   echo "$as_me: failed program was:" >&5
2116   cat conftest.$ac_ext >&5
2117   # Broken: fails on valid input.
2118 continue
2119 fi
2120 rm -f conftest.err conftest.$ac_ext
2121
2122   # OK, works on sane cases.  Now check whether non-existent headers
2123   # can be detected and how.
2124   cat >conftest.$ac_ext <<_ACEOF
2125 #line 2125 "configure"
2126 #include "confdefs.h"
2127 #include <ac_nonexistent.h>
2128 _ACEOF
2129 if { (eval echo "$as_me:2129: \"$ac_cpp conftest.$ac_ext\"") >&5
2130   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2131   ac_status=$?
2132   egrep -v '^ *\+' conftest.er1 >conftest.err
2133   rm -f conftest.er1
2134   cat conftest.err >&5
2135   echo "$as_me:2135: \$? = $ac_status" >&5
2136   (exit $ac_status); } >/dev/null; then
2137   if test -s conftest.err; then
2138     ac_cpp_err=$ac_c_preproc_warn_flag
2139   else
2140     ac_cpp_err=
2141   fi
2142 else
2143   ac_cpp_err=yes
2144 fi
2145 if test -z "$ac_cpp_err"; then
2146   # Broken: success on invalid input.
2147 continue
2148 else
2149   echo "$as_me: failed program was:" >&5
2150   cat conftest.$ac_ext >&5
2151   # Passes both tests.
2152 ac_preproc_ok=:
2153 break
2154 fi
2155 rm -f conftest.err conftest.$ac_ext
2156
2157 done
2158 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2159 rm -f conftest.err conftest.$ac_ext
2160 if $ac_preproc_ok; then
2161   :
2162 else
2163   { { echo "$as_me:2163: error: C preprocessor \"$CPP\" fails sanity check" >&5
2164 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2165    { (exit 1); exit 1; }; }
2166 fi
2167
2168 ac_ext=c
2169 ac_cpp='$CPP $CPPFLAGS'
2170 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2171 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2172 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2173 ac_main_return=return
2174
2175 if test $ac_cv_c_compiler_gnu = yes; then
2176     echo "$as_me:2176: checking whether $CC needs -traditional" >&5
2177 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2178 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2179   echo $ECHO_N "(cached) $ECHO_C" >&6
2180 else
2181     ac_pattern="Autoconf.*'x'"
2182   cat >conftest.$ac_ext <<_ACEOF
2183 #line 2183 "configure"
2184 #include "confdefs.h"
2185 #include <sgtty.h>
2186 int Autoconf = TIOCGETP;
2187 _ACEOF
2188 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2189   egrep "$ac_pattern" >/dev/null 2>&1; then
2190   ac_cv_prog_gcc_traditional=yes
2191 else
2192   ac_cv_prog_gcc_traditional=no
2193 fi
2194 rm -rf conftest*
2195
2196   if test $ac_cv_prog_gcc_traditional = no; then
2197     cat >conftest.$ac_ext <<_ACEOF
2198 #line 2198 "configure"
2199 #include "confdefs.h"
2200 #include <termio.h>
2201 int Autoconf = TCGETA;
2202 _ACEOF
2203 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2204   egrep "$ac_pattern" >/dev/null 2>&1; then
2205   ac_cv_prog_gcc_traditional=yes
2206 fi
2207 rm -rf conftest*
2208
2209   fi
2210 fi
2211 echo "$as_me:2211: result: $ac_cv_prog_gcc_traditional" >&5
2212 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2213   if test $ac_cv_prog_gcc_traditional = yes; then
2214     CC="$CC -traditional"
2215   fi
2216 fi
2217
2218 echo "$as_me:2218: checking whether $CC understands -c and -o together" >&5
2219 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2220 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2221   echo $ECHO_N "(cached) $ECHO_C" >&6
2222 else
2223
2224 cat > conftest.$ac_ext <<CF_EOF
2225 int main(void)
2226 {
2227         ${cf_cv_main_return:-return}(0);
2228 }
2229 CF_EOF
2230 # We do the test twice because some compilers refuse to overwrite an
2231 # existing .o file with -o, though they will create one.
2232 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2233 if { (eval echo "$as_me:2233: \"$ac_try\"") >&5
2234   (eval $ac_try) 2>&5
2235   ac_status=$?
2236   echo "$as_me:2236: \$? = $ac_status" >&5
2237   (exit $ac_status); } &&
2238   test -f conftest2.$ac_objext && { (eval echo "$as_me:2238: \"$ac_try\"") >&5
2239   (eval $ac_try) 2>&5
2240   ac_status=$?
2241   echo "$as_me:2241: \$? = $ac_status" >&5
2242   (exit $ac_status); };
2243 then
2244   eval cf_cv_prog_CC_c_o=yes
2245 else
2246   eval cf_cv_prog_CC_c_o=no
2247 fi
2248 rm -rf conftest*
2249
2250 fi
2251 if test $cf_cv_prog_CC_c_o = yes; then
2252   echo "$as_me:2252: result: yes" >&5
2253 echo "${ECHO_T}yes" >&6
2254 else
2255   echo "$as_me:2255: result: no" >&5
2256 echo "${ECHO_T}no" >&6
2257 fi
2258
2259 test "$program_prefix" != NONE &&
2260   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2261 # Use a double $ so make ignores it.
2262 test "$program_suffix" != NONE &&
2263   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2264 # Double any \ or $.  echo might interpret backslashes.
2265 # By default was `s,x,x', remove it if useless.
2266 cat <<\_ACEOF >conftest.sed
2267 s/[\\$]/&&/g;s/;s,x,x,$//
2268 _ACEOF
2269 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2270 rm conftest.sed
2271
2272 for ac_prog in mawk gawk nawk awk
2273 do
2274   # Extract the first word of "$ac_prog", so it can be a program name with args.
2275 set dummy $ac_prog; ac_word=$2
2276 echo "$as_me:2276: checking for $ac_word" >&5
2277 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2278 if test "${ac_cv_prog_AWK+set}" = set; then
2279   echo $ECHO_N "(cached) $ECHO_C" >&6
2280 else
2281   if test -n "$AWK"; then
2282   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2283 else
2284   ac_save_IFS=$IFS; IFS=$ac_path_separator
2285 ac_dummy="$PATH"
2286 for ac_dir in $ac_dummy; do
2287   IFS=$ac_save_IFS
2288   test -z "$ac_dir" && ac_dir=.
2289   $as_executable_p "$ac_dir/$ac_word" || continue
2290 ac_cv_prog_AWK="$ac_prog"
2291 echo "$as_me:2291: found $ac_dir/$ac_word" >&5
2292 break
2293 done
2294
2295 fi
2296 fi
2297 AWK=$ac_cv_prog_AWK
2298 if test -n "$AWK"; then
2299   echo "$as_me:2299: result: $AWK" >&5
2300 echo "${ECHO_T}$AWK" >&6
2301 else
2302   echo "$as_me:2302: result: no" >&5
2303 echo "${ECHO_T}no" >&6
2304 fi
2305
2306   test -n "$AWK" && break
2307 done
2308
2309 test -z "$AWK" && { { echo "$as_me:2309: error: No awk program found" >&5
2310 echo "$as_me: error: No awk program found" >&2;}
2311    { (exit 1); exit 1; }; }
2312
2313 echo "$as_me:2313: checking for egrep" >&5
2314 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2315 if test "${ac_cv_prog_egrep+set}" = set; then
2316   echo $ECHO_N "(cached) $ECHO_C" >&6
2317 else
2318   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2319                 then ac_cv_prog_egrep='grep -E'
2320                 else ac_cv_prog_egrep='egrep'
2321         fi
2322 fi
2323 echo "$as_me:2323: result: $ac_cv_prog_egrep" >&5
2324 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2325         EGREP=$ac_cv_prog_egrep
2326
2327         test -z "$EGREP" && { { echo "$as_me:2327: error: No egrep program found" >&5
2328 echo "$as_me: error: No egrep program found" >&2;}
2329    { (exit 1); exit 1; }; }
2330
2331 # Find a good install program.  We prefer a C program (faster),
2332 # so one script is as good as another.  But avoid the broken or
2333 # incompatible versions:
2334 # SysV /etc/install, /usr/sbin/install
2335 # SunOS /usr/etc/install
2336 # IRIX /sbin/install
2337 # AIX /bin/install
2338 # AmigaOS /C/install, which installs bootblocks on floppy discs
2339 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2340 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2341 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2342 # ./install, which can be erroneously created by make from ./install.sh.
2343 echo "$as_me:2343: checking for a BSD compatible install" >&5
2344 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2345 if test -z "$INSTALL"; then
2346 if test "${ac_cv_path_install+set}" = set; then
2347   echo $ECHO_N "(cached) $ECHO_C" >&6
2348 else
2349     ac_save_IFS=$IFS; IFS=$ac_path_separator
2350   for ac_dir in $PATH; do
2351     IFS=$ac_save_IFS
2352     # Account for people who put trailing slashes in PATH elements.
2353     case $ac_dir/ in
2354     / | ./ | .// | /cC/* \
2355     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2356     | /usr/ucb/* ) ;;
2357     *)
2358       # OSF1 and SCO ODT 3.0 have their own names for install.
2359       # Don't use installbsd from OSF since it installs stuff as root
2360       # by default.
2361       for ac_prog in ginstall scoinst install; do
2362         if $as_executable_p "$ac_dir/$ac_prog"; then
2363           if test $ac_prog = install &&
2364             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2365             # AIX install.  It has an incompatible calling convention.
2366             :
2367           elif test $ac_prog = install &&
2368             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2369             # program-specific install script used by HP pwplus--don't use.
2370             :
2371           else
2372             ac_cv_path_install="$ac_dir/$ac_prog -c"
2373             break 2
2374           fi
2375         fi
2376       done
2377       ;;
2378     esac
2379   done
2380
2381 fi
2382   if test "${ac_cv_path_install+set}" = set; then
2383     INSTALL=$ac_cv_path_install
2384   else
2385     # As a last resort, use the slow shell script.  We don't cache a
2386     # path for INSTALL within a source directory, because that will
2387     # break other packages using the cache if that directory is
2388     # removed, or if the path is relative.
2389     INSTALL=$ac_install_sh
2390   fi
2391 fi
2392 echo "$as_me:2392: result: $INSTALL" >&5
2393 echo "${ECHO_T}$INSTALL" >&6
2394
2395 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2396 # It thinks the first close brace ends the variable substitution.
2397 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2398
2399 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2400
2401 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2402
2403 echo "$as_me:2403: checking whether ln -s works" >&5
2404 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2405 LN_S=$as_ln_s
2406 if test "$LN_S" = "ln -s"; then
2407   echo "$as_me:2407: result: yes" >&5
2408 echo "${ECHO_T}yes" >&6
2409 else
2410   echo "$as_me:2410: result: no, using $LN_S" >&5
2411 echo "${ECHO_T}no, using $LN_S" >&6
2412 fi
2413
2414 echo "$as_me:2414: checking if $LN_S -f options work" >&5
2415 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2416
2417 rm -f conf$$.src conf$$dst
2418 echo >conf$$.dst
2419 echo first >conf$$.src
2420 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2421         cf_prog_ln_sf=yes
2422 else
2423         cf_prog_ln_sf=no
2424 fi
2425 rm -f conf$$.dst conf$$src
2426 echo "$as_me:2426: result: $cf_prog_ln_sf" >&5
2427 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2428
2429 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2430
2431 # Find a good install program.  We prefer a C program (faster),
2432 # so one script is as good as another.  But avoid the broken or
2433 # incompatible versions:
2434 # SysV /etc/install, /usr/sbin/install
2435 # SunOS /usr/etc/install
2436 # IRIX /sbin/install
2437 # AIX /bin/install
2438 # AmigaOS /C/install, which installs bootblocks on floppy discs
2439 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2440 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2441 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2442 # ./install, which can be erroneously created by make from ./install.sh.
2443 echo "$as_me:2443: checking for a BSD compatible install" >&5
2444 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2445 if test -z "$INSTALL"; then
2446 if test "${ac_cv_path_install+set}" = set; then
2447   echo $ECHO_N "(cached) $ECHO_C" >&6
2448 else
2449     ac_save_IFS=$IFS; IFS=$ac_path_separator
2450   for ac_dir in $PATH; do
2451     IFS=$ac_save_IFS
2452     # Account for people who put trailing slashes in PATH elements.
2453     case $ac_dir/ in
2454     / | ./ | .// | /cC/* \
2455     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2456     | /usr/ucb/* ) ;;
2457     *)
2458       # OSF1 and SCO ODT 3.0 have their own names for install.
2459       # Don't use installbsd from OSF since it installs stuff as root
2460       # by default.
2461       for ac_prog in ginstall scoinst install; do
2462         if $as_executable_p "$ac_dir/$ac_prog"; then
2463           if test $ac_prog = install &&
2464             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2465             # AIX install.  It has an incompatible calling convention.
2466             :
2467           elif test $ac_prog = install &&
2468             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2469             # program-specific install script used by HP pwplus--don't use.
2470             :
2471           else
2472             ac_cv_path_install="$ac_dir/$ac_prog -c"
2473             break 2
2474           fi
2475         fi
2476       done
2477       ;;
2478     esac
2479   done
2480
2481 fi
2482   if test "${ac_cv_path_install+set}" = set; then
2483     INSTALL=$ac_cv_path_install
2484   else
2485     # As a last resort, use the slow shell script.  We don't cache a
2486     # path for INSTALL within a source directory, because that will
2487     # break other packages using the cache if that directory is
2488     # removed, or if the path is relative.
2489     INSTALL=$ac_install_sh
2490   fi
2491 fi
2492 echo "$as_me:2492: result: $INSTALL" >&5
2493 echo "${ECHO_T}$INSTALL" >&6
2494
2495 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2496 # It thinks the first close brace ends the variable substitution.
2497 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2498
2499 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2500
2501 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2502
2503 case $INSTALL in
2504 (/*)
2505         ;;
2506 (*)
2507         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2508         test -z "$cf_dir" && cf_dir=.
2509         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2510         ;;
2511 esac
2512
2513 echo "$as_me:2513: checking if you want to install stripped executables" >&5
2514 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2515
2516 # Check whether --enable-stripping or --disable-stripping was given.
2517 if test "${enable_stripping+set}" = set; then
2518   enableval="$enable_stripping"
2519   test "$enableval" != no && enableval=yes
2520         if test "$enableval" != "yes" ; then
2521     with_stripping=no
2522         else
2523                 with_stripping=yes
2524         fi
2525 else
2526   enableval=yes
2527         with_stripping=yes
2528
2529 fi;
2530 echo "$as_me:2530: result: $with_stripping" >&5
2531 echo "${ECHO_T}$with_stripping" >&6
2532
2533 if test "$with_stripping" = yes
2534 then
2535         INSTALL_OPT_S="-s"
2536 else
2537         INSTALL_OPT_S=
2538 fi
2539
2540 echo "$as_me:2540: checking if install needs to be told about ownership" >&5
2541 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2542 case `$ac_config_guess` in
2543 (*minix)
2544         with_install_o=yes
2545         ;;
2546 (*)
2547         with_install_o=no
2548         ;;
2549 esac
2550
2551 echo "$as_me:2551: result: $with_install_o" >&5
2552 echo "${ECHO_T}$with_install_o" >&6
2553 if test "x$with_install_o" = xyes
2554 then
2555         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2556 else
2557         INSTALL_OPT_O=
2558 fi
2559
2560 echo "$as_me:2560: checking for long file names" >&5
2561 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2562 if test "${ac_cv_sys_long_file_names+set}" = set; then
2563   echo $ECHO_N "(cached) $ECHO_C" >&6
2564 else
2565   ac_cv_sys_long_file_names=yes
2566 # Test for long file names in all the places we know might matter:
2567 #      .                the current directory, where building will happen
2568 #      $prefix/lib      where we will be installing things
2569 #      $exec_prefix/lib likewise
2570 # eval it to expand exec_prefix.
2571 #      $TMPDIR          if set, where it might want to write temporary files
2572 # if $TMPDIR is not set:
2573 #      /tmp             where it might want to write temporary files
2574 #      /var/tmp         likewise
2575 #      /usr/tmp         likewise
2576 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2577   ac_tmpdirs=$TMPDIR
2578 else
2579   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2580 fi
2581 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2582   test -d $ac_dir || continue
2583   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2584   ac_xdir=$ac_dir/cf$$
2585   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2586   ac_tf1=$ac_xdir/conftest9012345
2587   ac_tf2=$ac_xdir/conftest9012346
2588   (echo 1 >$ac_tf1) 2>/dev/null
2589   (echo 2 >$ac_tf2) 2>/dev/null
2590   ac_val=`cat $ac_tf1 2>/dev/null`
2591   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2592     ac_cv_sys_long_file_names=no
2593     rm -rf $ac_xdir 2>/dev/null
2594     break
2595   fi
2596   rm -rf $ac_xdir 2>/dev/null
2597 done
2598 fi
2599 echo "$as_me:2599: result: $ac_cv_sys_long_file_names" >&5
2600 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2601 if test $ac_cv_sys_long_file_names = yes; then
2602
2603 cat >>confdefs.h <<\EOF
2604 #define HAVE_LONG_FILE_NAMES 1
2605 EOF
2606
2607 fi
2608
2609 # if we find pkg-config, check if we should install the ".pc" files.
2610
2611 echo "$as_me:2611: checking if you want to use pkg-config" >&5
2612 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2613
2614 # Check whether --with-pkg-config or --without-pkg-config was given.
2615 if test "${with_pkg_config+set}" = set; then
2616   withval="$with_pkg_config"
2617   cf_pkg_config=$withval
2618 else
2619   cf_pkg_config=yes
2620 fi;
2621 echo "$as_me:2621: result: $cf_pkg_config" >&5
2622 echo "${ECHO_T}$cf_pkg_config" >&6
2623
2624 case $cf_pkg_config in
2625 (no)
2626         PKG_CONFIG=none
2627         ;;
2628 (yes)
2629
2630 if test -n "$ac_tool_prefix"; then
2631   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2632 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2633 echo "$as_me:2633: checking for $ac_word" >&5
2634 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2635 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2636   echo $ECHO_N "(cached) $ECHO_C" >&6
2637 else
2638   case $PKG_CONFIG in
2639   [\\/]* | ?:[\\/]*)
2640   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2641   ;;
2642   *)
2643   ac_save_IFS=$IFS; IFS=$ac_path_separator
2644 ac_dummy="$PATH"
2645 for ac_dir in $ac_dummy; do
2646   IFS=$ac_save_IFS
2647   test -z "$ac_dir" && ac_dir=.
2648   if $as_executable_p "$ac_dir/$ac_word"; then
2649    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2650    echo "$as_me:2650: found $ac_dir/$ac_word" >&5
2651    break
2652 fi
2653 done
2654
2655   ;;
2656 esac
2657 fi
2658 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2659
2660 if test -n "$PKG_CONFIG"; then
2661   echo "$as_me:2661: result: $PKG_CONFIG" >&5
2662 echo "${ECHO_T}$PKG_CONFIG" >&6
2663 else
2664   echo "$as_me:2664: result: no" >&5
2665 echo "${ECHO_T}no" >&6
2666 fi
2667
2668 fi
2669 if test -z "$ac_cv_path_PKG_CONFIG"; then
2670   ac_pt_PKG_CONFIG=$PKG_CONFIG
2671   # Extract the first word of "pkg-config", so it can be a program name with args.
2672 set dummy pkg-config; ac_word=$2
2673 echo "$as_me:2673: checking for $ac_word" >&5
2674 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2675 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2676   echo $ECHO_N "(cached) $ECHO_C" >&6
2677 else
2678   case $ac_pt_PKG_CONFIG in
2679   [\\/]* | ?:[\\/]*)
2680   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2681   ;;
2682   *)
2683   ac_save_IFS=$IFS; IFS=$ac_path_separator
2684 ac_dummy="$PATH"
2685 for ac_dir in $ac_dummy; do
2686   IFS=$ac_save_IFS
2687   test -z "$ac_dir" && ac_dir=.
2688   if $as_executable_p "$ac_dir/$ac_word"; then
2689    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2690    echo "$as_me:2690: found $ac_dir/$ac_word" >&5
2691    break
2692 fi
2693 done
2694
2695   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2696   ;;
2697 esac
2698 fi
2699 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2700
2701 if test -n "$ac_pt_PKG_CONFIG"; then
2702   echo "$as_me:2702: result: $ac_pt_PKG_CONFIG" >&5
2703 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2704 else
2705   echo "$as_me:2705: result: no" >&5
2706 echo "${ECHO_T}no" >&6
2707 fi
2708
2709   PKG_CONFIG=$ac_pt_PKG_CONFIG
2710 else
2711   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2712 fi
2713
2714         ;;
2715 (*)
2716         PKG_CONFIG=$withval
2717         ;;
2718 esac
2719
2720 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2721 if test "$PKG_CONFIG" != none ; then
2722
2723 if test "x$prefix" != xNONE; then
2724         cf_path_syntax="$prefix"
2725 else
2726         cf_path_syntax="$ac_default_prefix"
2727 fi
2728
2729 case ".$PKG_CONFIG" in
2730 (.\$\(*\)*|.\'*\'*)
2731         ;;
2732 (..|./*|.\\*)
2733         ;;
2734 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2735         ;;
2736 (.\${*prefix}*|.\${*dir}*)
2737         eval PKG_CONFIG="$PKG_CONFIG"
2738         case ".$PKG_CONFIG" in
2739         (.NONE/*)
2740                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2741                 ;;
2742         esac
2743         ;;
2744 (.no|.NONE/*)
2745         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2746         ;;
2747 (*)
2748         { { echo "$as_me:2748: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2749 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2750    { (exit 1); exit 1; }; }
2751         ;;
2752 esac
2753
2754 elif test "x$cf_pkg_config" != xno ; then
2755         { echo "$as_me:2755: WARNING: pkg-config is not installed" >&5
2756 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2757 fi
2758
2759 case $PKG_CONFIG in
2760 (no|none|yes)
2761         echo "$as_me:2761: checking for pkg-config library directory" >&5
2762 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2763         ;;
2764 (*)
2765         echo "$as_me:2765: checking for $PKG_CONFIG library directory" >&5
2766 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2767         ;;
2768 esac
2769
2770 PKG_CONFIG_LIBDIR=no
2771
2772 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2773 if test "${with_pkg_config_libdir+set}" = set; then
2774   withval="$with_pkg_config_libdir"
2775   PKG_CONFIG_LIBDIR=$withval
2776 else
2777   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2778 fi;
2779
2780 case x$PKG_CONFIG_LIBDIR in
2781 (x/*)
2782         ;;
2783 (xyes)
2784         # Look for the library directory using the same prefix as the executable
2785         if test "x$PKG_CONFIG" = xnone
2786         then
2787                 cf_path=$prefix
2788         else
2789                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2790         fi
2791
2792         # If you don't like using the default architecture, you have to specify the
2793         # intended library directory and corresponding compiler/linker options.
2794         #
2795         # This case allows for Debian's 2014-flavor of multiarch, along with the
2796         # most common variations before that point.  Some other variants spell the
2797         # directory differently, e.g., "pkg-config", and put it in unusual places.
2798         # pkg-config has always been poorly standardized, which is ironic...
2799         case x`(arch) 2>/dev/null` in
2800         (*64)
2801                 cf_search_path="\
2802                         $cf_path/lib/*64-linux-gnu \
2803                         $cf_path/share \
2804                         $cf_path/lib64 \
2805                         $cf_path/lib32 \
2806                         $cf_path/lib"
2807                 ;;
2808         (*)
2809                 cf_search_path="\
2810                         $cf_path/lib/*-linux-gnu \
2811                         $cf_path/share \
2812                         $cf_path/lib32 \
2813                         $cf_path/lib \
2814                         $cf_path/libdata"
2815                 ;;
2816         esac
2817
2818         test -n "$verbose" && echo "    list..." 1>&6
2819
2820 echo "${as_me:-configure}:2820: testing list... ..." 1>&5
2821
2822         for cf_config in $cf_search_path
2823         do
2824                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2825
2826 echo "${as_me:-configure}:2826: testing checking $cf_config/pkgconfig ..." 1>&5
2827
2828                 if test -d $cf_config/pkgconfig
2829                 then
2830                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2831                         echo "$as_me:2831: checking done" >&5
2832 echo $ECHO_N "checking done... $ECHO_C" >&6
2833                         break
2834                 fi
2835         done
2836         ;;
2837 (*)
2838         ;;
2839 esac
2840
2841 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
2842         echo "$as_me:2842: result: $PKG_CONFIG_LIBDIR" >&5
2843 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2844 fi
2845
2846 echo "$as_me:2846: checking if you want to build test-programs" >&5
2847 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2848
2849 # Check whether --with-tests or --without-tests was given.
2850 if test "${with_tests+set}" = set; then
2851   withval="$with_tests"
2852   cf_with_tests=$withval
2853 else
2854   cf_with_tests=yes
2855 fi;
2856 echo "$as_me:2856: result: $cf_with_tests" >&5
2857 echo "${ECHO_T}$cf_with_tests" >&6
2858
2859 echo "$as_me:2859: checking if we should assume mixed-case filenames" >&5
2860 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2861
2862 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2863 if test "${enable_mixed_case+set}" = set; then
2864   enableval="$enable_mixed_case"
2865   enable_mixedcase=$enableval
2866 else
2867   enable_mixedcase=auto
2868 fi;
2869 echo "$as_me:2869: result: $enable_mixedcase" >&5
2870 echo "${ECHO_T}$enable_mixedcase" >&6
2871 if test "$enable_mixedcase" = "auto" ; then
2872
2873 echo "$as_me:2873: checking if filesystem supports mixed-case filenames" >&5
2874 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2875 if test "${cf_cv_mixedcase+set}" = set; then
2876   echo $ECHO_N "(cached) $ECHO_C" >&6
2877 else
2878
2879 if test "$cross_compiling" = yes ; then
2880         case $target_alias in
2881         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2882                 cf_cv_mixedcase=no
2883                 ;;
2884         (*)
2885                 cf_cv_mixedcase=yes
2886                 ;;
2887         esac
2888 else
2889         rm -f conftest CONFTEST
2890         echo test >conftest
2891         if test -f CONFTEST ; then
2892                 cf_cv_mixedcase=no
2893         else
2894                 cf_cv_mixedcase=yes
2895         fi
2896         rm -f conftest CONFTEST
2897 fi
2898
2899 fi
2900 echo "$as_me:2900: result: $cf_cv_mixedcase" >&5
2901 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2902 test "$cf_cv_mixedcase" = yes &&
2903 cat >>confdefs.h <<\EOF
2904 #define MIXEDCASE_FILENAMES 1
2905 EOF
2906
2907 else
2908         cf_cv_mixedcase=$enable_mixedcase
2909         if test "$enable_mixedcase" = "yes" ; then
2910                 cat >>confdefs.h <<\EOF
2911 #define MIXEDCASE_FILENAMES 1
2912 EOF
2913
2914         fi
2915 fi
2916
2917 # do this after mixed-case option (tags/TAGS is not as important as tic).
2918 echo "$as_me:2918: checking whether ${MAKE-make} sets \${MAKE}" >&5
2919 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2920 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2921 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2922   echo $ECHO_N "(cached) $ECHO_C" >&6
2923 else
2924   cat >conftest.make <<\EOF
2925 all:
2926         @echo 'ac_maketemp="${MAKE}"'
2927 EOF
2928 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2929 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2930 if test -n "$ac_maketemp"; then
2931   eval ac_cv_prog_make_${ac_make}_set=yes
2932 else
2933   eval ac_cv_prog_make_${ac_make}_set=no
2934 fi
2935 rm -f conftest.make
2936 fi
2937 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2938   echo "$as_me:2938: result: yes" >&5
2939 echo "${ECHO_T}yes" >&6
2940   SET_MAKE=
2941 else
2942   echo "$as_me:2942: result: no" >&5
2943 echo "${ECHO_T}no" >&6
2944   SET_MAKE="MAKE=${MAKE-make}"
2945 fi
2946
2947 for ac_prog in exctags ctags
2948 do
2949   # Extract the first word of "$ac_prog", so it can be a program name with args.
2950 set dummy $ac_prog; ac_word=$2
2951 echo "$as_me:2951: checking for $ac_word" >&5
2952 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2953 if test "${ac_cv_prog_CTAGS+set}" = set; then
2954   echo $ECHO_N "(cached) $ECHO_C" >&6
2955 else
2956   if test -n "$CTAGS"; then
2957   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2958 else
2959   ac_save_IFS=$IFS; IFS=$ac_path_separator
2960 ac_dummy="$PATH"
2961 for ac_dir in $ac_dummy; do
2962   IFS=$ac_save_IFS
2963   test -z "$ac_dir" && ac_dir=.
2964   $as_executable_p "$ac_dir/$ac_word" || continue
2965 ac_cv_prog_CTAGS="$ac_prog"
2966 echo "$as_me:2966: found $ac_dir/$ac_word" >&5
2967 break
2968 done
2969
2970 fi
2971 fi
2972 CTAGS=$ac_cv_prog_CTAGS
2973 if test -n "$CTAGS"; then
2974   echo "$as_me:2974: result: $CTAGS" >&5
2975 echo "${ECHO_T}$CTAGS" >&6
2976 else
2977   echo "$as_me:2977: result: no" >&5
2978 echo "${ECHO_T}no" >&6
2979 fi
2980
2981   test -n "$CTAGS" && break
2982 done
2983
2984 for ac_prog in exetags etags
2985 do
2986   # Extract the first word of "$ac_prog", so it can be a program name with args.
2987 set dummy $ac_prog; ac_word=$2
2988 echo "$as_me:2988: checking for $ac_word" >&5
2989 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2990 if test "${ac_cv_prog_ETAGS+set}" = set; then
2991   echo $ECHO_N "(cached) $ECHO_C" >&6
2992 else
2993   if test -n "$ETAGS"; then
2994   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2995 else
2996   ac_save_IFS=$IFS; IFS=$ac_path_separator
2997 ac_dummy="$PATH"
2998 for ac_dir in $ac_dummy; do
2999   IFS=$ac_save_IFS
3000   test -z "$ac_dir" && ac_dir=.
3001   $as_executable_p "$ac_dir/$ac_word" || continue
3002 ac_cv_prog_ETAGS="$ac_prog"
3003 echo "$as_me:3003: found $ac_dir/$ac_word" >&5
3004 break
3005 done
3006
3007 fi
3008 fi
3009 ETAGS=$ac_cv_prog_ETAGS
3010 if test -n "$ETAGS"; then
3011   echo "$as_me:3011: result: $ETAGS" >&5
3012 echo "${ECHO_T}$ETAGS" >&6
3013 else
3014   echo "$as_me:3014: result: no" >&5
3015 echo "${ECHO_T}no" >&6
3016 fi
3017
3018   test -n "$ETAGS" && break
3019 done
3020
3021 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3022 set dummy ${CTAGS:-ctags}; ac_word=$2
3023 echo "$as_me:3023: checking for $ac_word" >&5
3024 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3025 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3026   echo $ECHO_N "(cached) $ECHO_C" >&6
3027 else
3028   if test -n "$MAKE_LOWER_TAGS"; then
3029   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3030 else
3031   ac_save_IFS=$IFS; IFS=$ac_path_separator
3032 ac_dummy="$PATH"
3033 for ac_dir in $ac_dummy; do
3034   IFS=$ac_save_IFS
3035   test -z "$ac_dir" && ac_dir=.
3036   $as_executable_p "$ac_dir/$ac_word" || continue
3037 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3038 echo "$as_me:3038: found $ac_dir/$ac_word" >&5
3039 break
3040 done
3041
3042   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3043 fi
3044 fi
3045 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3046 if test -n "$MAKE_LOWER_TAGS"; then
3047   echo "$as_me:3047: result: $MAKE_LOWER_TAGS" >&5
3048 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3049 else
3050   echo "$as_me:3050: result: no" >&5
3051 echo "${ECHO_T}no" >&6
3052 fi
3053
3054 if test "$cf_cv_mixedcase" = yes ; then
3055         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3056 set dummy ${ETAGS:-etags}; ac_word=$2
3057 echo "$as_me:3057: checking for $ac_word" >&5
3058 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3059 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3060   echo $ECHO_N "(cached) $ECHO_C" >&6
3061 else
3062   if test -n "$MAKE_UPPER_TAGS"; then
3063   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3064 else
3065   ac_save_IFS=$IFS; IFS=$ac_path_separator
3066 ac_dummy="$PATH"
3067 for ac_dir in $ac_dummy; do
3068   IFS=$ac_save_IFS
3069   test -z "$ac_dir" && ac_dir=.
3070   $as_executable_p "$ac_dir/$ac_word" || continue
3071 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3072 echo "$as_me:3072: found $ac_dir/$ac_word" >&5
3073 break
3074 done
3075
3076   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3077 fi
3078 fi
3079 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3080 if test -n "$MAKE_UPPER_TAGS"; then
3081   echo "$as_me:3081: result: $MAKE_UPPER_TAGS" >&5
3082 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3083 else
3084   echo "$as_me:3084: result: no" >&5
3085 echo "${ECHO_T}no" >&6
3086 fi
3087
3088 else
3089         MAKE_UPPER_TAGS=no
3090 fi
3091
3092 if test "$MAKE_UPPER_TAGS" = yes ; then
3093         MAKE_UPPER_TAGS=
3094 else
3095         MAKE_UPPER_TAGS="#"
3096 fi
3097
3098 if test "$MAKE_LOWER_TAGS" = yes ; then
3099         MAKE_LOWER_TAGS=
3100 else
3101         MAKE_LOWER_TAGS="#"
3102 fi
3103
3104 echo "$as_me:3104: checking for makeflags variable" >&5
3105 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3106 if test "${cf_cv_makeflags+set}" = set; then
3107   echo $ECHO_N "(cached) $ECHO_C" >&6
3108 else
3109
3110         cf_cv_makeflags=''
3111         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3112         do
3113                 cat >cf_makeflags.tmp <<CF_EOF
3114 SHELL = $SHELL
3115 all :
3116         @ echo '.$cf_option'
3117 CF_EOF
3118                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3119                 case "$cf_result" in
3120                 (.*k|.*kw)
3121                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3122                         case "$cf_result" in
3123                         (.*CC=*)        cf_cv_makeflags=
3124                                 ;;
3125                         (*)     cf_cv_makeflags=$cf_option
3126                                 ;;
3127                         esac
3128                         break
3129                         ;;
3130                 (.-)
3131                         ;;
3132                 (*)
3133
3134 echo "${as_me:-configure}:3134: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3135
3136                         ;;
3137                 esac
3138         done
3139         rm -f cf_makeflags.tmp
3140
3141 fi
3142 echo "$as_me:3142: result: $cf_cv_makeflags" >&5
3143 echo "${ECHO_T}$cf_cv_makeflags" >&6
3144
3145 if test -n "$ac_tool_prefix"; then
3146   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3147 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3148 echo "$as_me:3148: checking for $ac_word" >&5
3149 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3150 if test "${ac_cv_prog_RANLIB+set}" = set; then
3151   echo $ECHO_N "(cached) $ECHO_C" >&6
3152 else
3153   if test -n "$RANLIB"; then
3154   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3155 else
3156   ac_save_IFS=$IFS; IFS=$ac_path_separator
3157 ac_dummy="$PATH"
3158 for ac_dir in $ac_dummy; do
3159   IFS=$ac_save_IFS
3160   test -z "$ac_dir" && ac_dir=.
3161   $as_executable_p "$ac_dir/$ac_word" || continue
3162 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3163 echo "$as_me:3163: found $ac_dir/$ac_word" >&5
3164 break
3165 done
3166
3167 fi
3168 fi
3169 RANLIB=$ac_cv_prog_RANLIB
3170 if test -n "$RANLIB"; then
3171   echo "$as_me:3171: result: $RANLIB" >&5
3172 echo "${ECHO_T}$RANLIB" >&6
3173 else
3174   echo "$as_me:3174: result: no" >&5
3175 echo "${ECHO_T}no" >&6
3176 fi
3177
3178 fi
3179 if test -z "$ac_cv_prog_RANLIB"; then
3180   ac_ct_RANLIB=$RANLIB
3181   # Extract the first word of "ranlib", so it can be a program name with args.
3182 set dummy ranlib; ac_word=$2
3183 echo "$as_me:3183: checking for $ac_word" >&5
3184 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3185 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3186   echo $ECHO_N "(cached) $ECHO_C" >&6
3187 else
3188   if test -n "$ac_ct_RANLIB"; then
3189   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3190 else
3191   ac_save_IFS=$IFS; IFS=$ac_path_separator
3192 ac_dummy="$PATH"
3193 for ac_dir in $ac_dummy; do
3194   IFS=$ac_save_IFS
3195   test -z "$ac_dir" && ac_dir=.
3196   $as_executable_p "$ac_dir/$ac_word" || continue
3197 ac_cv_prog_ac_ct_RANLIB="ranlib"
3198 echo "$as_me:3198: found $ac_dir/$ac_word" >&5
3199 break
3200 done
3201
3202   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3203 fi
3204 fi
3205 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3206 if test -n "$ac_ct_RANLIB"; then
3207   echo "$as_me:3207: result: $ac_ct_RANLIB" >&5
3208 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3209 else
3210   echo "$as_me:3210: result: no" >&5
3211 echo "${ECHO_T}no" >&6
3212 fi
3213
3214   RANLIB=$ac_ct_RANLIB
3215 else
3216   RANLIB="$ac_cv_prog_RANLIB"
3217 fi
3218
3219 if test -n "$ac_tool_prefix"; then
3220   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3221 set dummy ${ac_tool_prefix}ld; ac_word=$2
3222 echo "$as_me:3222: checking for $ac_word" >&5
3223 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3224 if test "${ac_cv_prog_LD+set}" = set; then
3225   echo $ECHO_N "(cached) $ECHO_C" >&6
3226 else
3227   if test -n "$LD"; then
3228   ac_cv_prog_LD="$LD" # Let the user override the test.
3229 else
3230   ac_save_IFS=$IFS; IFS=$ac_path_separator
3231 ac_dummy="$PATH"
3232 for ac_dir in $ac_dummy; do
3233   IFS=$ac_save_IFS
3234   test -z "$ac_dir" && ac_dir=.
3235   $as_executable_p "$ac_dir/$ac_word" || continue
3236 ac_cv_prog_LD="${ac_tool_prefix}ld"
3237 echo "$as_me:3237: found $ac_dir/$ac_word" >&5
3238 break
3239 done
3240
3241 fi
3242 fi
3243 LD=$ac_cv_prog_LD
3244 if test -n "$LD"; then
3245   echo "$as_me:3245: result: $LD" >&5
3246 echo "${ECHO_T}$LD" >&6
3247 else
3248   echo "$as_me:3248: result: no" >&5
3249 echo "${ECHO_T}no" >&6
3250 fi
3251
3252 fi
3253 if test -z "$ac_cv_prog_LD"; then
3254   ac_ct_LD=$LD
3255   # Extract the first word of "ld", so it can be a program name with args.
3256 set dummy ld; ac_word=$2
3257 echo "$as_me:3257: checking for $ac_word" >&5
3258 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3259 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3260   echo $ECHO_N "(cached) $ECHO_C" >&6
3261 else
3262   if test -n "$ac_ct_LD"; then
3263   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3264 else
3265   ac_save_IFS=$IFS; IFS=$ac_path_separator
3266 ac_dummy="$PATH"
3267 for ac_dir in $ac_dummy; do
3268   IFS=$ac_save_IFS
3269   test -z "$ac_dir" && ac_dir=.
3270   $as_executable_p "$ac_dir/$ac_word" || continue
3271 ac_cv_prog_ac_ct_LD="ld"
3272 echo "$as_me:3272: found $ac_dir/$ac_word" >&5
3273 break
3274 done
3275
3276   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3277 fi
3278 fi
3279 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3280 if test -n "$ac_ct_LD"; then
3281   echo "$as_me:3281: result: $ac_ct_LD" >&5
3282 echo "${ECHO_T}$ac_ct_LD" >&6
3283 else
3284   echo "$as_me:3284: result: no" >&5
3285 echo "${ECHO_T}no" >&6
3286 fi
3287
3288   LD=$ac_ct_LD
3289 else
3290   LD="$ac_cv_prog_LD"
3291 fi
3292
3293 if test -n "$ac_tool_prefix"; then
3294   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3295 set dummy ${ac_tool_prefix}ar; ac_word=$2
3296 echo "$as_me:3296: checking for $ac_word" >&5
3297 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3298 if test "${ac_cv_prog_AR+set}" = set; then
3299   echo $ECHO_N "(cached) $ECHO_C" >&6
3300 else
3301   if test -n "$AR"; then
3302   ac_cv_prog_AR="$AR" # Let the user override the test.
3303 else
3304   ac_save_IFS=$IFS; IFS=$ac_path_separator
3305 ac_dummy="$PATH"
3306 for ac_dir in $ac_dummy; do
3307   IFS=$ac_save_IFS
3308   test -z "$ac_dir" && ac_dir=.
3309   $as_executable_p "$ac_dir/$ac_word" || continue
3310 ac_cv_prog_AR="${ac_tool_prefix}ar"
3311 echo "$as_me:3311: found $ac_dir/$ac_word" >&5
3312 break
3313 done
3314
3315 fi
3316 fi
3317 AR=$ac_cv_prog_AR
3318 if test -n "$AR"; then
3319   echo "$as_me:3319: result: $AR" >&5
3320 echo "${ECHO_T}$AR" >&6
3321 else
3322   echo "$as_me:3322: result: no" >&5
3323 echo "${ECHO_T}no" >&6
3324 fi
3325
3326 fi
3327 if test -z "$ac_cv_prog_AR"; then
3328   ac_ct_AR=$AR
3329   # Extract the first word of "ar", so it can be a program name with args.
3330 set dummy ar; ac_word=$2
3331 echo "$as_me:3331: checking for $ac_word" >&5
3332 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3333 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3334   echo $ECHO_N "(cached) $ECHO_C" >&6
3335 else
3336   if test -n "$ac_ct_AR"; then
3337   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3338 else
3339   ac_save_IFS=$IFS; IFS=$ac_path_separator
3340 ac_dummy="$PATH"
3341 for ac_dir in $ac_dummy; do
3342   IFS=$ac_save_IFS
3343   test -z "$ac_dir" && ac_dir=.
3344   $as_executable_p "$ac_dir/$ac_word" || continue
3345 ac_cv_prog_ac_ct_AR="ar"
3346 echo "$as_me:3346: found $ac_dir/$ac_word" >&5
3347 break
3348 done
3349
3350   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3351 fi
3352 fi
3353 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3354 if test -n "$ac_ct_AR"; then
3355   echo "$as_me:3355: result: $ac_ct_AR" >&5
3356 echo "${ECHO_T}$ac_ct_AR" >&6
3357 else
3358   echo "$as_me:3358: result: no" >&5
3359 echo "${ECHO_T}no" >&6
3360 fi
3361
3362   AR=$ac_ct_AR
3363 else
3364   AR="$ac_cv_prog_AR"
3365 fi
3366
3367 if test -n "$ac_tool_prefix"; then
3368   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3369 set dummy ${ac_tool_prefix}ar; ac_word=$2
3370 echo "$as_me:3370: checking for $ac_word" >&5
3371 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3372 if test "${ac_cv_prog_AR+set}" = set; then
3373   echo $ECHO_N "(cached) $ECHO_C" >&6
3374 else
3375   if test -n "$AR"; then
3376   ac_cv_prog_AR="$AR" # Let the user override the test.
3377 else
3378   ac_save_IFS=$IFS; IFS=$ac_path_separator
3379 ac_dummy="$PATH"
3380 for ac_dir in $ac_dummy; do
3381   IFS=$ac_save_IFS
3382   test -z "$ac_dir" && ac_dir=.
3383   $as_executable_p "$ac_dir/$ac_word" || continue
3384 ac_cv_prog_AR="${ac_tool_prefix}ar"
3385 echo "$as_me:3385: found $ac_dir/$ac_word" >&5
3386 break
3387 done
3388
3389 fi
3390 fi
3391 AR=$ac_cv_prog_AR
3392 if test -n "$AR"; then
3393   echo "$as_me:3393: result: $AR" >&5
3394 echo "${ECHO_T}$AR" >&6
3395 else
3396   echo "$as_me:3396: result: no" >&5
3397 echo "${ECHO_T}no" >&6
3398 fi
3399
3400 fi
3401 if test -z "$ac_cv_prog_AR"; then
3402   ac_ct_AR=$AR
3403   # Extract the first word of "ar", so it can be a program name with args.
3404 set dummy ar; ac_word=$2
3405 echo "$as_me:3405: checking for $ac_word" >&5
3406 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3407 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3408   echo $ECHO_N "(cached) $ECHO_C" >&6
3409 else
3410   if test -n "$ac_ct_AR"; then
3411   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3412 else
3413   ac_save_IFS=$IFS; IFS=$ac_path_separator
3414 ac_dummy="$PATH"
3415 for ac_dir in $ac_dummy; do
3416   IFS=$ac_save_IFS
3417   test -z "$ac_dir" && ac_dir=.
3418   $as_executable_p "$ac_dir/$ac_word" || continue
3419 ac_cv_prog_ac_ct_AR="ar"
3420 echo "$as_me:3420: found $ac_dir/$ac_word" >&5
3421 break
3422 done
3423
3424   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3425 fi
3426 fi
3427 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3428 if test -n "$ac_ct_AR"; then
3429   echo "$as_me:3429: result: $ac_ct_AR" >&5
3430 echo "${ECHO_T}$ac_ct_AR" >&6
3431 else
3432   echo "$as_me:3432: result: no" >&5
3433 echo "${ECHO_T}no" >&6
3434 fi
3435
3436   AR=$ac_ct_AR
3437 else
3438   AR="$ac_cv_prog_AR"
3439 fi
3440
3441 echo "$as_me:3441: checking for options to update archives" >&5
3442 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3443 if test "${cf_cv_ar_flags+set}" = set; then
3444   echo $ECHO_N "(cached) $ECHO_C" >&6
3445 else
3446
3447         cf_cv_ar_flags=unknown
3448         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3449         do
3450
3451                 # check if $ARFLAGS already contains this choice
3452                 if test "x$ARFLAGS" != "x" ; then
3453                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3454                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3455                                 cf_cv_ar_flags=
3456                                 break
3457                         fi
3458                 fi
3459
3460                 rm -f conftest.$ac_cv_objext
3461                 rm -f conftest.a
3462
3463                 cat >conftest.$ac_ext <<EOF
3464 #line 3464 "configure"
3465 int     testdata[3] = { 123, 456, 789 };
3466 EOF
3467                 if { (eval echo "$as_me:3467: \"$ac_compile\"") >&5
3468   (eval $ac_compile) 2>&5
3469   ac_status=$?
3470   echo "$as_me:3470: \$? = $ac_status" >&5
3471   (exit $ac_status); } ; then
3472                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3473                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3474                         if test -f conftest.a ; then
3475                                 cf_cv_ar_flags=$cf_ar_flags
3476                                 break
3477                         fi
3478                 else
3479                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3480
3481 echo "${as_me:-configure}:3481: testing cannot compile test-program ..." 1>&5
3482
3483                         break
3484                 fi
3485         done
3486         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3487
3488 fi
3489 echo "$as_me:3489: result: $cf_cv_ar_flags" >&5
3490 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3491
3492 if test -n "$ARFLAGS" ; then
3493         if test -n "$cf_cv_ar_flags" ; then
3494                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3495         fi
3496 else
3497         ARFLAGS=$cf_cv_ar_flags
3498 fi
3499
3500         echo "$as_me:3500: checking for PATH separator" >&5
3501 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3502         case $cf_cv_system_name in
3503         (os2*)  PATH_SEPARATOR=';'  ;;
3504         (*)     ${PATH_SEPARATOR:=':'}  ;;
3505         esac
3506
3507         echo "$as_me:3507: result: $PATH_SEPARATOR" >&5
3508 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3509
3510 echo "$as_me:3510: checking if you have specified an install-prefix" >&5
3511 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3512
3513 # Check whether --with-install-prefix or --without-install-prefix was given.
3514 if test "${with_install_prefix+set}" = set; then
3515   withval="$with_install_prefix"
3516   case "$withval" in
3517         (yes|no)
3518                 ;;
3519         (*)     DESTDIR="$withval"
3520                 ;;
3521         esac
3522 fi;
3523 echo "$as_me:3523: result: $DESTDIR" >&5
3524 echo "${ECHO_T}$DESTDIR" >&6
3525
3526 ###############################################################################
3527
3528 # If we're cross-compiling, allow the user to override the tools and their
3529 # options.  The configure script is oriented toward identifying the host
3530 # compiler, etc., but we need a build compiler to generate parts of the source.
3531
3532 if test "$cross_compiling" = yes ; then
3533
3534         # defaults that we might want to override
3535         : ${BUILD_CFLAGS:=''}
3536         : ${BUILD_CPPFLAGS:=''}
3537         : ${BUILD_LDFLAGS:=''}
3538         : ${BUILD_LIBS:=''}
3539         : ${BUILD_EXEEXT:='$x'}
3540         : ${BUILD_OBJEXT:='o'}
3541
3542 # Check whether --with-build-cc or --without-build-cc was given.
3543 if test "${with_build_cc+set}" = set; then
3544   withval="$with_build_cc"
3545   BUILD_CC="$withval"
3546 else
3547   for ac_prog in gcc clang c99 c89 cc cl
3548 do
3549   # Extract the first word of "$ac_prog", so it can be a program name with args.
3550 set dummy $ac_prog; ac_word=$2
3551 echo "$as_me:3551: checking for $ac_word" >&5
3552 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3553 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3554   echo $ECHO_N "(cached) $ECHO_C" >&6
3555 else
3556   if test -n "$BUILD_CC"; then
3557   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3558 else
3559   ac_save_IFS=$IFS; IFS=$ac_path_separator
3560 ac_dummy="$PATH"
3561 for ac_dir in $ac_dummy; do
3562   IFS=$ac_save_IFS
3563   test -z "$ac_dir" && ac_dir=.
3564   $as_executable_p "$ac_dir/$ac_word" || continue
3565 ac_cv_prog_BUILD_CC="$ac_prog"
3566 echo "$as_me:3566: found $ac_dir/$ac_word" >&5
3567 break
3568 done
3569
3570 fi
3571 fi
3572 BUILD_CC=$ac_cv_prog_BUILD_CC
3573 if test -n "$BUILD_CC"; then
3574   echo "$as_me:3574: result: $BUILD_CC" >&5
3575 echo "${ECHO_T}$BUILD_CC" >&6
3576 else
3577   echo "$as_me:3577: result: no" >&5
3578 echo "${ECHO_T}no" >&6
3579 fi
3580
3581   test -n "$BUILD_CC" && break
3582 done
3583 test -n "$BUILD_CC" || BUILD_CC="none"
3584
3585 fi;
3586         echo "$as_me:3586: checking for native build C compiler" >&5
3587 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3588         echo "$as_me:3588: result: $BUILD_CC" >&5
3589 echo "${ECHO_T}$BUILD_CC" >&6
3590
3591         echo "$as_me:3591: checking for native build C preprocessor" >&5
3592 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3593
3594 # Check whether --with-build-cpp or --without-build-cpp was given.
3595 if test "${with_build_cpp+set}" = set; then
3596   withval="$with_build_cpp"
3597   BUILD_CPP="$withval"
3598 else
3599   BUILD_CPP='${BUILD_CC} -E'
3600 fi;
3601         echo "$as_me:3601: result: $BUILD_CPP" >&5
3602 echo "${ECHO_T}$BUILD_CPP" >&6
3603
3604         echo "$as_me:3604: checking for native build C flags" >&5
3605 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3606
3607 # Check whether --with-build-cflags or --without-build-cflags was given.
3608 if test "${with_build_cflags+set}" = set; then
3609   withval="$with_build_cflags"
3610   BUILD_CFLAGS="$withval"
3611 fi;
3612         echo "$as_me:3612: result: $BUILD_CFLAGS" >&5
3613 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3614
3615         echo "$as_me:3615: checking for native build C preprocessor-flags" >&5
3616 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3617
3618 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3619 if test "${with_build_cppflags+set}" = set; then
3620   withval="$with_build_cppflags"
3621   BUILD_CPPFLAGS="$withval"
3622 fi;
3623         echo "$as_me:3623: result: $BUILD_CPPFLAGS" >&5
3624 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3625
3626         echo "$as_me:3626: checking for native build linker-flags" >&5
3627 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3628
3629 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3630 if test "${with_build_ldflags+set}" = set; then
3631   withval="$with_build_ldflags"
3632   BUILD_LDFLAGS="$withval"
3633 fi;
3634         echo "$as_me:3634: result: $BUILD_LDFLAGS" >&5
3635 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3636
3637         echo "$as_me:3637: checking for native build linker-libraries" >&5
3638 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3639
3640 # Check whether --with-build-libs or --without-build-libs was given.
3641 if test "${with_build_libs+set}" = set; then
3642   withval="$with_build_libs"
3643   BUILD_LIBS="$withval"
3644 fi;
3645         echo "$as_me:3645: result: $BUILD_LIBS" >&5
3646 echo "${ECHO_T}$BUILD_LIBS" >&6
3647
3648         # this assumes we're on Unix.
3649         BUILD_EXEEXT=
3650         BUILD_OBJEXT=o
3651
3652         : ${BUILD_CC:='${CC}'}
3653
3654         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3655                 { { echo "$as_me:3655: error: Cross-build requires two compilers.
3656 Use --with-build-cc to specify the native compiler." >&5
3657 echo "$as_me: error: Cross-build requires two compilers.
3658 Use --with-build-cc to specify the native compiler." >&2;}
3659    { (exit 1); exit 1; }; }
3660         fi
3661
3662 else
3663         : ${BUILD_CC:='${CC}'}
3664         : ${BUILD_CPP:='${CPP}'}
3665         : ${BUILD_CFLAGS:='${CFLAGS}'}
3666         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3667         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3668         : ${BUILD_LIBS:='${LIBS}'}
3669         : ${BUILD_EXEEXT:='$x'}
3670         : ${BUILD_OBJEXT:='o'}
3671 fi
3672
3673 ###############################################################################
3674
3675 ### Options to allow the user to specify the set of libraries which are used.
3676 ### Use "--without-normal --with-shared" to allow the default model to be
3677 ### shared, for example.
3678 cf_list_models=""
3679
3680 echo "$as_me:3680: checking if you want to build shared C-objects" >&5
3681 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3682
3683 # Check whether --with-shared or --without-shared was given.
3684 if test "${with_shared+set}" = set; then
3685   withval="$with_shared"
3686   with_shared=$withval
3687 else
3688   with_shared=no
3689 fi;
3690 echo "$as_me:3690: result: $with_shared" >&5
3691 echo "${ECHO_T}$with_shared" >&6
3692 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3693
3694 echo "$as_me:3694: checking for specified models" >&5
3695 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3696 test -z "$cf_list_models" && cf_list_models=normal
3697 echo "$as_me:3697: result: $cf_list_models" >&5
3698 echo "${ECHO_T}$cf_list_models" >&6
3699
3700 ### Use the first model as the default, and save its suffix for use in building
3701 ### up test-applications.
3702 echo "$as_me:3702: checking for default model" >&5
3703 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3704 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3705 echo "$as_me:3705: result: $DFT_LWR_MODEL" >&5
3706 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3707
3708 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3709
3710 echo "$as_me:3710: checking for specific curses-directory" >&5
3711 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3712
3713 # Check whether --with-curses-dir or --without-curses-dir was given.
3714 if test "${with_curses_dir+set}" = set; then
3715   withval="$with_curses_dir"
3716   cf_cv_curses_dir=$withval
3717 else
3718   cf_cv_curses_dir=no
3719 fi;
3720 echo "$as_me:3720: result: $cf_cv_curses_dir" >&5
3721 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3722
3723 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3724 then
3725
3726 if test "x$prefix" != xNONE; then
3727         cf_path_syntax="$prefix"
3728 else
3729         cf_path_syntax="$ac_default_prefix"
3730 fi
3731
3732 case ".$withval" in
3733 (.\$\(*\)*|.\'*\'*)
3734         ;;
3735 (..|./*|.\\*)
3736         ;;
3737 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3738         ;;
3739 (.\${*prefix}*|.\${*dir}*)
3740         eval withval="$withval"
3741         case ".$withval" in
3742         (.NONE/*)
3743                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3744                 ;;
3745         esac
3746         ;;
3747 (.no|.NONE/*)
3748         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3749         ;;
3750 (*)
3751         { { echo "$as_me:3751: error: expected a pathname, not \"$withval\"" >&5
3752 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3753    { (exit 1); exit 1; }; }
3754         ;;
3755 esac
3756
3757         if test -d "$cf_cv_curses_dir"
3758         then
3759
3760 if test -n "$cf_cv_curses_dir/include" ; then
3761   for cf_add_incdir in $cf_cv_curses_dir/include
3762   do
3763         while test $cf_add_incdir != /usr/include
3764         do
3765           if test -d $cf_add_incdir
3766           then
3767                 cf_have_incdir=no
3768                 if test -n "$CFLAGS$CPPFLAGS" ; then
3769                   # a loop is needed to ensure we can add subdirs of existing dirs
3770                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3771                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3772                           cf_have_incdir=yes; break
3773                         fi
3774                   done
3775                 fi
3776
3777                 if test "$cf_have_incdir" = no ; then
3778                   if test "$cf_add_incdir" = /usr/local/include ; then
3779                         if test "$GCC" = yes
3780                         then
3781                           cf_save_CPPFLAGS=$CPPFLAGS
3782
3783         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3784         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
3785
3786                           cat >conftest.$ac_ext <<_ACEOF
3787 #line 3787 "configure"
3788 #include "confdefs.h"
3789 #include <stdio.h>
3790 int
3791 main (void)
3792 {
3793 printf("Hello")
3794   ;
3795   return 0;
3796 }
3797 _ACEOF
3798 rm -f conftest.$ac_objext
3799 if { (eval echo "$as_me:3799: \"$ac_compile\"") >&5
3800   (eval $ac_compile) 2>&5
3801   ac_status=$?
3802   echo "$as_me:3802: \$? = $ac_status" >&5
3803   (exit $ac_status); } &&
3804          { ac_try='test -s conftest.$ac_objext'
3805   { (eval echo "$as_me:3805: \"$ac_try\"") >&5
3806   (eval $ac_try) 2>&5
3807   ac_status=$?
3808   echo "$as_me:3808: \$? = $ac_status" >&5
3809   (exit $ac_status); }; }; then
3810   :
3811 else
3812   echo "$as_me: failed program was:" >&5
3813 cat conftest.$ac_ext >&5
3814 cf_have_incdir=yes
3815 fi
3816 rm -f conftest.$ac_objext conftest.$ac_ext
3817                           CPPFLAGS=$cf_save_CPPFLAGS
3818                         fi
3819                   fi
3820                 fi
3821
3822                 if test "$cf_have_incdir" = no ; then
3823                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3824
3825 echo "${as_me:-configure}:3825: testing adding $cf_add_incdir to include-path ..." 1>&5
3826
3827                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3828
3829                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3830                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3831                   cf_add_incdir="$cf_top_incdir"
3832                 else
3833                   break
3834                 fi
3835           else
3836                 break
3837           fi
3838         done
3839   done
3840 fi
3841
3842 if test -n "$cf_cv_curses_dir/lib" ; then
3843         for cf_add_libdir in $cf_cv_curses_dir/lib
3844         do
3845                 if test $cf_add_libdir = /usr/lib ; then
3846                         :
3847                 elif test -d $cf_add_libdir
3848                 then
3849                         cf_have_libdir=no
3850                         if test -n "$LDFLAGS$LIBS" ; then
3851                                 # a loop is needed to ensure we can add subdirs of existing dirs
3852                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3853                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3854                                                 cf_have_libdir=yes; break
3855                                         fi
3856                                 done
3857                         fi
3858                         if test "$cf_have_libdir" = no ; then
3859                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3860
3861 echo "${as_me:-configure}:3861: testing adding $cf_add_libdir to library-path ..." 1>&5
3862
3863                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3864                         fi
3865                 fi
3866         done
3867 fi
3868
3869         fi
3870 fi
3871
3872 cf_ncuconfig_root=ncurses
3873 cf_have_ncuconfig=no
3874
3875 if test "x${PKG_CONFIG:=none}" != xnone; then
3876         echo "$as_me:3876: checking pkg-config for $cf_ncuconfig_root" >&5
3877 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3878         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3879                 echo "$as_me:3879: result: yes" >&5
3880 echo "${ECHO_T}yes" >&6
3881
3882                 echo "$as_me:3882: checking if the $cf_ncuconfig_root package files work" >&5
3883 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3884                 cf_have_ncuconfig=unknown
3885
3886                 cf_save_CPPFLAGS="$CPPFLAGS"
3887                 cf_save_LIBS="$LIBS"
3888
3889 cf_fix_cppflags=no
3890 cf_new_cflags=
3891 cf_new_cppflags=
3892 cf_new_extra_cppflags=
3893
3894 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
3895 do
3896 case $cf_fix_cppflags in
3897 (no)
3898         case $cf_add_cflags in
3899         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3900                 case $cf_add_cflags in
3901                 (-D*)
3902                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3903
3904                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3905                                 && test -z "${cf_tst_cflags}" \
3906                                 && cf_fix_cppflags=yes
3907
3908                         if test $cf_fix_cppflags = yes ; then
3909
3910         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3911         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3912
3913                                 continue
3914                         elif test "${cf_tst_cflags}" = "\"'" ; then
3915
3916         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3917         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3918
3919                                 continue
3920                         fi
3921                         ;;
3922                 esac
3923                 case "$CPPFLAGS" in
3924                 (*$cf_add_cflags)
3925                         ;;
3926                 (*)
3927                         case $cf_add_cflags in
3928                         (-D*)
3929                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3930
3931 CPPFLAGS=`echo "$CPPFLAGS" | \
3932         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3933                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3934
3935                                 ;;
3936                         esac
3937
3938         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3939         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3940
3941                         ;;
3942                 esac
3943                 ;;
3944         (*)
3945
3946         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3947         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3948
3949                 ;;
3950         esac
3951         ;;
3952 (yes)
3953
3954         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3955         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3956
3957         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3958
3959         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3960                 && test -z "${cf_tst_cflags}" \
3961                 && cf_fix_cppflags=no
3962         ;;
3963 esac
3964 done
3965
3966 if test -n "$cf_new_cflags" ; then
3967
3968         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3969         CFLAGS="${CFLAGS}$cf_new_cflags"
3970
3971 fi
3972
3973 if test -n "$cf_new_cppflags" ; then
3974
3975         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3976         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3977
3978 fi
3979
3980 if test -n "$cf_new_extra_cppflags" ; then
3981
3982         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3983         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3984
3985 fi
3986
3987 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3988 # Filter out duplicates - this happens with badly-designed ".pc" files...
3989 for cf_add_1lib in $LIBS
3990 do
3991         for cf_add_2lib in $cf_add_libs
3992         do
3993                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3994                 then
3995                         cf_add_1lib=
3996                         break
3997                 fi
3998         done
3999         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4000 done
4001 LIBS="$cf_add_libs"
4002
4003                 cat >conftest.$ac_ext <<_ACEOF
4004 #line 4004 "configure"
4005 #include "confdefs.h"
4006 #include <${cf_cv_ncurses_header:-curses.h}>
4007 int
4008 main (void)
4009 {
4010 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4011   ;
4012   return 0;
4013 }
4014 _ACEOF
4015 rm -f conftest.$ac_objext conftest$ac_exeext
4016 if { (eval echo "$as_me:4016: \"$ac_link\"") >&5
4017   (eval $ac_link) 2>&5
4018   ac_status=$?
4019   echo "$as_me:4019: \$? = $ac_status" >&5
4020   (exit $ac_status); } &&
4021          { ac_try='test -s conftest$ac_exeext'
4022   { (eval echo "$as_me:4022: \"$ac_try\"") >&5
4023   (eval $ac_try) 2>&5
4024   ac_status=$?
4025   echo "$as_me:4025: \$? = $ac_status" >&5
4026   (exit $ac_status); }; }; then
4027   if test "$cross_compiling" = yes; then
4028   cf_have_ncuconfig=maybe
4029 else
4030   cat >conftest.$ac_ext <<_ACEOF
4031 #line 4031 "configure"
4032 #include "confdefs.h"
4033 #include <${cf_cv_ncurses_header:-curses.h}>
4034                                 int main(void)
4035                                 { char *xx = curses_version(); return (xx == 0); }
4036 _ACEOF
4037 rm -f conftest$ac_exeext
4038 if { (eval echo "$as_me:4038: \"$ac_link\"") >&5
4039   (eval $ac_link) 2>&5
4040   ac_status=$?
4041   echo "$as_me:4041: \$? = $ac_status" >&5
4042   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4043   { (eval echo "$as_me:4043: \"$ac_try\"") >&5
4044   (eval $ac_try) 2>&5
4045   ac_status=$?
4046   echo "$as_me:4046: \$? = $ac_status" >&5
4047   (exit $ac_status); }; }; then
4048   cf_have_ncuconfig=yes
4049 else
4050   echo "$as_me: program exited with status $ac_status" >&5
4051 echo "$as_me: failed program was:" >&5
4052 cat conftest.$ac_ext >&5
4053 cf_have_ncuconfig=no
4054 fi
4055 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4056 fi
4057 else
4058   echo "$as_me: failed program was:" >&5
4059 cat conftest.$ac_ext >&5
4060 cf_have_ncuconfig=no
4061 fi
4062 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4063                 echo "$as_me:4063: result: $cf_have_ncuconfig" >&5
4064 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4065                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4066                 if test "$cf_have_ncuconfig" != "yes"
4067                 then
4068                         CPPFLAGS="$cf_save_CPPFLAGS"
4069                         LIBS="$cf_save_LIBS"
4070                         NCURSES_CONFIG_PKG=none
4071                 else
4072
4073 cat >>confdefs.h <<\EOF
4074 #define NCURSES 1
4075 EOF
4076
4077                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4078
4079 echo "$as_me:4079: checking for terminfo header" >&5
4080 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4081 if test "${cf_cv_term_header+set}" = set; then
4082   echo $ECHO_N "(cached) $ECHO_C" >&6
4083 else
4084
4085 case ${cf_cv_ncurses_header} in
4086 (*/ncurses.h|*/ncursesw.h)
4087         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4088         ;;
4089 (*)
4090         cf_term_header=term.h
4091         ;;
4092 esac
4093
4094 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4095 do
4096 cat >conftest.$ac_ext <<_ACEOF
4097 #line 4097 "configure"
4098 #include "confdefs.h"
4099 #include <stdio.h>
4100 #include <${cf_cv_ncurses_header:-curses.h}>
4101 #include <$cf_test>
4102
4103 int
4104 main (void)
4105 {
4106 int x = auto_left_margin
4107   ;
4108   return 0;
4109 }
4110 _ACEOF
4111 rm -f conftest.$ac_objext
4112 if { (eval echo "$as_me:4112: \"$ac_compile\"") >&5
4113   (eval $ac_compile) 2>&5
4114   ac_status=$?
4115   echo "$as_me:4115: \$? = $ac_status" >&5
4116   (exit $ac_status); } &&
4117          { ac_try='test -s conftest.$ac_objext'
4118   { (eval echo "$as_me:4118: \"$ac_try\"") >&5
4119   (eval $ac_try) 2>&5
4120   ac_status=$?
4121   echo "$as_me:4121: \$? = $ac_status" >&5
4122   (exit $ac_status); }; }; then
4123
4124         cf_cv_term_header="$cf_test"
4125 else
4126   echo "$as_me: failed program was:" >&5
4127 cat conftest.$ac_ext >&5
4128
4129         cf_cv_term_header=unknown
4130
4131 fi
4132 rm -f conftest.$ac_objext conftest.$ac_ext
4133         test "$cf_cv_term_header" != unknown && break
4134 done
4135
4136 fi
4137 echo "$as_me:4137: result: $cf_cv_term_header" >&5
4138 echo "${ECHO_T}$cf_cv_term_header" >&6
4139
4140 # Set definitions to allow ifdef'ing to accommodate subdirectories
4141
4142 case $cf_cv_term_header in
4143 (*term.h)
4144
4145 cat >>confdefs.h <<\EOF
4146 #define HAVE_TERM_H 1
4147 EOF
4148
4149         ;;
4150 esac
4151
4152 case $cf_cv_term_header in
4153 (ncurses/term.h)
4154
4155 cat >>confdefs.h <<\EOF
4156 #define HAVE_NCURSES_TERM_H 1
4157 EOF
4158
4159         ;;
4160 (ncursesw/term.h)
4161
4162 cat >>confdefs.h <<\EOF
4163 #define HAVE_NCURSESW_TERM_H 1
4164 EOF
4165
4166         ;;
4167 esac
4168
4169                 fi
4170
4171         else
4172                 echo "$as_me:4172: result: no" >&5
4173 echo "${ECHO_T}no" >&6
4174                 NCURSES_CONFIG_PKG=none
4175         fi
4176 else
4177         NCURSES_CONFIG_PKG=none
4178 fi
4179
4180 if test "x$cf_have_ncuconfig" = "xno"; then
4181         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4182
4183 if test -n "$ac_tool_prefix"; then
4184   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4185   do
4186     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4187 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4188 echo "$as_me:4188: checking for $ac_word" >&5
4189 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4190 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4191   echo $ECHO_N "(cached) $ECHO_C" >&6
4192 else
4193   if test -n "$NCURSES_CONFIG"; then
4194   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4195 else
4196   ac_save_IFS=$IFS; IFS=$ac_path_separator
4197 ac_dummy="$PATH"
4198 for ac_dir in $ac_dummy; do
4199   IFS=$ac_save_IFS
4200   test -z "$ac_dir" && ac_dir=.
4201   $as_executable_p "$ac_dir/$ac_word" || continue
4202 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4203 echo "$as_me:4203: found $ac_dir/$ac_word" >&5
4204 break
4205 done
4206
4207 fi
4208 fi
4209 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4210 if test -n "$NCURSES_CONFIG"; then
4211   echo "$as_me:4211: result: $NCURSES_CONFIG" >&5
4212 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4213 else
4214   echo "$as_me:4214: result: no" >&5
4215 echo "${ECHO_T}no" >&6
4216 fi
4217
4218     test -n "$NCURSES_CONFIG" && break
4219   done
4220 fi
4221 if test -z "$NCURSES_CONFIG"; then
4222   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4223   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4224 do
4225   # Extract the first word of "$ac_prog", so it can be a program name with args.
4226 set dummy $ac_prog; ac_word=$2
4227 echo "$as_me:4227: checking for $ac_word" >&5
4228 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4229 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4230   echo $ECHO_N "(cached) $ECHO_C" >&6
4231 else
4232   if test -n "$ac_ct_NCURSES_CONFIG"; then
4233   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4234 else
4235   ac_save_IFS=$IFS; IFS=$ac_path_separator
4236 ac_dummy="$PATH"
4237 for ac_dir in $ac_dummy; do
4238   IFS=$ac_save_IFS
4239   test -z "$ac_dir" && ac_dir=.
4240   $as_executable_p "$ac_dir/$ac_word" || continue
4241 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4242 echo "$as_me:4242: found $ac_dir/$ac_word" >&5
4243 break
4244 done
4245
4246 fi
4247 fi
4248 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4249 if test -n "$ac_ct_NCURSES_CONFIG"; then
4250   echo "$as_me:4250: result: $ac_ct_NCURSES_CONFIG" >&5
4251 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4252 else
4253   echo "$as_me:4253: result: no" >&5
4254 echo "${ECHO_T}no" >&6
4255 fi
4256
4257   test -n "$ac_ct_NCURSES_CONFIG" && break
4258 done
4259 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4260
4261   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4262 fi
4263
4264         if test "$NCURSES_CONFIG" != none ; then
4265
4266 cf_fix_cppflags=no
4267 cf_new_cflags=
4268 cf_new_cppflags=
4269 cf_new_extra_cppflags=
4270
4271 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4272 do
4273 case $cf_fix_cppflags in
4274 (no)
4275         case $cf_add_cflags in
4276         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4277                 case $cf_add_cflags in
4278                 (-D*)
4279                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4280
4281                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4282                                 && test -z "${cf_tst_cflags}" \
4283                                 && cf_fix_cppflags=yes
4284
4285                         if test $cf_fix_cppflags = yes ; then
4286
4287         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4288         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4289
4290                                 continue
4291                         elif test "${cf_tst_cflags}" = "\"'" ; then
4292
4293         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4294         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4295
4296                                 continue
4297                         fi
4298                         ;;
4299                 esac
4300                 case "$CPPFLAGS" in
4301                 (*$cf_add_cflags)
4302                         ;;
4303                 (*)
4304                         case $cf_add_cflags in
4305                         (-D*)
4306                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4307
4308 CPPFLAGS=`echo "$CPPFLAGS" | \
4309         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4310                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4311
4312                                 ;;
4313                         esac
4314
4315         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4316         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4317
4318                         ;;
4319                 esac
4320                 ;;
4321         (*)
4322
4323         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4324         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4325
4326                 ;;
4327         esac
4328         ;;
4329 (yes)
4330
4331         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4332         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4333
4334         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4335
4336         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4337                 && test -z "${cf_tst_cflags}" \
4338                 && cf_fix_cppflags=no
4339         ;;
4340 esac
4341 done
4342
4343 if test -n "$cf_new_cflags" ; then
4344
4345         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4346         CFLAGS="${CFLAGS}$cf_new_cflags"
4347
4348 fi
4349
4350 if test -n "$cf_new_cppflags" ; then
4351
4352         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4353         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4354
4355 fi
4356
4357 if test -n "$cf_new_extra_cppflags" ; then
4358
4359         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4360         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4361
4362 fi
4363
4364 cf_add_libs="`$NCURSES_CONFIG --libs`"
4365 # Filter out duplicates - this happens with badly-designed ".pc" files...
4366 for cf_add_1lib in $LIBS
4367 do
4368         for cf_add_2lib in $cf_add_libs
4369         do
4370                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4371                 then
4372                         cf_add_1lib=
4373                         break
4374                 fi
4375         done
4376         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4377 done
4378 LIBS="$cf_add_libs"
4379
4380                 # even with config script, some packages use no-override for curses.h
4381
4382 echo "$as_me:4382: checking if we have identified curses headers" >&5
4383 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4384 if test "${cf_cv_ncurses_header+set}" = set; then
4385   echo $ECHO_N "(cached) $ECHO_C" >&6
4386 else
4387
4388 cf_cv_ncurses_header=none
4389 for cf_header in \
4390         ncurses.h ncurses/ncurses.h \
4391         curses.h ncurses/curses.h
4392 do
4393 cat >conftest.$ac_ext <<_ACEOF
4394 #line 4394 "configure"
4395 #include "confdefs.h"
4396 #include <${cf_header}>
4397 int
4398 main (void)
4399 {
4400 initscr(); tgoto("?", 0,0)
4401   ;
4402   return 0;
4403 }
4404 _ACEOF
4405 rm -f conftest.$ac_objext
4406 if { (eval echo "$as_me:4406: \"$ac_compile\"") >&5
4407   (eval $ac_compile) 2>&5
4408   ac_status=$?
4409   echo "$as_me:4409: \$? = $ac_status" >&5
4410   (exit $ac_status); } &&
4411          { ac_try='test -s conftest.$ac_objext'
4412   { (eval echo "$as_me:4412: \"$ac_try\"") >&5
4413   (eval $ac_try) 2>&5
4414   ac_status=$?
4415   echo "$as_me:4415: \$? = $ac_status" >&5
4416   (exit $ac_status); }; }; then
4417   cf_cv_ncurses_header=$cf_header; break
4418 else
4419   echo "$as_me: failed program was:" >&5
4420 cat conftest.$ac_ext >&5
4421 fi
4422 rm -f conftest.$ac_objext conftest.$ac_ext
4423 done
4424
4425 fi
4426 echo "$as_me:4426: result: $cf_cv_ncurses_header" >&5
4427 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4428
4429 if test "$cf_cv_ncurses_header" = none ; then
4430         { { echo "$as_me:4430: error: No curses header-files found" >&5
4431 echo "$as_me: error: No curses header-files found" >&2;}
4432    { (exit 1); exit 1; }; }
4433 fi
4434
4435 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4436
4437 for ac_header in $cf_cv_ncurses_header
4438 do
4439 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4440 echo "$as_me:4440: checking for $ac_header" >&5
4441 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4442 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4443   echo $ECHO_N "(cached) $ECHO_C" >&6
4444 else
4445   cat >conftest.$ac_ext <<_ACEOF
4446 #line 4446 "configure"
4447 #include "confdefs.h"
4448 #include <$ac_header>
4449 _ACEOF
4450 if { (eval echo "$as_me:4450: \"$ac_cpp conftest.$ac_ext\"") >&5
4451   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4452   ac_status=$?
4453   egrep -v '^ *\+' conftest.er1 >conftest.err
4454   rm -f conftest.er1
4455   cat conftest.err >&5
4456   echo "$as_me:4456: \$? = $ac_status" >&5
4457   (exit $ac_status); } >/dev/null; then
4458   if test -s conftest.err; then
4459     ac_cpp_err=$ac_c_preproc_warn_flag
4460   else
4461     ac_cpp_err=
4462   fi
4463 else
4464   ac_cpp_err=yes
4465 fi
4466 if test -z "$ac_cpp_err"; then
4467   eval "$as_ac_Header=yes"
4468 else
4469   echo "$as_me: failed program was:" >&5
4470   cat conftest.$ac_ext >&5
4471   eval "$as_ac_Header=no"
4472 fi
4473 rm -f conftest.err conftest.$ac_ext
4474 fi
4475 echo "$as_me:4475: result: `eval echo '${'$as_ac_Header'}'`" >&5
4476 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4477 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4478   cat >>confdefs.h <<EOF
4479 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4480 EOF
4481
4482 fi
4483 done
4484
4485 cat >>confdefs.h <<\EOF
4486 #define NCURSES 1
4487 EOF
4488
4489 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4490
4491                 cat >>confdefs.h <<EOF
4492 #define $cf_nculib_ROOT 1
4493 EOF
4494
4495                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4496
4497         else
4498
4499 cf_ncuhdr_root=ncurses
4500
4501 test -n "$cf_cv_curses_dir" && \
4502 test "$cf_cv_curses_dir" != "no" && { \
4503
4504 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4505   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4506   do
4507         while test $cf_add_incdir != /usr/include
4508         do
4509           if test -d $cf_add_incdir
4510           then
4511                 cf_have_incdir=no
4512                 if test -n "$CFLAGS$CPPFLAGS" ; then
4513                   # a loop is needed to ensure we can add subdirs of existing dirs
4514                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4515                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4516                           cf_have_incdir=yes; break
4517                         fi
4518                   done
4519                 fi
4520
4521                 if test "$cf_have_incdir" = no ; then
4522                   if test "$cf_add_incdir" = /usr/local/include ; then
4523                         if test "$GCC" = yes
4524                         then
4525                           cf_save_CPPFLAGS=$CPPFLAGS
4526
4527         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4528         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4529
4530                           cat >conftest.$ac_ext <<_ACEOF
4531 #line 4531 "configure"
4532 #include "confdefs.h"
4533 #include <stdio.h>
4534 int
4535 main (void)
4536 {
4537 printf("Hello")
4538   ;
4539   return 0;
4540 }
4541 _ACEOF
4542 rm -f conftest.$ac_objext
4543 if { (eval echo "$as_me:4543: \"$ac_compile\"") >&5
4544   (eval $ac_compile) 2>&5
4545   ac_status=$?
4546   echo "$as_me:4546: \$? = $ac_status" >&5
4547   (exit $ac_status); } &&
4548          { ac_try='test -s conftest.$ac_objext'
4549   { (eval echo "$as_me:4549: \"$ac_try\"") >&5
4550   (eval $ac_try) 2>&5
4551   ac_status=$?
4552   echo "$as_me:4552: \$? = $ac_status" >&5
4553   (exit $ac_status); }; }; then
4554   :
4555 else
4556   echo "$as_me: failed program was:" >&5
4557 cat conftest.$ac_ext >&5
4558 cf_have_incdir=yes
4559 fi
4560 rm -f conftest.$ac_objext conftest.$ac_ext
4561                           CPPFLAGS=$cf_save_CPPFLAGS
4562                         fi
4563                   fi
4564                 fi
4565
4566                 if test "$cf_have_incdir" = no ; then
4567                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4568
4569 echo "${as_me:-configure}:4569: testing adding $cf_add_incdir to include-path ..." 1>&5
4570
4571                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4572
4573                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4574                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4575                   cf_add_incdir="$cf_top_incdir"
4576                 else
4577                   break
4578                 fi
4579           else
4580                 break
4581           fi
4582         done
4583   done
4584 fi
4585
4586 }
4587
4588 echo "$as_me:4588: checking for $cf_ncuhdr_root header in include-path" >&5
4589 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4590 if test "${cf_cv_ncurses_h+set}" = set; then
4591   echo $ECHO_N "(cached) $ECHO_C" >&6
4592 else
4593
4594         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4595         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4596         for cf_header in $cf_header_list
4597         do
4598
4599         cat >conftest.$ac_ext <<_ACEOF
4600 #line 4600 "configure"
4601 #include "confdefs.h"
4602
4603 #include <$cf_header>
4604 int
4605 main (void)
4606 {
4607
4608 #ifdef NCURSES_VERSION
4609
4610 printf("%s\n", NCURSES_VERSION);
4611 #else
4612 #ifdef __NCURSES_H
4613 printf("old\n");
4614 #else
4615         make an error
4616 #endif
4617 #endif
4618
4619   ;
4620   return 0;
4621 }
4622 _ACEOF
4623 rm -f conftest.$ac_objext
4624 if { (eval echo "$as_me:4624: \"$ac_compile\"") >&5
4625   (eval $ac_compile) 2>&5
4626   ac_status=$?
4627   echo "$as_me:4627: \$? = $ac_status" >&5
4628   (exit $ac_status); } &&
4629          { ac_try='test -s conftest.$ac_objext'
4630   { (eval echo "$as_me:4630: \"$ac_try\"") >&5
4631   (eval $ac_try) 2>&5
4632   ac_status=$?
4633   echo "$as_me:4633: \$? = $ac_status" >&5
4634   (exit $ac_status); }; }; then
4635   cf_cv_ncurses_h=$cf_header
4636
4637 else
4638   echo "$as_me: failed program was:" >&5
4639 cat conftest.$ac_ext >&5
4640 cf_cv_ncurses_h=no
4641 fi
4642 rm -f conftest.$ac_objext conftest.$ac_ext
4643
4644                 test "$cf_cv_ncurses_h" != no && break
4645         done
4646
4647 fi
4648 echo "$as_me:4648: result: $cf_cv_ncurses_h" >&5
4649 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4650
4651 if test "$cf_cv_ncurses_h" != no ; then
4652         cf_cv_ncurses_header=$cf_cv_ncurses_h
4653 else
4654
4655 echo "$as_me:4655: checking for $cf_ncuhdr_root include-path" >&5
4656 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4657 if test "${cf_cv_ncurses_h2+set}" = set; then
4658   echo $ECHO_N "(cached) $ECHO_C" >&6
4659 else
4660
4661         test -n "$verbose" && echo
4662
4663 cf_search=
4664
4665 # collect the current set of include-directories from compiler flags
4666 cf_header_path_list=""
4667 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4668         for cf_header_path in $CPPFLAGS $CFLAGS
4669         do
4670                 case $cf_header_path in
4671                 (-I*)
4672                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4673
4674 test "x$cf_header_path" != "xNONE" && \
4675 test -d "$cf_header_path" && \
4676  {
4677         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4678         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4679         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4680         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4681         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4682         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"
4683 }
4684
4685                         cf_header_path_list="$cf_header_path_list $cf_search"
4686                         ;;
4687                 esac
4688         done
4689 fi
4690
4691 # add the variations for the package we are looking for
4692
4693 cf_search=
4694
4695 test "x$prefix" != "xNONE" && \
4696 test -d "$prefix" && \
4697  {
4698         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4699         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4700         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4701         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4702         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4703         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4704 }
4705
4706 for cf_subdir_prefix in \
4707         /usr \
4708         /usr/local \
4709         /usr/pkg \
4710         /opt \
4711         /opt/local \
4712         $HOME
4713 do
4714
4715 test "x$cf_subdir_prefix" != "x$prefix" && \
4716 test -d "$cf_subdir_prefix" && \
4717 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4718         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4719         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4720         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4721         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4722         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4723         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"
4724 }
4725
4726 done
4727
4728 test "$includedir" != NONE && \
4729 test "$includedir" != "/usr/include" && \
4730 test -d "$includedir" && {
4731         test -d $includedir &&    cf_search="$cf_search $includedir"
4732         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4733 }
4734
4735 test "$oldincludedir" != NONE && \
4736 test "$oldincludedir" != "/usr/include" && \
4737 test -d "$oldincludedir" && {
4738         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4739         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4740 }
4741
4742 cf_search="$cf_search $cf_header_path_list"
4743
4744         test -n "$verbose" && echo search path $cf_search
4745         cf_save2_CPPFLAGS="$CPPFLAGS"
4746         for cf_incdir in $cf_search
4747         do
4748
4749 if test -n "$cf_incdir" ; then
4750   for cf_add_incdir in $cf_incdir
4751   do
4752         while test $cf_add_incdir != /usr/include
4753         do
4754           if test -d $cf_add_incdir
4755           then
4756                 cf_have_incdir=no
4757                 if test -n "$CFLAGS$CPPFLAGS" ; then
4758                   # a loop is needed to ensure we can add subdirs of existing dirs
4759                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4760                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4761                           cf_have_incdir=yes; break
4762                         fi
4763                   done
4764                 fi
4765
4766                 if test "$cf_have_incdir" = no ; then
4767                   if test "$cf_add_incdir" = /usr/local/include ; then
4768                         if test "$GCC" = yes
4769                         then
4770                           cf_save_CPPFLAGS=$CPPFLAGS
4771
4772         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4773         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4774
4775                           cat >conftest.$ac_ext <<_ACEOF
4776 #line 4776 "configure"
4777 #include "confdefs.h"
4778 #include <stdio.h>
4779 int
4780 main (void)
4781 {
4782 printf("Hello")
4783   ;
4784   return 0;
4785 }
4786 _ACEOF
4787 rm -f conftest.$ac_objext
4788 if { (eval echo "$as_me:4788: \"$ac_compile\"") >&5
4789   (eval $ac_compile) 2>&5
4790   ac_status=$?
4791   echo "$as_me:4791: \$? = $ac_status" >&5
4792   (exit $ac_status); } &&
4793          { ac_try='test -s conftest.$ac_objext'
4794   { (eval echo "$as_me:4794: \"$ac_try\"") >&5
4795   (eval $ac_try) 2>&5
4796   ac_status=$?
4797   echo "$as_me:4797: \$? = $ac_status" >&5
4798   (exit $ac_status); }; }; then
4799   :
4800 else
4801   echo "$as_me: failed program was:" >&5
4802 cat conftest.$ac_ext >&5
4803 cf_have_incdir=yes
4804 fi
4805 rm -f conftest.$ac_objext conftest.$ac_ext
4806                           CPPFLAGS=$cf_save_CPPFLAGS
4807                         fi
4808                   fi
4809                 fi
4810
4811                 if test "$cf_have_incdir" = no ; then
4812                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4813
4814 echo "${as_me:-configure}:4814: testing adding $cf_add_incdir to include-path ..." 1>&5
4815
4816                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4817
4818                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4819                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4820                   cf_add_incdir="$cf_top_incdir"
4821                 else
4822                   break
4823                 fi
4824           else
4825                 break
4826           fi
4827         done
4828   done
4829 fi
4830
4831                 for cf_header in \
4832                         ncurses.h \
4833                         curses.h
4834                 do
4835
4836         cat >conftest.$ac_ext <<_ACEOF
4837 #line 4837 "configure"
4838 #include "confdefs.h"
4839
4840 #include <$cf_header>
4841 int
4842 main (void)
4843 {
4844
4845 #ifdef NCURSES_VERSION
4846
4847 printf("%s\n", NCURSES_VERSION);
4848 #else
4849 #ifdef __NCURSES_H
4850 printf("old\n");
4851 #else
4852         make an error
4853 #endif
4854 #endif
4855
4856   ;
4857   return 0;
4858 }
4859 _ACEOF
4860 rm -f conftest.$ac_objext
4861 if { (eval echo "$as_me:4861: \"$ac_compile\"") >&5
4862   (eval $ac_compile) 2>&5
4863   ac_status=$?
4864   echo "$as_me:4864: \$? = $ac_status" >&5
4865   (exit $ac_status); } &&
4866          { ac_try='test -s conftest.$ac_objext'
4867   { (eval echo "$as_me:4867: \"$ac_try\"") >&5
4868   (eval $ac_try) 2>&5
4869   ac_status=$?
4870   echo "$as_me:4870: \$? = $ac_status" >&5
4871   (exit $ac_status); }; }; then
4872   cf_cv_ncurses_h2=$cf_header
4873
4874 else
4875   echo "$as_me: failed program was:" >&5
4876 cat conftest.$ac_ext >&5
4877 cf_cv_ncurses_h2=no
4878 fi
4879 rm -f conftest.$ac_objext conftest.$ac_ext
4880
4881                         if test "$cf_cv_ncurses_h2" != no ; then
4882                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4883                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4884                                 break
4885                         fi
4886                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4887                 done
4888                 CPPFLAGS="$cf_save2_CPPFLAGS"
4889                 test "$cf_cv_ncurses_h2" != no && break
4890         done
4891         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4891: error: not found" >&5
4892 echo "$as_me: error: not found" >&2;}
4893    { (exit 1); exit 1; }; }
4894
4895 fi
4896 echo "$as_me:4896: result: $cf_cv_ncurses_h2" >&5
4897 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4898
4899         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4900         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4901         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4902                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4903         fi
4904
4905 if test -n "$cf_1st_incdir" ; then
4906   for cf_add_incdir in $cf_1st_incdir
4907   do
4908         while test $cf_add_incdir != /usr/include
4909         do
4910           if test -d $cf_add_incdir
4911           then
4912                 cf_have_incdir=no
4913                 if test -n "$CFLAGS$CPPFLAGS" ; then
4914                   # a loop is needed to ensure we can add subdirs of existing dirs
4915                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4916                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4917                           cf_have_incdir=yes; break
4918                         fi
4919                   done
4920                 fi
4921
4922                 if test "$cf_have_incdir" = no ; then
4923                   if test "$cf_add_incdir" = /usr/local/include ; then
4924                         if test "$GCC" = yes
4925                         then
4926                           cf_save_CPPFLAGS=$CPPFLAGS
4927
4928         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4929         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4930
4931                           cat >conftest.$ac_ext <<_ACEOF
4932 #line 4932 "configure"
4933 #include "confdefs.h"
4934 #include <stdio.h>
4935 int
4936 main (void)
4937 {
4938 printf("Hello")
4939   ;
4940   return 0;
4941 }
4942 _ACEOF
4943 rm -f conftest.$ac_objext
4944 if { (eval echo "$as_me:4944: \"$ac_compile\"") >&5
4945   (eval $ac_compile) 2>&5
4946   ac_status=$?
4947   echo "$as_me:4947: \$? = $ac_status" >&5
4948   (exit $ac_status); } &&
4949          { ac_try='test -s conftest.$ac_objext'
4950   { (eval echo "$as_me:4950: \"$ac_try\"") >&5
4951   (eval $ac_try) 2>&5
4952   ac_status=$?
4953   echo "$as_me:4953: \$? = $ac_status" >&5
4954   (exit $ac_status); }; }; then
4955   :
4956 else
4957   echo "$as_me: failed program was:" >&5
4958 cat conftest.$ac_ext >&5
4959 cf_have_incdir=yes
4960 fi
4961 rm -f conftest.$ac_objext conftest.$ac_ext
4962                           CPPFLAGS=$cf_save_CPPFLAGS
4963                         fi
4964                   fi
4965                 fi
4966
4967                 if test "$cf_have_incdir" = no ; then
4968                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4969
4970 echo "${as_me:-configure}:4970: testing adding $cf_add_incdir to include-path ..." 1>&5
4971
4972                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4973
4974                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4975                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4976                   cf_add_incdir="$cf_top_incdir"
4977                 else
4978                   break
4979                 fi
4980           else
4981                 break
4982           fi
4983         done
4984   done
4985 fi
4986
4987 fi
4988
4989 # Set definitions to allow ifdef'ing for ncurses.h
4990
4991 case $cf_cv_ncurses_header in
4992 (*ncurses.h)
4993
4994 cat >>confdefs.h <<\EOF
4995 #define HAVE_NCURSES_H 1
4996 EOF
4997
4998         ;;
4999 esac
5000
5001 case $cf_cv_ncurses_header in
5002 (ncurses/curses.h|ncurses/ncurses.h)
5003
5004 cat >>confdefs.h <<\EOF
5005 #define HAVE_NCURSES_NCURSES_H 1
5006 EOF
5007
5008         ;;
5009 (ncursesw/curses.h|ncursesw/ncurses.h)
5010
5011 cat >>confdefs.h <<\EOF
5012 #define HAVE_NCURSESW_NCURSES_H 1
5013 EOF
5014
5015         ;;
5016 esac
5017
5018 echo "$as_me:5018: checking for terminfo header" >&5
5019 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5020 if test "${cf_cv_term_header+set}" = set; then
5021   echo $ECHO_N "(cached) $ECHO_C" >&6
5022 else
5023
5024 case ${cf_cv_ncurses_header} in
5025 (*/ncurses.h|*/ncursesw.h)
5026         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5027         ;;
5028 (*)
5029         cf_term_header=term.h
5030         ;;
5031 esac
5032
5033 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5034 do
5035 cat >conftest.$ac_ext <<_ACEOF
5036 #line 5036 "configure"
5037 #include "confdefs.h"
5038 #include <stdio.h>
5039 #include <${cf_cv_ncurses_header:-curses.h}>
5040 #include <$cf_test>
5041
5042 int
5043 main (void)
5044 {
5045 int x = auto_left_margin
5046   ;
5047   return 0;
5048 }
5049 _ACEOF
5050 rm -f conftest.$ac_objext
5051 if { (eval echo "$as_me:5051: \"$ac_compile\"") >&5
5052   (eval $ac_compile) 2>&5
5053   ac_status=$?
5054   echo "$as_me:5054: \$? = $ac_status" >&5
5055   (exit $ac_status); } &&
5056          { ac_try='test -s conftest.$ac_objext'
5057   { (eval echo "$as_me:5057: \"$ac_try\"") >&5
5058   (eval $ac_try) 2>&5
5059   ac_status=$?
5060   echo "$as_me:5060: \$? = $ac_status" >&5
5061   (exit $ac_status); }; }; then
5062
5063         cf_cv_term_header="$cf_test"
5064 else
5065   echo "$as_me: failed program was:" >&5
5066 cat conftest.$ac_ext >&5
5067
5068         cf_cv_term_header=unknown
5069
5070 fi
5071 rm -f conftest.$ac_objext conftest.$ac_ext
5072         test "$cf_cv_term_header" != unknown && break
5073 done
5074
5075 fi
5076 echo "$as_me:5076: result: $cf_cv_term_header" >&5
5077 echo "${ECHO_T}$cf_cv_term_header" >&6
5078
5079 # Set definitions to allow ifdef'ing to accommodate subdirectories
5080
5081 case $cf_cv_term_header in
5082 (*term.h)
5083
5084 cat >>confdefs.h <<\EOF
5085 #define HAVE_TERM_H 1
5086 EOF
5087
5088         ;;
5089 esac
5090
5091 case $cf_cv_term_header in
5092 (ncurses/term.h)
5093
5094 cat >>confdefs.h <<\EOF
5095 #define HAVE_NCURSES_TERM_H 1
5096 EOF
5097
5098         ;;
5099 (ncursesw/term.h)
5100
5101 cat >>confdefs.h <<\EOF
5102 #define HAVE_NCURSESW_TERM_H 1
5103 EOF
5104
5105         ;;
5106 esac
5107
5108 # some applications need this, but should check for NCURSES_VERSION
5109
5110 cat >>confdefs.h <<\EOF
5111 #define NCURSES 1
5112 EOF
5113
5114 echo "$as_me:5114: checking for ncurses version" >&5
5115 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5116 if test "${cf_cv_ncurses_version+set}" = set; then
5117   echo $ECHO_N "(cached) $ECHO_C" >&6
5118 else
5119
5120         cf_cv_ncurses_version=no
5121         cf_tempfile=out$$
5122         rm -f $cf_tempfile
5123         if test "$cross_compiling" = yes; then
5124
5125         # This will not work if the preprocessor splits the line after the
5126         # Autoconf token.  The 'unproto' program does that.
5127         cat > conftest.$ac_ext <<EOF
5128 #include <${cf_cv_ncurses_header:-curses.h}>
5129 #undef Autoconf
5130 #ifdef NCURSES_VERSION
5131 Autoconf NCURSES_VERSION
5132 #else
5133 #ifdef __NCURSES_H
5134 Autoconf "old"
5135 #endif
5136 ;
5137 #endif
5138 EOF
5139         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5140         { (eval echo "$as_me:5140: \"$cf_try\"") >&5
5141   (eval $cf_try) 2>&5
5142   ac_status=$?
5143   echo "$as_me:5143: \$? = $ac_status" >&5
5144   (exit $ac_status); }
5145         if test -f conftest.out ; then
5146                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5147                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5148                 rm -f conftest.out
5149         fi
5150
5151 else
5152   cat >conftest.$ac_ext <<_ACEOF
5153 #line 5153 "configure"
5154 #include "confdefs.h"
5155
5156 #include <${cf_cv_ncurses_header:-curses.h}>
5157 #include <stdio.h>
5158 int main(void)
5159 {
5160         FILE *fp = fopen("$cf_tempfile", "w");
5161 #ifdef NCURSES_VERSION
5162 # ifdef NCURSES_VERSION_PATCH
5163         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5164 # else
5165         fprintf(fp, "%s\n", NCURSES_VERSION);
5166 # endif
5167 #else
5168 # ifdef __NCURSES_H
5169         fprintf(fp, "old\n");
5170 # else
5171         make an error
5172 # endif
5173 #endif
5174         ${cf_cv_main_return:-return}(0);
5175 }
5176 _ACEOF
5177 rm -f conftest$ac_exeext
5178 if { (eval echo "$as_me:5178: \"$ac_link\"") >&5
5179   (eval $ac_link) 2>&5
5180   ac_status=$?
5181   echo "$as_me:5181: \$? = $ac_status" >&5
5182   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5183   { (eval echo "$as_me:5183: \"$ac_try\"") >&5
5184   (eval $ac_try) 2>&5
5185   ac_status=$?
5186   echo "$as_me:5186: \$? = $ac_status" >&5
5187   (exit $ac_status); }; }; then
5188
5189         cf_cv_ncurses_version=`cat $cf_tempfile`
5190 else
5191   echo "$as_me: program exited with status $ac_status" >&5
5192 echo "$as_me: failed program was:" >&5
5193 cat conftest.$ac_ext >&5
5194 fi
5195 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5196 fi
5197         rm -f $cf_tempfile
5198
5199 fi
5200 echo "$as_me:5200: result: $cf_cv_ncurses_version" >&5
5201 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5202 test "$cf_cv_ncurses_version" = no ||
5203 cat >>confdefs.h <<\EOF
5204 #define NCURSES 1
5205 EOF
5206
5207 cf_nculib_root=ncurses
5208         # This works, except for the special case where we find gpm, but
5209         # ncurses is in a nonstandard location via $LIBS, and we really want
5210         # to link gpm.
5211 cf_ncurses_LIBS=""
5212 cf_ncurses_SAVE="$LIBS"
5213 echo "$as_me:5213: checking for Gpm_Open in -lgpm" >&5
5214 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5215 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5216   echo $ECHO_N "(cached) $ECHO_C" >&6
5217 else
5218   ac_check_lib_save_LIBS=$LIBS
5219 LIBS="-lgpm  $LIBS"
5220 cat >conftest.$ac_ext <<_ACEOF
5221 #line 5221 "configure"
5222 #include "confdefs.h"
5223
5224 /* Override any gcc2 internal prototype to avoid an error.  */
5225 #ifdef __cplusplus
5226 extern "C"
5227 #endif
5228 /* We use char because int might match the return type of a gcc2
5229    builtin and then its argument prototype would still apply.  */
5230 char Gpm_Open ();
5231 int
5232 main (void)
5233 {
5234 Gpm_Open ();
5235   ;
5236   return 0;
5237 }
5238 _ACEOF
5239 rm -f conftest.$ac_objext conftest$ac_exeext
5240 if { (eval echo "$as_me:5240: \"$ac_link\"") >&5
5241   (eval $ac_link) 2>&5
5242   ac_status=$?
5243   echo "$as_me:5243: \$? = $ac_status" >&5
5244   (exit $ac_status); } &&
5245          { ac_try='test -s conftest$ac_exeext'
5246   { (eval echo "$as_me:5246: \"$ac_try\"") >&5
5247   (eval $ac_try) 2>&5
5248   ac_status=$?
5249   echo "$as_me:5249: \$? = $ac_status" >&5
5250   (exit $ac_status); }; }; then
5251   ac_cv_lib_gpm_Gpm_Open=yes
5252 else
5253   echo "$as_me: failed program was:" >&5
5254 cat conftest.$ac_ext >&5
5255 ac_cv_lib_gpm_Gpm_Open=no
5256 fi
5257 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5258 LIBS=$ac_check_lib_save_LIBS
5259 fi
5260 echo "$as_me:5260: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5261 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5262 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5263   echo "$as_me:5263: checking for initscr in -lgpm" >&5
5264 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5265 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5266   echo $ECHO_N "(cached) $ECHO_C" >&6
5267 else
5268   ac_check_lib_save_LIBS=$LIBS
5269 LIBS="-lgpm  $LIBS"
5270 cat >conftest.$ac_ext <<_ACEOF
5271 #line 5271 "configure"
5272 #include "confdefs.h"
5273
5274 /* Override any gcc2 internal prototype to avoid an error.  */
5275 #ifdef __cplusplus
5276 extern "C"
5277 #endif
5278 /* We use char because int might match the return type of a gcc2
5279    builtin and then its argument prototype would still apply.  */
5280 char initscr ();
5281 int
5282 main (void)
5283 {
5284 initscr ();
5285   ;
5286   return 0;
5287 }
5288 _ACEOF
5289 rm -f conftest.$ac_objext conftest$ac_exeext
5290 if { (eval echo "$as_me:5290: \"$ac_link\"") >&5
5291   (eval $ac_link) 2>&5
5292   ac_status=$?
5293   echo "$as_me:5293: \$? = $ac_status" >&5
5294   (exit $ac_status); } &&
5295          { ac_try='test -s conftest$ac_exeext'
5296   { (eval echo "$as_me:5296: \"$ac_try\"") >&5
5297   (eval $ac_try) 2>&5
5298   ac_status=$?
5299   echo "$as_me:5299: \$? = $ac_status" >&5
5300   (exit $ac_status); }; }; then
5301   ac_cv_lib_gpm_initscr=yes
5302 else
5303   echo "$as_me: failed program was:" >&5
5304 cat conftest.$ac_ext >&5
5305 ac_cv_lib_gpm_initscr=no
5306 fi
5307 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5308 LIBS=$ac_check_lib_save_LIBS
5309 fi
5310 echo "$as_me:5310: result: $ac_cv_lib_gpm_initscr" >&5
5311 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5312 if test $ac_cv_lib_gpm_initscr = yes; then
5313   LIBS="$cf_ncurses_SAVE"
5314 else
5315   cf_ncurses_LIBS="-lgpm"
5316 fi
5317
5318 fi
5319
5320 case $host_os in
5321 (freebsd*)
5322         # This is only necessary if you are linking against an obsolete
5323         # version of ncurses (but it should do no harm, since it's static).
5324         if test "$cf_nculib_root" = ncurses ; then
5325                 echo "$as_me:5325: checking for tgoto in -lmytinfo" >&5
5326 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5327 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5328   echo $ECHO_N "(cached) $ECHO_C" >&6
5329 else
5330   ac_check_lib_save_LIBS=$LIBS
5331 LIBS="-lmytinfo  $LIBS"
5332 cat >conftest.$ac_ext <<_ACEOF
5333 #line 5333 "configure"
5334 #include "confdefs.h"
5335
5336 /* Override any gcc2 internal prototype to avoid an error.  */
5337 #ifdef __cplusplus
5338 extern "C"
5339 #endif
5340 /* We use char because int might match the return type of a gcc2
5341    builtin and then its argument prototype would still apply.  */
5342 char tgoto ();
5343 int
5344 main (void)
5345 {
5346 tgoto ();
5347   ;
5348   return 0;
5349 }
5350 _ACEOF
5351 rm -f conftest.$ac_objext conftest$ac_exeext
5352 if { (eval echo "$as_me:5352: \"$ac_link\"") >&5
5353   (eval $ac_link) 2>&5
5354   ac_status=$?
5355   echo "$as_me:5355: \$? = $ac_status" >&5
5356   (exit $ac_status); } &&
5357          { ac_try='test -s conftest$ac_exeext'
5358   { (eval echo "$as_me:5358: \"$ac_try\"") >&5
5359   (eval $ac_try) 2>&5
5360   ac_status=$?
5361   echo "$as_me:5361: \$? = $ac_status" >&5
5362   (exit $ac_status); }; }; then
5363   ac_cv_lib_mytinfo_tgoto=yes
5364 else
5365   echo "$as_me: failed program was:" >&5
5366 cat conftest.$ac_ext >&5
5367 ac_cv_lib_mytinfo_tgoto=no
5368 fi
5369 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5370 LIBS=$ac_check_lib_save_LIBS
5371 fi
5372 echo "$as_me:5372: result: $ac_cv_lib_mytinfo_tgoto" >&5
5373 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5374 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5375   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5376 fi
5377
5378         fi
5379         ;;
5380 esac
5381
5382 cf_add_libs="$cf_ncurses_LIBS"
5383 # Filter out duplicates - this happens with badly-designed ".pc" files...
5384 for cf_add_1lib in $LIBS
5385 do
5386         for cf_add_2lib in $cf_add_libs
5387         do
5388                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5389                 then
5390                         cf_add_1lib=
5391                         break
5392                 fi
5393         done
5394         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5395 done
5396 LIBS="$cf_add_libs"
5397
5398 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5399 then
5400
5401 cf_add_libs="-l$cf_nculib_root"
5402 # Filter out duplicates - this happens with badly-designed ".pc" files...
5403 for cf_add_1lib in $LIBS
5404 do
5405         for cf_add_2lib in $cf_add_libs
5406         do
5407                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5408                 then
5409                         cf_add_1lib=
5410                         break
5411                 fi
5412         done
5413         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5414 done
5415 LIBS="$cf_add_libs"
5416
5417 else
5418
5419         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5420         cf_libdir=""
5421         echo "$as_me:5421: checking for initscr" >&5
5422 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5423 if test "${ac_cv_func_initscr+set}" = set; then
5424   echo $ECHO_N "(cached) $ECHO_C" >&6
5425 else
5426   cat >conftest.$ac_ext <<_ACEOF
5427 #line 5427 "configure"
5428 #include "confdefs.h"
5429 /* System header to define __stub macros and hopefully few prototypes,
5430     which can conflict with char initscr (); below.  */
5431 #include <assert.h>
5432 /* Override any gcc2 internal prototype to avoid an error.  */
5433 #ifdef __cplusplus
5434 extern "C"
5435 #endif
5436 /* We use char because int might match the return type of a gcc2
5437    builtin and then its argument prototype would still apply.  */
5438 char initscr ();
5439 char (*f) ();
5440
5441 int
5442 main (void)
5443 {
5444 /* The GNU C library defines this for functions which it implements
5445     to always fail with ENOSYS.  Some functions are actually named
5446     something starting with __ and the normal name is an alias.  */
5447 #if defined (__stub_initscr) || defined (__stub___initscr)
5448 choke me
5449 #else
5450 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5451 #endif
5452
5453   ;
5454   return 0;
5455 }
5456 _ACEOF
5457 rm -f conftest.$ac_objext conftest$ac_exeext
5458 if { (eval echo "$as_me:5458: \"$ac_link\"") >&5
5459   (eval $ac_link) 2>&5
5460   ac_status=$?
5461   echo "$as_me:5461: \$? = $ac_status" >&5
5462   (exit $ac_status); } &&
5463          { ac_try='test -s conftest$ac_exeext'
5464   { (eval echo "$as_me:5464: \"$ac_try\"") >&5
5465   (eval $ac_try) 2>&5
5466   ac_status=$?
5467   echo "$as_me:5467: \$? = $ac_status" >&5
5468   (exit $ac_status); }; }; then
5469   ac_cv_func_initscr=yes
5470 else
5471   echo "$as_me: failed program was:" >&5
5472 cat conftest.$ac_ext >&5
5473 ac_cv_func_initscr=no
5474 fi
5475 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5476 fi
5477 echo "$as_me:5477: result: $ac_cv_func_initscr" >&5
5478 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5479 if test $ac_cv_func_initscr = yes; then
5480   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5481 else
5482
5483                 cf_save_LIBS="$LIBS"
5484                 echo "$as_me:5484: checking for initscr in -l$cf_nculib_root" >&5
5485 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5486                 LIBS="-l$cf_nculib_root $LIBS"
5487                 cat >conftest.$ac_ext <<_ACEOF
5488 #line 5488 "configure"
5489 #include "confdefs.h"
5490 #include <${cf_cv_ncurses_header:-curses.h}>
5491 int
5492 main (void)
5493 {
5494 initscr()
5495   ;
5496   return 0;
5497 }
5498 _ACEOF
5499 rm -f conftest.$ac_objext conftest$ac_exeext
5500 if { (eval echo "$as_me:5500: \"$ac_link\"") >&5
5501   (eval $ac_link) 2>&5
5502   ac_status=$?
5503   echo "$as_me:5503: \$? = $ac_status" >&5
5504   (exit $ac_status); } &&
5505          { ac_try='test -s conftest$ac_exeext'
5506   { (eval echo "$as_me:5506: \"$ac_try\"") >&5
5507   (eval $ac_try) 2>&5
5508   ac_status=$?
5509   echo "$as_me:5509: \$? = $ac_status" >&5
5510   (exit $ac_status); }; }; then
5511   echo "$as_me:5511: result: yes" >&5
5512 echo "${ECHO_T}yes" >&6
5513                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5514
5515 else
5516   echo "$as_me: failed program was:" >&5
5517 cat conftest.$ac_ext >&5
5518 echo "$as_me:5518: result: no" >&5
5519 echo "${ECHO_T}no" >&6
5520
5521 cf_search=
5522 cf_library_path_list=""
5523 if test -n "${LDFLAGS}${LIBS}" ; then
5524         for cf_library_path in $LDFLAGS $LIBS
5525         do
5526                 case $cf_library_path in
5527                 (-L*)
5528                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5529
5530 test "x$cf_library_path" != "xNONE" && \
5531 test -d "$cf_library_path" && \
5532  {
5533         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5534         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5535         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5536         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5537         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5538         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"
5539 }
5540
5541                         cf_library_path_list="$cf_library_path_list $cf_search"
5542                         ;;
5543                 esac
5544         done
5545 fi
5546
5547 cf_search=
5548
5549 test "x$prefix" != "xNONE" && \
5550 test -d "$prefix" && \
5551  {
5552         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5553         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5554         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5555         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5556         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5557         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5558 }
5559
5560 for cf_subdir_prefix in \
5561         /usr \
5562         /usr/local \
5563         /usr/pkg \
5564         /opt \
5565         /opt/local \
5566         $HOME
5567 do
5568
5569 test "x$cf_subdir_prefix" != "x$prefix" && \
5570 test -d "$cf_subdir_prefix" && \
5571 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5572         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5573         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5574         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5575         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5576         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5577         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"
5578 }
5579
5580 done
5581
5582 cf_search="$cf_library_path_list $cf_search"
5583
5584                         for cf_libdir in $cf_search
5585                         do
5586                                 echo "$as_me:5586: checking for -l$cf_nculib_root in $cf_libdir" >&5
5587 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5588                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5589                                 cat >conftest.$ac_ext <<_ACEOF
5590 #line 5590 "configure"
5591 #include "confdefs.h"
5592 #include <${cf_cv_ncurses_header:-curses.h}>
5593 int
5594 main (void)
5595 {
5596 initscr()
5597   ;
5598   return 0;
5599 }
5600 _ACEOF
5601 rm -f conftest.$ac_objext conftest$ac_exeext
5602 if { (eval echo "$as_me:5602: \"$ac_link\"") >&5
5603   (eval $ac_link) 2>&5
5604   ac_status=$?
5605   echo "$as_me:5605: \$? = $ac_status" >&5
5606   (exit $ac_status); } &&
5607          { ac_try='test -s conftest$ac_exeext'
5608   { (eval echo "$as_me:5608: \"$ac_try\"") >&5
5609   (eval $ac_try) 2>&5
5610   ac_status=$?
5611   echo "$as_me:5611: \$? = $ac_status" >&5
5612   (exit $ac_status); }; }; then
5613   echo "$as_me:5613: result: yes" >&5
5614 echo "${ECHO_T}yes" >&6
5615                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5616                                          break
5617 else
5618   echo "$as_me: failed program was:" >&5
5619 cat conftest.$ac_ext >&5
5620 echo "$as_me:5620: result: no" >&5
5621 echo "${ECHO_T}no" >&6
5622                                          LIBS="$cf_save_LIBS"
5623 fi
5624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5625                         done
5626
5627 fi
5628 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5629
5630 fi
5631
5632 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5633
5634 if test $cf_found_library = no ; then
5635         { { echo "$as_me:5635: error: Cannot link $cf_nculib_root library" >&5
5636 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5637    { (exit 1); exit 1; }; }
5638 fi
5639
5640 fi
5641
5642 if test -n "$cf_ncurses_LIBS" ; then
5643         echo "$as_me:5643: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5644 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5645         cf_ncurses_SAVE="$LIBS"
5646         for p in $cf_ncurses_LIBS ; do
5647                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5648                 if test "$q" != "$LIBS" ; then
5649                         LIBS="$q"
5650                 fi
5651         done
5652         cat >conftest.$ac_ext <<_ACEOF
5653 #line 5653 "configure"
5654 #include "confdefs.h"
5655 #include <${cf_cv_ncurses_header:-curses.h}>
5656 int
5657 main (void)
5658 {
5659 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5660   ;
5661   return 0;
5662 }
5663 _ACEOF
5664 rm -f conftest.$ac_objext conftest$ac_exeext
5665 if { (eval echo "$as_me:5665: \"$ac_link\"") >&5
5666   (eval $ac_link) 2>&5
5667   ac_status=$?
5668   echo "$as_me:5668: \$? = $ac_status" >&5
5669   (exit $ac_status); } &&
5670          { ac_try='test -s conftest$ac_exeext'
5671   { (eval echo "$as_me:5671: \"$ac_try\"") >&5
5672   (eval $ac_try) 2>&5
5673   ac_status=$?
5674   echo "$as_me:5674: \$? = $ac_status" >&5
5675   (exit $ac_status); }; }; then
5676   echo "$as_me:5676: result: yes" >&5
5677 echo "${ECHO_T}yes" >&6
5678 else
5679   echo "$as_me: failed program was:" >&5
5680 cat conftest.$ac_ext >&5
5681 echo "$as_me:5681: result: no" >&5
5682 echo "${ECHO_T}no" >&6
5683                  LIBS="$cf_ncurses_SAVE"
5684 fi
5685 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5686 fi
5687
5688 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5689
5690 cat >>confdefs.h <<EOF
5691 #define $cf_nculib_ROOT 1
5692 EOF
5693
5694         fi
5695 else
5696         NCURSES_CONFIG=none
5697 fi
5698
5699 echo "$as_me:5699: checking if you want wide-character code" >&5
5700 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5701
5702 # Check whether --enable-widec or --disable-widec was given.
5703 if test "${enable_widec+set}" = set; then
5704   enableval="$enable_widec"
5705   with_widec=$enableval
5706 else
5707   with_widec=no
5708 fi;
5709 echo "$as_me:5709: result: $with_widec" >&5
5710 echo "${ECHO_T}$with_widec" >&6
5711 if test "$with_widec" = yes ; then
5712
5713 echo "$as_me:5713: checking for multibyte character support" >&5
5714 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5715 if test "${cf_cv_utf8_lib+set}" = set; then
5716   echo $ECHO_N "(cached) $ECHO_C" >&6
5717 else
5718
5719         cf_save_LIBS="$LIBS"
5720         cat >conftest.$ac_ext <<_ACEOF
5721 #line 5721 "configure"
5722 #include "confdefs.h"
5723
5724 #include <stdlib.h>
5725 int
5726 main (void)
5727 {
5728 putwc(0,0);
5729   ;
5730   return 0;
5731 }
5732 _ACEOF
5733 rm -f conftest.$ac_objext conftest$ac_exeext
5734 if { (eval echo "$as_me:5734: \"$ac_link\"") >&5
5735   (eval $ac_link) 2>&5
5736   ac_status=$?
5737   echo "$as_me:5737: \$? = $ac_status" >&5
5738   (exit $ac_status); } &&
5739          { ac_try='test -s conftest$ac_exeext'
5740   { (eval echo "$as_me:5740: \"$ac_try\"") >&5
5741   (eval $ac_try) 2>&5
5742   ac_status=$?
5743   echo "$as_me:5743: \$? = $ac_status" >&5
5744   (exit $ac_status); }; }; then
5745   cf_cv_utf8_lib=yes
5746 else
5747   echo "$as_me: failed program was:" >&5
5748 cat conftest.$ac_ext >&5
5749
5750 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5751 # will be set on completion of the AC_TRY_LINK below.
5752 cf_cv_header_path_utf8=
5753 cf_cv_library_path_utf8=
5754
5755 echo "${as_me:-configure}:5755: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5756
5757 cf_save_LIBS="$LIBS"
5758
5759 cat >conftest.$ac_ext <<_ACEOF
5760 #line 5760 "configure"
5761 #include "confdefs.h"
5762
5763 #include <libutf8.h>
5764 int
5765 main (void)
5766 {
5767 putwc(0,0);
5768   ;
5769   return 0;
5770 }
5771 _ACEOF
5772 rm -f conftest.$ac_objext conftest$ac_exeext
5773 if { (eval echo "$as_me:5773: \"$ac_link\"") >&5
5774   (eval $ac_link) 2>&5
5775   ac_status=$?
5776   echo "$as_me:5776: \$? = $ac_status" >&5
5777   (exit $ac_status); } &&
5778          { ac_try='test -s conftest$ac_exeext'
5779   { (eval echo "$as_me:5779: \"$ac_try\"") >&5
5780   (eval $ac_try) 2>&5
5781   ac_status=$?
5782   echo "$as_me:5782: \$? = $ac_status" >&5
5783   (exit $ac_status); }; }; then
5784
5785         cf_cv_find_linkage_utf8=yes
5786         cf_cv_header_path_utf8=/usr/include
5787         cf_cv_library_path_utf8=/usr/lib
5788
5789 else
5790   echo "$as_me: failed program was:" >&5
5791 cat conftest.$ac_ext >&5
5792
5793 LIBS="-lutf8  $cf_save_LIBS"
5794
5795 cat >conftest.$ac_ext <<_ACEOF
5796 #line 5796 "configure"
5797 #include "confdefs.h"
5798
5799 #include <libutf8.h>
5800 int
5801 main (void)
5802 {
5803 putwc(0,0);
5804   ;
5805   return 0;
5806 }
5807 _ACEOF
5808 rm -f conftest.$ac_objext conftest$ac_exeext
5809 if { (eval echo "$as_me:5809: \"$ac_link\"") >&5
5810   (eval $ac_link) 2>&5
5811   ac_status=$?
5812   echo "$as_me:5812: \$? = $ac_status" >&5
5813   (exit $ac_status); } &&
5814          { ac_try='test -s conftest$ac_exeext'
5815   { (eval echo "$as_me:5815: \"$ac_try\"") >&5
5816   (eval $ac_try) 2>&5
5817   ac_status=$?
5818   echo "$as_me:5818: \$? = $ac_status" >&5
5819   (exit $ac_status); }; }; then
5820
5821         cf_cv_find_linkage_utf8=yes
5822         cf_cv_header_path_utf8=/usr/include
5823         cf_cv_library_path_utf8=/usr/lib
5824         cf_cv_library_file_utf8="-lutf8"
5825
5826 else
5827   echo "$as_me: failed program was:" >&5
5828 cat conftest.$ac_ext >&5
5829
5830         cf_cv_find_linkage_utf8=no
5831         LIBS="$cf_save_LIBS"
5832
5833         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5834
5835 echo "${as_me:-configure}:5835: testing find linkage for utf8 library ..." 1>&5
5836
5837 echo "${as_me:-configure}:5837: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5838
5839         cf_save_CPPFLAGS="$CPPFLAGS"
5840         cf_test_CPPFLAGS="$CPPFLAGS"
5841
5842 cf_search=
5843
5844 # collect the current set of include-directories from compiler flags
5845 cf_header_path_list=""
5846 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5847         for cf_header_path in $CPPFLAGS $CFLAGS
5848         do
5849                 case $cf_header_path in
5850                 (-I*)
5851                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5852
5853 test "x$cf_header_path" != "xNONE" && \
5854 test -d "$cf_header_path" && \
5855  {
5856         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5857         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5858         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5859         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5860         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5861         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5862 }
5863
5864                         cf_header_path_list="$cf_header_path_list $cf_search"
5865                         ;;
5866                 esac
5867         done
5868 fi
5869
5870 # add the variations for the package we are looking for
5871
5872 cf_search=
5873
5874 test "x$prefix" != "xNONE" && \
5875 test -d "$prefix" && \
5876  {
5877         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5878         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5879         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5880         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5881         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5882         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5883 }
5884
5885 for cf_subdir_prefix in \
5886         /usr \
5887         /usr/local \
5888         /usr/pkg \
5889         /opt \
5890         /opt/local \
5891         $HOME
5892 do
5893
5894 test "x$cf_subdir_prefix" != "x$prefix" && \
5895 test -d "$cf_subdir_prefix" && \
5896 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5897         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5898         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5899         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5900         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5901         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5902         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5903 }
5904
5905 done
5906
5907 test "$includedir" != NONE && \
5908 test "$includedir" != "/usr/include" && \
5909 test -d "$includedir" && {
5910         test -d $includedir &&    cf_search="$cf_search $includedir"
5911         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5912 }
5913
5914 test "$oldincludedir" != NONE && \
5915 test "$oldincludedir" != "/usr/include" && \
5916 test -d "$oldincludedir" && {
5917         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5918         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5919 }
5920
5921 cf_search="$cf_search $cf_header_path_list"
5922
5923         for cf_cv_header_path_utf8 in $cf_search
5924         do
5925                 if test -d $cf_cv_header_path_utf8 ; then
5926                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5927
5928 echo "${as_me:-configure}:5928: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5929
5930                         CPPFLAGS="$cf_save_CPPFLAGS"
5931
5932         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5933         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
5934
5935                         cat >conftest.$ac_ext <<_ACEOF
5936 #line 5936 "configure"
5937 #include "confdefs.h"
5938
5939 #include <libutf8.h>
5940 int
5941 main (void)
5942 {
5943 putwc(0,0);
5944   ;
5945   return 0;
5946 }
5947 _ACEOF
5948 rm -f conftest.$ac_objext
5949 if { (eval echo "$as_me:5949: \"$ac_compile\"") >&5
5950   (eval $ac_compile) 2>&5
5951   ac_status=$?
5952   echo "$as_me:5952: \$? = $ac_status" >&5
5953   (exit $ac_status); } &&
5954          { ac_try='test -s conftest.$ac_objext'
5955   { (eval echo "$as_me:5955: \"$ac_try\"") >&5
5956   (eval $ac_try) 2>&5
5957   ac_status=$?
5958   echo "$as_me:5958: \$? = $ac_status" >&5
5959   (exit $ac_status); }; }; then
5960
5961                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5962
5963 echo "${as_me:-configure}:5963: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5964
5965                                 cf_cv_find_linkage_utf8=maybe
5966                                 cf_test_CPPFLAGS="$CPPFLAGS"
5967                                 break
5968 else
5969   echo "$as_me: failed program was:" >&5
5970 cat conftest.$ac_ext >&5
5971
5972                                 CPPFLAGS="$cf_save_CPPFLAGS"
5973
5974 fi
5975 rm -f conftest.$ac_objext conftest.$ac_ext
5976                 fi
5977         done
5978
5979         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5980
5981 echo "${as_me:-configure}:5981: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5982
5983                 cf_save_LIBS="$LIBS"
5984                 cf_save_LDFLAGS="$LDFLAGS"
5985
5986                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5987
5988 cf_search=
5989 cf_library_path_list=""
5990 if test -n "${LDFLAGS}${LIBS}" ; then
5991         for cf_library_path in $LDFLAGS $LIBS
5992         do
5993                 case $cf_library_path in
5994                 (-L*)
5995                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5996
5997 test "x$cf_library_path" != "xNONE" && \
5998 test -d "$cf_library_path" && \
5999  {
6000         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6001         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6002         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6003         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6004         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6005         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6006 }
6007
6008                         cf_library_path_list="$cf_library_path_list $cf_search"
6009                         ;;
6010                 esac
6011         done
6012 fi
6013
6014 cf_search=
6015
6016 test "x$prefix" != "xNONE" && \
6017 test -d "$prefix" && \
6018  {
6019         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6020         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6021         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6022         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6023         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6024         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6025 }
6026
6027 for cf_subdir_prefix in \
6028         /usr \
6029         /usr/local \
6030         /usr/pkg \
6031         /opt \
6032         /opt/local \
6033         $HOME
6034 do
6035
6036 test "x$cf_subdir_prefix" != "x$prefix" && \
6037 test -d "$cf_subdir_prefix" && \
6038 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6039         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6040         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6041         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6042         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6043         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6044         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6045 }
6046
6047 done
6048
6049 cf_search="$cf_library_path_list $cf_search"
6050
6051                         for cf_cv_library_path_utf8 in $cf_search
6052                         do
6053                                 if test -d $cf_cv_library_path_utf8 ; then
6054                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6055
6056 echo "${as_me:-configure}:6056: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6057
6058                                         CPPFLAGS="$cf_test_CPPFLAGS"
6059                                         LIBS="-lutf8  $cf_save_LIBS"
6060                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6061                                         cat >conftest.$ac_ext <<_ACEOF
6062 #line 6062 "configure"
6063 #include "confdefs.h"
6064
6065 #include <libutf8.h>
6066 int
6067 main (void)
6068 {
6069 putwc(0,0);
6070   ;
6071   return 0;
6072 }
6073 _ACEOF
6074 rm -f conftest.$ac_objext conftest$ac_exeext
6075 if { (eval echo "$as_me:6075: \"$ac_link\"") >&5
6076   (eval $ac_link) 2>&5
6077   ac_status=$?
6078   echo "$as_me:6078: \$? = $ac_status" >&5
6079   (exit $ac_status); } &&
6080          { ac_try='test -s conftest$ac_exeext'
6081   { (eval echo "$as_me:6081: \"$ac_try\"") >&5
6082   (eval $ac_try) 2>&5
6083   ac_status=$?
6084   echo "$as_me:6084: \$? = $ac_status" >&5
6085   (exit $ac_status); }; }; then
6086
6087                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6088
6089 echo "${as_me:-configure}:6089: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6090
6091                                         cf_cv_find_linkage_utf8=yes
6092                                         cf_cv_library_file_utf8="-lutf8"
6093                                         break
6094 else
6095   echo "$as_me: failed program was:" >&5
6096 cat conftest.$ac_ext >&5
6097
6098                                         CPPFLAGS="$cf_save_CPPFLAGS"
6099                                         LIBS="$cf_save_LIBS"
6100                                         LDFLAGS="$cf_save_LDFLAGS"
6101
6102 fi
6103 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6104                                 fi
6105                         done
6106                         CPPFLAGS="$cf_save_CPPFLAGS"
6107                         LDFLAGS="$cf_save_LDFLAGS"
6108                 fi
6109
6110         else
6111                 cf_cv_find_linkage_utf8=no
6112         fi
6113
6114 fi
6115 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6116
6117 fi
6118 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6119
6120 LIBS="$cf_save_LIBS"
6121
6122 if test "$cf_cv_find_linkage_utf8" = yes ; then
6123 cf_cv_utf8_lib=add-on
6124 else
6125 cf_cv_utf8_lib=no
6126 fi
6127
6128 fi
6129 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6130 fi
6131 echo "$as_me:6131: result: $cf_cv_utf8_lib" >&5
6132 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6133
6134 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6135 # ncurses/ncursesw:
6136 if test "$cf_cv_utf8_lib" = "add-on" ; then
6137
6138 cat >>confdefs.h <<\EOF
6139 #define HAVE_LIBUTF8_H 1
6140 EOF
6141
6142 if test -n "$cf_cv_header_path_utf8" ; then
6143   for cf_add_incdir in $cf_cv_header_path_utf8
6144   do
6145         while test $cf_add_incdir != /usr/include
6146         do
6147           if test -d $cf_add_incdir
6148           then
6149                 cf_have_incdir=no
6150                 if test -n "$CFLAGS$CPPFLAGS" ; then
6151                   # a loop is needed to ensure we can add subdirs of existing dirs
6152                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6153                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6154                           cf_have_incdir=yes; break
6155                         fi
6156                   done
6157                 fi
6158
6159                 if test "$cf_have_incdir" = no ; then
6160                   if test "$cf_add_incdir" = /usr/local/include ; then
6161                         if test "$GCC" = yes
6162                         then
6163                           cf_save_CPPFLAGS=$CPPFLAGS
6164
6165         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6166         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6167
6168                           cat >conftest.$ac_ext <<_ACEOF
6169 #line 6169 "configure"
6170 #include "confdefs.h"
6171 #include <stdio.h>
6172 int
6173 main (void)
6174 {
6175 printf("Hello")
6176   ;
6177   return 0;
6178 }
6179 _ACEOF
6180 rm -f conftest.$ac_objext
6181 if { (eval echo "$as_me:6181: \"$ac_compile\"") >&5
6182   (eval $ac_compile) 2>&5
6183   ac_status=$?
6184   echo "$as_me:6184: \$? = $ac_status" >&5
6185   (exit $ac_status); } &&
6186          { ac_try='test -s conftest.$ac_objext'
6187   { (eval echo "$as_me:6187: \"$ac_try\"") >&5
6188   (eval $ac_try) 2>&5
6189   ac_status=$?
6190   echo "$as_me:6190: \$? = $ac_status" >&5
6191   (exit $ac_status); }; }; then
6192   :
6193 else
6194   echo "$as_me: failed program was:" >&5
6195 cat conftest.$ac_ext >&5
6196 cf_have_incdir=yes
6197 fi
6198 rm -f conftest.$ac_objext conftest.$ac_ext
6199                           CPPFLAGS=$cf_save_CPPFLAGS
6200                         fi
6201                   fi
6202                 fi
6203
6204                 if test "$cf_have_incdir" = no ; then
6205                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6206
6207 echo "${as_me:-configure}:6207: testing adding $cf_add_incdir to include-path ..." 1>&5
6208
6209                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6210
6211                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6212                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6213                   cf_add_incdir="$cf_top_incdir"
6214                 else
6215                   break
6216                 fi
6217           else
6218                 break
6219           fi
6220         done
6221   done
6222 fi
6223
6224 if test -n "$cf_cv_library_path_utf8" ; then
6225         for cf_add_libdir in $cf_cv_library_path_utf8
6226         do
6227                 if test $cf_add_libdir = /usr/lib ; then
6228                         :
6229                 elif test -d $cf_add_libdir
6230                 then
6231                         cf_have_libdir=no
6232                         if test -n "$LDFLAGS$LIBS" ; then
6233                                 # a loop is needed to ensure we can add subdirs of existing dirs
6234                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6235                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6236                                                 cf_have_libdir=yes; break
6237                                         fi
6238                                 done
6239                         fi
6240                         if test "$cf_have_libdir" = no ; then
6241                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6242
6243 echo "${as_me:-configure}:6243: testing adding $cf_add_libdir to library-path ..." 1>&5
6244
6245                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6246                         fi
6247                 fi
6248         done
6249 fi
6250
6251 cf_add_libs="$cf_cv_library_file_utf8"
6252 # Filter out duplicates - this happens with badly-designed ".pc" files...
6253 for cf_add_1lib in $LIBS
6254 do
6255         for cf_add_2lib in $cf_add_libs
6256         do
6257                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6258                 then
6259                         cf_add_1lib=
6260                         break
6261                 fi
6262         done
6263         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6264 done
6265 LIBS="$cf_add_libs"
6266
6267 fi
6268
6269 cf_ncuconfig_root=ncursesw
6270 cf_have_ncuconfig=no
6271
6272 if test "x${PKG_CONFIG:=none}" != xnone; then
6273         echo "$as_me:6273: checking pkg-config for $cf_ncuconfig_root" >&5
6274 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6275         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6276                 echo "$as_me:6276: result: yes" >&5
6277 echo "${ECHO_T}yes" >&6
6278
6279                 echo "$as_me:6279: checking if the $cf_ncuconfig_root package files work" >&5
6280 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6281                 cf_have_ncuconfig=unknown
6282
6283                 cf_save_CPPFLAGS="$CPPFLAGS"
6284                 cf_save_LIBS="$LIBS"
6285
6286 cf_fix_cppflags=no
6287 cf_new_cflags=
6288 cf_new_cppflags=
6289 cf_new_extra_cppflags=
6290
6291 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
6292 do
6293 case $cf_fix_cppflags in
6294 (no)
6295         case $cf_add_cflags in
6296         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6297                 case $cf_add_cflags in
6298                 (-D*)
6299                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6300
6301                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6302                                 && test -z "${cf_tst_cflags}" \
6303                                 && cf_fix_cppflags=yes
6304
6305                         if test $cf_fix_cppflags = yes ; then
6306
6307         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6308         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6309
6310                                 continue
6311                         elif test "${cf_tst_cflags}" = "\"'" ; then
6312
6313         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6314         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6315
6316                                 continue
6317                         fi
6318                         ;;
6319                 esac
6320                 case "$CPPFLAGS" in
6321                 (*$cf_add_cflags)
6322                         ;;
6323                 (*)
6324                         case $cf_add_cflags in
6325                         (-D*)
6326                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6327
6328 CPPFLAGS=`echo "$CPPFLAGS" | \
6329         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6330                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6331
6332                                 ;;
6333                         esac
6334
6335         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6336         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6337
6338                         ;;
6339                 esac
6340                 ;;
6341         (*)
6342
6343         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6344         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6345
6346                 ;;
6347         esac
6348         ;;
6349 (yes)
6350
6351         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6352         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6353
6354         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6355
6356         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6357                 && test -z "${cf_tst_cflags}" \
6358                 && cf_fix_cppflags=no
6359         ;;
6360 esac
6361 done
6362
6363 if test -n "$cf_new_cflags" ; then
6364
6365         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6366         CFLAGS="${CFLAGS}$cf_new_cflags"
6367
6368 fi
6369
6370 if test -n "$cf_new_cppflags" ; then
6371
6372         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6373         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6374
6375 fi
6376
6377 if test -n "$cf_new_extra_cppflags" ; then
6378
6379         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6380         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6381
6382 fi
6383
6384 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6385 # Filter out duplicates - this happens with badly-designed ".pc" files...
6386 for cf_add_1lib in $LIBS
6387 do
6388         for cf_add_2lib in $cf_add_libs
6389         do
6390                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6391                 then
6392                         cf_add_1lib=
6393                         break
6394                 fi
6395         done
6396         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6397 done
6398 LIBS="$cf_add_libs"
6399
6400                 cat >conftest.$ac_ext <<_ACEOF
6401 #line 6401 "configure"
6402 #include "confdefs.h"
6403 #include <${cf_cv_ncurses_header:-curses.h}>
6404 int
6405 main (void)
6406 {
6407 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6408   ;
6409   return 0;
6410 }
6411 _ACEOF
6412 rm -f conftest.$ac_objext conftest$ac_exeext
6413 if { (eval echo "$as_me:6413: \"$ac_link\"") >&5
6414   (eval $ac_link) 2>&5
6415   ac_status=$?
6416   echo "$as_me:6416: \$? = $ac_status" >&5
6417   (exit $ac_status); } &&
6418          { ac_try='test -s conftest$ac_exeext'
6419   { (eval echo "$as_me:6419: \"$ac_try\"") >&5
6420   (eval $ac_try) 2>&5
6421   ac_status=$?
6422   echo "$as_me:6422: \$? = $ac_status" >&5
6423   (exit $ac_status); }; }; then
6424   if test "$cross_compiling" = yes; then
6425   cf_have_ncuconfig=maybe
6426 else
6427   cat >conftest.$ac_ext <<_ACEOF
6428 #line 6428 "configure"
6429 #include "confdefs.h"
6430 #include <${cf_cv_ncurses_header:-curses.h}>
6431                                 int main(void)
6432                                 { char *xx = curses_version(); return (xx == 0); }
6433 _ACEOF
6434 rm -f conftest$ac_exeext
6435 if { (eval echo "$as_me:6435: \"$ac_link\"") >&5
6436   (eval $ac_link) 2>&5
6437   ac_status=$?
6438   echo "$as_me:6438: \$? = $ac_status" >&5
6439   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6440   { (eval echo "$as_me:6440: \"$ac_try\"") >&5
6441   (eval $ac_try) 2>&5
6442   ac_status=$?
6443   echo "$as_me:6443: \$? = $ac_status" >&5
6444   (exit $ac_status); }; }; then
6445   cf_have_ncuconfig=yes
6446 else
6447   echo "$as_me: program exited with status $ac_status" >&5
6448 echo "$as_me: failed program was:" >&5
6449 cat conftest.$ac_ext >&5
6450 cf_have_ncuconfig=no
6451 fi
6452 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6453 fi
6454 else
6455   echo "$as_me: failed program was:" >&5
6456 cat conftest.$ac_ext >&5
6457 cf_have_ncuconfig=no
6458 fi
6459 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6460                 echo "$as_me:6460: result: $cf_have_ncuconfig" >&5
6461 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6462                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6463                 if test "$cf_have_ncuconfig" != "yes"
6464                 then
6465                         CPPFLAGS="$cf_save_CPPFLAGS"
6466                         LIBS="$cf_save_LIBS"
6467                         NCURSES_CONFIG_PKG=none
6468                 else
6469
6470 cat >>confdefs.h <<\EOF
6471 #define NCURSES 1
6472 EOF
6473
6474                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6475
6476 echo "$as_me:6476: checking for terminfo header" >&5
6477 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6478 if test "${cf_cv_term_header+set}" = set; then
6479   echo $ECHO_N "(cached) $ECHO_C" >&6
6480 else
6481
6482 case ${cf_cv_ncurses_header} in
6483 (*/ncurses.h|*/ncursesw.h)
6484         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6485         ;;
6486 (*)
6487         cf_term_header=term.h
6488         ;;
6489 esac
6490
6491 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6492 do
6493 cat >conftest.$ac_ext <<_ACEOF
6494 #line 6494 "configure"
6495 #include "confdefs.h"
6496 #include <stdio.h>
6497 #include <${cf_cv_ncurses_header:-curses.h}>
6498 #include <$cf_test>
6499
6500 int
6501 main (void)
6502 {
6503 int x = auto_left_margin
6504   ;
6505   return 0;
6506 }
6507 _ACEOF
6508 rm -f conftest.$ac_objext
6509 if { (eval echo "$as_me:6509: \"$ac_compile\"") >&5
6510   (eval $ac_compile) 2>&5
6511   ac_status=$?
6512   echo "$as_me:6512: \$? = $ac_status" >&5
6513   (exit $ac_status); } &&
6514          { ac_try='test -s conftest.$ac_objext'
6515   { (eval echo "$as_me:6515: \"$ac_try\"") >&5
6516   (eval $ac_try) 2>&5
6517   ac_status=$?
6518   echo "$as_me:6518: \$? = $ac_status" >&5
6519   (exit $ac_status); }; }; then
6520
6521         cf_cv_term_header="$cf_test"
6522 else
6523   echo "$as_me: failed program was:" >&5
6524 cat conftest.$ac_ext >&5
6525
6526         cf_cv_term_header=unknown
6527
6528 fi
6529 rm -f conftest.$ac_objext conftest.$ac_ext
6530         test "$cf_cv_term_header" != unknown && break
6531 done
6532
6533 fi
6534 echo "$as_me:6534: result: $cf_cv_term_header" >&5
6535 echo "${ECHO_T}$cf_cv_term_header" >&6
6536
6537 # Set definitions to allow ifdef'ing to accommodate subdirectories
6538
6539 case $cf_cv_term_header in
6540 (*term.h)
6541
6542 cat >>confdefs.h <<\EOF
6543 #define HAVE_TERM_H 1
6544 EOF
6545
6546         ;;
6547 esac
6548
6549 case $cf_cv_term_header in
6550 (ncurses/term.h)
6551
6552 cat >>confdefs.h <<\EOF
6553 #define HAVE_NCURSES_TERM_H 1
6554 EOF
6555
6556         ;;
6557 (ncursesw/term.h)
6558
6559 cat >>confdefs.h <<\EOF
6560 #define HAVE_NCURSESW_TERM_H 1
6561 EOF
6562
6563         ;;
6564 esac
6565
6566                 fi
6567
6568         else
6569                 echo "$as_me:6569: result: no" >&5
6570 echo "${ECHO_T}no" >&6
6571                 NCURSES_CONFIG_PKG=none
6572         fi
6573 else
6574         NCURSES_CONFIG_PKG=none
6575 fi
6576
6577 if test "x$cf_have_ncuconfig" = "xno"; then
6578         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6579
6580 if test -n "$ac_tool_prefix"; then
6581   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6582   do
6583     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6584 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6585 echo "$as_me:6585: checking for $ac_word" >&5
6586 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6587 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6588   echo $ECHO_N "(cached) $ECHO_C" >&6
6589 else
6590   if test -n "$NCURSES_CONFIG"; then
6591   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6592 else
6593   ac_save_IFS=$IFS; IFS=$ac_path_separator
6594 ac_dummy="$PATH"
6595 for ac_dir in $ac_dummy; do
6596   IFS=$ac_save_IFS
6597   test -z "$ac_dir" && ac_dir=.
6598   $as_executable_p "$ac_dir/$ac_word" || continue
6599 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6600 echo "$as_me:6600: found $ac_dir/$ac_word" >&5
6601 break
6602 done
6603
6604 fi
6605 fi
6606 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6607 if test -n "$NCURSES_CONFIG"; then
6608   echo "$as_me:6608: result: $NCURSES_CONFIG" >&5
6609 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6610 else
6611   echo "$as_me:6611: result: no" >&5
6612 echo "${ECHO_T}no" >&6
6613 fi
6614
6615     test -n "$NCURSES_CONFIG" && break
6616   done
6617 fi
6618 if test -z "$NCURSES_CONFIG"; then
6619   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6620   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6621 do
6622   # Extract the first word of "$ac_prog", so it can be a program name with args.
6623 set dummy $ac_prog; ac_word=$2
6624 echo "$as_me:6624: checking for $ac_word" >&5
6625 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6626 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6627   echo $ECHO_N "(cached) $ECHO_C" >&6
6628 else
6629   if test -n "$ac_ct_NCURSES_CONFIG"; then
6630   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6631 else
6632   ac_save_IFS=$IFS; IFS=$ac_path_separator
6633 ac_dummy="$PATH"
6634 for ac_dir in $ac_dummy; do
6635   IFS=$ac_save_IFS
6636   test -z "$ac_dir" && ac_dir=.
6637   $as_executable_p "$ac_dir/$ac_word" || continue
6638 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6639 echo "$as_me:6639: found $ac_dir/$ac_word" >&5
6640 break
6641 done
6642
6643 fi
6644 fi
6645 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6646 if test -n "$ac_ct_NCURSES_CONFIG"; then
6647   echo "$as_me:6647: result: $ac_ct_NCURSES_CONFIG" >&5
6648 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6649 else
6650   echo "$as_me:6650: result: no" >&5
6651 echo "${ECHO_T}no" >&6
6652 fi
6653
6654   test -n "$ac_ct_NCURSES_CONFIG" && break
6655 done
6656 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6657
6658   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6659 fi
6660
6661         if test "$NCURSES_CONFIG" != none ; then
6662
6663 cf_fix_cppflags=no
6664 cf_new_cflags=
6665 cf_new_cppflags=
6666 cf_new_extra_cppflags=
6667
6668 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
6669 do
6670 case $cf_fix_cppflags in
6671 (no)
6672         case $cf_add_cflags in
6673         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6674                 case $cf_add_cflags in
6675                 (-D*)
6676                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6677
6678                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6679                                 && test -z "${cf_tst_cflags}" \
6680                                 && cf_fix_cppflags=yes
6681
6682                         if test $cf_fix_cppflags = yes ; then
6683
6684         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6685         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6686
6687                                 continue
6688                         elif test "${cf_tst_cflags}" = "\"'" ; then
6689
6690         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6691         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6692
6693                                 continue
6694                         fi
6695                         ;;
6696                 esac
6697                 case "$CPPFLAGS" in
6698                 (*$cf_add_cflags)
6699                         ;;
6700                 (*)
6701                         case $cf_add_cflags in
6702                         (-D*)
6703                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6704
6705 CPPFLAGS=`echo "$CPPFLAGS" | \
6706         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6707                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6708
6709                                 ;;
6710                         esac
6711
6712         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6713         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6714
6715                         ;;
6716                 esac
6717                 ;;
6718         (*)
6719
6720         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6721         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6722
6723                 ;;
6724         esac
6725         ;;
6726 (yes)
6727
6728         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6729         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6730
6731         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6732
6733         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6734                 && test -z "${cf_tst_cflags}" \
6735                 && cf_fix_cppflags=no
6736         ;;
6737 esac
6738 done
6739
6740 if test -n "$cf_new_cflags" ; then
6741
6742         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6743         CFLAGS="${CFLAGS}$cf_new_cflags"
6744
6745 fi
6746
6747 if test -n "$cf_new_cppflags" ; then
6748
6749         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6750         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6751
6752 fi
6753
6754 if test -n "$cf_new_extra_cppflags" ; then
6755
6756         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6757         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6758
6759 fi
6760
6761 cf_add_libs="`$NCURSES_CONFIG --libs`"
6762 # Filter out duplicates - this happens with badly-designed ".pc" files...
6763 for cf_add_1lib in $LIBS
6764 do
6765         for cf_add_2lib in $cf_add_libs
6766         do
6767                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6768                 then
6769                         cf_add_1lib=
6770                         break
6771                 fi
6772         done
6773         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6774 done
6775 LIBS="$cf_add_libs"
6776
6777                 # even with config script, some packages use no-override for curses.h
6778
6779 echo "$as_me:6779: checking if we have identified curses headers" >&5
6780 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6781 if test "${cf_cv_ncurses_header+set}" = set; then
6782   echo $ECHO_N "(cached) $ECHO_C" >&6
6783 else
6784
6785 cf_cv_ncurses_header=none
6786 for cf_header in \
6787         ncurses.h ncursesw/ncurses.h \
6788         curses.h ncursesw/curses.h
6789 do
6790 cat >conftest.$ac_ext <<_ACEOF
6791 #line 6791 "configure"
6792 #include "confdefs.h"
6793 #include <${cf_header}>
6794 int
6795 main (void)
6796 {
6797 initscr(); tgoto("?", 0,0)
6798   ;
6799   return 0;
6800 }
6801 _ACEOF
6802 rm -f conftest.$ac_objext
6803 if { (eval echo "$as_me:6803: \"$ac_compile\"") >&5
6804   (eval $ac_compile) 2>&5
6805   ac_status=$?
6806   echo "$as_me:6806: \$? = $ac_status" >&5
6807   (exit $ac_status); } &&
6808          { ac_try='test -s conftest.$ac_objext'
6809   { (eval echo "$as_me:6809: \"$ac_try\"") >&5
6810   (eval $ac_try) 2>&5
6811   ac_status=$?
6812   echo "$as_me:6812: \$? = $ac_status" >&5
6813   (exit $ac_status); }; }; then
6814   cf_cv_ncurses_header=$cf_header; break
6815 else
6816   echo "$as_me: failed program was:" >&5
6817 cat conftest.$ac_ext >&5
6818 fi
6819 rm -f conftest.$ac_objext conftest.$ac_ext
6820 done
6821
6822 fi
6823 echo "$as_me:6823: result: $cf_cv_ncurses_header" >&5
6824 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6825
6826 if test "$cf_cv_ncurses_header" = none ; then
6827         { { echo "$as_me:6827: error: No curses header-files found" >&5
6828 echo "$as_me: error: No curses header-files found" >&2;}
6829    { (exit 1); exit 1; }; }
6830 fi
6831
6832 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6833
6834 for ac_header in $cf_cv_ncurses_header
6835 do
6836 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6837 echo "$as_me:6837: checking for $ac_header" >&5
6838 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6839 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6840   echo $ECHO_N "(cached) $ECHO_C" >&6
6841 else
6842   cat >conftest.$ac_ext <<_ACEOF
6843 #line 6843 "configure"
6844 #include "confdefs.h"
6845 #include <$ac_header>
6846 _ACEOF
6847 if { (eval echo "$as_me:6847: \"$ac_cpp conftest.$ac_ext\"") >&5
6848   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6849   ac_status=$?
6850   egrep -v '^ *\+' conftest.er1 >conftest.err
6851   rm -f conftest.er1
6852   cat conftest.err >&5
6853   echo "$as_me:6853: \$? = $ac_status" >&5
6854   (exit $ac_status); } >/dev/null; then
6855   if test -s conftest.err; then
6856     ac_cpp_err=$ac_c_preproc_warn_flag
6857   else
6858     ac_cpp_err=
6859   fi
6860 else
6861   ac_cpp_err=yes
6862 fi
6863 if test -z "$ac_cpp_err"; then
6864   eval "$as_ac_Header=yes"
6865 else
6866   echo "$as_me: failed program was:" >&5
6867   cat conftest.$ac_ext >&5
6868   eval "$as_ac_Header=no"
6869 fi
6870 rm -f conftest.err conftest.$ac_ext
6871 fi
6872 echo "$as_me:6872: result: `eval echo '${'$as_ac_Header'}'`" >&5
6873 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6874 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6875   cat >>confdefs.h <<EOF
6876 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6877 EOF
6878
6879 fi
6880 done
6881
6882 cat >>confdefs.h <<\EOF
6883 #define NCURSES 1
6884 EOF
6885
6886 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6887
6888                 cat >>confdefs.h <<EOF
6889 #define $cf_nculib_ROOT 1
6890 EOF
6891
6892                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6893
6894         else
6895
6896 cf_ncuhdr_root=ncursesw
6897
6898 test -n "$cf_cv_curses_dir" && \
6899 test "$cf_cv_curses_dir" != "no" && { \
6900
6901 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6902   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6903   do
6904         while test $cf_add_incdir != /usr/include
6905         do
6906           if test -d $cf_add_incdir
6907           then
6908                 cf_have_incdir=no
6909                 if test -n "$CFLAGS$CPPFLAGS" ; then
6910                   # a loop is needed to ensure we can add subdirs of existing dirs
6911                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6912                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6913                           cf_have_incdir=yes; break
6914                         fi
6915                   done
6916                 fi
6917
6918                 if test "$cf_have_incdir" = no ; then
6919                   if test "$cf_add_incdir" = /usr/local/include ; then
6920                         if test "$GCC" = yes
6921                         then
6922                           cf_save_CPPFLAGS=$CPPFLAGS
6923
6924         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6925         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6926
6927                           cat >conftest.$ac_ext <<_ACEOF
6928 #line 6928 "configure"
6929 #include "confdefs.h"
6930 #include <stdio.h>
6931 int
6932 main (void)
6933 {
6934 printf("Hello")
6935   ;
6936   return 0;
6937 }
6938 _ACEOF
6939 rm -f conftest.$ac_objext
6940 if { (eval echo "$as_me:6940: \"$ac_compile\"") >&5
6941   (eval $ac_compile) 2>&5
6942   ac_status=$?
6943   echo "$as_me:6943: \$? = $ac_status" >&5
6944   (exit $ac_status); } &&
6945          { ac_try='test -s conftest.$ac_objext'
6946   { (eval echo "$as_me:6946: \"$ac_try\"") >&5
6947   (eval $ac_try) 2>&5
6948   ac_status=$?
6949   echo "$as_me:6949: \$? = $ac_status" >&5
6950   (exit $ac_status); }; }; then
6951   :
6952 else
6953   echo "$as_me: failed program was:" >&5
6954 cat conftest.$ac_ext >&5
6955 cf_have_incdir=yes
6956 fi
6957 rm -f conftest.$ac_objext conftest.$ac_ext
6958                           CPPFLAGS=$cf_save_CPPFLAGS
6959                         fi
6960                   fi
6961                 fi
6962
6963                 if test "$cf_have_incdir" = no ; then
6964                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6965
6966 echo "${as_me:-configure}:6966: testing adding $cf_add_incdir to include-path ..." 1>&5
6967
6968                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6969
6970                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6971                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6972                   cf_add_incdir="$cf_top_incdir"
6973                 else
6974                   break
6975                 fi
6976           else
6977                 break
6978           fi
6979         done
6980   done
6981 fi
6982
6983 }
6984
6985 echo "$as_me:6985: checking for $cf_ncuhdr_root header in include-path" >&5
6986 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6987 if test "${cf_cv_ncurses_h+set}" = set; then
6988   echo $ECHO_N "(cached) $ECHO_C" >&6
6989 else
6990
6991         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6992         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6993         for cf_header in $cf_header_list
6994         do
6995
6996         cat >conftest.$ac_ext <<_ACEOF
6997 #line 6997 "configure"
6998 #include "confdefs.h"
6999
7000 #define _XOPEN_SOURCE_EXTENDED
7001 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7002 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7003
7004 #include <$cf_header>
7005 int
7006 main (void)
7007 {
7008
7009 #ifdef NCURSES_VERSION
7010
7011 #ifndef WACS_BSSB
7012         make an error
7013 #endif
7014
7015 printf("%s\n", NCURSES_VERSION);
7016 #else
7017 #ifdef __NCURSES_H
7018 printf("old\n");
7019 #else
7020         make an error
7021 #endif
7022 #endif
7023
7024   ;
7025   return 0;
7026 }
7027 _ACEOF
7028 rm -f conftest.$ac_objext
7029 if { (eval echo "$as_me:7029: \"$ac_compile\"") >&5
7030   (eval $ac_compile) 2>&5
7031   ac_status=$?
7032   echo "$as_me:7032: \$? = $ac_status" >&5
7033   (exit $ac_status); } &&
7034          { ac_try='test -s conftest.$ac_objext'
7035   { (eval echo "$as_me:7035: \"$ac_try\"") >&5
7036   (eval $ac_try) 2>&5
7037   ac_status=$?
7038   echo "$as_me:7038: \$? = $ac_status" >&5
7039   (exit $ac_status); }; }; then
7040   cf_cv_ncurses_h=$cf_header
7041
7042 else
7043   echo "$as_me: failed program was:" >&5
7044 cat conftest.$ac_ext >&5
7045 cf_cv_ncurses_h=no
7046 fi
7047 rm -f conftest.$ac_objext conftest.$ac_ext
7048
7049                 test "$cf_cv_ncurses_h" != no && break
7050         done
7051
7052 fi
7053 echo "$as_me:7053: result: $cf_cv_ncurses_h" >&5
7054 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7055
7056 if test "$cf_cv_ncurses_h" != no ; then
7057         cf_cv_ncurses_header=$cf_cv_ncurses_h
7058 else
7059
7060 echo "$as_me:7060: checking for $cf_ncuhdr_root include-path" >&5
7061 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7062 if test "${cf_cv_ncurses_h2+set}" = set; then
7063   echo $ECHO_N "(cached) $ECHO_C" >&6
7064 else
7065
7066         test -n "$verbose" && echo
7067
7068 cf_search=
7069
7070 # collect the current set of include-directories from compiler flags
7071 cf_header_path_list=""
7072 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7073         for cf_header_path in $CPPFLAGS $CFLAGS
7074         do
7075                 case $cf_header_path in
7076                 (-I*)
7077                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7078
7079 test "x$cf_header_path" != "xNONE" && \
7080 test -d "$cf_header_path" && \
7081  {
7082         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7083         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7084         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7085         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7086         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7087         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"
7088 }
7089
7090                         cf_header_path_list="$cf_header_path_list $cf_search"
7091                         ;;
7092                 esac
7093         done
7094 fi
7095
7096 # add the variations for the package we are looking for
7097
7098 cf_search=
7099
7100 test "x$prefix" != "xNONE" && \
7101 test -d "$prefix" && \
7102  {
7103         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7104         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7105         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7106         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7107         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7108         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7109 }
7110
7111 for cf_subdir_prefix in \
7112         /usr \
7113         /usr/local \
7114         /usr/pkg \
7115         /opt \
7116         /opt/local \
7117         $HOME
7118 do
7119
7120 test "x$cf_subdir_prefix" != "x$prefix" && \
7121 test -d "$cf_subdir_prefix" && \
7122 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7123         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7124         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7125         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7126         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7127         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7128         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"
7129 }
7130
7131 done
7132
7133 test "$includedir" != NONE && \
7134 test "$includedir" != "/usr/include" && \
7135 test -d "$includedir" && {
7136         test -d $includedir &&    cf_search="$cf_search $includedir"
7137         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7138 }
7139
7140 test "$oldincludedir" != NONE && \
7141 test "$oldincludedir" != "/usr/include" && \
7142 test -d "$oldincludedir" && {
7143         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7144         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7145 }
7146
7147 cf_search="$cf_search $cf_header_path_list"
7148
7149         test -n "$verbose" && echo search path $cf_search
7150         cf_save2_CPPFLAGS="$CPPFLAGS"
7151         for cf_incdir in $cf_search
7152         do
7153
7154 if test -n "$cf_incdir" ; then
7155   for cf_add_incdir in $cf_incdir
7156   do
7157         while test $cf_add_incdir != /usr/include
7158         do
7159           if test -d $cf_add_incdir
7160           then
7161                 cf_have_incdir=no
7162                 if test -n "$CFLAGS$CPPFLAGS" ; then
7163                   # a loop is needed to ensure we can add subdirs of existing dirs
7164                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7165                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7166                           cf_have_incdir=yes; break
7167                         fi
7168                   done
7169                 fi
7170
7171                 if test "$cf_have_incdir" = no ; then
7172                   if test "$cf_add_incdir" = /usr/local/include ; then
7173                         if test "$GCC" = yes
7174                         then
7175                           cf_save_CPPFLAGS=$CPPFLAGS
7176
7177         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7178         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7179
7180                           cat >conftest.$ac_ext <<_ACEOF
7181 #line 7181 "configure"
7182 #include "confdefs.h"
7183 #include <stdio.h>
7184 int
7185 main (void)
7186 {
7187 printf("Hello")
7188   ;
7189   return 0;
7190 }
7191 _ACEOF
7192 rm -f conftest.$ac_objext
7193 if { (eval echo "$as_me:7193: \"$ac_compile\"") >&5
7194   (eval $ac_compile) 2>&5
7195   ac_status=$?
7196   echo "$as_me:7196: \$? = $ac_status" >&5
7197   (exit $ac_status); } &&
7198          { ac_try='test -s conftest.$ac_objext'
7199   { (eval echo "$as_me:7199: \"$ac_try\"") >&5
7200   (eval $ac_try) 2>&5
7201   ac_status=$?
7202   echo "$as_me:7202: \$? = $ac_status" >&5
7203   (exit $ac_status); }; }; then
7204   :
7205 else
7206   echo "$as_me: failed program was:" >&5
7207 cat conftest.$ac_ext >&5
7208 cf_have_incdir=yes
7209 fi
7210 rm -f conftest.$ac_objext conftest.$ac_ext
7211                           CPPFLAGS=$cf_save_CPPFLAGS
7212                         fi
7213                   fi
7214                 fi
7215
7216                 if test "$cf_have_incdir" = no ; then
7217                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7218
7219 echo "${as_me:-configure}:7219: testing adding $cf_add_incdir to include-path ..." 1>&5
7220
7221                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7222
7223                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7224                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7225                   cf_add_incdir="$cf_top_incdir"
7226                 else
7227                   break
7228                 fi
7229           else
7230                 break
7231           fi
7232         done
7233   done
7234 fi
7235
7236                 for cf_header in \
7237                         ncurses.h \
7238                         curses.h
7239                 do
7240
7241         cat >conftest.$ac_ext <<_ACEOF
7242 #line 7242 "configure"
7243 #include "confdefs.h"
7244
7245 #include <$cf_header>
7246 int
7247 main (void)
7248 {
7249
7250 #ifdef NCURSES_VERSION
7251
7252 printf("%s\n", NCURSES_VERSION);
7253 #else
7254 #ifdef __NCURSES_H
7255 printf("old\n");
7256 #else
7257         make an error
7258 #endif
7259 #endif
7260
7261   ;
7262   return 0;
7263 }
7264 _ACEOF
7265 rm -f conftest.$ac_objext
7266 if { (eval echo "$as_me:7266: \"$ac_compile\"") >&5
7267   (eval $ac_compile) 2>&5
7268   ac_status=$?
7269   echo "$as_me:7269: \$? = $ac_status" >&5
7270   (exit $ac_status); } &&
7271          { ac_try='test -s conftest.$ac_objext'
7272   { (eval echo "$as_me:7272: \"$ac_try\"") >&5
7273   (eval $ac_try) 2>&5
7274   ac_status=$?
7275   echo "$as_me:7275: \$? = $ac_status" >&5
7276   (exit $ac_status); }; }; then
7277   cf_cv_ncurses_h2=$cf_header
7278
7279 else
7280   echo "$as_me: failed program was:" >&5
7281 cat conftest.$ac_ext >&5
7282 cf_cv_ncurses_h2=no
7283 fi
7284 rm -f conftest.$ac_objext conftest.$ac_ext
7285
7286                         if test "$cf_cv_ncurses_h2" != no ; then
7287                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7288                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7289                                 break
7290                         fi
7291                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7292                 done
7293                 CPPFLAGS="$cf_save2_CPPFLAGS"
7294                 test "$cf_cv_ncurses_h2" != no && break
7295         done
7296         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7296: error: not found" >&5
7297 echo "$as_me: error: not found" >&2;}
7298    { (exit 1); exit 1; }; }
7299
7300 fi
7301 echo "$as_me:7301: result: $cf_cv_ncurses_h2" >&5
7302 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7303
7304         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7305         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7306         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7307                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7308         fi
7309
7310 if test -n "$cf_1st_incdir" ; then
7311   for cf_add_incdir in $cf_1st_incdir
7312   do
7313         while test $cf_add_incdir != /usr/include
7314         do
7315           if test -d $cf_add_incdir
7316           then
7317                 cf_have_incdir=no
7318                 if test -n "$CFLAGS$CPPFLAGS" ; then
7319                   # a loop is needed to ensure we can add subdirs of existing dirs
7320                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7321                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7322                           cf_have_incdir=yes; break
7323                         fi
7324                   done
7325                 fi
7326
7327                 if test "$cf_have_incdir" = no ; then
7328                   if test "$cf_add_incdir" = /usr/local/include ; then
7329                         if test "$GCC" = yes
7330                         then
7331                           cf_save_CPPFLAGS=$CPPFLAGS
7332
7333         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7334         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7335
7336                           cat >conftest.$ac_ext <<_ACEOF
7337 #line 7337 "configure"
7338 #include "confdefs.h"
7339 #include <stdio.h>
7340 int
7341 main (void)
7342 {
7343 printf("Hello")
7344   ;
7345   return 0;
7346 }
7347 _ACEOF
7348 rm -f conftest.$ac_objext
7349 if { (eval echo "$as_me:7349: \"$ac_compile\"") >&5
7350   (eval $ac_compile) 2>&5
7351   ac_status=$?
7352   echo "$as_me:7352: \$? = $ac_status" >&5
7353   (exit $ac_status); } &&
7354          { ac_try='test -s conftest.$ac_objext'
7355   { (eval echo "$as_me:7355: \"$ac_try\"") >&5
7356   (eval $ac_try) 2>&5
7357   ac_status=$?
7358   echo "$as_me:7358: \$? = $ac_status" >&5
7359   (exit $ac_status); }; }; then
7360   :
7361 else
7362   echo "$as_me: failed program was:" >&5
7363 cat conftest.$ac_ext >&5
7364 cf_have_incdir=yes
7365 fi
7366 rm -f conftest.$ac_objext conftest.$ac_ext
7367                           CPPFLAGS=$cf_save_CPPFLAGS
7368                         fi
7369                   fi
7370                 fi
7371
7372                 if test "$cf_have_incdir" = no ; then
7373                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7374
7375 echo "${as_me:-configure}:7375: testing adding $cf_add_incdir to include-path ..." 1>&5
7376
7377                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7378
7379                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7380                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7381                   cf_add_incdir="$cf_top_incdir"
7382                 else
7383                   break
7384                 fi
7385           else
7386                 break
7387           fi
7388         done
7389   done
7390 fi
7391
7392 fi
7393
7394 # Set definitions to allow ifdef'ing for ncurses.h
7395
7396 case $cf_cv_ncurses_header in
7397 (*ncurses.h)
7398
7399 cat >>confdefs.h <<\EOF
7400 #define HAVE_NCURSES_H 1
7401 EOF
7402
7403         ;;
7404 esac
7405
7406 case $cf_cv_ncurses_header in
7407 (ncurses/curses.h|ncurses/ncurses.h)
7408
7409 cat >>confdefs.h <<\EOF
7410 #define HAVE_NCURSES_NCURSES_H 1
7411 EOF
7412
7413         ;;
7414 (ncursesw/curses.h|ncursesw/ncurses.h)
7415
7416 cat >>confdefs.h <<\EOF
7417 #define HAVE_NCURSESW_NCURSES_H 1
7418 EOF
7419
7420         ;;
7421 esac
7422
7423 echo "$as_me:7423: checking for terminfo header" >&5
7424 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7425 if test "${cf_cv_term_header+set}" = set; then
7426   echo $ECHO_N "(cached) $ECHO_C" >&6
7427 else
7428
7429 case ${cf_cv_ncurses_header} in
7430 (*/ncurses.h|*/ncursesw.h)
7431         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7432         ;;
7433 (*)
7434         cf_term_header=term.h
7435         ;;
7436 esac
7437
7438 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7439 do
7440 cat >conftest.$ac_ext <<_ACEOF
7441 #line 7441 "configure"
7442 #include "confdefs.h"
7443 #include <stdio.h>
7444 #include <${cf_cv_ncurses_header:-curses.h}>
7445 #include <$cf_test>
7446
7447 int
7448 main (void)
7449 {
7450 int x = auto_left_margin
7451   ;
7452   return 0;
7453 }
7454 _ACEOF
7455 rm -f conftest.$ac_objext
7456 if { (eval echo "$as_me:7456: \"$ac_compile\"") >&5
7457   (eval $ac_compile) 2>&5
7458   ac_status=$?
7459   echo "$as_me:7459: \$? = $ac_status" >&5
7460   (exit $ac_status); } &&
7461          { ac_try='test -s conftest.$ac_objext'
7462   { (eval echo "$as_me:7462: \"$ac_try\"") >&5
7463   (eval $ac_try) 2>&5
7464   ac_status=$?
7465   echo "$as_me:7465: \$? = $ac_status" >&5
7466   (exit $ac_status); }; }; then
7467
7468         cf_cv_term_header="$cf_test"
7469 else
7470   echo "$as_me: failed program was:" >&5
7471 cat conftest.$ac_ext >&5
7472
7473         cf_cv_term_header=unknown
7474
7475 fi
7476 rm -f conftest.$ac_objext conftest.$ac_ext
7477         test "$cf_cv_term_header" != unknown && break
7478 done
7479
7480 fi
7481 echo "$as_me:7481: result: $cf_cv_term_header" >&5
7482 echo "${ECHO_T}$cf_cv_term_header" >&6
7483
7484 # Set definitions to allow ifdef'ing to accommodate subdirectories
7485
7486 case $cf_cv_term_header in
7487 (*term.h)
7488
7489 cat >>confdefs.h <<\EOF
7490 #define HAVE_TERM_H 1
7491 EOF
7492
7493         ;;
7494 esac
7495
7496 case $cf_cv_term_header in
7497 (ncurses/term.h)
7498
7499 cat >>confdefs.h <<\EOF
7500 #define HAVE_NCURSES_TERM_H 1
7501 EOF
7502
7503         ;;
7504 (ncursesw/term.h)
7505
7506 cat >>confdefs.h <<\EOF
7507 #define HAVE_NCURSESW_TERM_H 1
7508 EOF
7509
7510         ;;
7511 esac
7512
7513 # some applications need this, but should check for NCURSES_VERSION
7514
7515 cat >>confdefs.h <<\EOF
7516 #define NCURSES 1
7517 EOF
7518
7519 echo "$as_me:7519: checking for ncurses version" >&5
7520 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7521 if test "${cf_cv_ncurses_version+set}" = set; then
7522   echo $ECHO_N "(cached) $ECHO_C" >&6
7523 else
7524
7525         cf_cv_ncurses_version=no
7526         cf_tempfile=out$$
7527         rm -f $cf_tempfile
7528         if test "$cross_compiling" = yes; then
7529
7530         # This will not work if the preprocessor splits the line after the
7531         # Autoconf token.  The 'unproto' program does that.
7532         cat > conftest.$ac_ext <<EOF
7533 #include <${cf_cv_ncurses_header:-curses.h}>
7534 #undef Autoconf
7535 #ifdef NCURSES_VERSION
7536 Autoconf NCURSES_VERSION
7537 #else
7538 #ifdef __NCURSES_H
7539 Autoconf "old"
7540 #endif
7541 ;
7542 #endif
7543 EOF
7544         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7545         { (eval echo "$as_me:7545: \"$cf_try\"") >&5
7546   (eval $cf_try) 2>&5
7547   ac_status=$?
7548   echo "$as_me:7548: \$? = $ac_status" >&5
7549   (exit $ac_status); }
7550         if test -f conftest.out ; then
7551                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7552                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7553                 rm -f conftest.out
7554         fi
7555
7556 else
7557   cat >conftest.$ac_ext <<_ACEOF
7558 #line 7558 "configure"
7559 #include "confdefs.h"
7560
7561 #include <${cf_cv_ncurses_header:-curses.h}>
7562 #include <stdio.h>
7563 int main(void)
7564 {
7565         FILE *fp = fopen("$cf_tempfile", "w");
7566 #ifdef NCURSES_VERSION
7567 # ifdef NCURSES_VERSION_PATCH
7568         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7569 # else
7570         fprintf(fp, "%s\n", NCURSES_VERSION);
7571 # endif
7572 #else
7573 # ifdef __NCURSES_H
7574         fprintf(fp, "old\n");
7575 # else
7576         make an error
7577 # endif
7578 #endif
7579         ${cf_cv_main_return:-return}(0);
7580 }
7581 _ACEOF
7582 rm -f conftest$ac_exeext
7583 if { (eval echo "$as_me:7583: \"$ac_link\"") >&5
7584   (eval $ac_link) 2>&5
7585   ac_status=$?
7586   echo "$as_me:7586: \$? = $ac_status" >&5
7587   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7588   { (eval echo "$as_me:7588: \"$ac_try\"") >&5
7589   (eval $ac_try) 2>&5
7590   ac_status=$?
7591   echo "$as_me:7591: \$? = $ac_status" >&5
7592   (exit $ac_status); }; }; then
7593
7594         cf_cv_ncurses_version=`cat $cf_tempfile`
7595 else
7596   echo "$as_me: program exited with status $ac_status" >&5
7597 echo "$as_me: failed program was:" >&5
7598 cat conftest.$ac_ext >&5
7599 fi
7600 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7601 fi
7602         rm -f $cf_tempfile
7603
7604 fi
7605 echo "$as_me:7605: result: $cf_cv_ncurses_version" >&5
7606 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7607 test "$cf_cv_ncurses_version" = no ||
7608 cat >>confdefs.h <<\EOF
7609 #define NCURSES 1
7610 EOF
7611
7612 cf_nculib_root=ncursesw
7613         # This works, except for the special case where we find gpm, but
7614         # ncurses is in a nonstandard location via $LIBS, and we really want
7615         # to link gpm.
7616 cf_ncurses_LIBS=""
7617 cf_ncurses_SAVE="$LIBS"
7618 echo "$as_me:7618: checking for Gpm_Open in -lgpm" >&5
7619 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7620 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7621   echo $ECHO_N "(cached) $ECHO_C" >&6
7622 else
7623   ac_check_lib_save_LIBS=$LIBS
7624 LIBS="-lgpm  $LIBS"
7625 cat >conftest.$ac_ext <<_ACEOF
7626 #line 7626 "configure"
7627 #include "confdefs.h"
7628
7629 /* Override any gcc2 internal prototype to avoid an error.  */
7630 #ifdef __cplusplus
7631 extern "C"
7632 #endif
7633 /* We use char because int might match the return type of a gcc2
7634    builtin and then its argument prototype would still apply.  */
7635 char Gpm_Open ();
7636 int
7637 main (void)
7638 {
7639 Gpm_Open ();
7640   ;
7641   return 0;
7642 }
7643 _ACEOF
7644 rm -f conftest.$ac_objext conftest$ac_exeext
7645 if { (eval echo "$as_me:7645: \"$ac_link\"") >&5
7646   (eval $ac_link) 2>&5
7647   ac_status=$?
7648   echo "$as_me:7648: \$? = $ac_status" >&5
7649   (exit $ac_status); } &&
7650          { ac_try='test -s conftest$ac_exeext'
7651   { (eval echo "$as_me:7651: \"$ac_try\"") >&5
7652   (eval $ac_try) 2>&5
7653   ac_status=$?
7654   echo "$as_me:7654: \$? = $ac_status" >&5
7655   (exit $ac_status); }; }; then
7656   ac_cv_lib_gpm_Gpm_Open=yes
7657 else
7658   echo "$as_me: failed program was:" >&5
7659 cat conftest.$ac_ext >&5
7660 ac_cv_lib_gpm_Gpm_Open=no
7661 fi
7662 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7663 LIBS=$ac_check_lib_save_LIBS
7664 fi
7665 echo "$as_me:7665: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7666 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7667 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7668   echo "$as_me:7668: checking for initscr in -lgpm" >&5
7669 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7670 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7671   echo $ECHO_N "(cached) $ECHO_C" >&6
7672 else
7673   ac_check_lib_save_LIBS=$LIBS
7674 LIBS="-lgpm  $LIBS"
7675 cat >conftest.$ac_ext <<_ACEOF
7676 #line 7676 "configure"
7677 #include "confdefs.h"
7678
7679 /* Override any gcc2 internal prototype to avoid an error.  */
7680 #ifdef __cplusplus
7681 extern "C"
7682 #endif
7683 /* We use char because int might match the return type of a gcc2
7684    builtin and then its argument prototype would still apply.  */
7685 char initscr ();
7686 int
7687 main (void)
7688 {
7689 initscr ();
7690   ;
7691   return 0;
7692 }
7693 _ACEOF
7694 rm -f conftest.$ac_objext conftest$ac_exeext
7695 if { (eval echo "$as_me:7695: \"$ac_link\"") >&5
7696   (eval $ac_link) 2>&5
7697   ac_status=$?
7698   echo "$as_me:7698: \$? = $ac_status" >&5
7699   (exit $ac_status); } &&
7700          { ac_try='test -s conftest$ac_exeext'
7701   { (eval echo "$as_me:7701: \"$ac_try\"") >&5
7702   (eval $ac_try) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit $ac_status); }; }; then
7706   ac_cv_lib_gpm_initscr=yes
7707 else
7708   echo "$as_me: failed program was:" >&5
7709 cat conftest.$ac_ext >&5
7710 ac_cv_lib_gpm_initscr=no
7711 fi
7712 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7713 LIBS=$ac_check_lib_save_LIBS
7714 fi
7715 echo "$as_me:7715: result: $ac_cv_lib_gpm_initscr" >&5
7716 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7717 if test $ac_cv_lib_gpm_initscr = yes; then
7718   LIBS="$cf_ncurses_SAVE"
7719 else
7720   cf_ncurses_LIBS="-lgpm"
7721 fi
7722
7723 fi
7724
7725 case $host_os in
7726 (freebsd*)
7727         # This is only necessary if you are linking against an obsolete
7728         # version of ncurses (but it should do no harm, since it's static).
7729         if test "$cf_nculib_root" = ncurses ; then
7730                 echo "$as_me:7730: checking for tgoto in -lmytinfo" >&5
7731 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7732 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7733   echo $ECHO_N "(cached) $ECHO_C" >&6
7734 else
7735   ac_check_lib_save_LIBS=$LIBS
7736 LIBS="-lmytinfo  $LIBS"
7737 cat >conftest.$ac_ext <<_ACEOF
7738 #line 7738 "configure"
7739 #include "confdefs.h"
7740
7741 /* Override any gcc2 internal prototype to avoid an error.  */
7742 #ifdef __cplusplus
7743 extern "C"
7744 #endif
7745 /* We use char because int might match the return type of a gcc2
7746    builtin and then its argument prototype would still apply.  */
7747 char tgoto ();
7748 int
7749 main (void)
7750 {
7751 tgoto ();
7752   ;
7753   return 0;
7754 }
7755 _ACEOF
7756 rm -f conftest.$ac_objext conftest$ac_exeext
7757 if { (eval echo "$as_me:7757: \"$ac_link\"") >&5
7758   (eval $ac_link) 2>&5
7759   ac_status=$?
7760   echo "$as_me:7760: \$? = $ac_status" >&5
7761   (exit $ac_status); } &&
7762          { ac_try='test -s conftest$ac_exeext'
7763   { (eval echo "$as_me:7763: \"$ac_try\"") >&5
7764   (eval $ac_try) 2>&5
7765   ac_status=$?
7766   echo "$as_me:7766: \$? = $ac_status" >&5
7767   (exit $ac_status); }; }; then
7768   ac_cv_lib_mytinfo_tgoto=yes
7769 else
7770   echo "$as_me: failed program was:" >&5
7771 cat conftest.$ac_ext >&5
7772 ac_cv_lib_mytinfo_tgoto=no
7773 fi
7774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7775 LIBS=$ac_check_lib_save_LIBS
7776 fi
7777 echo "$as_me:7777: result: $ac_cv_lib_mytinfo_tgoto" >&5
7778 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7779 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7780   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7781 fi
7782
7783         fi
7784         ;;
7785 esac
7786
7787 cf_add_libs="$cf_ncurses_LIBS"
7788 # Filter out duplicates - this happens with badly-designed ".pc" files...
7789 for cf_add_1lib in $LIBS
7790 do
7791         for cf_add_2lib in $cf_add_libs
7792         do
7793                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7794                 then
7795                         cf_add_1lib=
7796                         break
7797                 fi
7798         done
7799         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7800 done
7801 LIBS="$cf_add_libs"
7802
7803 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7804 then
7805
7806 cf_add_libs="-l$cf_nculib_root"
7807 # Filter out duplicates - this happens with badly-designed ".pc" files...
7808 for cf_add_1lib in $LIBS
7809 do
7810         for cf_add_2lib in $cf_add_libs
7811         do
7812                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7813                 then
7814                         cf_add_1lib=
7815                         break
7816                 fi
7817         done
7818         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7819 done
7820 LIBS="$cf_add_libs"
7821
7822 else
7823
7824         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7825         cf_libdir=""
7826         echo "$as_me:7826: checking for initscr" >&5
7827 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7828 if test "${ac_cv_func_initscr+set}" = set; then
7829   echo $ECHO_N "(cached) $ECHO_C" >&6
7830 else
7831   cat >conftest.$ac_ext <<_ACEOF
7832 #line 7832 "configure"
7833 #include "confdefs.h"
7834 /* System header to define __stub macros and hopefully few prototypes,
7835     which can conflict with char initscr (); below.  */
7836 #include <assert.h>
7837 /* Override any gcc2 internal prototype to avoid an error.  */
7838 #ifdef __cplusplus
7839 extern "C"
7840 #endif
7841 /* We use char because int might match the return type of a gcc2
7842    builtin and then its argument prototype would still apply.  */
7843 char initscr ();
7844 char (*f) ();
7845
7846 int
7847 main (void)
7848 {
7849 /* The GNU C library defines this for functions which it implements
7850     to always fail with ENOSYS.  Some functions are actually named
7851     something starting with __ and the normal name is an alias.  */
7852 #if defined (__stub_initscr) || defined (__stub___initscr)
7853 choke me
7854 #else
7855 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7856 #endif
7857
7858   ;
7859   return 0;
7860 }
7861 _ACEOF
7862 rm -f conftest.$ac_objext conftest$ac_exeext
7863 if { (eval echo "$as_me:7863: \"$ac_link\"") >&5
7864   (eval $ac_link) 2>&5
7865   ac_status=$?
7866   echo "$as_me:7866: \$? = $ac_status" >&5
7867   (exit $ac_status); } &&
7868          { ac_try='test -s conftest$ac_exeext'
7869   { (eval echo "$as_me:7869: \"$ac_try\"") >&5
7870   (eval $ac_try) 2>&5
7871   ac_status=$?
7872   echo "$as_me:7872: \$? = $ac_status" >&5
7873   (exit $ac_status); }; }; then
7874   ac_cv_func_initscr=yes
7875 else
7876   echo "$as_me: failed program was:" >&5
7877 cat conftest.$ac_ext >&5
7878 ac_cv_func_initscr=no
7879 fi
7880 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7881 fi
7882 echo "$as_me:7882: result: $ac_cv_func_initscr" >&5
7883 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7884 if test $ac_cv_func_initscr = yes; then
7885   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7886 else
7887
7888                 cf_save_LIBS="$LIBS"
7889                 echo "$as_me:7889: checking for initscr in -l$cf_nculib_root" >&5
7890 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7891                 LIBS="-l$cf_nculib_root $LIBS"
7892                 cat >conftest.$ac_ext <<_ACEOF
7893 #line 7893 "configure"
7894 #include "confdefs.h"
7895 #include <${cf_cv_ncurses_header:-curses.h}>
7896 int
7897 main (void)
7898 {
7899 initscr()
7900   ;
7901   return 0;
7902 }
7903 _ACEOF
7904 rm -f conftest.$ac_objext conftest$ac_exeext
7905 if { (eval echo "$as_me:7905: \"$ac_link\"") >&5
7906   (eval $ac_link) 2>&5
7907   ac_status=$?
7908   echo "$as_me:7908: \$? = $ac_status" >&5
7909   (exit $ac_status); } &&
7910          { ac_try='test -s conftest$ac_exeext'
7911   { (eval echo "$as_me:7911: \"$ac_try\"") >&5
7912   (eval $ac_try) 2>&5
7913   ac_status=$?
7914   echo "$as_me:7914: \$? = $ac_status" >&5
7915   (exit $ac_status); }; }; then
7916   echo "$as_me:7916: result: yes" >&5
7917 echo "${ECHO_T}yes" >&6
7918                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7919
7920 else
7921   echo "$as_me: failed program was:" >&5
7922 cat conftest.$ac_ext >&5
7923 echo "$as_me:7923: result: no" >&5
7924 echo "${ECHO_T}no" >&6
7925
7926 cf_search=
7927 cf_library_path_list=""
7928 if test -n "${LDFLAGS}${LIBS}" ; then
7929         for cf_library_path in $LDFLAGS $LIBS
7930         do
7931                 case $cf_library_path in
7932                 (-L*)
7933                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7934
7935 test "x$cf_library_path" != "xNONE" && \
7936 test -d "$cf_library_path" && \
7937  {
7938         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7939         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7940         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7941         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7942         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7943         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"
7944 }
7945
7946                         cf_library_path_list="$cf_library_path_list $cf_search"
7947                         ;;
7948                 esac
7949         done
7950 fi
7951
7952 cf_search=
7953
7954 test "x$prefix" != "xNONE" && \
7955 test -d "$prefix" && \
7956  {
7957         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7958         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7959         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7960         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7961         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7962         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7963 }
7964
7965 for cf_subdir_prefix in \
7966         /usr \
7967         /usr/local \
7968         /usr/pkg \
7969         /opt \
7970         /opt/local \
7971         $HOME
7972 do
7973
7974 test "x$cf_subdir_prefix" != "x$prefix" && \
7975 test -d "$cf_subdir_prefix" && \
7976 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7977         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7978         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7979         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7980         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7981         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7982         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"
7983 }
7984
7985 done
7986
7987 cf_search="$cf_library_path_list $cf_search"
7988
7989                         for cf_libdir in $cf_search
7990                         do
7991                                 echo "$as_me:7991: checking for -l$cf_nculib_root in $cf_libdir" >&5
7992 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7993                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7994                                 cat >conftest.$ac_ext <<_ACEOF
7995 #line 7995 "configure"
7996 #include "confdefs.h"
7997 #include <${cf_cv_ncurses_header:-curses.h}>
7998 int
7999 main (void)
8000 {
8001 initscr()
8002   ;
8003   return 0;
8004 }
8005 _ACEOF
8006 rm -f conftest.$ac_objext conftest$ac_exeext
8007 if { (eval echo "$as_me:8007: \"$ac_link\"") >&5
8008   (eval $ac_link) 2>&5
8009   ac_status=$?
8010   echo "$as_me:8010: \$? = $ac_status" >&5
8011   (exit $ac_status); } &&
8012          { ac_try='test -s conftest$ac_exeext'
8013   { (eval echo "$as_me:8013: \"$ac_try\"") >&5
8014   (eval $ac_try) 2>&5
8015   ac_status=$?
8016   echo "$as_me:8016: \$? = $ac_status" >&5
8017   (exit $ac_status); }; }; then
8018   echo "$as_me:8018: result: yes" >&5
8019 echo "${ECHO_T}yes" >&6
8020                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8021                                          break
8022 else
8023   echo "$as_me: failed program was:" >&5
8024 cat conftest.$ac_ext >&5
8025 echo "$as_me:8025: result: no" >&5
8026 echo "${ECHO_T}no" >&6
8027                                          LIBS="$cf_save_LIBS"
8028 fi
8029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8030                         done
8031
8032 fi
8033 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8034
8035 fi
8036
8037 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8038
8039 if test $cf_found_library = no ; then
8040         { { echo "$as_me:8040: error: Cannot link $cf_nculib_root library" >&5
8041 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8042    { (exit 1); exit 1; }; }
8043 fi
8044
8045 fi
8046
8047 if test -n "$cf_ncurses_LIBS" ; then
8048         echo "$as_me:8048: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8049 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8050         cf_ncurses_SAVE="$LIBS"
8051         for p in $cf_ncurses_LIBS ; do
8052                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8053                 if test "$q" != "$LIBS" ; then
8054                         LIBS="$q"
8055                 fi
8056         done
8057         cat >conftest.$ac_ext <<_ACEOF
8058 #line 8058 "configure"
8059 #include "confdefs.h"
8060 #include <${cf_cv_ncurses_header:-curses.h}>
8061 int
8062 main (void)
8063 {
8064 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8065   ;
8066   return 0;
8067 }
8068 _ACEOF
8069 rm -f conftest.$ac_objext conftest$ac_exeext
8070 if { (eval echo "$as_me:8070: \"$ac_link\"") >&5
8071   (eval $ac_link) 2>&5
8072   ac_status=$?
8073   echo "$as_me:8073: \$? = $ac_status" >&5
8074   (exit $ac_status); } &&
8075          { ac_try='test -s conftest$ac_exeext'
8076   { (eval echo "$as_me:8076: \"$ac_try\"") >&5
8077   (eval $ac_try) 2>&5
8078   ac_status=$?
8079   echo "$as_me:8079: \$? = $ac_status" >&5
8080   (exit $ac_status); }; }; then
8081   echo "$as_me:8081: result: yes" >&5
8082 echo "${ECHO_T}yes" >&6
8083 else
8084   echo "$as_me: failed program was:" >&5
8085 cat conftest.$ac_ext >&5
8086 echo "$as_me:8086: result: no" >&5
8087 echo "${ECHO_T}no" >&6
8088                  LIBS="$cf_ncurses_SAVE"
8089 fi
8090 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8091 fi
8092
8093 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8094
8095 cat >>confdefs.h <<EOF
8096 #define $cf_nculib_ROOT 1
8097 EOF
8098
8099         fi
8100 else
8101         NCURSES_CONFIG=none
8102 fi
8103
8104 else
8105
8106 cf_ncuconfig_root=ncurses
8107 cf_have_ncuconfig=no
8108
8109 if test "x${PKG_CONFIG:=none}" != xnone; then
8110         echo "$as_me:8110: checking pkg-config for $cf_ncuconfig_root" >&5
8111 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8112         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8113                 echo "$as_me:8113: result: yes" >&5
8114 echo "${ECHO_T}yes" >&6
8115
8116                 echo "$as_me:8116: checking if the $cf_ncuconfig_root package files work" >&5
8117 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8118                 cf_have_ncuconfig=unknown
8119
8120                 cf_save_CPPFLAGS="$CPPFLAGS"
8121                 cf_save_LIBS="$LIBS"
8122
8123 cf_fix_cppflags=no
8124 cf_new_cflags=
8125 cf_new_cppflags=
8126 cf_new_extra_cppflags=
8127
8128 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
8129 do
8130 case $cf_fix_cppflags in
8131 (no)
8132         case $cf_add_cflags in
8133         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8134                 case $cf_add_cflags in
8135                 (-D*)
8136                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8137
8138                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8139                                 && test -z "${cf_tst_cflags}" \
8140                                 && cf_fix_cppflags=yes
8141
8142                         if test $cf_fix_cppflags = yes ; then
8143
8144         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8145         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8146
8147                                 continue
8148                         elif test "${cf_tst_cflags}" = "\"'" ; then
8149
8150         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8151         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8152
8153                                 continue
8154                         fi
8155                         ;;
8156                 esac
8157                 case "$CPPFLAGS" in
8158                 (*$cf_add_cflags)
8159                         ;;
8160                 (*)
8161                         case $cf_add_cflags in
8162                         (-D*)
8163                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8164
8165 CPPFLAGS=`echo "$CPPFLAGS" | \
8166         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8167                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8168
8169                                 ;;
8170                         esac
8171
8172         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8173         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8174
8175                         ;;
8176                 esac
8177                 ;;
8178         (*)
8179
8180         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8181         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8182
8183                 ;;
8184         esac
8185         ;;
8186 (yes)
8187
8188         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8189         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8190
8191         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8192
8193         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8194                 && test -z "${cf_tst_cflags}" \
8195                 && cf_fix_cppflags=no
8196         ;;
8197 esac
8198 done
8199
8200 if test -n "$cf_new_cflags" ; then
8201
8202         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8203         CFLAGS="${CFLAGS}$cf_new_cflags"
8204
8205 fi
8206
8207 if test -n "$cf_new_cppflags" ; then
8208
8209         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8210         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8211
8212 fi
8213
8214 if test -n "$cf_new_extra_cppflags" ; then
8215
8216         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8217         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8218
8219 fi
8220
8221 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8222 # Filter out duplicates - this happens with badly-designed ".pc" files...
8223 for cf_add_1lib in $LIBS
8224 do
8225         for cf_add_2lib in $cf_add_libs
8226         do
8227                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8228                 then
8229                         cf_add_1lib=
8230                         break
8231                 fi
8232         done
8233         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8234 done
8235 LIBS="$cf_add_libs"
8236
8237                 cat >conftest.$ac_ext <<_ACEOF
8238 #line 8238 "configure"
8239 #include "confdefs.h"
8240 #include <${cf_cv_ncurses_header:-curses.h}>
8241 int
8242 main (void)
8243 {
8244 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8245   ;
8246   return 0;
8247 }
8248 _ACEOF
8249 rm -f conftest.$ac_objext conftest$ac_exeext
8250 if { (eval echo "$as_me:8250: \"$ac_link\"") >&5
8251   (eval $ac_link) 2>&5
8252   ac_status=$?
8253   echo "$as_me:8253: \$? = $ac_status" >&5
8254   (exit $ac_status); } &&
8255          { ac_try='test -s conftest$ac_exeext'
8256   { (eval echo "$as_me:8256: \"$ac_try\"") >&5
8257   (eval $ac_try) 2>&5
8258   ac_status=$?
8259   echo "$as_me:8259: \$? = $ac_status" >&5
8260   (exit $ac_status); }; }; then
8261   if test "$cross_compiling" = yes; then
8262   cf_have_ncuconfig=maybe
8263 else
8264   cat >conftest.$ac_ext <<_ACEOF
8265 #line 8265 "configure"
8266 #include "confdefs.h"
8267 #include <${cf_cv_ncurses_header:-curses.h}>
8268                                 int main(void)
8269                                 { char *xx = curses_version(); return (xx == 0); }
8270 _ACEOF
8271 rm -f conftest$ac_exeext
8272 if { (eval echo "$as_me:8272: \"$ac_link\"") >&5
8273   (eval $ac_link) 2>&5
8274   ac_status=$?
8275   echo "$as_me:8275: \$? = $ac_status" >&5
8276   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8277   { (eval echo "$as_me:8277: \"$ac_try\"") >&5
8278   (eval $ac_try) 2>&5
8279   ac_status=$?
8280   echo "$as_me:8280: \$? = $ac_status" >&5
8281   (exit $ac_status); }; }; then
8282   cf_have_ncuconfig=yes
8283 else
8284   echo "$as_me: program exited with status $ac_status" >&5
8285 echo "$as_me: failed program was:" >&5
8286 cat conftest.$ac_ext >&5
8287 cf_have_ncuconfig=no
8288 fi
8289 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8290 fi
8291 else
8292   echo "$as_me: failed program was:" >&5
8293 cat conftest.$ac_ext >&5
8294 cf_have_ncuconfig=no
8295 fi
8296 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8297                 echo "$as_me:8297: result: $cf_have_ncuconfig" >&5
8298 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8299                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8300                 if test "$cf_have_ncuconfig" != "yes"
8301                 then
8302                         CPPFLAGS="$cf_save_CPPFLAGS"
8303                         LIBS="$cf_save_LIBS"
8304                         NCURSES_CONFIG_PKG=none
8305                 else
8306
8307 cat >>confdefs.h <<\EOF
8308 #define NCURSES 1
8309 EOF
8310
8311                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8312
8313 echo "$as_me:8313: checking for terminfo header" >&5
8314 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8315 if test "${cf_cv_term_header+set}" = set; then
8316   echo $ECHO_N "(cached) $ECHO_C" >&6
8317 else
8318
8319 case ${cf_cv_ncurses_header} in
8320 (*/ncurses.h|*/ncursesw.h)
8321         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8322         ;;
8323 (*)
8324         cf_term_header=term.h
8325         ;;
8326 esac
8327
8328 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8329 do
8330 cat >conftest.$ac_ext <<_ACEOF
8331 #line 8331 "configure"
8332 #include "confdefs.h"
8333 #include <stdio.h>
8334 #include <${cf_cv_ncurses_header:-curses.h}>
8335 #include <$cf_test>
8336
8337 int
8338 main (void)
8339 {
8340 int x = auto_left_margin
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
8358         cf_cv_term_header="$cf_test"
8359 else
8360   echo "$as_me: failed program was:" >&5
8361 cat conftest.$ac_ext >&5
8362
8363         cf_cv_term_header=unknown
8364
8365 fi
8366 rm -f conftest.$ac_objext conftest.$ac_ext
8367         test "$cf_cv_term_header" != unknown && break
8368 done
8369
8370 fi
8371 echo "$as_me:8371: result: $cf_cv_term_header" >&5
8372 echo "${ECHO_T}$cf_cv_term_header" >&6
8373
8374 # Set definitions to allow ifdef'ing to accommodate subdirectories
8375
8376 case $cf_cv_term_header in
8377 (*term.h)
8378
8379 cat >>confdefs.h <<\EOF
8380 #define HAVE_TERM_H 1
8381 EOF
8382
8383         ;;
8384 esac
8385
8386 case $cf_cv_term_header in
8387 (ncurses/term.h)
8388
8389 cat >>confdefs.h <<\EOF
8390 #define HAVE_NCURSES_TERM_H 1
8391 EOF
8392
8393         ;;
8394 (ncursesw/term.h)
8395
8396 cat >>confdefs.h <<\EOF
8397 #define HAVE_NCURSESW_TERM_H 1
8398 EOF
8399
8400         ;;
8401 esac
8402
8403                 fi
8404
8405         else
8406                 echo "$as_me:8406: result: no" >&5
8407 echo "${ECHO_T}no" >&6
8408                 NCURSES_CONFIG_PKG=none
8409         fi
8410 else
8411         NCURSES_CONFIG_PKG=none
8412 fi
8413
8414 if test "x$cf_have_ncuconfig" = "xno"; then
8415         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8416
8417 if test -n "$ac_tool_prefix"; then
8418   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8419   do
8420     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8421 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8422 echo "$as_me:8422: checking for $ac_word" >&5
8423 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8424 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8425   echo $ECHO_N "(cached) $ECHO_C" >&6
8426 else
8427   if test -n "$NCURSES_CONFIG"; then
8428   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8429 else
8430   ac_save_IFS=$IFS; IFS=$ac_path_separator
8431 ac_dummy="$PATH"
8432 for ac_dir in $ac_dummy; do
8433   IFS=$ac_save_IFS
8434   test -z "$ac_dir" && ac_dir=.
8435   $as_executable_p "$ac_dir/$ac_word" || continue
8436 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8437 echo "$as_me:8437: found $ac_dir/$ac_word" >&5
8438 break
8439 done
8440
8441 fi
8442 fi
8443 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8444 if test -n "$NCURSES_CONFIG"; then
8445   echo "$as_me:8445: result: $NCURSES_CONFIG" >&5
8446 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8447 else
8448   echo "$as_me:8448: result: no" >&5
8449 echo "${ECHO_T}no" >&6
8450 fi
8451
8452     test -n "$NCURSES_CONFIG" && break
8453   done
8454 fi
8455 if test -z "$NCURSES_CONFIG"; then
8456   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8457   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8458 do
8459   # Extract the first word of "$ac_prog", so it can be a program name with args.
8460 set dummy $ac_prog; ac_word=$2
8461 echo "$as_me:8461: checking for $ac_word" >&5
8462 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8463 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8464   echo $ECHO_N "(cached) $ECHO_C" >&6
8465 else
8466   if test -n "$ac_ct_NCURSES_CONFIG"; then
8467   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8468 else
8469   ac_save_IFS=$IFS; IFS=$ac_path_separator
8470 ac_dummy="$PATH"
8471 for ac_dir in $ac_dummy; do
8472   IFS=$ac_save_IFS
8473   test -z "$ac_dir" && ac_dir=.
8474   $as_executable_p "$ac_dir/$ac_word" || continue
8475 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8476 echo "$as_me:8476: found $ac_dir/$ac_word" >&5
8477 break
8478 done
8479
8480 fi
8481 fi
8482 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8483 if test -n "$ac_ct_NCURSES_CONFIG"; then
8484   echo "$as_me:8484: result: $ac_ct_NCURSES_CONFIG" >&5
8485 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8486 else
8487   echo "$as_me:8487: result: no" >&5
8488 echo "${ECHO_T}no" >&6
8489 fi
8490
8491   test -n "$ac_ct_NCURSES_CONFIG" && break
8492 done
8493 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8494
8495   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8496 fi
8497
8498         if test "$NCURSES_CONFIG" != none ; then
8499
8500 cf_fix_cppflags=no
8501 cf_new_cflags=
8502 cf_new_cppflags=
8503 cf_new_extra_cppflags=
8504
8505 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8506 do
8507 case $cf_fix_cppflags in
8508 (no)
8509         case $cf_add_cflags in
8510         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8511                 case $cf_add_cflags in
8512                 (-D*)
8513                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8514
8515                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8516                                 && test -z "${cf_tst_cflags}" \
8517                                 && cf_fix_cppflags=yes
8518
8519                         if test $cf_fix_cppflags = yes ; then
8520
8521         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8522         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8523
8524                                 continue
8525                         elif test "${cf_tst_cflags}" = "\"'" ; then
8526
8527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8529
8530                                 continue
8531                         fi
8532                         ;;
8533                 esac
8534                 case "$CPPFLAGS" in
8535                 (*$cf_add_cflags)
8536                         ;;
8537                 (*)
8538                         case $cf_add_cflags in
8539                         (-D*)
8540                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8541
8542 CPPFLAGS=`echo "$CPPFLAGS" | \
8543         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8544                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8545
8546                                 ;;
8547                         esac
8548
8549         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8550         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8551
8552                         ;;
8553                 esac
8554                 ;;
8555         (*)
8556
8557         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8558         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8559
8560                 ;;
8561         esac
8562         ;;
8563 (yes)
8564
8565         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8566         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8567
8568         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8569
8570         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8571                 && test -z "${cf_tst_cflags}" \
8572                 && cf_fix_cppflags=no
8573         ;;
8574 esac
8575 done
8576
8577 if test -n "$cf_new_cflags" ; then
8578
8579         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8580         CFLAGS="${CFLAGS}$cf_new_cflags"
8581
8582 fi
8583
8584 if test -n "$cf_new_cppflags" ; then
8585
8586         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8587         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8588
8589 fi
8590
8591 if test -n "$cf_new_extra_cppflags" ; then
8592
8593         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8594         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8595
8596 fi
8597
8598 cf_add_libs="`$NCURSES_CONFIG --libs`"
8599 # Filter out duplicates - this happens with badly-designed ".pc" files...
8600 for cf_add_1lib in $LIBS
8601 do
8602         for cf_add_2lib in $cf_add_libs
8603         do
8604                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8605                 then
8606                         cf_add_1lib=
8607                         break
8608                 fi
8609         done
8610         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8611 done
8612 LIBS="$cf_add_libs"
8613
8614                 # even with config script, some packages use no-override for curses.h
8615
8616 echo "$as_me:8616: checking if we have identified curses headers" >&5
8617 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8618 if test "${cf_cv_ncurses_header+set}" = set; then
8619   echo $ECHO_N "(cached) $ECHO_C" >&6
8620 else
8621
8622 cf_cv_ncurses_header=none
8623 for cf_header in \
8624         ncurses.h ncurses/ncurses.h \
8625         curses.h ncurses/curses.h
8626 do
8627 cat >conftest.$ac_ext <<_ACEOF
8628 #line 8628 "configure"
8629 #include "confdefs.h"
8630 #include <${cf_header}>
8631 int
8632 main (void)
8633 {
8634 initscr(); tgoto("?", 0,0)
8635   ;
8636   return 0;
8637 }
8638 _ACEOF
8639 rm -f conftest.$ac_objext
8640 if { (eval echo "$as_me:8640: \"$ac_compile\"") >&5
8641   (eval $ac_compile) 2>&5
8642   ac_status=$?
8643   echo "$as_me:8643: \$? = $ac_status" >&5
8644   (exit $ac_status); } &&
8645          { ac_try='test -s conftest.$ac_objext'
8646   { (eval echo "$as_me:8646: \"$ac_try\"") >&5
8647   (eval $ac_try) 2>&5
8648   ac_status=$?
8649   echo "$as_me:8649: \$? = $ac_status" >&5
8650   (exit $ac_status); }; }; then
8651   cf_cv_ncurses_header=$cf_header; break
8652 else
8653   echo "$as_me: failed program was:" >&5
8654 cat conftest.$ac_ext >&5
8655 fi
8656 rm -f conftest.$ac_objext conftest.$ac_ext
8657 done
8658
8659 fi
8660 echo "$as_me:8660: result: $cf_cv_ncurses_header" >&5
8661 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8662
8663 if test "$cf_cv_ncurses_header" = none ; then
8664         { { echo "$as_me:8664: error: No curses header-files found" >&5
8665 echo "$as_me: error: No curses header-files found" >&2;}
8666    { (exit 1); exit 1; }; }
8667 fi
8668
8669 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8670
8671 for ac_header in $cf_cv_ncurses_header
8672 do
8673 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8674 echo "$as_me:8674: checking for $ac_header" >&5
8675 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8676 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8677   echo $ECHO_N "(cached) $ECHO_C" >&6
8678 else
8679   cat >conftest.$ac_ext <<_ACEOF
8680 #line 8680 "configure"
8681 #include "confdefs.h"
8682 #include <$ac_header>
8683 _ACEOF
8684 if { (eval echo "$as_me:8684: \"$ac_cpp conftest.$ac_ext\"") >&5
8685   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8686   ac_status=$?
8687   egrep -v '^ *\+' conftest.er1 >conftest.err
8688   rm -f conftest.er1
8689   cat conftest.err >&5
8690   echo "$as_me:8690: \$? = $ac_status" >&5
8691   (exit $ac_status); } >/dev/null; then
8692   if test -s conftest.err; then
8693     ac_cpp_err=$ac_c_preproc_warn_flag
8694   else
8695     ac_cpp_err=
8696   fi
8697 else
8698   ac_cpp_err=yes
8699 fi
8700 if test -z "$ac_cpp_err"; then
8701   eval "$as_ac_Header=yes"
8702 else
8703   echo "$as_me: failed program was:" >&5
8704   cat conftest.$ac_ext >&5
8705   eval "$as_ac_Header=no"
8706 fi
8707 rm -f conftest.err conftest.$ac_ext
8708 fi
8709 echo "$as_me:8709: result: `eval echo '${'$as_ac_Header'}'`" >&5
8710 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8711 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8712   cat >>confdefs.h <<EOF
8713 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8714 EOF
8715
8716 fi
8717 done
8718
8719 cat >>confdefs.h <<\EOF
8720 #define NCURSES 1
8721 EOF
8722
8723 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8724
8725                 cat >>confdefs.h <<EOF
8726 #define $cf_nculib_ROOT 1
8727 EOF
8728
8729                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8730
8731         else
8732
8733 cf_ncuhdr_root=ncurses
8734
8735 test -n "$cf_cv_curses_dir" && \
8736 test "$cf_cv_curses_dir" != "no" && { \
8737
8738 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8739   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8740   do
8741         while test $cf_add_incdir != /usr/include
8742         do
8743           if test -d $cf_add_incdir
8744           then
8745                 cf_have_incdir=no
8746                 if test -n "$CFLAGS$CPPFLAGS" ; then
8747                   # a loop is needed to ensure we can add subdirs of existing dirs
8748                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8749                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8750                           cf_have_incdir=yes; break
8751                         fi
8752                   done
8753                 fi
8754
8755                 if test "$cf_have_incdir" = no ; then
8756                   if test "$cf_add_incdir" = /usr/local/include ; then
8757                         if test "$GCC" = yes
8758                         then
8759                           cf_save_CPPFLAGS=$CPPFLAGS
8760
8761         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8762         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8763
8764                           cat >conftest.$ac_ext <<_ACEOF
8765 #line 8765 "configure"
8766 #include "confdefs.h"
8767 #include <stdio.h>
8768 int
8769 main (void)
8770 {
8771 printf("Hello")
8772   ;
8773   return 0;
8774 }
8775 _ACEOF
8776 rm -f conftest.$ac_objext
8777 if { (eval echo "$as_me:8777: \"$ac_compile\"") >&5
8778   (eval $ac_compile) 2>&5
8779   ac_status=$?
8780   echo "$as_me:8780: \$? = $ac_status" >&5
8781   (exit $ac_status); } &&
8782          { ac_try='test -s conftest.$ac_objext'
8783   { (eval echo "$as_me:8783: \"$ac_try\"") >&5
8784   (eval $ac_try) 2>&5
8785   ac_status=$?
8786   echo "$as_me:8786: \$? = $ac_status" >&5
8787   (exit $ac_status); }; }; then
8788   :
8789 else
8790   echo "$as_me: failed program was:" >&5
8791 cat conftest.$ac_ext >&5
8792 cf_have_incdir=yes
8793 fi
8794 rm -f conftest.$ac_objext conftest.$ac_ext
8795                           CPPFLAGS=$cf_save_CPPFLAGS
8796                         fi
8797                   fi
8798                 fi
8799
8800                 if test "$cf_have_incdir" = no ; then
8801                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8802
8803 echo "${as_me:-configure}:8803: testing adding $cf_add_incdir to include-path ..." 1>&5
8804
8805                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8806
8807                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8808                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8809                   cf_add_incdir="$cf_top_incdir"
8810                 else
8811                   break
8812                 fi
8813           else
8814                 break
8815           fi
8816         done
8817   done
8818 fi
8819
8820 }
8821
8822 echo "$as_me:8822: checking for $cf_ncuhdr_root header in include-path" >&5
8823 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8824 if test "${cf_cv_ncurses_h+set}" = set; then
8825   echo $ECHO_N "(cached) $ECHO_C" >&6
8826 else
8827
8828         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8829         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8830         for cf_header in $cf_header_list
8831         do
8832
8833         cat >conftest.$ac_ext <<_ACEOF
8834 #line 8834 "configure"
8835 #include "confdefs.h"
8836
8837 #include <$cf_header>
8838 int
8839 main (void)
8840 {
8841
8842 #ifdef NCURSES_VERSION
8843
8844 printf("%s\n", NCURSES_VERSION);
8845 #else
8846 #ifdef __NCURSES_H
8847 printf("old\n");
8848 #else
8849         make an error
8850 #endif
8851 #endif
8852
8853   ;
8854   return 0;
8855 }
8856 _ACEOF
8857 rm -f conftest.$ac_objext
8858 if { (eval echo "$as_me:8858: \"$ac_compile\"") >&5
8859   (eval $ac_compile) 2>&5
8860   ac_status=$?
8861   echo "$as_me:8861: \$? = $ac_status" >&5
8862   (exit $ac_status); } &&
8863          { ac_try='test -s conftest.$ac_objext'
8864   { (eval echo "$as_me:8864: \"$ac_try\"") >&5
8865   (eval $ac_try) 2>&5
8866   ac_status=$?
8867   echo "$as_me:8867: \$? = $ac_status" >&5
8868   (exit $ac_status); }; }; then
8869   cf_cv_ncurses_h=$cf_header
8870
8871 else
8872   echo "$as_me: failed program was:" >&5
8873 cat conftest.$ac_ext >&5
8874 cf_cv_ncurses_h=no
8875 fi
8876 rm -f conftest.$ac_objext conftest.$ac_ext
8877
8878                 test "$cf_cv_ncurses_h" != no && break
8879         done
8880
8881 fi
8882 echo "$as_me:8882: result: $cf_cv_ncurses_h" >&5
8883 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8884
8885 if test "$cf_cv_ncurses_h" != no ; then
8886         cf_cv_ncurses_header=$cf_cv_ncurses_h
8887 else
8888
8889 echo "$as_me:8889: checking for $cf_ncuhdr_root include-path" >&5
8890 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8891 if test "${cf_cv_ncurses_h2+set}" = set; then
8892   echo $ECHO_N "(cached) $ECHO_C" >&6
8893 else
8894
8895         test -n "$verbose" && echo
8896
8897 cf_search=
8898
8899 # collect the current set of include-directories from compiler flags
8900 cf_header_path_list=""
8901 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8902         for cf_header_path in $CPPFLAGS $CFLAGS
8903         do
8904                 case $cf_header_path in
8905                 (-I*)
8906                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8907
8908 test "x$cf_header_path" != "xNONE" && \
8909 test -d "$cf_header_path" && \
8910  {
8911         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8912         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8913         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8914         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8915         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8916         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"
8917 }
8918
8919                         cf_header_path_list="$cf_header_path_list $cf_search"
8920                         ;;
8921                 esac
8922         done
8923 fi
8924
8925 # add the variations for the package we are looking for
8926
8927 cf_search=
8928
8929 test "x$prefix" != "xNONE" && \
8930 test -d "$prefix" && \
8931  {
8932         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8933         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8934         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8935         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8936         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8937         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8938 }
8939
8940 for cf_subdir_prefix in \
8941         /usr \
8942         /usr/local \
8943         /usr/pkg \
8944         /opt \
8945         /opt/local \
8946         $HOME
8947 do
8948
8949 test "x$cf_subdir_prefix" != "x$prefix" && \
8950 test -d "$cf_subdir_prefix" && \
8951 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8952         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8953         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8954         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8955         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8956         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8957         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"
8958 }
8959
8960 done
8961
8962 test "$includedir" != NONE && \
8963 test "$includedir" != "/usr/include" && \
8964 test -d "$includedir" && {
8965         test -d $includedir &&    cf_search="$cf_search $includedir"
8966         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8967 }
8968
8969 test "$oldincludedir" != NONE && \
8970 test "$oldincludedir" != "/usr/include" && \
8971 test -d "$oldincludedir" && {
8972         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8973         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8974 }
8975
8976 cf_search="$cf_search $cf_header_path_list"
8977
8978         test -n "$verbose" && echo search path $cf_search
8979         cf_save2_CPPFLAGS="$CPPFLAGS"
8980         for cf_incdir in $cf_search
8981         do
8982
8983 if test -n "$cf_incdir" ; then
8984   for cf_add_incdir in $cf_incdir
8985   do
8986         while test $cf_add_incdir != /usr/include
8987         do
8988           if test -d $cf_add_incdir
8989           then
8990                 cf_have_incdir=no
8991                 if test -n "$CFLAGS$CPPFLAGS" ; then
8992                   # a loop is needed to ensure we can add subdirs of existing dirs
8993                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8994                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8995                           cf_have_incdir=yes; break
8996                         fi
8997                   done
8998                 fi
8999
9000                 if test "$cf_have_incdir" = no ; then
9001                   if test "$cf_add_incdir" = /usr/local/include ; then
9002                         if test "$GCC" = yes
9003                         then
9004                           cf_save_CPPFLAGS=$CPPFLAGS
9005
9006         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9007         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9008
9009                           cat >conftest.$ac_ext <<_ACEOF
9010 #line 9010 "configure"
9011 #include "confdefs.h"
9012 #include <stdio.h>
9013 int
9014 main (void)
9015 {
9016 printf("Hello")
9017   ;
9018   return 0;
9019 }
9020 _ACEOF
9021 rm -f conftest.$ac_objext
9022 if { (eval echo "$as_me:9022: \"$ac_compile\"") >&5
9023   (eval $ac_compile) 2>&5
9024   ac_status=$?
9025   echo "$as_me:9025: \$? = $ac_status" >&5
9026   (exit $ac_status); } &&
9027          { ac_try='test -s conftest.$ac_objext'
9028   { (eval echo "$as_me:9028: \"$ac_try\"") >&5
9029   (eval $ac_try) 2>&5
9030   ac_status=$?
9031   echo "$as_me:9031: \$? = $ac_status" >&5
9032   (exit $ac_status); }; }; then
9033   :
9034 else
9035   echo "$as_me: failed program was:" >&5
9036 cat conftest.$ac_ext >&5
9037 cf_have_incdir=yes
9038 fi
9039 rm -f conftest.$ac_objext conftest.$ac_ext
9040                           CPPFLAGS=$cf_save_CPPFLAGS
9041                         fi
9042                   fi
9043                 fi
9044
9045                 if test "$cf_have_incdir" = no ; then
9046                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9047
9048 echo "${as_me:-configure}:9048: testing adding $cf_add_incdir to include-path ..." 1>&5
9049
9050                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9051
9052                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9053                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9054                   cf_add_incdir="$cf_top_incdir"
9055                 else
9056                   break
9057                 fi
9058           else
9059                 break
9060           fi
9061         done
9062   done
9063 fi
9064
9065                 for cf_header in \
9066                         ncurses.h \
9067                         curses.h
9068                 do
9069
9070         cat >conftest.$ac_ext <<_ACEOF
9071 #line 9071 "configure"
9072 #include "confdefs.h"
9073
9074 #include <$cf_header>
9075 int
9076 main (void)
9077 {
9078
9079 #ifdef NCURSES_VERSION
9080
9081 printf("%s\n", NCURSES_VERSION);
9082 #else
9083 #ifdef __NCURSES_H
9084 printf("old\n");
9085 #else
9086         make an error
9087 #endif
9088 #endif
9089
9090   ;
9091   return 0;
9092 }
9093 _ACEOF
9094 rm -f conftest.$ac_objext
9095 if { (eval echo "$as_me:9095: \"$ac_compile\"") >&5
9096   (eval $ac_compile) 2>&5
9097   ac_status=$?
9098   echo "$as_me:9098: \$? = $ac_status" >&5
9099   (exit $ac_status); } &&
9100          { ac_try='test -s conftest.$ac_objext'
9101   { (eval echo "$as_me:9101: \"$ac_try\"") >&5
9102   (eval $ac_try) 2>&5
9103   ac_status=$?
9104   echo "$as_me:9104: \$? = $ac_status" >&5
9105   (exit $ac_status); }; }; then
9106   cf_cv_ncurses_h2=$cf_header
9107
9108 else
9109   echo "$as_me: failed program was:" >&5
9110 cat conftest.$ac_ext >&5
9111 cf_cv_ncurses_h2=no
9112 fi
9113 rm -f conftest.$ac_objext conftest.$ac_ext
9114
9115                         if test "$cf_cv_ncurses_h2" != no ; then
9116                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9117                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9118                                 break
9119                         fi
9120                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9121                 done
9122                 CPPFLAGS="$cf_save2_CPPFLAGS"
9123                 test "$cf_cv_ncurses_h2" != no && break
9124         done
9125         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9125: error: not found" >&5
9126 echo "$as_me: error: not found" >&2;}
9127    { (exit 1); exit 1; }; }
9128
9129 fi
9130 echo "$as_me:9130: result: $cf_cv_ncurses_h2" >&5
9131 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9132
9133         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9134         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9135         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9136                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9137         fi
9138
9139 if test -n "$cf_1st_incdir" ; then
9140   for cf_add_incdir in $cf_1st_incdir
9141   do
9142         while test $cf_add_incdir != /usr/include
9143         do
9144           if test -d $cf_add_incdir
9145           then
9146                 cf_have_incdir=no
9147                 if test -n "$CFLAGS$CPPFLAGS" ; then
9148                   # a loop is needed to ensure we can add subdirs of existing dirs
9149                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9150                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9151                           cf_have_incdir=yes; break
9152                         fi
9153                   done
9154                 fi
9155
9156                 if test "$cf_have_incdir" = no ; then
9157                   if test "$cf_add_incdir" = /usr/local/include ; then
9158                         if test "$GCC" = yes
9159                         then
9160                           cf_save_CPPFLAGS=$CPPFLAGS
9161
9162         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9163         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9164
9165                           cat >conftest.$ac_ext <<_ACEOF
9166 #line 9166 "configure"
9167 #include "confdefs.h"
9168 #include <stdio.h>
9169 int
9170 main (void)
9171 {
9172 printf("Hello")
9173   ;
9174   return 0;
9175 }
9176 _ACEOF
9177 rm -f conftest.$ac_objext
9178 if { (eval echo "$as_me:9178: \"$ac_compile\"") >&5
9179   (eval $ac_compile) 2>&5
9180   ac_status=$?
9181   echo "$as_me:9181: \$? = $ac_status" >&5
9182   (exit $ac_status); } &&
9183          { ac_try='test -s conftest.$ac_objext'
9184   { (eval echo "$as_me:9184: \"$ac_try\"") >&5
9185   (eval $ac_try) 2>&5
9186   ac_status=$?
9187   echo "$as_me:9187: \$? = $ac_status" >&5
9188   (exit $ac_status); }; }; then
9189   :
9190 else
9191   echo "$as_me: failed program was:" >&5
9192 cat conftest.$ac_ext >&5
9193 cf_have_incdir=yes
9194 fi
9195 rm -f conftest.$ac_objext conftest.$ac_ext
9196                           CPPFLAGS=$cf_save_CPPFLAGS
9197                         fi
9198                   fi
9199                 fi
9200
9201                 if test "$cf_have_incdir" = no ; then
9202                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9203
9204 echo "${as_me:-configure}:9204: testing adding $cf_add_incdir to include-path ..." 1>&5
9205
9206                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9207
9208                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9209                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9210                   cf_add_incdir="$cf_top_incdir"
9211                 else
9212                   break
9213                 fi
9214           else
9215                 break
9216           fi
9217         done
9218   done
9219 fi
9220
9221 fi
9222
9223 # Set definitions to allow ifdef'ing for ncurses.h
9224
9225 case $cf_cv_ncurses_header in
9226 (*ncurses.h)
9227
9228 cat >>confdefs.h <<\EOF
9229 #define HAVE_NCURSES_H 1
9230 EOF
9231
9232         ;;
9233 esac
9234
9235 case $cf_cv_ncurses_header in
9236 (ncurses/curses.h|ncurses/ncurses.h)
9237
9238 cat >>confdefs.h <<\EOF
9239 #define HAVE_NCURSES_NCURSES_H 1
9240 EOF
9241
9242         ;;
9243 (ncursesw/curses.h|ncursesw/ncurses.h)
9244
9245 cat >>confdefs.h <<\EOF
9246 #define HAVE_NCURSESW_NCURSES_H 1
9247 EOF
9248
9249         ;;
9250 esac
9251
9252 echo "$as_me:9252: checking for terminfo header" >&5
9253 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9254 if test "${cf_cv_term_header+set}" = set; then
9255   echo $ECHO_N "(cached) $ECHO_C" >&6
9256 else
9257
9258 case ${cf_cv_ncurses_header} in
9259 (*/ncurses.h|*/ncursesw.h)
9260         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9261         ;;
9262 (*)
9263         cf_term_header=term.h
9264         ;;
9265 esac
9266
9267 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9268 do
9269 cat >conftest.$ac_ext <<_ACEOF
9270 #line 9270 "configure"
9271 #include "confdefs.h"
9272 #include <stdio.h>
9273 #include <${cf_cv_ncurses_header:-curses.h}>
9274 #include <$cf_test>
9275
9276 int
9277 main (void)
9278 {
9279 int x = auto_left_margin
9280   ;
9281   return 0;
9282 }
9283 _ACEOF
9284 rm -f conftest.$ac_objext
9285 if { (eval echo "$as_me:9285: \"$ac_compile\"") >&5
9286   (eval $ac_compile) 2>&5
9287   ac_status=$?
9288   echo "$as_me:9288: \$? = $ac_status" >&5
9289   (exit $ac_status); } &&
9290          { ac_try='test -s conftest.$ac_objext'
9291   { (eval echo "$as_me:9291: \"$ac_try\"") >&5
9292   (eval $ac_try) 2>&5
9293   ac_status=$?
9294   echo "$as_me:9294: \$? = $ac_status" >&5
9295   (exit $ac_status); }; }; then
9296
9297         cf_cv_term_header="$cf_test"
9298 else
9299   echo "$as_me: failed program was:" >&5
9300 cat conftest.$ac_ext >&5
9301
9302         cf_cv_term_header=unknown
9303
9304 fi
9305 rm -f conftest.$ac_objext conftest.$ac_ext
9306         test "$cf_cv_term_header" != unknown && break
9307 done
9308
9309 fi
9310 echo "$as_me:9310: result: $cf_cv_term_header" >&5
9311 echo "${ECHO_T}$cf_cv_term_header" >&6
9312
9313 # Set definitions to allow ifdef'ing to accommodate subdirectories
9314
9315 case $cf_cv_term_header in
9316 (*term.h)
9317
9318 cat >>confdefs.h <<\EOF
9319 #define HAVE_TERM_H 1
9320 EOF
9321
9322         ;;
9323 esac
9324
9325 case $cf_cv_term_header in
9326 (ncurses/term.h)
9327
9328 cat >>confdefs.h <<\EOF
9329 #define HAVE_NCURSES_TERM_H 1
9330 EOF
9331
9332         ;;
9333 (ncursesw/term.h)
9334
9335 cat >>confdefs.h <<\EOF
9336 #define HAVE_NCURSESW_TERM_H 1
9337 EOF
9338
9339         ;;
9340 esac
9341
9342 # some applications need this, but should check for NCURSES_VERSION
9343
9344 cat >>confdefs.h <<\EOF
9345 #define NCURSES 1
9346 EOF
9347
9348 echo "$as_me:9348: checking for ncurses version" >&5
9349 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9350 if test "${cf_cv_ncurses_version+set}" = set; then
9351   echo $ECHO_N "(cached) $ECHO_C" >&6
9352 else
9353
9354         cf_cv_ncurses_version=no
9355         cf_tempfile=out$$
9356         rm -f $cf_tempfile
9357         if test "$cross_compiling" = yes; then
9358
9359         # This will not work if the preprocessor splits the line after the
9360         # Autoconf token.  The 'unproto' program does that.
9361         cat > conftest.$ac_ext <<EOF
9362 #include <${cf_cv_ncurses_header:-curses.h}>
9363 #undef Autoconf
9364 #ifdef NCURSES_VERSION
9365 Autoconf NCURSES_VERSION
9366 #else
9367 #ifdef __NCURSES_H
9368 Autoconf "old"
9369 #endif
9370 ;
9371 #endif
9372 EOF
9373         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9374         { (eval echo "$as_me:9374: \"$cf_try\"") >&5
9375   (eval $cf_try) 2>&5
9376   ac_status=$?
9377   echo "$as_me:9377: \$? = $ac_status" >&5
9378   (exit $ac_status); }
9379         if test -f conftest.out ; then
9380                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9381                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9382                 rm -f conftest.out
9383         fi
9384
9385 else
9386   cat >conftest.$ac_ext <<_ACEOF
9387 #line 9387 "configure"
9388 #include "confdefs.h"
9389
9390 #include <${cf_cv_ncurses_header:-curses.h}>
9391 #include <stdio.h>
9392 int main(void)
9393 {
9394         FILE *fp = fopen("$cf_tempfile", "w");
9395 #ifdef NCURSES_VERSION
9396 # ifdef NCURSES_VERSION_PATCH
9397         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9398 # else
9399         fprintf(fp, "%s\n", NCURSES_VERSION);
9400 # endif
9401 #else
9402 # ifdef __NCURSES_H
9403         fprintf(fp, "old\n");
9404 # else
9405         make an error
9406 # endif
9407 #endif
9408         ${cf_cv_main_return:-return}(0);
9409 }
9410 _ACEOF
9411 rm -f conftest$ac_exeext
9412 if { (eval echo "$as_me:9412: \"$ac_link\"") >&5
9413   (eval $ac_link) 2>&5
9414   ac_status=$?
9415   echo "$as_me:9415: \$? = $ac_status" >&5
9416   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9417   { (eval echo "$as_me:9417: \"$ac_try\"") >&5
9418   (eval $ac_try) 2>&5
9419   ac_status=$?
9420   echo "$as_me:9420: \$? = $ac_status" >&5
9421   (exit $ac_status); }; }; then
9422
9423         cf_cv_ncurses_version=`cat $cf_tempfile`
9424 else
9425   echo "$as_me: program exited with status $ac_status" >&5
9426 echo "$as_me: failed program was:" >&5
9427 cat conftest.$ac_ext >&5
9428 fi
9429 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9430 fi
9431         rm -f $cf_tempfile
9432
9433 fi
9434 echo "$as_me:9434: result: $cf_cv_ncurses_version" >&5
9435 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9436 test "$cf_cv_ncurses_version" = no ||
9437 cat >>confdefs.h <<\EOF
9438 #define NCURSES 1
9439 EOF
9440
9441 cf_nculib_root=ncurses
9442         # This works, except for the special case where we find gpm, but
9443         # ncurses is in a nonstandard location via $LIBS, and we really want
9444         # to link gpm.
9445 cf_ncurses_LIBS=""
9446 cf_ncurses_SAVE="$LIBS"
9447 echo "$as_me:9447: checking for Gpm_Open in -lgpm" >&5
9448 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9449 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9450   echo $ECHO_N "(cached) $ECHO_C" >&6
9451 else
9452   ac_check_lib_save_LIBS=$LIBS
9453 LIBS="-lgpm  $LIBS"
9454 cat >conftest.$ac_ext <<_ACEOF
9455 #line 9455 "configure"
9456 #include "confdefs.h"
9457
9458 /* Override any gcc2 internal prototype to avoid an error.  */
9459 #ifdef __cplusplus
9460 extern "C"
9461 #endif
9462 /* We use char because int might match the return type of a gcc2
9463    builtin and then its argument prototype would still apply.  */
9464 char Gpm_Open ();
9465 int
9466 main (void)
9467 {
9468 Gpm_Open ();
9469   ;
9470   return 0;
9471 }
9472 _ACEOF
9473 rm -f conftest.$ac_objext conftest$ac_exeext
9474 if { (eval echo "$as_me:9474: \"$ac_link\"") >&5
9475   (eval $ac_link) 2>&5
9476   ac_status=$?
9477   echo "$as_me:9477: \$? = $ac_status" >&5
9478   (exit $ac_status); } &&
9479          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_lib_gpm_Gpm_Open=yes
9486 else
9487   echo "$as_me: failed program was:" >&5
9488 cat conftest.$ac_ext >&5
9489 ac_cv_lib_gpm_Gpm_Open=no
9490 fi
9491 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9492 LIBS=$ac_check_lib_save_LIBS
9493 fi
9494 echo "$as_me:9494: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9495 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9496 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9497   echo "$as_me:9497: checking for initscr in -lgpm" >&5
9498 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9499 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9500   echo $ECHO_N "(cached) $ECHO_C" >&6
9501 else
9502   ac_check_lib_save_LIBS=$LIBS
9503 LIBS="-lgpm  $LIBS"
9504 cat >conftest.$ac_ext <<_ACEOF
9505 #line 9505 "configure"
9506 #include "confdefs.h"
9507
9508 /* Override any gcc2 internal prototype to avoid an error.  */
9509 #ifdef __cplusplus
9510 extern "C"
9511 #endif
9512 /* We use char because int might match the return type of a gcc2
9513    builtin and then its argument prototype would still apply.  */
9514 char initscr ();
9515 int
9516 main (void)
9517 {
9518 initscr ();
9519   ;
9520   return 0;
9521 }
9522 _ACEOF
9523 rm -f conftest.$ac_objext conftest$ac_exeext
9524 if { (eval echo "$as_me:9524: \"$ac_link\"") >&5
9525   (eval $ac_link) 2>&5
9526   ac_status=$?
9527   echo "$as_me:9527: \$? = $ac_status" >&5
9528   (exit $ac_status); } &&
9529          { ac_try='test -s conftest$ac_exeext'
9530   { (eval echo "$as_me:9530: \"$ac_try\"") >&5
9531   (eval $ac_try) 2>&5
9532   ac_status=$?
9533   echo "$as_me:9533: \$? = $ac_status" >&5
9534   (exit $ac_status); }; }; then
9535   ac_cv_lib_gpm_initscr=yes
9536 else
9537   echo "$as_me: failed program was:" >&5
9538 cat conftest.$ac_ext >&5
9539 ac_cv_lib_gpm_initscr=no
9540 fi
9541 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9542 LIBS=$ac_check_lib_save_LIBS
9543 fi
9544 echo "$as_me:9544: result: $ac_cv_lib_gpm_initscr" >&5
9545 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9546 if test $ac_cv_lib_gpm_initscr = yes; then
9547   LIBS="$cf_ncurses_SAVE"
9548 else
9549   cf_ncurses_LIBS="-lgpm"
9550 fi
9551
9552 fi
9553
9554 case $host_os in
9555 (freebsd*)
9556         # This is only necessary if you are linking against an obsolete
9557         # version of ncurses (but it should do no harm, since it's static).
9558         if test "$cf_nculib_root" = ncurses ; then
9559                 echo "$as_me:9559: checking for tgoto in -lmytinfo" >&5
9560 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9561 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9562   echo $ECHO_N "(cached) $ECHO_C" >&6
9563 else
9564   ac_check_lib_save_LIBS=$LIBS
9565 LIBS="-lmytinfo  $LIBS"
9566 cat >conftest.$ac_ext <<_ACEOF
9567 #line 9567 "configure"
9568 #include "confdefs.h"
9569
9570 /* Override any gcc2 internal prototype to avoid an error.  */
9571 #ifdef __cplusplus
9572 extern "C"
9573 #endif
9574 /* We use char because int might match the return type of a gcc2
9575    builtin and then its argument prototype would still apply.  */
9576 char tgoto ();
9577 int
9578 main (void)
9579 {
9580 tgoto ();
9581   ;
9582   return 0;
9583 }
9584 _ACEOF
9585 rm -f conftest.$ac_objext conftest$ac_exeext
9586 if { (eval echo "$as_me:9586: \"$ac_link\"") >&5
9587   (eval $ac_link) 2>&5
9588   ac_status=$?
9589   echo "$as_me:9589: \$? = $ac_status" >&5
9590   (exit $ac_status); } &&
9591          { ac_try='test -s conftest$ac_exeext'
9592   { (eval echo "$as_me:9592: \"$ac_try\"") >&5
9593   (eval $ac_try) 2>&5
9594   ac_status=$?
9595   echo "$as_me:9595: \$? = $ac_status" >&5
9596   (exit $ac_status); }; }; then
9597   ac_cv_lib_mytinfo_tgoto=yes
9598 else
9599   echo "$as_me: failed program was:" >&5
9600 cat conftest.$ac_ext >&5
9601 ac_cv_lib_mytinfo_tgoto=no
9602 fi
9603 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9604 LIBS=$ac_check_lib_save_LIBS
9605 fi
9606 echo "$as_me:9606: result: $ac_cv_lib_mytinfo_tgoto" >&5
9607 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9608 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9609   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9610 fi
9611
9612         fi
9613         ;;
9614 esac
9615
9616 cf_add_libs="$cf_ncurses_LIBS"
9617 # Filter out duplicates - this happens with badly-designed ".pc" files...
9618 for cf_add_1lib in $LIBS
9619 do
9620         for cf_add_2lib in $cf_add_libs
9621         do
9622                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9623                 then
9624                         cf_add_1lib=
9625                         break
9626                 fi
9627         done
9628         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9629 done
9630 LIBS="$cf_add_libs"
9631
9632 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9633 then
9634
9635 cf_add_libs="-l$cf_nculib_root"
9636 # Filter out duplicates - this happens with badly-designed ".pc" files...
9637 for cf_add_1lib in $LIBS
9638 do
9639         for cf_add_2lib in $cf_add_libs
9640         do
9641                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9642                 then
9643                         cf_add_1lib=
9644                         break
9645                 fi
9646         done
9647         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9648 done
9649 LIBS="$cf_add_libs"
9650
9651 else
9652
9653         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9654         cf_libdir=""
9655         echo "$as_me:9655: checking for initscr" >&5
9656 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9657 if test "${ac_cv_func_initscr+set}" = set; then
9658   echo $ECHO_N "(cached) $ECHO_C" >&6
9659 else
9660   cat >conftest.$ac_ext <<_ACEOF
9661 #line 9661 "configure"
9662 #include "confdefs.h"
9663 /* System header to define __stub macros and hopefully few prototypes,
9664     which can conflict with char initscr (); below.  */
9665 #include <assert.h>
9666 /* Override any gcc2 internal prototype to avoid an error.  */
9667 #ifdef __cplusplus
9668 extern "C"
9669 #endif
9670 /* We use char because int might match the return type of a gcc2
9671    builtin and then its argument prototype would still apply.  */
9672 char initscr ();
9673 char (*f) ();
9674
9675 int
9676 main (void)
9677 {
9678 /* The GNU C library defines this for functions which it implements
9679     to always fail with ENOSYS.  Some functions are actually named
9680     something starting with __ and the normal name is an alias.  */
9681 #if defined (__stub_initscr) || defined (__stub___initscr)
9682 choke me
9683 #else
9684 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9685 #endif
9686
9687   ;
9688   return 0;
9689 }
9690 _ACEOF
9691 rm -f conftest.$ac_objext conftest$ac_exeext
9692 if { (eval echo "$as_me:9692: \"$ac_link\"") >&5
9693   (eval $ac_link) 2>&5
9694   ac_status=$?
9695   echo "$as_me:9695: \$? = $ac_status" >&5
9696   (exit $ac_status); } &&
9697          { ac_try='test -s conftest$ac_exeext'
9698   { (eval echo "$as_me:9698: \"$ac_try\"") >&5
9699   (eval $ac_try) 2>&5
9700   ac_status=$?
9701   echo "$as_me:9701: \$? = $ac_status" >&5
9702   (exit $ac_status); }; }; then
9703   ac_cv_func_initscr=yes
9704 else
9705   echo "$as_me: failed program was:" >&5
9706 cat conftest.$ac_ext >&5
9707 ac_cv_func_initscr=no
9708 fi
9709 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9710 fi
9711 echo "$as_me:9711: result: $ac_cv_func_initscr" >&5
9712 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9713 if test $ac_cv_func_initscr = yes; then
9714   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9715 else
9716
9717                 cf_save_LIBS="$LIBS"
9718                 echo "$as_me:9718: checking for initscr in -l$cf_nculib_root" >&5
9719 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9720                 LIBS="-l$cf_nculib_root $LIBS"
9721                 cat >conftest.$ac_ext <<_ACEOF
9722 #line 9722 "configure"
9723 #include "confdefs.h"
9724 #include <${cf_cv_ncurses_header:-curses.h}>
9725 int
9726 main (void)
9727 {
9728 initscr()
9729   ;
9730   return 0;
9731 }
9732 _ACEOF
9733 rm -f conftest.$ac_objext conftest$ac_exeext
9734 if { (eval echo "$as_me:9734: \"$ac_link\"") >&5
9735   (eval $ac_link) 2>&5
9736   ac_status=$?
9737   echo "$as_me:9737: \$? = $ac_status" >&5
9738   (exit $ac_status); } &&
9739          { ac_try='test -s conftest$ac_exeext'
9740   { (eval echo "$as_me:9740: \"$ac_try\"") >&5
9741   (eval $ac_try) 2>&5
9742   ac_status=$?
9743   echo "$as_me:9743: \$? = $ac_status" >&5
9744   (exit $ac_status); }; }; then
9745   echo "$as_me:9745: result: yes" >&5
9746 echo "${ECHO_T}yes" >&6
9747                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9748
9749 else
9750   echo "$as_me: failed program was:" >&5
9751 cat conftest.$ac_ext >&5
9752 echo "$as_me:9752: result: no" >&5
9753 echo "${ECHO_T}no" >&6
9754
9755 cf_search=
9756 cf_library_path_list=""
9757 if test -n "${LDFLAGS}${LIBS}" ; then
9758         for cf_library_path in $LDFLAGS $LIBS
9759         do
9760                 case $cf_library_path in
9761                 (-L*)
9762                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9763
9764 test "x$cf_library_path" != "xNONE" && \
9765 test -d "$cf_library_path" && \
9766  {
9767         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9768         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9769         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9770         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9771         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9772         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"
9773 }
9774
9775                         cf_library_path_list="$cf_library_path_list $cf_search"
9776                         ;;
9777                 esac
9778         done
9779 fi
9780
9781 cf_search=
9782
9783 test "x$prefix" != "xNONE" && \
9784 test -d "$prefix" && \
9785  {
9786         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9787         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9788         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9789         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9790         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9791         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9792 }
9793
9794 for cf_subdir_prefix in \
9795         /usr \
9796         /usr/local \
9797         /usr/pkg \
9798         /opt \
9799         /opt/local \
9800         $HOME
9801 do
9802
9803 test "x$cf_subdir_prefix" != "x$prefix" && \
9804 test -d "$cf_subdir_prefix" && \
9805 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9806         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9807         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9808         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9809         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9810         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9811         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"
9812 }
9813
9814 done
9815
9816 cf_search="$cf_library_path_list $cf_search"
9817
9818                         for cf_libdir in $cf_search
9819                         do
9820                                 echo "$as_me:9820: checking for -l$cf_nculib_root in $cf_libdir" >&5
9821 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9822                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9823                                 cat >conftest.$ac_ext <<_ACEOF
9824 #line 9824 "configure"
9825 #include "confdefs.h"
9826 #include <${cf_cv_ncurses_header:-curses.h}>
9827 int
9828 main (void)
9829 {
9830 initscr()
9831   ;
9832   return 0;
9833 }
9834 _ACEOF
9835 rm -f conftest.$ac_objext conftest$ac_exeext
9836 if { (eval echo "$as_me:9836: \"$ac_link\"") >&5
9837   (eval $ac_link) 2>&5
9838   ac_status=$?
9839   echo "$as_me:9839: \$? = $ac_status" >&5
9840   (exit $ac_status); } &&
9841          { ac_try='test -s conftest$ac_exeext'
9842   { (eval echo "$as_me:9842: \"$ac_try\"") >&5
9843   (eval $ac_try) 2>&5
9844   ac_status=$?
9845   echo "$as_me:9845: \$? = $ac_status" >&5
9846   (exit $ac_status); }; }; then
9847   echo "$as_me:9847: result: yes" >&5
9848 echo "${ECHO_T}yes" >&6
9849                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9850                                          break
9851 else
9852   echo "$as_me: failed program was:" >&5
9853 cat conftest.$ac_ext >&5
9854 echo "$as_me:9854: result: no" >&5
9855 echo "${ECHO_T}no" >&6
9856                                          LIBS="$cf_save_LIBS"
9857 fi
9858 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9859                         done
9860
9861 fi
9862 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9863
9864 fi
9865
9866 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9867
9868 if test $cf_found_library = no ; then
9869         { { echo "$as_me:9869: error: Cannot link $cf_nculib_root library" >&5
9870 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9871    { (exit 1); exit 1; }; }
9872 fi
9873
9874 fi
9875
9876 if test -n "$cf_ncurses_LIBS" ; then
9877         echo "$as_me:9877: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9878 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9879         cf_ncurses_SAVE="$LIBS"
9880         for p in $cf_ncurses_LIBS ; do
9881                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9882                 if test "$q" != "$LIBS" ; then
9883                         LIBS="$q"
9884                 fi
9885         done
9886         cat >conftest.$ac_ext <<_ACEOF
9887 #line 9887 "configure"
9888 #include "confdefs.h"
9889 #include <${cf_cv_ncurses_header:-curses.h}>
9890 int
9891 main (void)
9892 {
9893 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9894   ;
9895   return 0;
9896 }
9897 _ACEOF
9898 rm -f conftest.$ac_objext conftest$ac_exeext
9899 if { (eval echo "$as_me:9899: \"$ac_link\"") >&5
9900   (eval $ac_link) 2>&5
9901   ac_status=$?
9902   echo "$as_me:9902: \$? = $ac_status" >&5
9903   (exit $ac_status); } &&
9904          { ac_try='test -s conftest$ac_exeext'
9905   { (eval echo "$as_me:9905: \"$ac_try\"") >&5
9906   (eval $ac_try) 2>&5
9907   ac_status=$?
9908   echo "$as_me:9908: \$? = $ac_status" >&5
9909   (exit $ac_status); }; }; then
9910   echo "$as_me:9910: result: yes" >&5
9911 echo "${ECHO_T}yes" >&6
9912 else
9913   echo "$as_me: failed program was:" >&5
9914 cat conftest.$ac_ext >&5
9915 echo "$as_me:9915: result: no" >&5
9916 echo "${ECHO_T}no" >&6
9917                  LIBS="$cf_ncurses_SAVE"
9918 fi
9919 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9920 fi
9921
9922 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9923
9924 cat >>confdefs.h <<EOF
9925 #define $cf_nculib_ROOT 1
9926 EOF
9927
9928         fi
9929 else
9930         NCURSES_CONFIG=none
9931 fi
9932
9933 fi
9934
9935 if test "$NCURSES_CONFIG_PKG" != none ; then
9936         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
9937
9938         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9939         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9940         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9941
9942         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
9943         if test -z "$cf_cv_abi_version"
9944         then
9945                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
9946         fi
9947
9948 elif test "$NCURSES_CONFIG" != none ; then
9949
9950         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
9951
9952         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9953         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9954         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9955
9956         # ABI version is not available from headers
9957         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
9958
9959 else
9960
9961         for cf_name in MAJOR MINOR PATCH
9962         do
9963         cat >conftest.$ac_ext <<CF_EOF
9964         #include <${cf_cv_ncurses_header:-curses.h}>
9965         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
9966 CF_EOF
9967                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
9968                 { (eval echo "$as_me:9968: \"$cf_try\"") >&5
9969   (eval $cf_try) 2>&5
9970   ac_status=$?
9971   echo "$as_me:9971: \$? = $ac_status" >&5
9972   (exit $ac_status); }
9973                 if test -f conftest.out ; then
9974                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
9975                         eval NCURSES_$cf_name=\"$cf_result\"
9976                         # cat conftest.$ac_ext
9977                         # cat conftest.out
9978                 fi
9979         done
9980
9981         cf_cv_abi_version=${NCURSES_MAJOR}
9982
9983 fi
9984
9985 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
9986
9987 cf_cv_timestamp=`date`
9988
9989 echo "$as_me:9989: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
9990 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
9991
9992 echo "$as_me:9992: checking if you want to have a library-prefix" >&5
9993 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
9994
9995 # Check whether --with-lib-prefix or --without-lib-prefix was given.
9996 if test "${with_lib_prefix+set}" = set; then
9997   withval="$with_lib_prefix"
9998   with_lib_prefix=$withval
9999 else
10000   with_lib_prefix=auto
10001 fi;
10002 echo "$as_me:10002: result: $with_lib_prefix" >&5
10003 echo "${ECHO_T}$with_lib_prefix" >&6
10004
10005 if test $with_lib_prefix = auto
10006 then
10007
10008         case $cf_cv_system_name in
10009         (OS/2*|os2*)
10010                 if test "$DFT_LWR_MODEL" = libtool; then
10011                         LIB_PREFIX='lib'
10012                 else
10013                         LIB_PREFIX=''
10014                 fi
10015                 ;;
10016         (*)     LIB_PREFIX='lib'
10017                 ;;
10018         esac
10019 cf_prefix=$LIB_PREFIX
10020
10021 elif test $with_lib_prefix = no
10022 then
10023         LIB_PREFIX=
10024 else
10025         LIB_PREFIX=$with_lib_prefix
10026 fi
10027
10028 LIB_SUFFIX=
10029
10030 ###############################################################################
10031
10032 if test X"$CC_G_OPT" = X"" ; then
10033         CC_G_OPT='-g'
10034         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10035 fi
10036
10037 echo "$as_me:10037: checking for default loader flags" >&5
10038 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10039 case $DFT_LWR_MODEL in
10040 (normal)  LD_MODEL=''   ;;
10041 (debug)   LD_MODEL=$CC_G_OPT ;;
10042 (profile) LD_MODEL='-pg';;
10043 (shared)  LD_MODEL=''   ;;
10044 esac
10045 echo "$as_me:10045: result: $LD_MODEL" >&5
10046 echo "${ECHO_T}$LD_MODEL" >&6
10047
10048 LD_RPATH_OPT=
10049 echo "$as_me:10049: checking for an rpath option" >&5
10050 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10051 case $cf_cv_system_name in
10052 (irix*)
10053         if test "$GCC" = yes; then
10054                 LD_RPATH_OPT="-Wl,-rpath,"
10055         else
10056                 LD_RPATH_OPT="-rpath "
10057         fi
10058         ;;
10059 (linux*|gnu*|k*bsd*-gnu|freebsd*)
10060         LD_RPATH_OPT="-Wl,-rpath,"
10061         ;;
10062 (openbsd[2-9].*|mirbsd*)
10063         LD_RPATH_OPT="-Wl,-rpath,"
10064         ;;
10065 (dragonfly*)
10066         LD_RPATH_OPT="-rpath "
10067         ;;
10068 (netbsd*)
10069         LD_RPATH_OPT="-Wl,-rpath,"
10070         ;;
10071 (osf*|mls+*)
10072         LD_RPATH_OPT="-rpath "
10073         ;;
10074 (solaris2*)
10075         LD_RPATH_OPT="-R"
10076         ;;
10077 (*)
10078         ;;
10079 esac
10080 echo "$as_me:10080: result: $LD_RPATH_OPT" >&5
10081 echo "${ECHO_T}$LD_RPATH_OPT" >&6
10082
10083 case "x$LD_RPATH_OPT" in
10084 (x-R*)
10085         echo "$as_me:10085: checking if we need a space after rpath option" >&5
10086 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
10087         cf_save_LIBS="$LIBS"
10088
10089 cf_add_libs="${LD_RPATH_OPT}$libdir"
10090 # Filter out duplicates - this happens with badly-designed ".pc" files...
10091 for cf_add_1lib in $LIBS
10092 do
10093         for cf_add_2lib in $cf_add_libs
10094         do
10095                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10096                 then
10097                         cf_add_1lib=
10098                         break
10099                 fi
10100         done
10101         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10102 done
10103 LIBS="$cf_add_libs"
10104
10105         cat >conftest.$ac_ext <<_ACEOF
10106 #line 10106 "configure"
10107 #include "confdefs.h"
10108
10109 int
10110 main (void)
10111 {
10112
10113   ;
10114   return 0;
10115 }
10116 _ACEOF
10117 rm -f conftest.$ac_objext conftest$ac_exeext
10118 if { (eval echo "$as_me:10118: \"$ac_link\"") >&5
10119   (eval $ac_link) 2>&5
10120   ac_status=$?
10121   echo "$as_me:10121: \$? = $ac_status" >&5
10122   (exit $ac_status); } &&
10123          { ac_try='test -s conftest$ac_exeext'
10124   { (eval echo "$as_me:10124: \"$ac_try\"") >&5
10125   (eval $ac_try) 2>&5
10126   ac_status=$?
10127   echo "$as_me:10127: \$? = $ac_status" >&5
10128   (exit $ac_status); }; }; then
10129   cf_rpath_space=no
10130 else
10131   echo "$as_me: failed program was:" >&5
10132 cat conftest.$ac_ext >&5
10133 cf_rpath_space=yes
10134 fi
10135 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10136         LIBS="$cf_save_LIBS"
10137         echo "$as_me:10137: result: $cf_rpath_space" >&5
10138 echo "${ECHO_T}$cf_rpath_space" >&6
10139         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
10140         ;;
10141 esac
10142
10143         RM_SHARED_OPTS=
10144         LOCAL_LDFLAGS=
10145         LOCAL_LDFLAGS2=
10146         LD_SHARED_OPTS=
10147         INSTALL_LIB="-m 644"
10148         : ${rel_builddir:=.}
10149
10150         shlibdir=$libdir
10151
10152         MAKE_DLLS="#"
10153
10154         cf_cv_do_symlinks=no
10155         cf_ld_rpath_opt=
10156         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
10157
10158         echo "$as_me:10158: checking if release/abi version should be used for shared libs" >&5
10159 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
10160
10161 # Check whether --with-shlib-version or --without-shlib-version was given.
10162 if test "${with_shlib_version+set}" = set; then
10163   withval="$with_shlib_version"
10164   test -z "$withval" && withval=auto
10165         case $withval in
10166         (yes)
10167                 cf_cv_shlib_version=auto
10168                 ;;
10169         (rel|abi|auto)
10170                 cf_cv_shlib_version=$withval
10171                 ;;
10172         (*)
10173                 echo "$as_me:10173: result: $withval" >&5
10174 echo "${ECHO_T}$withval" >&6
10175                 { { echo "$as_me:10175: error: option value must be one of: rel, abi, or auto" >&5
10176 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
10177    { (exit 1); exit 1; }; }
10178                 ;;
10179         esac
10180
10181 else
10182   cf_cv_shlib_version=auto
10183 fi;
10184         echo "$as_me:10184: result: $cf_cv_shlib_version" >&5
10185 echo "${ECHO_T}$cf_cv_shlib_version" >&6
10186
10187         cf_cv_rm_so_locs=no
10188         cf_try_cflags=
10189
10190         # Some less-capable ports of gcc support only -fpic
10191         CC_SHARED_OPTS=
10192
10193         cf_try_fPIC=no
10194         if test "$GCC" = yes
10195         then
10196                 cf_try_fPIC=yes
10197         else
10198                 case $cf_cv_system_name in
10199                 (*linux*)       # e.g., PGI compiler
10200                         cf_try_fPIC=yes
10201                         ;;
10202                 esac
10203         fi
10204
10205         if test "$cf_try_fPIC" = yes
10206         then
10207                 echo "$as_me:10207: checking which $CC option to use" >&5
10208 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
10209                 cf_save_CFLAGS="$CFLAGS"
10210                 for CC_SHARED_OPTS in -fPIC -fpic ''
10211                 do
10212                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
10213                         cat >conftest.$ac_ext <<_ACEOF
10214 #line 10214 "configure"
10215 #include "confdefs.h"
10216 #include <stdio.h>
10217 int
10218 main (void)
10219 {
10220 int x = 1
10221   ;
10222   return 0;
10223 }
10224 _ACEOF
10225 rm -f conftest.$ac_objext
10226 if { (eval echo "$as_me:10226: \"$ac_compile\"") >&5
10227   (eval $ac_compile) 2>&5
10228   ac_status=$?
10229   echo "$as_me:10229: \$? = $ac_status" >&5
10230   (exit $ac_status); } &&
10231          { ac_try='test -s conftest.$ac_objext'
10232   { (eval echo "$as_me:10232: \"$ac_try\"") >&5
10233   (eval $ac_try) 2>&5
10234   ac_status=$?
10235   echo "$as_me:10235: \$? = $ac_status" >&5
10236   (exit $ac_status); }; }; then
10237   break
10238 else
10239   echo "$as_me: failed program was:" >&5
10240 cat conftest.$ac_ext >&5
10241 fi
10242 rm -f conftest.$ac_objext conftest.$ac_ext
10243                 done
10244                 echo "$as_me:10244: result: $CC_SHARED_OPTS" >&5
10245 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
10246                 CFLAGS="$cf_save_CFLAGS"
10247         fi
10248
10249         cf_cv_shlib_version_infix=no
10250
10251         case $cf_cv_system_name in
10252         (aix4.3-9*|aix[5-7]*)
10253                 if test "$GCC" = yes; then
10254                         CC_SHARED_OPTS='-Wl,-brtl'
10255                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10256                 else
10257                         CC_SHARED_OPTS='-brtl'
10258                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
10259                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10260                 fi
10261                 ;;
10262         (beos*)
10263                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
10264                 ;;
10265         (cygwin*)
10266                 CC_SHARED_OPTS=
10267                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10268                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10269                 cf_cv_shlib_version=cygdll
10270                 cf_cv_shlib_version_infix=cygdll
10271                 shlibdir=$bindir
10272                 MAKE_DLLS=
10273                 cat >mk_shared_lib.sh <<-CF_EOF
10274                 #!$SHELL
10275                 SHARED_LIB=\$1
10276                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10277                 shift
10278                 cat <<-EOF
10279                 Linking shared library
10280                 ** SHARED_LIB \$SHARED_LIB
10281                 ** IMPORT_LIB \$IMPORT_LIB
10282 EOF
10283                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10284 CF_EOF
10285                 chmod +x mk_shared_lib.sh
10286                 ;;
10287         (msys*)
10288                 CC_SHARED_OPTS=
10289                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10290                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10291                 cf_cv_shlib_version=msysdll
10292                 cf_cv_shlib_version_infix=msysdll
10293                 shlibdir=$bindir
10294                 MAKE_DLLS=
10295                 cat >mk_shared_lib.sh <<-CF_EOF
10296                 #!$SHELL
10297                 SHARED_LIB=\$1
10298                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10299                 shift
10300                 cat <<-EOF
10301                 Linking shared library
10302                 ** SHARED_LIB \$SHARED_LIB
10303                 ** IMPORT_LIB \$IMPORT_LIB
10304 EOF
10305                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10306 CF_EOF
10307                 chmod +x mk_shared_lib.sh
10308                 ;;
10309         (darwin*)
10310                 cf_try_cflags="no-cpp-precomp"
10311                 CC_SHARED_OPTS="-dynamic"
10312                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
10313                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
10314                 cf_cv_shlib_version_infix=yes
10315                 echo "$as_me:10315: checking if ld -search_paths_first works" >&5
10316 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
10317 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
10318   echo $ECHO_N "(cached) $ECHO_C" >&6
10319 else
10320
10321                         cf_save_LDFLAGS=$LDFLAGS
10322                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10323                         cat >conftest.$ac_ext <<_ACEOF
10324 #line 10324 "configure"
10325 #include "confdefs.h"
10326
10327 int
10328 main (void)
10329 {
10330 int i;
10331   ;
10332   return 0;
10333 }
10334 _ACEOF
10335 rm -f conftest.$ac_objext conftest$ac_exeext
10336 if { (eval echo "$as_me:10336: \"$ac_link\"") >&5
10337   (eval $ac_link) 2>&5
10338   ac_status=$?
10339   echo "$as_me:10339: \$? = $ac_status" >&5
10340   (exit $ac_status); } &&
10341          { ac_try='test -s conftest$ac_exeext'
10342   { (eval echo "$as_me:10342: \"$ac_try\"") >&5
10343   (eval $ac_try) 2>&5
10344   ac_status=$?
10345   echo "$as_me:10345: \$? = $ac_status" >&5
10346   (exit $ac_status); }; }; then
10347   cf_cv_ldflags_search_paths_first=yes
10348 else
10349   echo "$as_me: failed program was:" >&5
10350 cat conftest.$ac_ext >&5
10351 cf_cv_ldflags_search_paths_first=no
10352 fi
10353 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10354                                 LDFLAGS=$cf_save_LDFLAGS
10355 fi
10356 echo "$as_me:10356: result: $cf_cv_ldflags_search_paths_first" >&5
10357 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
10358                 if test $cf_cv_ldflags_search_paths_first = yes; then
10359                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10360                 fi
10361                 ;;
10362         (hpux[7-8]*)
10363                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
10364                 if test "$GCC" != yes; then
10365                         CC_SHARED_OPTS='+Z'
10366                 fi
10367                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
10368                 INSTALL_LIB="-m 555"
10369                 ;;
10370         (hpux*)
10371                 # (tested with gcc 2.7.2 -- I don't have c89)
10372                 if test "$GCC" = yes; then
10373                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
10374                 else
10375                         CC_SHARED_OPTS='+Z'
10376                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
10377                 fi
10378                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
10379                 # HP-UX shared libraries must be executable, and should be
10380                 # readonly to exploit a quirk in the memory manager.
10381                 INSTALL_LIB="-m 555"
10382                 ;;
10383         (interix*)
10384                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10385                 if test "$cf_cv_shlib_version" = rel; then
10386                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10387                 else
10388                         cf_shared_soname='`basename $@`'
10389                 fi
10390                 CC_SHARED_OPTS=
10391                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
10392                 ;;
10393         (irix*)
10394                 if test "$cf_cv_enable_rpath" = yes ; then
10395                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10396                 fi
10397                 # tested with IRIX 5.2 and 'cc'.
10398                 if test "$GCC" != yes; then
10399                         CC_SHARED_OPTS='-KPIC'
10400                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
10401                 else
10402                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
10403                 fi
10404                 cf_cv_rm_so_locs=yes
10405                 ;;
10406         (linux*|gnu*|k*bsd*-gnu)
10407                 if test "$DFT_LWR_MODEL" = "shared" ; then
10408                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10409                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10410                 fi
10411                 if test "$cf_cv_enable_rpath" = yes ; then
10412                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10413                 fi
10414
10415         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10416         if test "$cf_cv_shlib_version" = rel; then
10417                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10418         else
10419                 cf_cv_shared_soname='`basename $@`'
10420         fi
10421
10422                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10423                 ;;
10424         (mingw*)
10425                 cf_cv_shlib_version=mingw
10426                 cf_cv_shlib_version_infix=mingw
10427                 shlibdir=$bindir
10428                 MAKE_DLLS=
10429                 if test "$DFT_LWR_MODEL" = "shared" ; then
10430                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
10431                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10432                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
10433                 fi
10434                 CC_SHARED_OPTS=
10435                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10436                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10437                 cat >mk_shared_lib.sh <<-CF_EOF
10438                 #!$SHELL
10439                 SHARED_LIB=\$1
10440                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
10441                 shift
10442                 cat <<-EOF
10443                 Linking shared library
10444                 ** SHARED_LIB \$SHARED_LIB
10445                 ** IMPORT_LIB \$IMPORT_LIB
10446 EOF
10447                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10448 CF_EOF
10449                 chmod +x mk_shared_lib.sh
10450                 ;;
10451         (openbsd[2-9].*|mirbsd*)
10452                 if test "$DFT_LWR_MODEL" = "shared" ; then
10453                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10454                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10455                 fi
10456                 if test "$cf_cv_enable_rpath" = yes ; then
10457                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10458                 fi
10459                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10460
10461         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10462         if test "$cf_cv_shlib_version" = rel; then
10463                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10464         else
10465                 cf_cv_shared_soname='`basename $@`'
10466         fi
10467
10468                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10469                 ;;
10470         (nto-qnx*|openbsd*|freebsd[12].*)
10471                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10472                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
10473                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10474                 ;;
10475         (dragonfly*|freebsd*)
10476                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10477                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10478                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10479                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
10480                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10481                 fi
10482
10483         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10484         if test "$cf_cv_shlib_version" = rel; then
10485                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10486         else
10487                 cf_cv_shared_soname='`basename $@`'
10488         fi
10489
10490                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10491                 ;;
10492         (netbsd*)
10493                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10494                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10495                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10496                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10497                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10498                         if test "$cf_cv_shlib_version" = auto; then
10499                         if test -f /usr/libexec/ld.elf_so; then
10500                                 cf_cv_shlib_version=abi
10501                         else
10502                                 cf_cv_shlib_version=rel
10503                         fi
10504                         fi
10505
10506         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10507         if test "$cf_cv_shlib_version" = rel; then
10508                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10509         else
10510                 cf_cv_shared_soname='`basename $@`'
10511         fi
10512
10513                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
10514                 else
10515                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
10516                 fi
10517                 ;;
10518         (osf*|mls+*)
10519                 # tested with OSF/1 V3.2 and 'cc'
10520                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
10521                 # link with shared libs).
10522                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
10523                 case $host_os in
10524                 (osf4*)
10525                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
10526                         ;;
10527                 esac
10528                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
10529                 if test "$DFT_LWR_MODEL" = "shared" ; then
10530                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10531                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10532                 fi
10533                 cf_cv_rm_so_locs=yes
10534                 ;;
10535         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
10536                 # tested with osr5.0.5
10537                 if test "$GCC" != yes; then
10538                         CC_SHARED_OPTS='-belf -KPIC'
10539                 fi
10540                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
10541                 if test "$cf_cv_enable_rpath" = yes ; then
10542                         # only way is to set LD_RUN_PATH but no switch for it
10543                         RUN_PATH=$libdir
10544                 fi
10545                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10546                 LINK_PROGS='LD_RUN_PATH=${libdir}'
10547                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
10548                 ;;
10549         (sunos4*)
10550                 # tested with SunOS 4.1.1 and gcc 2.7.0
10551                 if test "$GCC" != yes; then
10552                         CC_SHARED_OPTS='-KPIC'
10553                 fi
10554                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
10555                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10556                 ;;
10557         (solaris2*)
10558                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
10559                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
10560                 if test "$DFT_LWR_MODEL" = "shared" ; then
10561                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
10562                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10563                 fi
10564                 if test "$cf_cv_enable_rpath" = yes ; then
10565                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
10566                 fi
10567
10568         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10569         if test "$cf_cv_shlib_version" = rel; then
10570                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10571         else
10572                 cf_cv_shared_soname='`basename $@`'
10573         fi
10574
10575                 if test "$GCC" != yes; then
10576                         cf_save_CFLAGS="$CFLAGS"
10577                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
10578                         do
10579                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
10580                                 cat >conftest.$ac_ext <<_ACEOF
10581 #line 10581 "configure"
10582 #include "confdefs.h"
10583 #include <stdio.h>
10584 int
10585 main (void)
10586 {
10587 printf("Hello\n");
10588   ;
10589   return 0;
10590 }
10591 _ACEOF
10592 rm -f conftest.$ac_objext
10593 if { (eval echo "$as_me:10593: \"$ac_compile\"") >&5
10594   (eval $ac_compile) 2>&5
10595   ac_status=$?
10596   echo "$as_me:10596: \$? = $ac_status" >&5
10597   (exit $ac_status); } &&
10598          { ac_try='test -s conftest.$ac_objext'
10599   { (eval echo "$as_me:10599: \"$ac_try\"") >&5
10600   (eval $ac_try) 2>&5
10601   ac_status=$?
10602   echo "$as_me:10602: \$? = $ac_status" >&5
10603   (exit $ac_status); }; }; then
10604   break
10605 else
10606   echo "$as_me: failed program was:" >&5
10607 cat conftest.$ac_ext >&5
10608 fi
10609 rm -f conftest.$ac_objext conftest.$ac_ext
10610                         done
10611                         CFLAGS="$cf_save_CFLAGS"
10612                         CC_SHARED_OPTS=$cf_shared_opts
10613                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
10614                 else
10615                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
10616                 fi
10617                 ;;
10618         (sysv5uw7*|unix_sv*)
10619                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
10620                 if test "$GCC" != yes; then
10621                         CC_SHARED_OPTS='-KPIC'
10622                 fi
10623                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
10624                 ;;
10625         (*)
10626                 CC_SHARED_OPTS='unknown'
10627                 MK_SHARED_LIB='echo unknown'
10628                 ;;
10629         esac
10630
10631         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
10632         case "$cf_cv_shlib_version" in
10633         (rel|abi)
10634                 case "$MK_SHARED_LIB" in
10635                 (*'-o $@')
10636                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
10637                         ;;
10638                 (*)
10639                         { echo "$as_me:10639: WARNING: ignored --with-shlib-version" >&5
10640 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
10641                         ;;
10642                 esac
10643                 ;;
10644         esac
10645
10646         if test -n "$cf_try_cflags"
10647         then
10648 cat > conftest.$ac_ext <<EOF
10649 #line 10649 "${as_me:-configure}"
10650 #include <stdio.h>
10651 int main(int argc, char *argv[])
10652 {
10653         printf("hello\n");
10654         return (argv[argc-1] == 0) ;
10655 }
10656 EOF
10657                 cf_save_CFLAGS="$CFLAGS"
10658                 for cf_opt in $cf_try_cflags
10659                 do
10660                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
10661                         echo "$as_me:10661: checking if CFLAGS option -$cf_opt works" >&5
10662 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
10663                         if { (eval echo "$as_me:10663: \"$ac_compile\"") >&5
10664   (eval $ac_compile) 2>&5
10665   ac_status=$?
10666   echo "$as_me:10666: \$? = $ac_status" >&5
10667   (exit $ac_status); }; then
10668                                 echo "$as_me:10668: result: yes" >&5
10669 echo "${ECHO_T}yes" >&6
10670                                 cf_save_CFLAGS="$CFLAGS"
10671                         else
10672                                 echo "$as_me:10672: result: no" >&5
10673 echo "${ECHO_T}no" >&6
10674                         fi
10675                 done
10676                 CFLAGS="$cf_save_CFLAGS"
10677         fi
10678
10679         # RPATH_LIST is a colon-separated list of directories
10680         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
10681         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
10682
10683         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
10684
10685         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
10686
10687 echo "${as_me:-configure}:10687: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
10688
10689         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
10690
10691 echo "${as_me:-configure}:10691: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
10692
10693 # The test/sample programs in the original tree link using rpath option.
10694 # Make it optional for packagers.
10695 if test -n "$LOCAL_LDFLAGS"
10696 then
10697         echo "$as_me:10697: checking if you want to link sample programs with rpath option" >&5
10698 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
10699
10700 # Check whether --enable-rpath-link or --disable-rpath-link was given.
10701 if test "${enable_rpath_link+set}" = set; then
10702   enableval="$enable_rpath_link"
10703   with_rpath_link=$enableval
10704 else
10705   with_rpath_link=yes
10706 fi;
10707         echo "$as_me:10707: result: $with_rpath_link" >&5
10708 echo "${ECHO_T}$with_rpath_link" >&6
10709         if test "$with_rpath_link" = no
10710         then
10711                 LOCAL_LDFLAGS=
10712                 LOCAL_LDFLAGS2=
10713         fi
10714 fi
10715
10716 ###############################################################################
10717
10718 ###   use option --enable-broken-linker to force on use of broken-linker support
10719 echo "$as_me:10719: checking if you want broken-linker support code" >&5
10720 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
10721
10722 # Check whether --enable-broken_linker or --disable-broken_linker was given.
10723 if test "${enable_broken_linker+set}" = set; then
10724   enableval="$enable_broken_linker"
10725   with_broken_linker=$enableval
10726 else
10727   with_broken_linker=${BROKEN_LINKER:-no}
10728 fi;
10729 echo "$as_me:10729: result: $with_broken_linker" >&5
10730 echo "${ECHO_T}$with_broken_linker" >&6
10731
10732 BROKEN_LINKER=0
10733 if test "$with_broken_linker" = yes ; then
10734         cat >>confdefs.h <<\EOF
10735 #define BROKEN_LINKER 1
10736 EOF
10737
10738         BROKEN_LINKER=1
10739 elif test "$DFT_LWR_MODEL" = shared ; then
10740         case $cf_cv_system_name in
10741         (cygwin*)
10742                 cat >>confdefs.h <<\EOF
10743 #define BROKEN_LINKER 1
10744 EOF
10745
10746                 BROKEN_LINKER=1
10747                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
10748
10749 echo "${as_me:-configure}:10749: testing cygwin linker is broken anyway ..." 1>&5
10750
10751                 ;;
10752         esac
10753 fi
10754
10755 # Check to define _XOPEN_SOURCE "automatically"
10756
10757 cf_XOPEN_SOURCE=600
10758 cf_POSIX_C_SOURCE=199506L
10759 cf_xopen_source=
10760
10761 case $host_os in
10762 (aix[4-7]*)
10763         cf_xopen_source="-D_ALL_SOURCE"
10764         ;;
10765 (msys)
10766         cf_XOPEN_SOURCE=600
10767         ;;
10768 (darwin[0-8].*)
10769         cf_xopen_source="-D_APPLE_C_SOURCE"
10770         ;;
10771 (darwin*)
10772         cf_xopen_source="-D_DARWIN_C_SOURCE"
10773         cf_XOPEN_SOURCE=
10774         ;;
10775 (freebsd*|dragonfly*)
10776         # 5.x headers associate
10777         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
10778         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
10779         cf_POSIX_C_SOURCE=200112L
10780         cf_XOPEN_SOURCE=600
10781         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10782         ;;
10783 (hpux11*)
10784         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
10785         ;;
10786 (hpux*)
10787         cf_xopen_source="-D_HPUX_SOURCE"
10788         ;;
10789 (irix[56].*)
10790         cf_xopen_source="-D_SGI_SOURCE"
10791         cf_XOPEN_SOURCE=
10792         ;;
10793 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
10794
10795 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
10796
10797 echo "$as_me:10797: checking if this is the GNU C library" >&5
10798 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
10799 if test "${cf_cv_gnu_library+set}" = set; then
10800   echo $ECHO_N "(cached) $ECHO_C" >&6
10801 else
10802
10803 cat >conftest.$ac_ext <<_ACEOF
10804 #line 10804 "configure"
10805 #include "confdefs.h"
10806 #include <sys/types.h>
10807 int
10808 main (void)
10809 {
10810
10811         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
10812                 return 0;
10813         #else
10814         #       error not GNU C library
10815         #endif
10816   ;
10817   return 0;
10818 }
10819 _ACEOF
10820 rm -f conftest.$ac_objext
10821 if { (eval echo "$as_me:10821: \"$ac_compile\"") >&5
10822   (eval $ac_compile) 2>&5
10823   ac_status=$?
10824   echo "$as_me:10824: \$? = $ac_status" >&5
10825   (exit $ac_status); } &&
10826          { ac_try='test -s conftest.$ac_objext'
10827   { (eval echo "$as_me:10827: \"$ac_try\"") >&5
10828   (eval $ac_try) 2>&5
10829   ac_status=$?
10830   echo "$as_me:10830: \$? = $ac_status" >&5
10831   (exit $ac_status); }; }; then
10832   cf_cv_gnu_library=yes
10833 else
10834   echo "$as_me: failed program was:" >&5
10835 cat conftest.$ac_ext >&5
10836 cf_cv_gnu_library=no
10837 fi
10838 rm -f conftest.$ac_objext conftest.$ac_ext
10839
10840 fi
10841 echo "$as_me:10841: result: $cf_cv_gnu_library" >&5
10842 echo "${ECHO_T}$cf_cv_gnu_library" >&6
10843
10844 if test x$cf_cv_gnu_library = xyes; then
10845
10846         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
10847         # was changed to help a little...
10848         echo "$as_me:10848: checking if _DEFAULT_SOURCE can be used as a basis" >&5
10849 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
10850 if test "${cf_cv_gnu_library_219+set}" = set; then
10851   echo $ECHO_N "(cached) $ECHO_C" >&6
10852 else
10853
10854                 cf_save="$CPPFLAGS"
10855
10856         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10857         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
10858
10859                 cat >conftest.$ac_ext <<_ACEOF
10860 #line 10860 "configure"
10861 #include "confdefs.h"
10862 #include <sys/types.h>
10863 int
10864 main (void)
10865 {
10866
10867                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
10868                                 return 0;
10869                         #else
10870                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
10871                         #endif
10872   ;
10873   return 0;
10874 }
10875 _ACEOF
10876 rm -f conftest.$ac_objext
10877 if { (eval echo "$as_me:10877: \"$ac_compile\"") >&5
10878   (eval $ac_compile) 2>&5
10879   ac_status=$?
10880   echo "$as_me:10880: \$? = $ac_status" >&5
10881   (exit $ac_status); } &&
10882          { ac_try='test -s conftest.$ac_objext'
10883   { (eval echo "$as_me:10883: \"$ac_try\"") >&5
10884   (eval $ac_try) 2>&5
10885   ac_status=$?
10886   echo "$as_me:10886: \$? = $ac_status" >&5
10887   (exit $ac_status); }; }; then
10888   cf_cv_gnu_library_219=yes
10889 else
10890   echo "$as_me: failed program was:" >&5
10891 cat conftest.$ac_ext >&5
10892 cf_cv_gnu_library_219=no
10893 fi
10894 rm -f conftest.$ac_objext conftest.$ac_ext
10895                 CPPFLAGS="$cf_save"
10896
10897 fi
10898 echo "$as_me:10898: result: $cf_cv_gnu_library_219" >&5
10899 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
10900
10901         if test "x$cf_cv_gnu_library_219" = xyes; then
10902                 cf_save="$CPPFLAGS"
10903                 echo "$as_me:10903: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
10904 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
10905 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
10906   echo $ECHO_N "(cached) $ECHO_C" >&6
10907 else
10908
10909 cf_fix_cppflags=no
10910 cf_new_cflags=
10911 cf_new_cppflags=
10912 cf_new_extra_cppflags=
10913
10914 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
10915 do
10916 case $cf_fix_cppflags in
10917 (no)
10918         case $cf_add_cflags in
10919         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10920                 case $cf_add_cflags in
10921                 (-D*)
10922                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10923
10924                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10925                                 && test -z "${cf_tst_cflags}" \
10926                                 && cf_fix_cppflags=yes
10927
10928                         if test $cf_fix_cppflags = yes ; then
10929
10930         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10931         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10932
10933                                 continue
10934                         elif test "${cf_tst_cflags}" = "\"'" ; then
10935
10936         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10937         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10938
10939                                 continue
10940                         fi
10941                         ;;
10942                 esac
10943                 case "$CPPFLAGS" in
10944                 (*$cf_add_cflags)
10945                         ;;
10946                 (*)
10947                         case $cf_add_cflags in
10948                         (-D*)
10949                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10950
10951 CPPFLAGS=`echo "$CPPFLAGS" | \
10952         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10953                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10954
10955                                 ;;
10956                         esac
10957
10958         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10959         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10960
10961                         ;;
10962                 esac
10963                 ;;
10964         (*)
10965
10966         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10967         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10968
10969                 ;;
10970         esac
10971         ;;
10972 (yes)
10973
10974         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10975         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10976
10977         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10978
10979         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10980                 && test -z "${cf_tst_cflags}" \
10981                 && cf_fix_cppflags=no
10982         ;;
10983 esac
10984 done
10985
10986 if test -n "$cf_new_cflags" ; then
10987
10988         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10989         CFLAGS="${CFLAGS}$cf_new_cflags"
10990
10991 fi
10992
10993 if test -n "$cf_new_cppflags" ; then
10994
10995         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10996         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10997
10998 fi
10999
11000 if test -n "$cf_new_extra_cppflags" ; then
11001
11002         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11003         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11004
11005 fi
11006
11007                         cat >conftest.$ac_ext <<_ACEOF
11008 #line 11008 "configure"
11009 #include "confdefs.h"
11010
11011                                 #include <limits.h>
11012                                 #include <sys/types.h>
11013
11014 int
11015 main (void)
11016 {
11017
11018                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
11019                                         return 0;
11020                                 #else
11021                                 #       error GNU C library is too old
11022                                 #endif
11023   ;
11024   return 0;
11025 }
11026 _ACEOF
11027 rm -f conftest.$ac_objext
11028 if { (eval echo "$as_me:11028: \"$ac_compile\"") >&5
11029   (eval $ac_compile) 2>&5
11030   ac_status=$?
11031   echo "$as_me:11031: \$? = $ac_status" >&5
11032   (exit $ac_status); } &&
11033          { ac_try='test -s conftest.$ac_objext'
11034   { (eval echo "$as_me:11034: \"$ac_try\"") >&5
11035   (eval $ac_try) 2>&5
11036   ac_status=$?
11037   echo "$as_me:11037: \$? = $ac_status" >&5
11038   (exit $ac_status); }; }; then
11039   cf_cv_gnu_dftsrc_219=yes
11040 else
11041   echo "$as_me: failed program was:" >&5
11042 cat conftest.$ac_ext >&5
11043 cf_cv_gnu_dftsrc_219=no
11044 fi
11045 rm -f conftest.$ac_objext conftest.$ac_ext
11046
11047 fi
11048 echo "$as_me:11048: result: $cf_cv_gnu_dftsrc_219" >&5
11049 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
11050                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
11051         else
11052                 cf_cv_gnu_dftsrc_219=maybe
11053         fi
11054
11055         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
11056
11057                 echo "$as_me:11057: checking if we must define _GNU_SOURCE" >&5
11058 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
11059 if test "${cf_cv_gnu_source+set}" = set; then
11060   echo $ECHO_N "(cached) $ECHO_C" >&6
11061 else
11062
11063                 cat >conftest.$ac_ext <<_ACEOF
11064 #line 11064 "configure"
11065 #include "confdefs.h"
11066 #include <sys/types.h>
11067 int
11068 main (void)
11069 {
11070
11071                         #ifndef _XOPEN_SOURCE
11072                         #error  expected _XOPEN_SOURCE to be defined
11073                         #endif
11074   ;
11075   return 0;
11076 }
11077 _ACEOF
11078 rm -f conftest.$ac_objext
11079 if { (eval echo "$as_me:11079: \"$ac_compile\"") >&5
11080   (eval $ac_compile) 2>&5
11081   ac_status=$?
11082   echo "$as_me:11082: \$? = $ac_status" >&5
11083   (exit $ac_status); } &&
11084          { ac_try='test -s conftest.$ac_objext'
11085   { (eval echo "$as_me:11085: \"$ac_try\"") >&5
11086   (eval $ac_try) 2>&5
11087   ac_status=$?
11088   echo "$as_me:11088: \$? = $ac_status" >&5
11089   (exit $ac_status); }; }; then
11090   cf_cv_gnu_source=no
11091 else
11092   echo "$as_me: failed program was:" >&5
11093 cat conftest.$ac_ext >&5
11094 cf_save="$CPPFLAGS"
11095
11096 cf_fix_cppflags=no
11097 cf_new_cflags=
11098 cf_new_cppflags=
11099 cf_new_extra_cppflags=
11100
11101 for cf_add_cflags in -D_GNU_SOURCE
11102 do
11103 case $cf_fix_cppflags in
11104 (no)
11105         case $cf_add_cflags in
11106         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11107                 case $cf_add_cflags in
11108                 (-D*)
11109                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11110
11111                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11112                                 && test -z "${cf_tst_cflags}" \
11113                                 && cf_fix_cppflags=yes
11114
11115                         if test $cf_fix_cppflags = yes ; then
11116
11117         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11118         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11119
11120                                 continue
11121                         elif test "${cf_tst_cflags}" = "\"'" ; then
11122
11123         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11124         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11125
11126                                 continue
11127                         fi
11128                         ;;
11129                 esac
11130                 case "$CPPFLAGS" in
11131                 (*$cf_add_cflags)
11132                         ;;
11133                 (*)
11134                         case $cf_add_cflags in
11135                         (-D*)
11136                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11137
11138 CPPFLAGS=`echo "$CPPFLAGS" | \
11139         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11140                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11141
11142                                 ;;
11143                         esac
11144
11145         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11146         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11147
11148                         ;;
11149                 esac
11150                 ;;
11151         (*)
11152
11153         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11154         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11155
11156                 ;;
11157         esac
11158         ;;
11159 (yes)
11160
11161         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11162         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11163
11164         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11165
11166         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11167                 && test -z "${cf_tst_cflags}" \
11168                 && cf_fix_cppflags=no
11169         ;;
11170 esac
11171 done
11172
11173 if test -n "$cf_new_cflags" ; then
11174
11175         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11176         CFLAGS="${CFLAGS}$cf_new_cflags"
11177
11178 fi
11179
11180 if test -n "$cf_new_cppflags" ; then
11181
11182         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11183         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11184
11185 fi
11186
11187 if test -n "$cf_new_extra_cppflags" ; then
11188
11189         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11190         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11191
11192 fi
11193
11194                          cat >conftest.$ac_ext <<_ACEOF
11195 #line 11195 "configure"
11196 #include "confdefs.h"
11197 #include <sys/types.h>
11198 int
11199 main (void)
11200 {
11201
11202                                 #ifdef _XOPEN_SOURCE
11203                                 #error  expected _XOPEN_SOURCE to be undefined
11204                                 #endif
11205   ;
11206   return 0;
11207 }
11208 _ACEOF
11209 rm -f conftest.$ac_objext
11210 if { (eval echo "$as_me:11210: \"$ac_compile\"") >&5
11211   (eval $ac_compile) 2>&5
11212   ac_status=$?
11213   echo "$as_me:11213: \$? = $ac_status" >&5
11214   (exit $ac_status); } &&
11215          { ac_try='test -s conftest.$ac_objext'
11216   { (eval echo "$as_me:11216: \"$ac_try\"") >&5
11217   (eval $ac_try) 2>&5
11218   ac_status=$?
11219   echo "$as_me:11219: \$? = $ac_status" >&5
11220   (exit $ac_status); }; }; then
11221   cf_cv_gnu_source=no
11222 else
11223   echo "$as_me: failed program was:" >&5
11224 cat conftest.$ac_ext >&5
11225 cf_cv_gnu_source=yes
11226 fi
11227 rm -f conftest.$ac_objext conftest.$ac_ext
11228                         CPPFLAGS="$cf_save"
11229
11230 fi
11231 rm -f conftest.$ac_objext conftest.$ac_ext
11232
11233 fi
11234 echo "$as_me:11234: result: $cf_cv_gnu_source" >&5
11235 echo "${ECHO_T}$cf_cv_gnu_source" >&6
11236
11237                 if test "$cf_cv_gnu_source" = yes
11238                 then
11239                 echo "$as_me:11239: checking if we should also define _DEFAULT_SOURCE" >&5
11240 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
11241 if test "${cf_cv_default_source+set}" = set; then
11242   echo $ECHO_N "(cached) $ECHO_C" >&6
11243 else
11244
11245         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11246         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
11247
11248                         cat >conftest.$ac_ext <<_ACEOF
11249 #line 11249 "configure"
11250 #include "confdefs.h"
11251 #include <sys/types.h>
11252 int
11253 main (void)
11254 {
11255
11256                                 #ifdef _DEFAULT_SOURCE
11257                                 #error  expected _DEFAULT_SOURCE to be undefined
11258                                 #endif
11259   ;
11260   return 0;
11261 }
11262 _ACEOF
11263 rm -f conftest.$ac_objext
11264 if { (eval echo "$as_me:11264: \"$ac_compile\"") >&5
11265   (eval $ac_compile) 2>&5
11266   ac_status=$?
11267   echo "$as_me:11267: \$? = $ac_status" >&5
11268   (exit $ac_status); } &&
11269          { ac_try='test -s conftest.$ac_objext'
11270   { (eval echo "$as_me:11270: \"$ac_try\"") >&5
11271   (eval $ac_try) 2>&5
11272   ac_status=$?
11273   echo "$as_me:11273: \$? = $ac_status" >&5
11274   (exit $ac_status); }; }; then
11275   cf_cv_default_source=no
11276 else
11277   echo "$as_me: failed program was:" >&5
11278 cat conftest.$ac_ext >&5
11279 cf_cv_default_source=yes
11280 fi
11281 rm -f conftest.$ac_objext conftest.$ac_ext
11282
11283 fi
11284 echo "$as_me:11284: result: $cf_cv_default_source" >&5
11285 echo "${ECHO_T}$cf_cv_default_source" >&6
11286                         if test "$cf_cv_default_source" = yes
11287                         then
11288
11289         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11290         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11291
11292                         fi
11293                 fi
11294         fi
11295
11296 fi
11297
11298         ;;
11299 (minix*)
11300         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
11301         ;;
11302 (mirbsd*)
11303         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
11304         cf_XOPEN_SOURCE=
11305
11306 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11307
11308 cf_save_CFLAGS="$CFLAGS"
11309 cf_save_CPPFLAGS="$CPPFLAGS"
11310
11311 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11312         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11313                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11314
11315 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11316         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11317                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11318
11319 echo "$as_me:11319: checking if we should define _POSIX_C_SOURCE" >&5
11320 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11321 if test "${cf_cv_posix_c_source+set}" = set; then
11322   echo $ECHO_N "(cached) $ECHO_C" >&6
11323 else
11324
11325 echo "${as_me:-configure}:11325: testing if the symbol is already defined go no further ..." 1>&5
11326
11327         cat >conftest.$ac_ext <<_ACEOF
11328 #line 11328 "configure"
11329 #include "confdefs.h"
11330 #include <sys/types.h>
11331 int
11332 main (void)
11333 {
11334
11335 #ifndef _POSIX_C_SOURCE
11336 make an error
11337 #endif
11338   ;
11339   return 0;
11340 }
11341 _ACEOF
11342 rm -f conftest.$ac_objext
11343 if { (eval echo "$as_me:11343: \"$ac_compile\"") >&5
11344   (eval $ac_compile) 2>&5
11345   ac_status=$?
11346   echo "$as_me:11346: \$? = $ac_status" >&5
11347   (exit $ac_status); } &&
11348          { ac_try='test -s conftest.$ac_objext'
11349   { (eval echo "$as_me:11349: \"$ac_try\"") >&5
11350   (eval $ac_try) 2>&5
11351   ac_status=$?
11352   echo "$as_me:11352: \$? = $ac_status" >&5
11353   (exit $ac_status); }; }; then
11354   cf_cv_posix_c_source=no
11355 else
11356   echo "$as_me: failed program was:" >&5
11357 cat conftest.$ac_ext >&5
11358 cf_want_posix_source=no
11359          case .$cf_POSIX_C_SOURCE in
11360          (.[12]??*)
11361                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11362                 ;;
11363          (.2)
11364                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11365                 cf_want_posix_source=yes
11366                 ;;
11367          (.*)
11368                 cf_want_posix_source=yes
11369                 ;;
11370          esac
11371          if test "$cf_want_posix_source" = yes ; then
11372                 cat >conftest.$ac_ext <<_ACEOF
11373 #line 11373 "configure"
11374 #include "confdefs.h"
11375 #include <sys/types.h>
11376 int
11377 main (void)
11378 {
11379
11380 #ifdef _POSIX_SOURCE
11381 make an error
11382 #endif
11383   ;
11384   return 0;
11385 }
11386 _ACEOF
11387 rm -f conftest.$ac_objext
11388 if { (eval echo "$as_me:11388: \"$ac_compile\"") >&5
11389   (eval $ac_compile) 2>&5
11390   ac_status=$?
11391   echo "$as_me:11391: \$? = $ac_status" >&5
11392   (exit $ac_status); } &&
11393          { ac_try='test -s conftest.$ac_objext'
11394   { (eval echo "$as_me:11394: \"$ac_try\"") >&5
11395   (eval $ac_try) 2>&5
11396   ac_status=$?
11397   echo "$as_me:11397: \$? = $ac_status" >&5
11398   (exit $ac_status); }; }; then
11399   :
11400 else
11401   echo "$as_me: failed program was:" >&5
11402 cat conftest.$ac_ext >&5
11403 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
11404 fi
11405 rm -f conftest.$ac_objext conftest.$ac_ext
11406          fi
11407
11408 echo "${as_me:-configure}:11408: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
11409
11410          CFLAGS="$cf_trim_CFLAGS"
11411          CPPFLAGS="$cf_trim_CPPFLAGS"
11412
11413         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11414         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
11415
11416 echo "${as_me:-configure}:11416: testing if the second compile does not leave our definition intact error ..." 1>&5
11417
11418          cat >conftest.$ac_ext <<_ACEOF
11419 #line 11419 "configure"
11420 #include "confdefs.h"
11421 #include <sys/types.h>
11422 int
11423 main (void)
11424 {
11425
11426 #ifndef _POSIX_C_SOURCE
11427 make an error
11428 #endif
11429   ;
11430   return 0;
11431 }
11432 _ACEOF
11433 rm -f conftest.$ac_objext
11434 if { (eval echo "$as_me:11434: \"$ac_compile\"") >&5
11435   (eval $ac_compile) 2>&5
11436   ac_status=$?
11437   echo "$as_me:11437: \$? = $ac_status" >&5
11438   (exit $ac_status); } &&
11439          { ac_try='test -s conftest.$ac_objext'
11440   { (eval echo "$as_me:11440: \"$ac_try\"") >&5
11441   (eval $ac_try) 2>&5
11442   ac_status=$?
11443   echo "$as_me:11443: \$? = $ac_status" >&5
11444   (exit $ac_status); }; }; then
11445   :
11446 else
11447   echo "$as_me: failed program was:" >&5
11448 cat conftest.$ac_ext >&5
11449 cf_cv_posix_c_source=no
11450 fi
11451 rm -f conftest.$ac_objext conftest.$ac_ext
11452          CFLAGS="$cf_save_CFLAGS"
11453          CPPFLAGS="$cf_save_CPPFLAGS"
11454
11455 fi
11456 rm -f conftest.$ac_objext conftest.$ac_ext
11457
11458 fi
11459 echo "$as_me:11459: result: $cf_cv_posix_c_source" >&5
11460 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
11461
11462 if test "$cf_cv_posix_c_source" != no ; then
11463         CFLAGS="$cf_trim_CFLAGS"
11464         CPPFLAGS="$cf_trim_CPPFLAGS"
11465
11466 cf_fix_cppflags=no
11467 cf_new_cflags=
11468 cf_new_cppflags=
11469 cf_new_extra_cppflags=
11470
11471 for cf_add_cflags in $cf_cv_posix_c_source
11472 do
11473 case $cf_fix_cppflags in
11474 (no)
11475         case $cf_add_cflags in
11476         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11477                 case $cf_add_cflags in
11478                 (-D*)
11479                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11480
11481                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11482                                 && test -z "${cf_tst_cflags}" \
11483                                 && cf_fix_cppflags=yes
11484
11485                         if test $cf_fix_cppflags = yes ; then
11486
11487         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11488         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11489
11490                                 continue
11491                         elif test "${cf_tst_cflags}" = "\"'" ; then
11492
11493         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11494         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11495
11496                                 continue
11497                         fi
11498                         ;;
11499                 esac
11500                 case "$CPPFLAGS" in
11501                 (*$cf_add_cflags)
11502                         ;;
11503                 (*)
11504                         case $cf_add_cflags in
11505                         (-D*)
11506                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11507
11508 CPPFLAGS=`echo "$CPPFLAGS" | \
11509         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11510                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11511
11512                                 ;;
11513                         esac
11514
11515         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11516         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11517
11518                         ;;
11519                 esac
11520                 ;;
11521         (*)
11522
11523         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11524         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11525
11526                 ;;
11527         esac
11528         ;;
11529 (yes)
11530
11531         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11532         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11533
11534         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11535
11536         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11537                 && test -z "${cf_tst_cflags}" \
11538                 && cf_fix_cppflags=no
11539         ;;
11540 esac
11541 done
11542
11543 if test -n "$cf_new_cflags" ; then
11544
11545         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11546         CFLAGS="${CFLAGS}$cf_new_cflags"
11547
11548 fi
11549
11550 if test -n "$cf_new_cppflags" ; then
11551
11552         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11553         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11554
11555 fi
11556
11557 if test -n "$cf_new_extra_cppflags" ; then
11558
11559         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11560         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11561
11562 fi
11563
11564 fi
11565
11566         ;;
11567 (netbsd*)
11568         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
11569         ;;
11570 (openbsd[4-9]*)
11571         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
11572         cf_xopen_source="-D_BSD_SOURCE"
11573         cf_XOPEN_SOURCE=600
11574         ;;
11575 (openbsd*)
11576         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
11577         ;;
11578 (osf[45]*)
11579         cf_xopen_source="-D_OSF_SOURCE"
11580         ;;
11581 (nto-qnx*)
11582         cf_xopen_source="-D_QNX_SOURCE"
11583         ;;
11584 (sco*)
11585         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
11586         ;;
11587 (solaris2.*)
11588         cf_xopen_source="-D__EXTENSIONS__"
11589         cf_cv_xopen_source=broken
11590         ;;
11591 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
11592         cf_XOPEN_SOURCE=
11593         cf_POSIX_C_SOURCE=
11594         ;;
11595 (*)
11596
11597 echo "$as_me:11597: checking if we should define _XOPEN_SOURCE" >&5
11598 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11599 if test "${cf_cv_xopen_source+set}" = set; then
11600   echo $ECHO_N "(cached) $ECHO_C" >&6
11601 else
11602
11603         cat >conftest.$ac_ext <<_ACEOF
11604 #line 11604 "configure"
11605 #include "confdefs.h"
11606
11607 #include <stdlib.h>
11608 #include <string.h>
11609 #include <sys/types.h>
11610
11611 int
11612 main (void)
11613 {
11614
11615 #ifndef _XOPEN_SOURCE
11616 make an error
11617 #endif
11618   ;
11619   return 0;
11620 }
11621 _ACEOF
11622 rm -f conftest.$ac_objext
11623 if { (eval echo "$as_me:11623: \"$ac_compile\"") >&5
11624   (eval $ac_compile) 2>&5
11625   ac_status=$?
11626   echo "$as_me:11626: \$? = $ac_status" >&5
11627   (exit $ac_status); } &&
11628          { ac_try='test -s conftest.$ac_objext'
11629   { (eval echo "$as_me:11629: \"$ac_try\"") >&5
11630   (eval $ac_try) 2>&5
11631   ac_status=$?
11632   echo "$as_me:11632: \$? = $ac_status" >&5
11633   (exit $ac_status); }; }; then
11634   cf_cv_xopen_source=no
11635 else
11636   echo "$as_me: failed program was:" >&5
11637 cat conftest.$ac_ext >&5
11638 cf_save="$CPPFLAGS"
11639
11640         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11641         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11642
11643          cat >conftest.$ac_ext <<_ACEOF
11644 #line 11644 "configure"
11645 #include "confdefs.h"
11646
11647 #include <stdlib.h>
11648 #include <string.h>
11649 #include <sys/types.h>
11650
11651 int
11652 main (void)
11653 {
11654
11655 #ifdef _XOPEN_SOURCE
11656 make an error
11657 #endif
11658   ;
11659   return 0;
11660 }
11661 _ACEOF
11662 rm -f conftest.$ac_objext
11663 if { (eval echo "$as_me:11663: \"$ac_compile\"") >&5
11664   (eval $ac_compile) 2>&5
11665   ac_status=$?
11666   echo "$as_me:11666: \$? = $ac_status" >&5
11667   (exit $ac_status); } &&
11668          { ac_try='test -s conftest.$ac_objext'
11669   { (eval echo "$as_me:11669: \"$ac_try\"") >&5
11670   (eval $ac_try) 2>&5
11671   ac_status=$?
11672   echo "$as_me:11672: \$? = $ac_status" >&5
11673   (exit $ac_status); }; }; then
11674   cf_cv_xopen_source=no
11675 else
11676   echo "$as_me: failed program was:" >&5
11677 cat conftest.$ac_ext >&5
11678 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11679 fi
11680 rm -f conftest.$ac_objext conftest.$ac_ext
11681         CPPFLAGS="$cf_save"
11682
11683 fi
11684 rm -f conftest.$ac_objext conftest.$ac_ext
11685
11686 fi
11687 echo "$as_me:11687: result: $cf_cv_xopen_source" >&5
11688 echo "${ECHO_T}$cf_cv_xopen_source" >&6
11689
11690 if test "$cf_cv_xopen_source" != no ; then
11691
11692 CFLAGS=`echo "$CFLAGS" | \
11693         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11694                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11695
11696 CPPFLAGS=`echo "$CPPFLAGS" | \
11697         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11698                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11699
11700         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
11701
11702 cf_fix_cppflags=no
11703 cf_new_cflags=
11704 cf_new_cppflags=
11705 cf_new_extra_cppflags=
11706
11707 for cf_add_cflags in $cf_temp_xopen_source
11708 do
11709 case $cf_fix_cppflags in
11710 (no)
11711         case $cf_add_cflags in
11712         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11713                 case $cf_add_cflags in
11714                 (-D*)
11715                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11716
11717                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11718                                 && test -z "${cf_tst_cflags}" \
11719                                 && cf_fix_cppflags=yes
11720
11721                         if test $cf_fix_cppflags = yes ; then
11722
11723         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11724         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11725
11726                                 continue
11727                         elif test "${cf_tst_cflags}" = "\"'" ; then
11728
11729         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11730         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11731
11732                                 continue
11733                         fi
11734                         ;;
11735                 esac
11736                 case "$CPPFLAGS" in
11737                 (*$cf_add_cflags)
11738                         ;;
11739                 (*)
11740                         case $cf_add_cflags in
11741                         (-D*)
11742                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11743
11744 CPPFLAGS=`echo "$CPPFLAGS" | \
11745         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11746                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11747
11748                                 ;;
11749                         esac
11750
11751         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11752         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11753
11754                         ;;
11755                 esac
11756                 ;;
11757         (*)
11758
11759         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11760         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11761
11762                 ;;
11763         esac
11764         ;;
11765 (yes)
11766
11767         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11768         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11769
11770         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11771
11772         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11773                 && test -z "${cf_tst_cflags}" \
11774                 && cf_fix_cppflags=no
11775         ;;
11776 esac
11777 done
11778
11779 if test -n "$cf_new_cflags" ; then
11780
11781         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11782         CFLAGS="${CFLAGS}$cf_new_cflags"
11783
11784 fi
11785
11786 if test -n "$cf_new_cppflags" ; then
11787
11788         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11789         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11790
11791 fi
11792
11793 if test -n "$cf_new_extra_cppflags" ; then
11794
11795         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11796         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11797
11798 fi
11799
11800 fi
11801
11802 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11803
11804 cf_save_CFLAGS="$CFLAGS"
11805 cf_save_CPPFLAGS="$CPPFLAGS"
11806
11807 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11808         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11809                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11810
11811 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11812         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11813                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11814
11815 echo "$as_me:11815: checking if we should define _POSIX_C_SOURCE" >&5
11816 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11817 if test "${cf_cv_posix_c_source+set}" = set; then
11818   echo $ECHO_N "(cached) $ECHO_C" >&6
11819 else
11820
11821 echo "${as_me:-configure}:11821: testing if the symbol is already defined go no further ..." 1>&5
11822
11823         cat >conftest.$ac_ext <<_ACEOF
11824 #line 11824 "configure"
11825 #include "confdefs.h"
11826 #include <sys/types.h>
11827 int
11828 main (void)
11829 {
11830
11831 #ifndef _POSIX_C_SOURCE
11832 make an error
11833 #endif
11834   ;
11835   return 0;
11836 }
11837 _ACEOF
11838 rm -f conftest.$ac_objext
11839 if { (eval echo "$as_me:11839: \"$ac_compile\"") >&5
11840   (eval $ac_compile) 2>&5
11841   ac_status=$?
11842   echo "$as_me:11842: \$? = $ac_status" >&5
11843   (exit $ac_status); } &&
11844          { ac_try='test -s conftest.$ac_objext'
11845   { (eval echo "$as_me:11845: \"$ac_try\"") >&5
11846   (eval $ac_try) 2>&5
11847   ac_status=$?
11848   echo "$as_me:11848: \$? = $ac_status" >&5
11849   (exit $ac_status); }; }; then
11850   cf_cv_posix_c_source=no
11851 else
11852   echo "$as_me: failed program was:" >&5
11853 cat conftest.$ac_ext >&5
11854 cf_want_posix_source=no
11855          case .$cf_POSIX_C_SOURCE in
11856          (.[12]??*)
11857                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11858                 ;;
11859          (.2)
11860                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11861                 cf_want_posix_source=yes
11862                 ;;
11863          (.*)
11864                 cf_want_posix_source=yes
11865                 ;;
11866          esac
11867          if test "$cf_want_posix_source" = yes ; then
11868                 cat >conftest.$ac_ext <<_ACEOF
11869 #line 11869 "configure"
11870 #include "confdefs.h"
11871 #include <sys/types.h>
11872 int
11873 main (void)
11874 {
11875
11876 #ifdef _POSIX_SOURCE
11877 make an error
11878 #endif
11879   ;
11880   return 0;
11881 }
11882 _ACEOF
11883 rm -f conftest.$ac_objext
11884 if { (eval echo "$as_me:11884: \"$ac_compile\"") >&5
11885   (eval $ac_compile) 2>&5
11886   ac_status=$?
11887   echo "$as_me:11887: \$? = $ac_status" >&5
11888   (exit $ac_status); } &&
11889          { ac_try='test -s conftest.$ac_objext'
11890   { (eval echo "$as_me:11890: \"$ac_try\"") >&5
11891   (eval $ac_try) 2>&5
11892   ac_status=$?
11893   echo "$as_me:11893: \$? = $ac_status" >&5
11894   (exit $ac_status); }; }; then
11895   :
11896 else
11897   echo "$as_me: failed program was:" >&5
11898 cat conftest.$ac_ext >&5
11899 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
11900 fi
11901 rm -f conftest.$ac_objext conftest.$ac_ext
11902          fi
11903
11904 echo "${as_me:-configure}:11904: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
11905
11906          CFLAGS="$cf_trim_CFLAGS"
11907          CPPFLAGS="$cf_trim_CPPFLAGS"
11908
11909         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11910         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
11911
11912 echo "${as_me:-configure}:11912: testing if the second compile does not leave our definition intact error ..." 1>&5
11913
11914          cat >conftest.$ac_ext <<_ACEOF
11915 #line 11915 "configure"
11916 #include "confdefs.h"
11917 #include <sys/types.h>
11918 int
11919 main (void)
11920 {
11921
11922 #ifndef _POSIX_C_SOURCE
11923 make an error
11924 #endif
11925   ;
11926   return 0;
11927 }
11928 _ACEOF
11929 rm -f conftest.$ac_objext
11930 if { (eval echo "$as_me:11930: \"$ac_compile\"") >&5
11931   (eval $ac_compile) 2>&5
11932   ac_status=$?
11933   echo "$as_me:11933: \$? = $ac_status" >&5
11934   (exit $ac_status); } &&
11935          { ac_try='test -s conftest.$ac_objext'
11936   { (eval echo "$as_me:11936: \"$ac_try\"") >&5
11937   (eval $ac_try) 2>&5
11938   ac_status=$?
11939   echo "$as_me:11939: \$? = $ac_status" >&5
11940   (exit $ac_status); }; }; then
11941   :
11942 else
11943   echo "$as_me: failed program was:" >&5
11944 cat conftest.$ac_ext >&5
11945 cf_cv_posix_c_source=no
11946 fi
11947 rm -f conftest.$ac_objext conftest.$ac_ext
11948          CFLAGS="$cf_save_CFLAGS"
11949          CPPFLAGS="$cf_save_CPPFLAGS"
11950
11951 fi
11952 rm -f conftest.$ac_objext conftest.$ac_ext
11953
11954 fi
11955 echo "$as_me:11955: result: $cf_cv_posix_c_source" >&5
11956 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
11957
11958 if test "$cf_cv_posix_c_source" != no ; then
11959         CFLAGS="$cf_trim_CFLAGS"
11960         CPPFLAGS="$cf_trim_CPPFLAGS"
11961
11962 cf_fix_cppflags=no
11963 cf_new_cflags=
11964 cf_new_cppflags=
11965 cf_new_extra_cppflags=
11966
11967 for cf_add_cflags in $cf_cv_posix_c_source
11968 do
11969 case $cf_fix_cppflags in
11970 (no)
11971         case $cf_add_cflags in
11972         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11973                 case $cf_add_cflags in
11974                 (-D*)
11975                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11976
11977                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11978                                 && test -z "${cf_tst_cflags}" \
11979                                 && cf_fix_cppflags=yes
11980
11981                         if test $cf_fix_cppflags = yes ; then
11982
11983         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11984         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11985
11986                                 continue
11987                         elif test "${cf_tst_cflags}" = "\"'" ; then
11988
11989         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11990         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11991
11992                                 continue
11993                         fi
11994                         ;;
11995                 esac
11996                 case "$CPPFLAGS" in
11997                 (*$cf_add_cflags)
11998                         ;;
11999                 (*)
12000                         case $cf_add_cflags in
12001                         (-D*)
12002                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12003
12004 CPPFLAGS=`echo "$CPPFLAGS" | \
12005         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12006                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12007
12008                                 ;;
12009                         esac
12010
12011         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12012         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12013
12014                         ;;
12015                 esac
12016                 ;;
12017         (*)
12018
12019         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12020         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12021
12022                 ;;
12023         esac
12024         ;;
12025 (yes)
12026
12027         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12028         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12029
12030         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12031
12032         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12033                 && test -z "${cf_tst_cflags}" \
12034                 && cf_fix_cppflags=no
12035         ;;
12036 esac
12037 done
12038
12039 if test -n "$cf_new_cflags" ; then
12040
12041         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12042         CFLAGS="${CFLAGS}$cf_new_cflags"
12043
12044 fi
12045
12046 if test -n "$cf_new_cppflags" ; then
12047
12048         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12049         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12050
12051 fi
12052
12053 if test -n "$cf_new_extra_cppflags" ; then
12054
12055         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12056         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12057
12058 fi
12059
12060 fi
12061
12062         ;;
12063 esac
12064
12065 if test -n "$cf_xopen_source" ; then
12066
12067 cf_fix_cppflags=no
12068 cf_new_cflags=
12069 cf_new_cppflags=
12070 cf_new_extra_cppflags=
12071
12072 for cf_add_cflags in $cf_xopen_source
12073 do
12074 case $cf_fix_cppflags in
12075 (no)
12076         case $cf_add_cflags in
12077         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12078                 case $cf_add_cflags in
12079                 (-D*)
12080                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12081
12082                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12083                                 && test -z "${cf_tst_cflags}" \
12084                                 && cf_fix_cppflags=yes
12085
12086                         if test $cf_fix_cppflags = yes ; then
12087
12088         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12089         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12090
12091                                 continue
12092                         elif test "${cf_tst_cflags}" = "\"'" ; then
12093
12094         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12095         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12096
12097                                 continue
12098                         fi
12099                         ;;
12100                 esac
12101                 case "$CPPFLAGS" in
12102                 (*$cf_add_cflags)
12103                         ;;
12104                 (*)
12105                         case $cf_add_cflags in
12106                         (-D*)
12107                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12108
12109 CPPFLAGS=`echo "$CPPFLAGS" | \
12110         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12111                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12112
12113                                 ;;
12114                         esac
12115
12116         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12117         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12118
12119                         ;;
12120                 esac
12121                 ;;
12122         (*)
12123
12124         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12125         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12126
12127                 ;;
12128         esac
12129         ;;
12130 (yes)
12131
12132         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12133         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12134
12135         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12136
12137         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12138                 && test -z "${cf_tst_cflags}" \
12139                 && cf_fix_cppflags=no
12140         ;;
12141 esac
12142 done
12143
12144 if test -n "$cf_new_cflags" ; then
12145         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12146
12147 echo "${as_me:-configure}:12147: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12148
12149         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12150         CFLAGS="${CFLAGS}$cf_new_cflags"
12151
12152 fi
12153
12154 if test -n "$cf_new_cppflags" ; then
12155         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12156
12157 echo "${as_me:-configure}:12157: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12158
12159         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12160         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12161
12162 fi
12163
12164 if test -n "$cf_new_extra_cppflags" ; then
12165         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12166
12167 echo "${as_me:-configure}:12167: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12168
12169         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12170         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12171
12172 fi
12173
12174 fi
12175
12176 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
12177         echo "$as_me:12177: checking if _XOPEN_SOURCE really is set" >&5
12178 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
12179         cat >conftest.$ac_ext <<_ACEOF
12180 #line 12180 "configure"
12181 #include "confdefs.h"
12182 #include <stdlib.h>
12183 int
12184 main (void)
12185 {
12186
12187 #ifndef _XOPEN_SOURCE
12188 make an error
12189 #endif
12190   ;
12191   return 0;
12192 }
12193 _ACEOF
12194 rm -f conftest.$ac_objext
12195 if { (eval echo "$as_me:12195: \"$ac_compile\"") >&5
12196   (eval $ac_compile) 2>&5
12197   ac_status=$?
12198   echo "$as_me:12198: \$? = $ac_status" >&5
12199   (exit $ac_status); } &&
12200          { ac_try='test -s conftest.$ac_objext'
12201   { (eval echo "$as_me:12201: \"$ac_try\"") >&5
12202   (eval $ac_try) 2>&5
12203   ac_status=$?
12204   echo "$as_me:12204: \$? = $ac_status" >&5
12205   (exit $ac_status); }; }; then
12206   cf_XOPEN_SOURCE_set=yes
12207 else
12208   echo "$as_me: failed program was:" >&5
12209 cat conftest.$ac_ext >&5
12210 cf_XOPEN_SOURCE_set=no
12211 fi
12212 rm -f conftest.$ac_objext conftest.$ac_ext
12213         echo "$as_me:12213: result: $cf_XOPEN_SOURCE_set" >&5
12214 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
12215         if test $cf_XOPEN_SOURCE_set = yes
12216         then
12217                 cat >conftest.$ac_ext <<_ACEOF
12218 #line 12218 "configure"
12219 #include "confdefs.h"
12220 #include <stdlib.h>
12221 int
12222 main (void)
12223 {
12224
12225 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
12226 make an error
12227 #endif
12228   ;
12229   return 0;
12230 }
12231 _ACEOF
12232 rm -f conftest.$ac_objext
12233 if { (eval echo "$as_me:12233: \"$ac_compile\"") >&5
12234   (eval $ac_compile) 2>&5
12235   ac_status=$?
12236   echo "$as_me:12236: \$? = $ac_status" >&5
12237   (exit $ac_status); } &&
12238          { ac_try='test -s conftest.$ac_objext'
12239   { (eval echo "$as_me:12239: \"$ac_try\"") >&5
12240   (eval $ac_try) 2>&5
12241   ac_status=$?
12242   echo "$as_me:12242: \$? = $ac_status" >&5
12243   (exit $ac_status); }; }; then
12244   cf_XOPEN_SOURCE_set_ok=yes
12245 else
12246   echo "$as_me: failed program was:" >&5
12247 cat conftest.$ac_ext >&5
12248 cf_XOPEN_SOURCE_set_ok=no
12249 fi
12250 rm -f conftest.$ac_objext conftest.$ac_ext
12251                 if test $cf_XOPEN_SOURCE_set_ok = no
12252                 then
12253                         { echo "$as_me:12253: WARNING: _XOPEN_SOURCE is lower than requested" >&5
12254 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
12255                 fi
12256         else
12257
12258 echo "$as_me:12258: checking if we should define _XOPEN_SOURCE" >&5
12259 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12260 if test "${cf_cv_xopen_source+set}" = set; then
12261   echo $ECHO_N "(cached) $ECHO_C" >&6
12262 else
12263
12264         cat >conftest.$ac_ext <<_ACEOF
12265 #line 12265 "configure"
12266 #include "confdefs.h"
12267
12268 #include <stdlib.h>
12269 #include <string.h>
12270 #include <sys/types.h>
12271
12272 int
12273 main (void)
12274 {
12275
12276 #ifndef _XOPEN_SOURCE
12277 make an error
12278 #endif
12279   ;
12280   return 0;
12281 }
12282 _ACEOF
12283 rm -f conftest.$ac_objext
12284 if { (eval echo "$as_me:12284: \"$ac_compile\"") >&5
12285   (eval $ac_compile) 2>&5
12286   ac_status=$?
12287   echo "$as_me:12287: \$? = $ac_status" >&5
12288   (exit $ac_status); } &&
12289          { ac_try='test -s conftest.$ac_objext'
12290   { (eval echo "$as_me:12290: \"$ac_try\"") >&5
12291   (eval $ac_try) 2>&5
12292   ac_status=$?
12293   echo "$as_me:12293: \$? = $ac_status" >&5
12294   (exit $ac_status); }; }; then
12295   cf_cv_xopen_source=no
12296 else
12297   echo "$as_me: failed program was:" >&5
12298 cat conftest.$ac_ext >&5
12299 cf_save="$CPPFLAGS"
12300
12301         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12302         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12303
12304          cat >conftest.$ac_ext <<_ACEOF
12305 #line 12305 "configure"
12306 #include "confdefs.h"
12307
12308 #include <stdlib.h>
12309 #include <string.h>
12310 #include <sys/types.h>
12311
12312 int
12313 main (void)
12314 {
12315
12316 #ifdef _XOPEN_SOURCE
12317 make an error
12318 #endif
12319   ;
12320   return 0;
12321 }
12322 _ACEOF
12323 rm -f conftest.$ac_objext
12324 if { (eval echo "$as_me:12324: \"$ac_compile\"") >&5
12325   (eval $ac_compile) 2>&5
12326   ac_status=$?
12327   echo "$as_me:12327: \$? = $ac_status" >&5
12328   (exit $ac_status); } &&
12329          { ac_try='test -s conftest.$ac_objext'
12330   { (eval echo "$as_me:12330: \"$ac_try\"") >&5
12331   (eval $ac_try) 2>&5
12332   ac_status=$?
12333   echo "$as_me:12333: \$? = $ac_status" >&5
12334   (exit $ac_status); }; }; then
12335   cf_cv_xopen_source=no
12336 else
12337   echo "$as_me: failed program was:" >&5
12338 cat conftest.$ac_ext >&5
12339 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12340 fi
12341 rm -f conftest.$ac_objext conftest.$ac_ext
12342         CPPFLAGS="$cf_save"
12343
12344 fi
12345 rm -f conftest.$ac_objext conftest.$ac_ext
12346
12347 fi
12348 echo "$as_me:12348: result: $cf_cv_xopen_source" >&5
12349 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12350
12351 if test "$cf_cv_xopen_source" != no ; then
12352
12353 CFLAGS=`echo "$CFLAGS" | \
12354         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12355                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12356
12357 CPPFLAGS=`echo "$CPPFLAGS" | \
12358         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12359                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12360
12361         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12362
12363 cf_fix_cppflags=no
12364 cf_new_cflags=
12365 cf_new_cppflags=
12366 cf_new_extra_cppflags=
12367
12368 for cf_add_cflags in $cf_temp_xopen_source
12369 do
12370 case $cf_fix_cppflags in
12371 (no)
12372         case $cf_add_cflags in
12373         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12374                 case $cf_add_cflags in
12375                 (-D*)
12376                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12377
12378                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12379                                 && test -z "${cf_tst_cflags}" \
12380                                 && cf_fix_cppflags=yes
12381
12382                         if test $cf_fix_cppflags = yes ; then
12383
12384         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12385         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12386
12387                                 continue
12388                         elif test "${cf_tst_cflags}" = "\"'" ; then
12389
12390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12392
12393                                 continue
12394                         fi
12395                         ;;
12396                 esac
12397                 case "$CPPFLAGS" in
12398                 (*$cf_add_cflags)
12399                         ;;
12400                 (*)
12401                         case $cf_add_cflags in
12402                         (-D*)
12403                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12404
12405 CPPFLAGS=`echo "$CPPFLAGS" | \
12406         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12407                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12408
12409                                 ;;
12410                         esac
12411
12412         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12413         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12414
12415                         ;;
12416                 esac
12417                 ;;
12418         (*)
12419
12420         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12421         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12422
12423                 ;;
12424         esac
12425         ;;
12426 (yes)
12427
12428         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12429         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12430
12431         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12432
12433         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12434                 && test -z "${cf_tst_cflags}" \
12435                 && cf_fix_cppflags=no
12436         ;;
12437 esac
12438 done
12439
12440 if test -n "$cf_new_cflags" ; then
12441
12442         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12443         CFLAGS="${CFLAGS}$cf_new_cflags"
12444
12445 fi
12446
12447 if test -n "$cf_new_cppflags" ; then
12448
12449         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12450         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12451
12452 fi
12453
12454 if test -n "$cf_new_extra_cppflags" ; then
12455
12456         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12457         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12458
12459 fi
12460
12461 fi
12462
12463         fi
12464 fi
12465
12466 # Check whether --enable-largefile or --disable-largefile was given.
12467 if test "${enable_largefile+set}" = set; then
12468   enableval="$enable_largefile"
12469
12470 fi;
12471 if test "$enable_largefile" != no; then
12472
12473   echo "$as_me:12473: checking for special C compiler options needed for large files" >&5
12474 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
12475 if test "${ac_cv_sys_largefile_CC+set}" = set; then
12476   echo $ECHO_N "(cached) $ECHO_C" >&6
12477 else
12478   ac_cv_sys_largefile_CC=no
12479      if test "$GCC" != yes; then
12480        ac_save_CC=$CC
12481        while :; do
12482          # IRIX 6.2 and later do not support large files by default,
12483          # so use the C compiler's -n32 option if that helps.
12484          cat >conftest.$ac_ext <<_ACEOF
12485 #line 12485 "configure"
12486 #include "confdefs.h"
12487 #include <sys/types.h>
12488  /* Check that off_t can represent 2**63 - 1 correctly.
12489     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12490     since some C++ compilers masquerading as C compilers
12491     incorrectly reject 9223372036854775807.  */
12492 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12493   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12494                        && LARGE_OFF_T % 2147483647 == 1)
12495                       ? 1 : -1];
12496 int
12497 main (void)
12498 {
12499
12500   ;
12501   return 0;
12502 }
12503 _ACEOF
12504          rm -f conftest.$ac_objext
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); } &&
12510          { ac_try='test -s conftest.$ac_objext'
12511   { (eval echo "$as_me:12511: \"$ac_try\"") >&5
12512   (eval $ac_try) 2>&5
12513   ac_status=$?
12514   echo "$as_me:12514: \$? = $ac_status" >&5
12515   (exit $ac_status); }; }; then
12516   break
12517 else
12518   echo "$as_me: failed program was:" >&5
12519 cat conftest.$ac_ext >&5
12520 fi
12521 rm -f conftest.$ac_objext
12522          CC="$CC -n32"
12523          rm -f conftest.$ac_objext
12524 if { (eval echo "$as_me:12524: \"$ac_compile\"") >&5
12525   (eval $ac_compile) 2>&5
12526   ac_status=$?
12527   echo "$as_me:12527: \$? = $ac_status" >&5
12528   (exit $ac_status); } &&
12529          { ac_try='test -s conftest.$ac_objext'
12530   { (eval echo "$as_me:12530: \"$ac_try\"") >&5
12531   (eval $ac_try) 2>&5
12532   ac_status=$?
12533   echo "$as_me:12533: \$? = $ac_status" >&5
12534   (exit $ac_status); }; }; then
12535   ac_cv_sys_largefile_CC=' -n32'; break
12536 else
12537   echo "$as_me: failed program was:" >&5
12538 cat conftest.$ac_ext >&5
12539 fi
12540 rm -f conftest.$ac_objext
12541          break
12542        done
12543        CC=$ac_save_CC
12544        rm -f conftest.$ac_ext
12545     fi
12546 fi
12547 echo "$as_me:12547: result: $ac_cv_sys_largefile_CC" >&5
12548 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
12549   if test "$ac_cv_sys_largefile_CC" != no; then
12550     CC=$CC$ac_cv_sys_largefile_CC
12551   fi
12552
12553   echo "$as_me:12553: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12554 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
12555 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
12556   echo $ECHO_N "(cached) $ECHO_C" >&6
12557 else
12558   while :; do
12559   ac_cv_sys_file_offset_bits=no
12560   cat >conftest.$ac_ext <<_ACEOF
12561 #line 12561 "configure"
12562 #include "confdefs.h"
12563 #include <sys/types.h>
12564  /* Check that off_t can represent 2**63 - 1 correctly.
12565     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12566     since some C++ compilers masquerading as C compilers
12567     incorrectly reject 9223372036854775807.  */
12568 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12569   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12570                        && LARGE_OFF_T % 2147483647 == 1)
12571                       ? 1 : -1];
12572 int
12573 main (void)
12574 {
12575
12576   ;
12577   return 0;
12578 }
12579 _ACEOF
12580 rm -f conftest.$ac_objext
12581 if { (eval echo "$as_me:12581: \"$ac_compile\"") >&5
12582   (eval $ac_compile) 2>&5
12583   ac_status=$?
12584   echo "$as_me:12584: \$? = $ac_status" >&5
12585   (exit $ac_status); } &&
12586          { ac_try='test -s conftest.$ac_objext'
12587   { (eval echo "$as_me:12587: \"$ac_try\"") >&5
12588   (eval $ac_try) 2>&5
12589   ac_status=$?
12590   echo "$as_me:12590: \$? = $ac_status" >&5
12591   (exit $ac_status); }; }; then
12592   break
12593 else
12594   echo "$as_me: failed program was:" >&5
12595 cat conftest.$ac_ext >&5
12596 fi
12597 rm -f conftest.$ac_objext conftest.$ac_ext
12598   cat >conftest.$ac_ext <<_ACEOF
12599 #line 12599 "configure"
12600 #include "confdefs.h"
12601 #define _FILE_OFFSET_BITS 64
12602 #include <sys/types.h>
12603  /* Check that off_t can represent 2**63 - 1 correctly.
12604     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12605     since some C++ compilers masquerading as C compilers
12606     incorrectly reject 9223372036854775807.  */
12607 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12608   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12609                        && LARGE_OFF_T % 2147483647 == 1)
12610                       ? 1 : -1];
12611 int
12612 main (void)
12613 {
12614
12615   ;
12616   return 0;
12617 }
12618 _ACEOF
12619 rm -f conftest.$ac_objext
12620 if { (eval echo "$as_me:12620: \"$ac_compile\"") >&5
12621   (eval $ac_compile) 2>&5
12622   ac_status=$?
12623   echo "$as_me:12623: \$? = $ac_status" >&5
12624   (exit $ac_status); } &&
12625          { ac_try='test -s conftest.$ac_objext'
12626   { (eval echo "$as_me:12626: \"$ac_try\"") >&5
12627   (eval $ac_try) 2>&5
12628   ac_status=$?
12629   echo "$as_me:12629: \$? = $ac_status" >&5
12630   (exit $ac_status); }; }; then
12631   ac_cv_sys_file_offset_bits=64; break
12632 else
12633   echo "$as_me: failed program was:" >&5
12634 cat conftest.$ac_ext >&5
12635 fi
12636 rm -f conftest.$ac_objext conftest.$ac_ext
12637   break
12638 done
12639 fi
12640 echo "$as_me:12640: result: $ac_cv_sys_file_offset_bits" >&5
12641 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
12642 if test "$ac_cv_sys_file_offset_bits" != no; then
12643
12644 cat >>confdefs.h <<EOF
12645 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12646 EOF
12647
12648 fi
12649 rm -rf conftest*
12650   echo "$as_me:12650: checking for _LARGE_FILES value needed for large files" >&5
12651 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
12652 if test "${ac_cv_sys_large_files+set}" = set; then
12653   echo $ECHO_N "(cached) $ECHO_C" >&6
12654 else
12655   while :; do
12656   ac_cv_sys_large_files=no
12657   cat >conftest.$ac_ext <<_ACEOF
12658 #line 12658 "configure"
12659 #include "confdefs.h"
12660 #include <sys/types.h>
12661  /* Check that off_t can represent 2**63 - 1 correctly.
12662     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12663     since some C++ compilers masquerading as C compilers
12664     incorrectly reject 9223372036854775807.  */
12665 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12666   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12667                        && LARGE_OFF_T % 2147483647 == 1)
12668                       ? 1 : -1];
12669 int
12670 main (void)
12671 {
12672
12673   ;
12674   return 0;
12675 }
12676 _ACEOF
12677 rm -f conftest.$ac_objext
12678 if { (eval echo "$as_me:12678: \"$ac_compile\"") >&5
12679   (eval $ac_compile) 2>&5
12680   ac_status=$?
12681   echo "$as_me:12681: \$? = $ac_status" >&5
12682   (exit $ac_status); } &&
12683          { ac_try='test -s conftest.$ac_objext'
12684   { (eval echo "$as_me:12684: \"$ac_try\"") >&5
12685   (eval $ac_try) 2>&5
12686   ac_status=$?
12687   echo "$as_me:12687: \$? = $ac_status" >&5
12688   (exit $ac_status); }; }; then
12689   break
12690 else
12691   echo "$as_me: failed program was:" >&5
12692 cat conftest.$ac_ext >&5
12693 fi
12694 rm -f conftest.$ac_objext conftest.$ac_ext
12695   cat >conftest.$ac_ext <<_ACEOF
12696 #line 12696 "configure"
12697 #include "confdefs.h"
12698 #define _LARGE_FILES 1
12699 #include <sys/types.h>
12700  /* Check that off_t can represent 2**63 - 1 correctly.
12701     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12702     since some C++ compilers masquerading as C compilers
12703     incorrectly reject 9223372036854775807.  */
12704 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12705   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12706                        && LARGE_OFF_T % 2147483647 == 1)
12707                       ? 1 : -1];
12708 int
12709 main (void)
12710 {
12711
12712   ;
12713   return 0;
12714 }
12715 _ACEOF
12716 rm -f conftest.$ac_objext
12717 if { (eval echo "$as_me:12717: \"$ac_compile\"") >&5
12718   (eval $ac_compile) 2>&5
12719   ac_status=$?
12720   echo "$as_me:12720: \$? = $ac_status" >&5
12721   (exit $ac_status); } &&
12722          { ac_try='test -s conftest.$ac_objext'
12723   { (eval echo "$as_me:12723: \"$ac_try\"") >&5
12724   (eval $ac_try) 2>&5
12725   ac_status=$?
12726   echo "$as_me:12726: \$? = $ac_status" >&5
12727   (exit $ac_status); }; }; then
12728   ac_cv_sys_large_files=1; break
12729 else
12730   echo "$as_me: failed program was:" >&5
12731 cat conftest.$ac_ext >&5
12732 fi
12733 rm -f conftest.$ac_objext conftest.$ac_ext
12734   break
12735 done
12736 fi
12737 echo "$as_me:12737: result: $ac_cv_sys_large_files" >&5
12738 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
12739 if test "$ac_cv_sys_large_files" != no; then
12740
12741 cat >>confdefs.h <<EOF
12742 #define _LARGE_FILES $ac_cv_sys_large_files
12743 EOF
12744
12745 fi
12746 rm -rf conftest*
12747 fi
12748
12749         if test "$enable_largefile" != no ; then
12750         echo "$as_me:12750: checking for _LARGEFILE_SOURCE value needed for large files" >&5
12751 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
12752 if test "${ac_cv_sys_largefile_source+set}" = set; then
12753   echo $ECHO_N "(cached) $ECHO_C" >&6
12754 else
12755   while :; do
12756   ac_cv_sys_largefile_source=no
12757   cat >conftest.$ac_ext <<_ACEOF
12758 #line 12758 "configure"
12759 #include "confdefs.h"
12760 #include <stdio.h>
12761 int
12762 main (void)
12763 {
12764 return !fseeko;
12765   ;
12766   return 0;
12767 }
12768 _ACEOF
12769 rm -f conftest.$ac_objext
12770 if { (eval echo "$as_me:12770: \"$ac_compile\"") >&5
12771   (eval $ac_compile) 2>&5
12772   ac_status=$?
12773   echo "$as_me:12773: \$? = $ac_status" >&5
12774   (exit $ac_status); } &&
12775          { ac_try='test -s conftest.$ac_objext'
12776   { (eval echo "$as_me:12776: \"$ac_try\"") >&5
12777   (eval $ac_try) 2>&5
12778   ac_status=$?
12779   echo "$as_me:12779: \$? = $ac_status" >&5
12780   (exit $ac_status); }; }; then
12781   break
12782 else
12783   echo "$as_me: failed program was:" >&5
12784 cat conftest.$ac_ext >&5
12785 fi
12786 rm -f conftest.$ac_objext conftest.$ac_ext
12787   cat >conftest.$ac_ext <<_ACEOF
12788 #line 12788 "configure"
12789 #include "confdefs.h"
12790 #define _LARGEFILE_SOURCE 1
12791 #include <stdio.h>
12792 int
12793 main (void)
12794 {
12795 return !fseeko;
12796   ;
12797   return 0;
12798 }
12799 _ACEOF
12800 rm -f conftest.$ac_objext
12801 if { (eval echo "$as_me:12801: \"$ac_compile\"") >&5
12802   (eval $ac_compile) 2>&5
12803   ac_status=$?
12804   echo "$as_me:12804: \$? = $ac_status" >&5
12805   (exit $ac_status); } &&
12806          { ac_try='test -s conftest.$ac_objext'
12807   { (eval echo "$as_me:12807: \"$ac_try\"") >&5
12808   (eval $ac_try) 2>&5
12809   ac_status=$?
12810   echo "$as_me:12810: \$? = $ac_status" >&5
12811   (exit $ac_status); }; }; then
12812   ac_cv_sys_largefile_source=1; break
12813 else
12814   echo "$as_me: failed program was:" >&5
12815 cat conftest.$ac_ext >&5
12816 fi
12817 rm -f conftest.$ac_objext conftest.$ac_ext
12818   break
12819 done
12820 fi
12821 echo "$as_me:12821: result: $ac_cv_sys_largefile_source" >&5
12822 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
12823 if test "$ac_cv_sys_largefile_source" != no; then
12824
12825 cat >>confdefs.h <<EOF
12826 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
12827 EOF
12828
12829 fi
12830 rm -rf conftest*
12831
12832 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
12833 # in glibc 2.1.3, but that breaks too many other things.
12834 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
12835 echo "$as_me:12835: checking for fseeko" >&5
12836 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
12837 if test "${ac_cv_func_fseeko+set}" = set; then
12838   echo $ECHO_N "(cached) $ECHO_C" >&6
12839 else
12840   cat >conftest.$ac_ext <<_ACEOF
12841 #line 12841 "configure"
12842 #include "confdefs.h"
12843 #include <stdio.h>
12844 int
12845 main (void)
12846 {
12847 return fseeko && fseeko (stdin, 0, 0);
12848   ;
12849   return 0;
12850 }
12851 _ACEOF
12852 rm -f conftest.$ac_objext conftest$ac_exeext
12853 if { (eval echo "$as_me:12853: \"$ac_link\"") >&5
12854   (eval $ac_link) 2>&5
12855   ac_status=$?
12856   echo "$as_me:12856: \$? = $ac_status" >&5
12857   (exit $ac_status); } &&
12858          { ac_try='test -s conftest$ac_exeext'
12859   { (eval echo "$as_me:12859: \"$ac_try\"") >&5
12860   (eval $ac_try) 2>&5
12861   ac_status=$?
12862   echo "$as_me:12862: \$? = $ac_status" >&5
12863   (exit $ac_status); }; }; then
12864   ac_cv_func_fseeko=yes
12865 else
12866   echo "$as_me: failed program was:" >&5
12867 cat conftest.$ac_ext >&5
12868 ac_cv_func_fseeko=no
12869 fi
12870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12871 fi
12872 echo "$as_me:12872: result: $ac_cv_func_fseeko" >&5
12873 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
12874 if test $ac_cv_func_fseeko = yes; then
12875
12876 cat >>confdefs.h <<\EOF
12877 #define HAVE_FSEEKO 1
12878 EOF
12879
12880 fi
12881
12882         # Normally we would collect these definitions in the config.h,
12883         # but (like _XOPEN_SOURCE), some environments rely on having these
12884         # defined before any of the system headers are included.  Another
12885         # case comes up with C++, e.g., on AIX the compiler compiles the
12886         # header files by themselves before looking at the body files it is
12887         # told to compile.  For ncurses, those header files do not include
12888         # the config.h
12889         if test "$ac_cv_sys_large_files" != no
12890         then
12891
12892         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12893         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
12894
12895         fi
12896         if test "$ac_cv_sys_largefile_source" != no
12897         then
12898
12899         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12900         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
12901
12902         fi
12903         if test "$ac_cv_sys_file_offset_bits" != no
12904         then
12905
12906         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12907         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
12908
12909         fi
12910
12911         echo "$as_me:12911: checking whether to use struct dirent64" >&5
12912 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
12913 if test "${cf_cv_struct_dirent64+set}" = set; then
12914   echo $ECHO_N "(cached) $ECHO_C" >&6
12915 else
12916
12917                 cat >conftest.$ac_ext <<_ACEOF
12918 #line 12918 "configure"
12919 #include "confdefs.h"
12920
12921 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
12922 #include <sys/types.h>
12923 #include <dirent.h>
12924
12925 int
12926 main (void)
12927 {
12928
12929                 /* if transitional largefile support is setup, this is true */
12930                 extern struct dirent64 * readdir(DIR *);
12931                 struct dirent64 *x = readdir((DIR *)0);
12932                 struct dirent *y = readdir((DIR *)0);
12933                 int z = x - y;
12934
12935   ;
12936   return 0;
12937 }
12938 _ACEOF
12939 rm -f conftest.$ac_objext
12940 if { (eval echo "$as_me:12940: \"$ac_compile\"") >&5
12941   (eval $ac_compile) 2>&5
12942   ac_status=$?
12943   echo "$as_me:12943: \$? = $ac_status" >&5
12944   (exit $ac_status); } &&
12945          { ac_try='test -s conftest.$ac_objext'
12946   { (eval echo "$as_me:12946: \"$ac_try\"") >&5
12947   (eval $ac_try) 2>&5
12948   ac_status=$?
12949   echo "$as_me:12949: \$? = $ac_status" >&5
12950   (exit $ac_status); }; }; then
12951   cf_cv_struct_dirent64=yes
12952 else
12953   echo "$as_me: failed program was:" >&5
12954 cat conftest.$ac_ext >&5
12955 cf_cv_struct_dirent64=no
12956 fi
12957 rm -f conftest.$ac_objext conftest.$ac_ext
12958
12959 fi
12960 echo "$as_me:12960: result: $cf_cv_struct_dirent64" >&5
12961 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
12962         test "$cf_cv_struct_dirent64" = yes &&
12963 cat >>confdefs.h <<\EOF
12964 #define HAVE_STRUCT_DIRENT64 1
12965 EOF
12966
12967         fi
12968
12969 ### Enable compiling-in rcs id's
12970 echo "$as_me:12970: checking if RCS identifiers should be compiled-in" >&5
12971 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
12972
12973 # Check whether --with-rcs-ids or --without-rcs-ids was given.
12974 if test "${with_rcs_ids+set}" = set; then
12975   withval="$with_rcs_ids"
12976   with_rcs_ids=$withval
12977 else
12978   with_rcs_ids=no
12979 fi;
12980 echo "$as_me:12980: result: $with_rcs_ids" >&5
12981 echo "${ECHO_T}$with_rcs_ids" >&6
12982 test "$with_rcs_ids" = yes &&
12983 cat >>confdefs.h <<\EOF
12984 #define USE_RCS_IDS 1
12985 EOF
12986
12987 ###############################################################################
12988
12989 ### Note that some functions (such as const) are normally disabled anyway.
12990 echo "$as_me:12990: checking if you want to build with function extensions" >&5
12991 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
12992
12993 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
12994 if test "${enable_ext_funcs+set}" = set; then
12995   enableval="$enable_ext_funcs"
12996   with_ext_funcs=$enableval
12997 else
12998   with_ext_funcs=yes
12999 fi;
13000 echo "$as_me:13000: result: $with_ext_funcs" >&5
13001 echo "${ECHO_T}$with_ext_funcs" >&6
13002 if test "$with_ext_funcs" = yes ; then
13003         NCURSES_EXT_FUNCS=1
13004
13005 cat >>confdefs.h <<\EOF
13006 #define HAVE_USE_DEFAULT_COLORS 1
13007 EOF
13008
13009 cat >>confdefs.h <<\EOF
13010 #define NCURSES_EXT_FUNCS 1
13011 EOF
13012
13013 else
13014         NCURSES_EXT_FUNCS=0
13015 fi
13016
13017 ###   use option --enable-const to turn on use of const beyond that in XSI.
13018 echo "$as_me:13018: checking for extended use of const keyword" >&5
13019 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
13020
13021 # Check whether --enable-const or --disable-const was given.
13022 if test "${enable_const+set}" = set; then
13023   enableval="$enable_const"
13024   with_ext_const=$enableval
13025 else
13026   with_ext_const=no
13027 fi;
13028 echo "$as_me:13028: result: $with_ext_const" >&5
13029 echo "${ECHO_T}$with_ext_const" >&6
13030 NCURSES_CONST='/*nothing*/'
13031 if test "$with_ext_const" = yes ; then
13032         NCURSES_CONST=const
13033 fi
13034
13035 ###############################################################################
13036 # These options are relatively safe to experiment with.
13037
13038 echo "$as_me:13038: checking if you want all development code" >&5
13039 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
13040
13041 # Check whether --with-develop or --without-develop was given.
13042 if test "${with_develop+set}" = set; then
13043   withval="$with_develop"
13044   with_develop=$withval
13045 else
13046   with_develop=no
13047 fi;
13048 echo "$as_me:13048: result: $with_develop" >&5
13049 echo "${ECHO_T}$with_develop" >&6
13050
13051 ###############################################################################
13052 # These are just experimental, probably should not be in a package:
13053
13054 # This is still experimental (20080329), but should ultimately be moved to
13055 # the script-block --with-normal, etc.
13056
13057 echo "$as_me:13057: checking if you want to link with the pthread library" >&5
13058 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
13059
13060 # Check whether --with-pthread or --without-pthread was given.
13061 if test "${with_pthread+set}" = set; then
13062   withval="$with_pthread"
13063   with_pthread=$withval
13064 else
13065   with_pthread=no
13066 fi;
13067 echo "$as_me:13067: result: $with_pthread" >&5
13068 echo "${ECHO_T}$with_pthread" >&6
13069
13070 if test "$with_pthread" != no ; then
13071         echo "$as_me:13071: checking for pthread.h" >&5
13072 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
13073 if test "${ac_cv_header_pthread_h+set}" = set; then
13074   echo $ECHO_N "(cached) $ECHO_C" >&6
13075 else
13076   cat >conftest.$ac_ext <<_ACEOF
13077 #line 13077 "configure"
13078 #include "confdefs.h"
13079 #include <pthread.h>
13080 _ACEOF
13081 if { (eval echo "$as_me:13081: \"$ac_cpp conftest.$ac_ext\"") >&5
13082   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13083   ac_status=$?
13084   egrep -v '^ *\+' conftest.er1 >conftest.err
13085   rm -f conftest.er1
13086   cat conftest.err >&5
13087   echo "$as_me:13087: \$? = $ac_status" >&5
13088   (exit $ac_status); } >/dev/null; then
13089   if test -s conftest.err; then
13090     ac_cpp_err=$ac_c_preproc_warn_flag
13091   else
13092     ac_cpp_err=
13093   fi
13094 else
13095   ac_cpp_err=yes
13096 fi
13097 if test -z "$ac_cpp_err"; then
13098   ac_cv_header_pthread_h=yes
13099 else
13100   echo "$as_me: failed program was:" >&5
13101   cat conftest.$ac_ext >&5
13102   ac_cv_header_pthread_h=no
13103 fi
13104 rm -f conftest.err conftest.$ac_ext
13105 fi
13106 echo "$as_me:13106: result: $ac_cv_header_pthread_h" >&5
13107 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
13108 if test $ac_cv_header_pthread_h = yes; then
13109
13110 cat >>confdefs.h <<\EOF
13111 #define HAVE_PTHREADS_H 1
13112 EOF
13113
13114         for cf_lib_pthread in pthread c_r
13115         do
13116             echo "$as_me:13116: checking if we can link with the $cf_lib_pthread library" >&5
13117 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
13118             cf_save_LIBS="$LIBS"
13119
13120 cf_add_libs="-l$cf_lib_pthread"
13121 # Filter out duplicates - this happens with badly-designed ".pc" files...
13122 for cf_add_1lib in $LIBS
13123 do
13124         for cf_add_2lib in $cf_add_libs
13125         do
13126                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13127                 then
13128                         cf_add_1lib=
13129                         break
13130                 fi
13131         done
13132         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13133 done
13134 LIBS="$cf_add_libs"
13135
13136             cat >conftest.$ac_ext <<_ACEOF
13137 #line 13137 "configure"
13138 #include "confdefs.h"
13139
13140 #include <pthread.h>
13141
13142 int
13143 main (void)
13144 {
13145
13146                 int rc = pthread_create(0,0,0,0);
13147                 int r2 = pthread_mutexattr_settype(0, 0);
13148
13149   ;
13150   return 0;
13151 }
13152 _ACEOF
13153 rm -f conftest.$ac_objext conftest$ac_exeext
13154 if { (eval echo "$as_me:13154: \"$ac_link\"") >&5
13155   (eval $ac_link) 2>&5
13156   ac_status=$?
13157   echo "$as_me:13157: \$? = $ac_status" >&5
13158   (exit $ac_status); } &&
13159          { ac_try='test -s conftest$ac_exeext'
13160   { (eval echo "$as_me:13160: \"$ac_try\"") >&5
13161   (eval $ac_try) 2>&5
13162   ac_status=$?
13163   echo "$as_me:13163: \$? = $ac_status" >&5
13164   (exit $ac_status); }; }; then
13165   with_pthread=yes
13166 else
13167   echo "$as_me: failed program was:" >&5
13168 cat conftest.$ac_ext >&5
13169 with_pthread=no
13170 fi
13171 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13172             LIBS="$cf_save_LIBS"
13173             echo "$as_me:13173: result: $with_pthread" >&5
13174 echo "${ECHO_T}$with_pthread" >&6
13175             test "$with_pthread" = yes && break
13176         done
13177
13178         if test "$with_pthread" = yes ; then
13179
13180 cf_add_libs="-l$cf_lib_pthread"
13181 # Filter out duplicates - this happens with badly-designed ".pc" files...
13182 for cf_add_1lib in $LIBS
13183 do
13184         for cf_add_2lib in $cf_add_libs
13185         do
13186                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13187                 then
13188                         cf_add_1lib=
13189                         break
13190                 fi
13191         done
13192         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13193 done
13194 LIBS="$cf_add_libs"
13195
13196 cat >>confdefs.h <<\EOF
13197 #define HAVE_LIBPTHREADS 1
13198 EOF
13199
13200         else
13201             { { echo "$as_me:13201: error: Cannot link with pthread library" >&5
13202 echo "$as_me: error: Cannot link with pthread library" >&2;}
13203    { (exit 1); exit 1; }; }
13204         fi
13205
13206 fi
13207
13208 fi
13209
13210 echo "$as_me:13210: checking if you want to use weak-symbols for pthreads" >&5
13211 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
13212
13213 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
13214 if test "${enable_weak_symbols+set}" = set; then
13215   enableval="$enable_weak_symbols"
13216   use_weak_symbols=$withval
13217 else
13218   use_weak_symbols=no
13219 fi;
13220 echo "$as_me:13220: result: $use_weak_symbols" >&5
13221 echo "${ECHO_T}$use_weak_symbols" >&6
13222 if test "$use_weak_symbols" = yes ; then
13223
13224 echo "$as_me:13224: checking if $CC supports weak symbols" >&5
13225 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
13226 if test "${cf_cv_weak_symbols+set}" = set; then
13227   echo $ECHO_N "(cached) $ECHO_C" >&6
13228 else
13229
13230 cat >conftest.$ac_ext <<_ACEOF
13231 #line 13231 "configure"
13232 #include "confdefs.h"
13233
13234 #include <stdio.h>
13235 int
13236 main (void)
13237 {
13238
13239 #if defined(__GNUC__)
13240 #  if defined __USE_ISOC99
13241 #    define _cat_pragma(exp)    _Pragma(#exp)
13242 #    define _weak_pragma(exp)   _cat_pragma(weak name)
13243 #  else
13244 #    define _weak_pragma(exp)
13245 #  endif
13246 #  define _declare(name)        __extension__ extern __typeof__(name) name
13247 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
13248 #endif
13249
13250 weak_symbol(fopen);
13251
13252   ;
13253   return 0;
13254 }
13255 _ACEOF
13256 rm -f conftest.$ac_objext
13257 if { (eval echo "$as_me:13257: \"$ac_compile\"") >&5
13258   (eval $ac_compile) 2>&5
13259   ac_status=$?
13260   echo "$as_me:13260: \$? = $ac_status" >&5
13261   (exit $ac_status); } &&
13262          { ac_try='test -s conftest.$ac_objext'
13263   { (eval echo "$as_me:13263: \"$ac_try\"") >&5
13264   (eval $ac_try) 2>&5
13265   ac_status=$?
13266   echo "$as_me:13266: \$? = $ac_status" >&5
13267   (exit $ac_status); }; }; then
13268   cf_cv_weak_symbols=yes
13269 else
13270   echo "$as_me: failed program was:" >&5
13271 cat conftest.$ac_ext >&5
13272 cf_cv_weak_symbols=no
13273 fi
13274 rm -f conftest.$ac_objext conftest.$ac_ext
13275
13276 fi
13277 echo "$as_me:13277: result: $cf_cv_weak_symbols" >&5
13278 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
13279
13280 else
13281         cf_cv_weak_symbols=no
13282 fi
13283
13284 if test $cf_cv_weak_symbols = yes ; then
13285
13286 cat >>confdefs.h <<\EOF
13287 #define USE_WEAK_SYMBOLS 1
13288 EOF
13289
13290 fi
13291
13292 PTHREAD=
13293 if test "$with_pthread" = "yes" ; then
13294
13295 cat >>confdefs.h <<\EOF
13296 #define USE_PTHREADS 1
13297 EOF
13298
13299         enable_reentrant=yes
13300         if test $cf_cv_weak_symbols = yes ; then
13301                 PTHREAD=-lpthread
13302         fi
13303 fi
13304
13305 # OpenSUSE is installing ncurses6, using reentrant option.
13306 echo "$as_me:13306: checking for _nc_TABSIZE" >&5
13307 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
13308 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
13309   echo $ECHO_N "(cached) $ECHO_C" >&6
13310 else
13311   cat >conftest.$ac_ext <<_ACEOF
13312 #line 13312 "configure"
13313 #include "confdefs.h"
13314 /* System header to define __stub macros and hopefully few prototypes,
13315     which can conflict with char _nc_TABSIZE (); below.  */
13316 #include <assert.h>
13317 /* Override any gcc2 internal prototype to avoid an error.  */
13318 #ifdef __cplusplus
13319 extern "C"
13320 #endif
13321 /* We use char because int might match the return type of a gcc2
13322    builtin and then its argument prototype would still apply.  */
13323 char _nc_TABSIZE ();
13324 char (*f) ();
13325
13326 int
13327 main (void)
13328 {
13329 /* The GNU C library defines this for functions which it implements
13330     to always fail with ENOSYS.  Some functions are actually named
13331     something starting with __ and the normal name is an alias.  */
13332 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
13333 choke me
13334 #else
13335 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13336 #endif
13337
13338   ;
13339   return 0;
13340 }
13341 _ACEOF
13342 rm -f conftest.$ac_objext conftest$ac_exeext
13343 if { (eval echo "$as_me:13343: \"$ac_link\"") >&5
13344   (eval $ac_link) 2>&5
13345   ac_status=$?
13346   echo "$as_me:13346: \$? = $ac_status" >&5
13347   (exit $ac_status); } &&
13348          { ac_try='test -s conftest$ac_exeext'
13349   { (eval echo "$as_me:13349: \"$ac_try\"") >&5
13350   (eval $ac_try) 2>&5
13351   ac_status=$?
13352   echo "$as_me:13352: \$? = $ac_status" >&5
13353   (exit $ac_status); }; }; then
13354   ac_cv_func__nc_TABSIZE=yes
13355 else
13356   echo "$as_me: failed program was:" >&5
13357 cat conftest.$ac_ext >&5
13358 ac_cv_func__nc_TABSIZE=no
13359 fi
13360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13361 fi
13362 echo "$as_me:13362: result: $ac_cv_func__nc_TABSIZE" >&5
13363 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
13364 if test $ac_cv_func__nc_TABSIZE = yes; then
13365   assume_reentrant=yes
13366 else
13367   assume_reentrant=no
13368 fi
13369
13370 # Reentrant code has to be opaque; there's little advantage to making ncurses
13371 # opaque outside of that, so there is no --enable-opaque option.  We can use
13372 # this option without --with-pthreads, but this will be always set for
13373 # pthreads.
13374 echo "$as_me:13374: checking if you want experimental reentrant code" >&5
13375 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
13376
13377 # Check whether --enable-reentrant or --disable-reentrant was given.
13378 if test "${enable_reentrant+set}" = set; then
13379   enableval="$enable_reentrant"
13380   with_reentrant=$enableval
13381 else
13382   with_reentrant=$assume_reentrant
13383 fi;
13384 echo "$as_me:13384: result: $with_reentrant" >&5
13385 echo "${ECHO_T}$with_reentrant" >&6
13386 if test "$with_reentrant" = yes ; then
13387         cf_cv_enable_reentrant=1
13388         if test $cf_cv_weak_symbols = yes ; then
13389
13390 # remove pthread library from $LIBS
13391 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
13392
13393         elif test "$assume_reentrant" = no ; then
13394                 LIB_SUFFIX="t${LIB_SUFFIX}"
13395         fi
13396
13397 cat >>confdefs.h <<\EOF
13398 #define USE_REENTRANT 1
13399 EOF
13400
13401 else
13402         cf_cv_enable_reentrant=0
13403 fi
13404
13405 ### Allow using a different wrap-prefix
13406 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
13407         echo "$as_me:13407: checking for prefix used to wrap public variables" >&5
13408 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
13409
13410 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
13411 if test "${with_wrap_prefix+set}" = set; then
13412   withval="$with_wrap_prefix"
13413   NCURSES_WRAP_PREFIX=$withval
13414 else
13415   NCURSES_WRAP_PREFIX=_nc_
13416 fi;
13417         echo "$as_me:13417: result: $NCURSES_WRAP_PREFIX" >&5
13418 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
13419 else
13420         NCURSES_WRAP_PREFIX=_nc_
13421 fi
13422
13423 cat >>confdefs.h <<EOF
13424 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
13425 EOF
13426
13427 ###############################################################################
13428
13429 ###     use option --disable-echo to suppress full display compiling commands
13430
13431 echo "$as_me:13431: checking if you want to see long compiling messages" >&5
13432 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
13433
13434 # Check whether --enable-echo or --disable-echo was given.
13435 if test "${enable_echo+set}" = set; then
13436   enableval="$enable_echo"
13437   test "$enableval" != no && enableval=yes
13438         if test "$enableval" != "yes" ; then
13439
13440         ECHO_LT='--silent'
13441         ECHO_LD='@echo linking $@;'
13442         RULE_CC='@echo compiling $<'
13443         SHOW_CC='@echo compiling $@'
13444         ECHO_CC='@'
13445
13446         else
13447
13448         ECHO_LT=''
13449         ECHO_LD=''
13450         RULE_CC=''
13451         SHOW_CC=''
13452         ECHO_CC=''
13453
13454         fi
13455 else
13456   enableval=yes
13457
13458         ECHO_LT=''
13459         ECHO_LD=''
13460         RULE_CC=''
13461         SHOW_CC=''
13462         ECHO_CC=''
13463
13464 fi;
13465 echo "$as_me:13465: result: $enableval" >&5
13466 echo "${ECHO_T}$enableval" >&6
13467
13468 ###     use option --enable-warnings to turn on all gcc warnings
13469 echo "$as_me:13469: checking if you want to see compiler warnings" >&5
13470 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
13471
13472 # Check whether --enable-warnings or --disable-warnings was given.
13473 if test "${enable_warnings+set}" = set; then
13474   enableval="$enable_warnings"
13475   with_warnings=$enableval
13476 fi;
13477 echo "$as_me:13477: result: $with_warnings" >&5
13478 echo "${ECHO_T}$with_warnings" >&6
13479
13480 if test "x$with_warnings" = "xyes"; then
13481
13482         ADAFLAGS="$ADAFLAGS -gnatg"
13483
13484 INTEL_COMPILER=no
13485
13486 if test "$GCC" = yes ; then
13487         case $host_os in
13488         (linux*|gnu*)
13489                 echo "$as_me:13489: checking if this is really Intel C compiler" >&5
13490 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
13491                 cf_save_CFLAGS="$CFLAGS"
13492                 CFLAGS="$CFLAGS -no-gcc"
13493                 cat >conftest.$ac_ext <<_ACEOF
13494 #line 13494 "configure"
13495 #include "confdefs.h"
13496
13497 int
13498 main (void)
13499 {
13500
13501 #ifdef __INTEL_COMPILER
13502 #else
13503 make an error
13504 #endif
13505
13506   ;
13507   return 0;
13508 }
13509 _ACEOF
13510 rm -f conftest.$ac_objext
13511 if { (eval echo "$as_me:13511: \"$ac_compile\"") >&5
13512   (eval $ac_compile) 2>&5
13513   ac_status=$?
13514   echo "$as_me:13514: \$? = $ac_status" >&5
13515   (exit $ac_status); } &&
13516          { ac_try='test -s conftest.$ac_objext'
13517   { (eval echo "$as_me:13517: \"$ac_try\"") >&5
13518   (eval $ac_try) 2>&5
13519   ac_status=$?
13520   echo "$as_me:13520: \$? = $ac_status" >&5
13521   (exit $ac_status); }; }; then
13522   INTEL_COMPILER=yes
13523 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
13524
13525 else
13526   echo "$as_me: failed program was:" >&5
13527 cat conftest.$ac_ext >&5
13528 fi
13529 rm -f conftest.$ac_objext conftest.$ac_ext
13530                 CFLAGS="$cf_save_CFLAGS"
13531                 echo "$as_me:13531: result: $INTEL_COMPILER" >&5
13532 echo "${ECHO_T}$INTEL_COMPILER" >&6
13533                 ;;
13534         esac
13535 fi
13536
13537 CLANG_COMPILER=no
13538
13539 if test "$GCC" = yes ; then
13540         echo "$as_me:13540: checking if this is really Clang C compiler" >&5
13541 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
13542         cf_save_CFLAGS="$CFLAGS"
13543         CFLAGS="$CFLAGS -Qunused-arguments"
13544         cat >conftest.$ac_ext <<_ACEOF
13545 #line 13545 "configure"
13546 #include "confdefs.h"
13547
13548 int
13549 main (void)
13550 {
13551
13552 #ifdef __clang__
13553 #else
13554 make an error
13555 #endif
13556
13557   ;
13558   return 0;
13559 }
13560 _ACEOF
13561 rm -f conftest.$ac_objext
13562 if { (eval echo "$as_me:13562: \"$ac_compile\"") >&5
13563   (eval $ac_compile) 2>&5
13564   ac_status=$?
13565   echo "$as_me:13565: \$? = $ac_status" >&5
13566   (exit $ac_status); } &&
13567          { ac_try='test -s conftest.$ac_objext'
13568   { (eval echo "$as_me:13568: \"$ac_try\"") >&5
13569   (eval $ac_try) 2>&5
13570   ac_status=$?
13571   echo "$as_me:13571: \$? = $ac_status" >&5
13572   (exit $ac_status); }; }; then
13573   CLANG_COMPILER=yes
13574 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
13575
13576 else
13577   echo "$as_me: failed program was:" >&5
13578 cat conftest.$ac_ext >&5
13579 fi
13580 rm -f conftest.$ac_objext conftest.$ac_ext
13581         CFLAGS="$cf_save_CFLAGS"
13582         echo "$as_me:13582: result: $CLANG_COMPILER" >&5
13583 echo "${ECHO_T}$CLANG_COMPILER" >&6
13584 fi
13585
13586 cat > conftest.$ac_ext <<EOF
13587 #line 13587 "${as_me:-configure}"
13588 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
13589 EOF
13590
13591 if test "$INTEL_COMPILER" = yes
13592 then
13593 # The "-wdXXX" options suppress warnings:
13594 # remark #1419: external declaration in primary source file
13595 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
13596 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
13597 # remark #193: zero used for undefined preprocessing identifier
13598 # remark #593: variable "curs_sb_left_arrow" was set but never used
13599 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
13600 # remark #869: parameter "tw" was never referenced
13601 # remark #981: operands are evaluated in unspecified order
13602 # warning #279: controlling expression is constant
13603
13604         { echo "$as_me:13604: checking for $CC warning options..." >&5
13605 echo "$as_me: checking for $CC warning options..." >&6;}
13606         cf_save_CFLAGS="$CFLAGS"
13607         EXTRA_CFLAGS="-Wall"
13608         for cf_opt in \
13609                 wd1419 \
13610                 wd1683 \
13611                 wd1684 \
13612                 wd193 \
13613                 wd593 \
13614                 wd279 \
13615                 wd810 \
13616                 wd869 \
13617                 wd981
13618         do
13619                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13620                 if { (eval echo "$as_me:13620: \"$ac_compile\"") >&5
13621   (eval $ac_compile) 2>&5
13622   ac_status=$?
13623   echo "$as_me:13623: \$? = $ac_status" >&5
13624   (exit $ac_status); }; then
13625                         test -n "$verbose" && echo "$as_me:13625: result: ... -$cf_opt" >&5
13626 echo "${ECHO_T}... -$cf_opt" >&6
13627                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13628                 fi
13629         done
13630         CFLAGS="$cf_save_CFLAGS"
13631
13632 elif test "$GCC" = yes
13633 then
13634         { echo "$as_me:13634: checking for $CC warning options..." >&5
13635 echo "$as_me: checking for $CC warning options..." >&6;}
13636         cf_save_CFLAGS="$CFLAGS"
13637         EXTRA_CFLAGS=
13638         cf_warn_CONST=""
13639         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
13640         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
13641         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
13642         for cf_opt in W Wall \
13643                 Wbad-function-cast \
13644                 Wcast-align \
13645                 Wcast-qual \
13646                 Wdeclaration-after-statement \
13647                 Wextra \
13648                 Winline \
13649                 Wmissing-declarations \
13650                 Wmissing-prototypes \
13651                 Wnested-externs \
13652                 Wpointer-arith \
13653                 Wshadow \
13654                 Wstrict-prototypes \
13655                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
13656         do
13657                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13658                 if { (eval echo "$as_me:13658: \"$ac_compile\"") >&5
13659   (eval $ac_compile) 2>&5
13660   ac_status=$?
13661   echo "$as_me:13661: \$? = $ac_status" >&5
13662   (exit $ac_status); }; then
13663                         test -n "$verbose" && echo "$as_me:13663: result: ... -$cf_opt" >&5
13664 echo "${ECHO_T}... -$cf_opt" >&6
13665                         case $cf_opt in
13666                         (Wcast-qual)
13667
13668         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13669         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
13670
13671                                 ;;
13672                         (Winline)
13673                                 case $GCC_VERSION in
13674                                 ([34].*)
13675                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
13676
13677 echo "${as_me:-configure}:13677: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
13678
13679                                         continue;;
13680                                 esac
13681                                 ;;
13682                         (Wpointer-arith)
13683                                 case $GCC_VERSION in
13684                                 ([12].*)
13685                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
13686
13687 echo "${as_me:-configure}:13687: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
13688
13689                                         continue;;
13690                                 esac
13691                                 ;;
13692                         esac
13693                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13694                 fi
13695         done
13696         CFLAGS="$cf_save_CFLAGS"
13697 fi
13698 rm -rf conftest*
13699
13700 fi
13701
13702 if test "$GCC" = yes
13703 then
13704 cat > conftest.i <<EOF
13705 #ifndef GCC_PRINTF
13706 #define GCC_PRINTF 0
13707 #endif
13708 #ifndef GCC_SCANF
13709 #define GCC_SCANF 0
13710 #endif
13711 #ifndef GCC_NORETURN
13712 #define GCC_NORETURN /* nothing */
13713 #endif
13714 #ifndef GCC_UNUSED
13715 #define GCC_UNUSED /* nothing */
13716 #endif
13717 EOF
13718 if test "$GCC" = yes
13719 then
13720         { echo "$as_me:13720: checking for $CC __attribute__ directives..." >&5
13721 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
13722 cat > conftest.$ac_ext <<EOF
13723 #line 13723 "${as_me:-configure}"
13724 #include "confdefs.h"
13725 #include "conftest.h"
13726 #include "conftest.i"
13727 #if     GCC_PRINTF
13728 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
13729 #else
13730 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
13731 #endif
13732 #if     GCC_SCANF
13733 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
13734 #else
13735 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
13736 #endif
13737 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
13738 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
13739 extern void foo(void) GCC_NORETURN;
13740 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
13741 EOF
13742         cf_printf_attribute=no
13743         cf_scanf_attribute=no
13744         for cf_attribute in scanf printf unused noreturn
13745         do
13746
13747 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13748
13749                 cf_directive="__attribute__(($cf_attribute))"
13750                 echo "checking for $CC $cf_directive" 1>&5
13751
13752                 case $cf_attribute in
13753                 (printf)
13754                         cf_printf_attribute=yes
13755                         cat >conftest.h <<EOF
13756 #define GCC_$cf_ATTRIBUTE 1
13757 EOF
13758                         ;;
13759                 (scanf)
13760                         cf_scanf_attribute=yes
13761                         cat >conftest.h <<EOF
13762 #define GCC_$cf_ATTRIBUTE 1
13763 EOF
13764                         ;;
13765                 (*)
13766                         cat >conftest.h <<EOF
13767 #define GCC_$cf_ATTRIBUTE $cf_directive
13768 EOF
13769                         ;;
13770                 esac
13771
13772                 if { (eval echo "$as_me:13772: \"$ac_compile\"") >&5
13773   (eval $ac_compile) 2>&5
13774   ac_status=$?
13775   echo "$as_me:13775: \$? = $ac_status" >&5
13776   (exit $ac_status); }; then
13777                         test -n "$verbose" && echo "$as_me:13777: result: ... $cf_attribute" >&5
13778 echo "${ECHO_T}... $cf_attribute" >&6
13779                         cat conftest.h >>confdefs.h
13780                         case $cf_attribute in
13781                         (noreturn)
13782
13783 cat >>confdefs.h <<EOF
13784 #define GCC_NORETURN $cf_directive
13785 EOF
13786
13787                                 ;;
13788                         (printf)
13789                                 cf_value='/* nothing */'
13790                                 if test "$cf_printf_attribute" != no ; then
13791                                         cf_value='__attribute__((format(printf,fmt,var)))'
13792
13793 cat >>confdefs.h <<\EOF
13794 #define GCC_PRINTF 1
13795 EOF
13796
13797                                 fi
13798
13799 cat >>confdefs.h <<EOF
13800 #define GCC_PRINTFLIKE(fmt,var) $cf_value
13801 EOF
13802
13803                                 ;;
13804                         (scanf)
13805                                 cf_value='/* nothing */'
13806                                 if test "$cf_scanf_attribute" != no ; then
13807                                         cf_value='__attribute__((format(scanf,fmt,var)))'
13808
13809 cat >>confdefs.h <<\EOF
13810 #define GCC_SCANF 1
13811 EOF
13812
13813                                 fi
13814
13815 cat >>confdefs.h <<EOF
13816 #define GCC_SCANFLIKE(fmt,var) $cf_value
13817 EOF
13818
13819                                 ;;
13820                         (unused)
13821
13822 cat >>confdefs.h <<EOF
13823 #define GCC_UNUSED $cf_directive
13824 EOF
13825
13826                                 ;;
13827                         esac
13828                 fi
13829         done
13830 else
13831         fgrep define conftest.i >>confdefs.h
13832 fi
13833 rm -rf conftest*
13834 fi
13835
13836 ###     use option --enable-assertions to turn on generation of assertion code
13837 echo "$as_me:13837: checking if you want to enable runtime assertions" >&5
13838 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
13839
13840 # Check whether --enable-assertions or --disable-assertions was given.
13841 if test "${enable_assertions+set}" = set; then
13842   enableval="$enable_assertions"
13843   with_assertions=$enableval
13844 else
13845   with_assertions=no
13846 fi;
13847 echo "$as_me:13847: result: $with_assertions" >&5
13848 echo "${ECHO_T}$with_assertions" >&6
13849 if test -n "$GCC"
13850 then
13851         if test "$with_assertions" = no
13852         then
13853                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
13854         else
13855
13856         ADAFLAGS="$ADAFLAGS -gnata"
13857
13858         fi
13859 fi
13860
13861 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
13862
13863 cat >>confdefs.h <<\EOF
13864 #define HAVE_NC_ALLOC_H 1
13865 EOF
13866
13867 ###     use option --enable-expanded to generate certain macros as functions
13868
13869 # Check whether --enable-expanded or --disable-expanded was given.
13870 if test "${enable_expanded+set}" = set; then
13871   enableval="$enable_expanded"
13872   test "$enableval" = yes &&
13873 cat >>confdefs.h <<\EOF
13874 #define NCURSES_EXPANDED 1
13875 EOF
13876
13877 fi;
13878
13879 ###     use option --disable-macros to suppress macros in favor of functions
13880
13881 # Check whether --enable-macros or --disable-macros was given.
13882 if test "${enable_macros+set}" = set; then
13883   enableval="$enable_macros"
13884   test "$enableval" = no &&
13885 cat >>confdefs.h <<\EOF
13886 #define NCURSES_NOMACROS 1
13887 EOF
13888
13889 fi;
13890
13891 # Normally we only add trace() to the debug-library.  Allow this to be
13892 # extended to all models of the ncurses library:
13893 cf_all_traces=no
13894 case "$CFLAGS $CPPFLAGS" in
13895 (*-DTRACE*)
13896         cf_all_traces=yes
13897         ;;
13898 esac
13899
13900 echo "$as_me:13900: checking whether to add trace feature to all models" >&5
13901 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
13902
13903 # Check whether --with-trace or --without-trace was given.
13904 if test "${with_trace+set}" = set; then
13905   withval="$with_trace"
13906   cf_with_trace=$withval
13907 else
13908   cf_with_trace=$cf_all_traces
13909 fi;
13910 echo "$as_me:13910: result: $cf_with_trace" >&5
13911 echo "${ECHO_T}$cf_with_trace" >&6
13912
13913 if test "$cf_with_trace" = yes ; then
13914         ADA_TRACE=TRUE
13915
13916 cf_fix_cppflags=no
13917 cf_new_cflags=
13918 cf_new_cppflags=
13919 cf_new_extra_cppflags=
13920
13921 for cf_add_cflags in -DTRACE
13922 do
13923 case $cf_fix_cppflags in
13924 (no)
13925         case $cf_add_cflags in
13926         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13927                 case $cf_add_cflags in
13928                 (-D*)
13929                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13930
13931                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13932                                 && test -z "${cf_tst_cflags}" \
13933                                 && cf_fix_cppflags=yes
13934
13935                         if test $cf_fix_cppflags = yes ; then
13936
13937         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13938         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13939
13940                                 continue
13941                         elif test "${cf_tst_cflags}" = "\"'" ; then
13942
13943         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13944         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13945
13946                                 continue
13947                         fi
13948                         ;;
13949                 esac
13950                 case "$CPPFLAGS" in
13951                 (*$cf_add_cflags)
13952                         ;;
13953                 (*)
13954                         case $cf_add_cflags in
13955                         (-D*)
13956                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13957
13958 CPPFLAGS=`echo "$CPPFLAGS" | \
13959         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13960                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13961
13962                                 ;;
13963                         esac
13964
13965         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13966         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13967
13968                         ;;
13969                 esac
13970                 ;;
13971         (*)
13972
13973         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13974         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13975
13976                 ;;
13977         esac
13978         ;;
13979 (yes)
13980
13981         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13982         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13983
13984         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13985
13986         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13987                 && test -z "${cf_tst_cflags}" \
13988                 && cf_fix_cppflags=no
13989         ;;
13990 esac
13991 done
13992
13993 if test -n "$cf_new_cflags" ; then
13994
13995         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13996         CFLAGS="${CFLAGS}$cf_new_cflags"
13997
13998 fi
13999
14000 if test -n "$cf_new_cppflags" ; then
14001
14002         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14003         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14004
14005 fi
14006
14007 if test -n "$cf_new_extra_cppflags" ; then
14008
14009         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14010         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14011
14012 fi
14013
14014 else
14015         ADA_TRACE=FALSE
14016 fi
14017
14018 echo "$as_me:14018: checking if we want to use GNAT projects" >&5
14019 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
14020
14021 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
14022 if test "${enable_gnat_projects+set}" = set; then
14023   enableval="$enable_gnat_projects"
14024   test "$enableval" != no && enableval=yes
14025         if test "$enableval" != "yes" ; then
14026     enable_gnat_projects=no
14027         else
14028                 enable_gnat_projects=yes
14029         fi
14030 else
14031   enableval=yes
14032         enable_gnat_projects=yes
14033
14034 fi;
14035 echo "$as_me:14035: result: $enable_gnat_projects" >&5
14036 echo "${ECHO_T}$enable_gnat_projects" >&6
14037
14038 ###     Checks for libraries.
14039 case $cf_cv_system_name in
14040 (*mingw32*)
14041         ;;
14042 (*)
14043 echo "$as_me:14043: checking for gettimeofday" >&5
14044 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
14045 if test "${ac_cv_func_gettimeofday+set}" = set; then
14046   echo $ECHO_N "(cached) $ECHO_C" >&6
14047 else
14048   cat >conftest.$ac_ext <<_ACEOF
14049 #line 14049 "configure"
14050 #include "confdefs.h"
14051 /* System header to define __stub macros and hopefully few prototypes,
14052     which can conflict with char gettimeofday (); below.  */
14053 #include <assert.h>
14054 /* Override any gcc2 internal prototype to avoid an error.  */
14055 #ifdef __cplusplus
14056 extern "C"
14057 #endif
14058 /* We use char because int might match the return type of a gcc2
14059    builtin and then its argument prototype would still apply.  */
14060 char gettimeofday ();
14061 char (*f) ();
14062
14063 int
14064 main (void)
14065 {
14066 /* The GNU C library defines this for functions which it implements
14067     to always fail with ENOSYS.  Some functions are actually named
14068     something starting with __ and the normal name is an alias.  */
14069 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
14070 choke me
14071 #else
14072 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14073 #endif
14074
14075   ;
14076   return 0;
14077 }
14078 _ACEOF
14079 rm -f conftest.$ac_objext conftest$ac_exeext
14080 if { (eval echo "$as_me:14080: \"$ac_link\"") >&5
14081   (eval $ac_link) 2>&5
14082   ac_status=$?
14083   echo "$as_me:14083: \$? = $ac_status" >&5
14084   (exit $ac_status); } &&
14085          { ac_try='test -s conftest$ac_exeext'
14086   { (eval echo "$as_me:14086: \"$ac_try\"") >&5
14087   (eval $ac_try) 2>&5
14088   ac_status=$?
14089   echo "$as_me:14089: \$? = $ac_status" >&5
14090   (exit $ac_status); }; }; then
14091   ac_cv_func_gettimeofday=yes
14092 else
14093   echo "$as_me: failed program was:" >&5
14094 cat conftest.$ac_ext >&5
14095 ac_cv_func_gettimeofday=no
14096 fi
14097 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14098 fi
14099 echo "$as_me:14099: result: $ac_cv_func_gettimeofday" >&5
14100 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
14101 if test $ac_cv_func_gettimeofday = yes; then
14102   cat >>confdefs.h <<\EOF
14103 #define HAVE_GETTIMEOFDAY 1
14104 EOF
14105
14106 else
14107
14108 echo "$as_me:14108: checking for gettimeofday in -lbsd" >&5
14109 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
14110 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
14111   echo $ECHO_N "(cached) $ECHO_C" >&6
14112 else
14113   ac_check_lib_save_LIBS=$LIBS
14114 LIBS="-lbsd  $LIBS"
14115 cat >conftest.$ac_ext <<_ACEOF
14116 #line 14116 "configure"
14117 #include "confdefs.h"
14118
14119 /* Override any gcc2 internal prototype to avoid an error.  */
14120 #ifdef __cplusplus
14121 extern "C"
14122 #endif
14123 /* We use char because int might match the return type of a gcc2
14124    builtin and then its argument prototype would still apply.  */
14125 char gettimeofday ();
14126 int
14127 main (void)
14128 {
14129 gettimeofday ();
14130   ;
14131   return 0;
14132 }
14133 _ACEOF
14134 rm -f conftest.$ac_objext conftest$ac_exeext
14135 if { (eval echo "$as_me:14135: \"$ac_link\"") >&5
14136   (eval $ac_link) 2>&5
14137   ac_status=$?
14138   echo "$as_me:14138: \$? = $ac_status" >&5
14139   (exit $ac_status); } &&
14140          { ac_try='test -s conftest$ac_exeext'
14141   { (eval echo "$as_me:14141: \"$ac_try\"") >&5
14142   (eval $ac_try) 2>&5
14143   ac_status=$?
14144   echo "$as_me:14144: \$? = $ac_status" >&5
14145   (exit $ac_status); }; }; then
14146   ac_cv_lib_bsd_gettimeofday=yes
14147 else
14148   echo "$as_me: failed program was:" >&5
14149 cat conftest.$ac_ext >&5
14150 ac_cv_lib_bsd_gettimeofday=no
14151 fi
14152 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14153 LIBS=$ac_check_lib_save_LIBS
14154 fi
14155 echo "$as_me:14155: result: $ac_cv_lib_bsd_gettimeofday" >&5
14156 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
14157 if test $ac_cv_lib_bsd_gettimeofday = yes; then
14158
14159 cat >>confdefs.h <<\EOF
14160 #define HAVE_GETTIMEOFDAY 1
14161 EOF
14162
14163         LIBS="$LIBS -lbsd"
14164 fi
14165
14166 fi
14167         ;;
14168 esac
14169
14170 ###     Checks for header files.
14171 echo "$as_me:14171: checking for ANSI C header files" >&5
14172 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14173 if test "${ac_cv_header_stdc+set}" = set; then
14174   echo $ECHO_N "(cached) $ECHO_C" >&6
14175 else
14176   cat >conftest.$ac_ext <<_ACEOF
14177 #line 14177 "configure"
14178 #include "confdefs.h"
14179 #include <stdlib.h>
14180 #include <stdarg.h>
14181 #include <string.h>
14182 #include <float.h>
14183
14184 _ACEOF
14185 if { (eval echo "$as_me:14185: \"$ac_cpp conftest.$ac_ext\"") >&5
14186   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14187   ac_status=$?
14188   egrep -v '^ *\+' conftest.er1 >conftest.err
14189   rm -f conftest.er1
14190   cat conftest.err >&5
14191   echo "$as_me:14191: \$? = $ac_status" >&5
14192   (exit $ac_status); } >/dev/null; then
14193   if test -s conftest.err; then
14194     ac_cpp_err=$ac_c_preproc_warn_flag
14195   else
14196     ac_cpp_err=
14197   fi
14198 else
14199   ac_cpp_err=yes
14200 fi
14201 if test -z "$ac_cpp_err"; then
14202   ac_cv_header_stdc=yes
14203 else
14204   echo "$as_me: failed program was:" >&5
14205   cat conftest.$ac_ext >&5
14206   ac_cv_header_stdc=no
14207 fi
14208 rm -f conftest.err conftest.$ac_ext
14209
14210 if test $ac_cv_header_stdc = yes; then
14211   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14212   cat >conftest.$ac_ext <<_ACEOF
14213 #line 14213 "configure"
14214 #include "confdefs.h"
14215 #include <string.h>
14216
14217 _ACEOF
14218 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14219   egrep "memchr" >/dev/null 2>&1; then
14220   :
14221 else
14222   ac_cv_header_stdc=no
14223 fi
14224 rm -rf conftest*
14225
14226 fi
14227
14228 if test $ac_cv_header_stdc = yes; then
14229   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14230   cat >conftest.$ac_ext <<_ACEOF
14231 #line 14231 "configure"
14232 #include "confdefs.h"
14233 #include <stdlib.h>
14234
14235 _ACEOF
14236 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14237   egrep "free" >/dev/null 2>&1; then
14238   :
14239 else
14240   ac_cv_header_stdc=no
14241 fi
14242 rm -rf conftest*
14243
14244 fi
14245
14246 if test $ac_cv_header_stdc = yes; then
14247   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14248   if test "$cross_compiling" = yes; then
14249   :
14250 else
14251   cat >conftest.$ac_ext <<_ACEOF
14252 #line 14252 "configure"
14253 #include "confdefs.h"
14254 #include <ctype.h>
14255 #if ((' ' & 0x0FF) == 0x020)
14256 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14257 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14258 #else
14259 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14260                      || ('j' <= (c) && (c) <= 'r') \
14261                      || ('s' <= (c) && (c) <= 'z'))
14262 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14263 #endif
14264
14265 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14266 int
14267 main (void)
14268 {
14269   int i;
14270   for (i = 0; i < 256; i++)
14271     if (XOR (islower (i), ISLOWER (i))
14272         || toupper (i) != TOUPPER (i))
14273       $ac_main_return(2);
14274   $ac_main_return (0);
14275 }
14276 _ACEOF
14277 rm -f conftest$ac_exeext
14278 if { (eval echo "$as_me:14278: \"$ac_link\"") >&5
14279   (eval $ac_link) 2>&5
14280   ac_status=$?
14281   echo "$as_me:14281: \$? = $ac_status" >&5
14282   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14283   { (eval echo "$as_me:14283: \"$ac_try\"") >&5
14284   (eval $ac_try) 2>&5
14285   ac_status=$?
14286   echo "$as_me:14286: \$? = $ac_status" >&5
14287   (exit $ac_status); }; }; then
14288   :
14289 else
14290   echo "$as_me: program exited with status $ac_status" >&5
14291 echo "$as_me: failed program was:" >&5
14292 cat conftest.$ac_ext >&5
14293 ac_cv_header_stdc=no
14294 fi
14295 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14296 fi
14297 fi
14298 fi
14299 echo "$as_me:14299: result: $ac_cv_header_stdc" >&5
14300 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14301 if test $ac_cv_header_stdc = yes; then
14302
14303 cat >>confdefs.h <<\EOF
14304 #define STDC_HEADERS 1
14305 EOF
14306
14307 fi
14308
14309 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14310
14311 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14312                   inttypes.h stdint.h unistd.h
14313 do
14314 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14315 echo "$as_me:14315: checking for $ac_header" >&5
14316 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14317 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14318   echo $ECHO_N "(cached) $ECHO_C" >&6
14319 else
14320   cat >conftest.$ac_ext <<_ACEOF
14321 #line 14321 "configure"
14322 #include "confdefs.h"
14323 $ac_includes_default
14324 #include <$ac_header>
14325 _ACEOF
14326 rm -f conftest.$ac_objext
14327 if { (eval echo "$as_me:14327: \"$ac_compile\"") >&5
14328   (eval $ac_compile) 2>&5
14329   ac_status=$?
14330   echo "$as_me:14330: \$? = $ac_status" >&5
14331   (exit $ac_status); } &&
14332          { ac_try='test -s conftest.$ac_objext'
14333   { (eval echo "$as_me:14333: \"$ac_try\"") >&5
14334   (eval $ac_try) 2>&5
14335   ac_status=$?
14336   echo "$as_me:14336: \$? = $ac_status" >&5
14337   (exit $ac_status); }; }; then
14338   eval "$as_ac_Header=yes"
14339 else
14340   echo "$as_me: failed program was:" >&5
14341 cat conftest.$ac_ext >&5
14342 eval "$as_ac_Header=no"
14343 fi
14344 rm -f conftest.$ac_objext conftest.$ac_ext
14345 fi
14346 echo "$as_me:14346: result: `eval echo '${'$as_ac_Header'}'`" >&5
14347 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14348 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14349   cat >>confdefs.h <<EOF
14350 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14351 EOF
14352
14353 fi
14354 done
14355
14356 echo "$as_me:14356: checking for signed char" >&5
14357 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
14358 if test "${ac_cv_type_signed_char+set}" = set; then
14359   echo $ECHO_N "(cached) $ECHO_C" >&6
14360 else
14361   cat >conftest.$ac_ext <<_ACEOF
14362 #line 14362 "configure"
14363 #include "confdefs.h"
14364 $ac_includes_default
14365 int
14366 main (void)
14367 {
14368 if ((signed char *) 0)
14369   return 0;
14370 if (sizeof (signed char))
14371   return 0;
14372   ;
14373   return 0;
14374 }
14375 _ACEOF
14376 rm -f conftest.$ac_objext
14377 if { (eval echo "$as_me:14377: \"$ac_compile\"") >&5
14378   (eval $ac_compile) 2>&5
14379   ac_status=$?
14380   echo "$as_me:14380: \$? = $ac_status" >&5
14381   (exit $ac_status); } &&
14382          { ac_try='test -s conftest.$ac_objext'
14383   { (eval echo "$as_me:14383: \"$ac_try\"") >&5
14384   (eval $ac_try) 2>&5
14385   ac_status=$?
14386   echo "$as_me:14386: \$? = $ac_status" >&5
14387   (exit $ac_status); }; }; then
14388   ac_cv_type_signed_char=yes
14389 else
14390   echo "$as_me: failed program was:" >&5
14391 cat conftest.$ac_ext >&5
14392 ac_cv_type_signed_char=no
14393 fi
14394 rm -f conftest.$ac_objext conftest.$ac_ext
14395 fi
14396 echo "$as_me:14396: result: $ac_cv_type_signed_char" >&5
14397 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
14398
14399 echo "$as_me:14399: checking size of signed char" >&5
14400 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
14401 if test "${ac_cv_sizeof_signed_char+set}" = set; then
14402   echo $ECHO_N "(cached) $ECHO_C" >&6
14403 else
14404   if test "$ac_cv_type_signed_char" = yes; then
14405   if test "$cross_compiling" = yes; then
14406   # Depending upon the size, compute the lo and hi bounds.
14407 cat >conftest.$ac_ext <<_ACEOF
14408 #line 14408 "configure"
14409 #include "confdefs.h"
14410 $ac_includes_default
14411 int
14412 main (void)
14413 {
14414 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
14415   ;
14416   return 0;
14417 }
14418 _ACEOF
14419 rm -f conftest.$ac_objext
14420 if { (eval echo "$as_me:14420: \"$ac_compile\"") >&5
14421   (eval $ac_compile) 2>&5
14422   ac_status=$?
14423   echo "$as_me:14423: \$? = $ac_status" >&5
14424   (exit $ac_status); } &&
14425          { ac_try='test -s conftest.$ac_objext'
14426   { (eval echo "$as_me:14426: \"$ac_try\"") >&5
14427   (eval $ac_try) 2>&5
14428   ac_status=$?
14429   echo "$as_me:14429: \$? = $ac_status" >&5
14430   (exit $ac_status); }; }; then
14431   ac_lo=0 ac_mid=0
14432   while :; do
14433     cat >conftest.$ac_ext <<_ACEOF
14434 #line 14434 "configure"
14435 #include "confdefs.h"
14436 $ac_includes_default
14437 int
14438 main (void)
14439 {
14440 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14441   ;
14442   return 0;
14443 }
14444 _ACEOF
14445 rm -f conftest.$ac_objext
14446 if { (eval echo "$as_me:14446: \"$ac_compile\"") >&5
14447   (eval $ac_compile) 2>&5
14448   ac_status=$?
14449   echo "$as_me:14449: \$? = $ac_status" >&5
14450   (exit $ac_status); } &&
14451          { ac_try='test -s conftest.$ac_objext'
14452   { (eval echo "$as_me:14452: \"$ac_try\"") >&5
14453   (eval $ac_try) 2>&5
14454   ac_status=$?
14455   echo "$as_me:14455: \$? = $ac_status" >&5
14456   (exit $ac_status); }; }; then
14457   ac_hi=$ac_mid; break
14458 else
14459   echo "$as_me: failed program was:" >&5
14460 cat conftest.$ac_ext >&5
14461 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
14462 fi
14463 rm -f conftest.$ac_objext conftest.$ac_ext
14464   done
14465 else
14466   echo "$as_me: failed program was:" >&5
14467 cat conftest.$ac_ext >&5
14468 ac_hi=-1 ac_mid=-1
14469   while :; do
14470     cat >conftest.$ac_ext <<_ACEOF
14471 #line 14471 "configure"
14472 #include "confdefs.h"
14473 $ac_includes_default
14474 int
14475 main (void)
14476 {
14477 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
14478   ;
14479   return 0;
14480 }
14481 _ACEOF
14482 rm -f conftest.$ac_objext
14483 if { (eval echo "$as_me:14483: \"$ac_compile\"") >&5
14484   (eval $ac_compile) 2>&5
14485   ac_status=$?
14486   echo "$as_me:14486: \$? = $ac_status" >&5
14487   (exit $ac_status); } &&
14488          { ac_try='test -s conftest.$ac_objext'
14489   { (eval echo "$as_me:14489: \"$ac_try\"") >&5
14490   (eval $ac_try) 2>&5
14491   ac_status=$?
14492   echo "$as_me:14492: \$? = $ac_status" >&5
14493   (exit $ac_status); }; }; then
14494   ac_lo=$ac_mid; break
14495 else
14496   echo "$as_me: failed program was:" >&5
14497 cat conftest.$ac_ext >&5
14498 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
14499 fi
14500 rm -f conftest.$ac_objext conftest.$ac_ext
14501   done
14502 fi
14503 rm -f conftest.$ac_objext conftest.$ac_ext
14504 # Binary search between lo and hi bounds.
14505 while test "x$ac_lo" != "x$ac_hi"; do
14506   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
14507   cat >conftest.$ac_ext <<_ACEOF
14508 #line 14508 "configure"
14509 #include "confdefs.h"
14510 $ac_includes_default
14511 int
14512 main (void)
14513 {
14514 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14515   ;
14516   return 0;
14517 }
14518 _ACEOF
14519 rm -f conftest.$ac_objext
14520 if { (eval echo "$as_me:14520: \"$ac_compile\"") >&5
14521   (eval $ac_compile) 2>&5
14522   ac_status=$?
14523   echo "$as_me:14523: \$? = $ac_status" >&5
14524   (exit $ac_status); } &&
14525          { ac_try='test -s conftest.$ac_objext'
14526   { (eval echo "$as_me:14526: \"$ac_try\"") >&5
14527   (eval $ac_try) 2>&5
14528   ac_status=$?
14529   echo "$as_me:14529: \$? = $ac_status" >&5
14530   (exit $ac_status); }; }; then
14531   ac_hi=$ac_mid
14532 else
14533   echo "$as_me: failed program was:" >&5
14534 cat conftest.$ac_ext >&5
14535 ac_lo=`expr $ac_mid + 1`
14536 fi
14537 rm -f conftest.$ac_objext conftest.$ac_ext
14538 done
14539 ac_cv_sizeof_signed_char=$ac_lo
14540 else
14541   if test "$cross_compiling" = yes; then
14542   { { echo "$as_me:14542: error: cannot run test program while cross compiling" >&5
14543 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
14544    { (exit 1); exit 1; }; }
14545 else
14546   cat >conftest.$ac_ext <<_ACEOF
14547 #line 14547 "configure"
14548 #include "confdefs.h"
14549 $ac_includes_default
14550 int
14551 main (void)
14552 {
14553 FILE *f = fopen ("conftest.val", "w");
14554 if (!f)
14555   $ac_main_return (1);
14556 fprintf (f, "%d", (sizeof (signed char)));
14557 fclose (f);
14558   ;
14559   return 0;
14560 }
14561 _ACEOF
14562 rm -f conftest$ac_exeext
14563 if { (eval echo "$as_me:14563: \"$ac_link\"") >&5
14564   (eval $ac_link) 2>&5
14565   ac_status=$?
14566   echo "$as_me:14566: \$? = $ac_status" >&5
14567   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14568   { (eval echo "$as_me:14568: \"$ac_try\"") >&5
14569   (eval $ac_try) 2>&5
14570   ac_status=$?
14571   echo "$as_me:14571: \$? = $ac_status" >&5
14572   (exit $ac_status); }; }; then
14573   ac_cv_sizeof_signed_char=`cat conftest.val`
14574 else
14575   echo "$as_me: program exited with status $ac_status" >&5
14576 echo "$as_me: failed program was:" >&5
14577 cat conftest.$ac_ext >&5
14578 fi
14579 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14580 fi
14581 fi
14582 rm -f conftest.val
14583 else
14584   ac_cv_sizeof_signed_char=0
14585 fi
14586 fi
14587 echo "$as_me:14587: result: $ac_cv_sizeof_signed_char" >&5
14588 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
14589 cat >>confdefs.h <<EOF
14590 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
14591 EOF
14592
14593 echo "$as_me:14593: checking for ANSI C header files" >&5
14594 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14595 if test "${ac_cv_header_stdc+set}" = set; then
14596   echo $ECHO_N "(cached) $ECHO_C" >&6
14597 else
14598   cat >conftest.$ac_ext <<_ACEOF
14599 #line 14599 "configure"
14600 #include "confdefs.h"
14601 #include <stdlib.h>
14602 #include <stdarg.h>
14603 #include <string.h>
14604 #include <float.h>
14605
14606 _ACEOF
14607 if { (eval echo "$as_me:14607: \"$ac_cpp conftest.$ac_ext\"") >&5
14608   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14609   ac_status=$?
14610   egrep -v '^ *\+' conftest.er1 >conftest.err
14611   rm -f conftest.er1
14612   cat conftest.err >&5
14613   echo "$as_me:14613: \$? = $ac_status" >&5
14614   (exit $ac_status); } >/dev/null; then
14615   if test -s conftest.err; then
14616     ac_cpp_err=$ac_c_preproc_warn_flag
14617   else
14618     ac_cpp_err=
14619   fi
14620 else
14621   ac_cpp_err=yes
14622 fi
14623 if test -z "$ac_cpp_err"; then
14624   ac_cv_header_stdc=yes
14625 else
14626   echo "$as_me: failed program was:" >&5
14627   cat conftest.$ac_ext >&5
14628   ac_cv_header_stdc=no
14629 fi
14630 rm -f conftest.err conftest.$ac_ext
14631
14632 if test $ac_cv_header_stdc = yes; then
14633   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14634   cat >conftest.$ac_ext <<_ACEOF
14635 #line 14635 "configure"
14636 #include "confdefs.h"
14637 #include <string.h>
14638
14639 _ACEOF
14640 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14641   egrep "memchr" >/dev/null 2>&1; then
14642   :
14643 else
14644   ac_cv_header_stdc=no
14645 fi
14646 rm -rf conftest*
14647
14648 fi
14649
14650 if test $ac_cv_header_stdc = yes; then
14651   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14652   cat >conftest.$ac_ext <<_ACEOF
14653 #line 14653 "configure"
14654 #include "confdefs.h"
14655 #include <stdlib.h>
14656
14657 _ACEOF
14658 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14659   egrep "free" >/dev/null 2>&1; then
14660   :
14661 else
14662   ac_cv_header_stdc=no
14663 fi
14664 rm -rf conftest*
14665
14666 fi
14667
14668 if test $ac_cv_header_stdc = yes; then
14669   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14670   if test "$cross_compiling" = yes; then
14671   :
14672 else
14673   cat >conftest.$ac_ext <<_ACEOF
14674 #line 14674 "configure"
14675 #include "confdefs.h"
14676 #include <ctype.h>
14677 #if ((' ' & 0x0FF) == 0x020)
14678 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14679 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14680 #else
14681 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14682                      || ('j' <= (c) && (c) <= 'r') \
14683                      || ('s' <= (c) && (c) <= 'z'))
14684 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14685 #endif
14686
14687 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14688 int
14689 main (void)
14690 {
14691   int i;
14692   for (i = 0; i < 256; i++)
14693     if (XOR (islower (i), ISLOWER (i))
14694         || toupper (i) != TOUPPER (i))
14695       $ac_main_return(2);
14696   $ac_main_return (0);
14697 }
14698 _ACEOF
14699 rm -f conftest$ac_exeext
14700 if { (eval echo "$as_me:14700: \"$ac_link\"") >&5
14701   (eval $ac_link) 2>&5
14702   ac_status=$?
14703   echo "$as_me:14703: \$? = $ac_status" >&5
14704   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14705   { (eval echo "$as_me:14705: \"$ac_try\"") >&5
14706   (eval $ac_try) 2>&5
14707   ac_status=$?
14708   echo "$as_me:14708: \$? = $ac_status" >&5
14709   (exit $ac_status); }; }; then
14710   :
14711 else
14712   echo "$as_me: program exited with status $ac_status" >&5
14713 echo "$as_me: failed program was:" >&5
14714 cat conftest.$ac_ext >&5
14715 ac_cv_header_stdc=no
14716 fi
14717 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14718 fi
14719 fi
14720 fi
14721 echo "$as_me:14721: result: $ac_cv_header_stdc" >&5
14722 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14723 if test $ac_cv_header_stdc = yes; then
14724
14725 cat >>confdefs.h <<\EOF
14726 #define STDC_HEADERS 1
14727 EOF
14728
14729 fi
14730
14731 ac_header_dirent=no
14732 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
14733   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
14734 echo "$as_me:14734: checking for $ac_hdr that defines DIR" >&5
14735 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
14736 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14737   echo $ECHO_N "(cached) $ECHO_C" >&6
14738 else
14739   cat >conftest.$ac_ext <<_ACEOF
14740 #line 14740 "configure"
14741 #include "confdefs.h"
14742 #include <sys/types.h>
14743 #include <$ac_hdr>
14744
14745 int
14746 main (void)
14747 {
14748 if ((DIR *) 0)
14749 return 0;
14750   ;
14751   return 0;
14752 }
14753 _ACEOF
14754 rm -f conftest.$ac_objext
14755 if { (eval echo "$as_me:14755: \"$ac_compile\"") >&5
14756   (eval $ac_compile) 2>&5
14757   ac_status=$?
14758   echo "$as_me:14758: \$? = $ac_status" >&5
14759   (exit $ac_status); } &&
14760          { ac_try='test -s conftest.$ac_objext'
14761   { (eval echo "$as_me:14761: \"$ac_try\"") >&5
14762   (eval $ac_try) 2>&5
14763   ac_status=$?
14764   echo "$as_me:14764: \$? = $ac_status" >&5
14765   (exit $ac_status); }; }; then
14766   eval "$as_ac_Header=yes"
14767 else
14768   echo "$as_me: failed program was:" >&5
14769 cat conftest.$ac_ext >&5
14770 eval "$as_ac_Header=no"
14771 fi
14772 rm -f conftest.$ac_objext conftest.$ac_ext
14773 fi
14774 echo "$as_me:14774: result: `eval echo '${'$as_ac_Header'}'`" >&5
14775 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14776 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14777   cat >>confdefs.h <<EOF
14778 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
14779 EOF
14780
14781 ac_header_dirent=$ac_hdr; break
14782 fi
14783
14784 done
14785 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
14786 if test $ac_header_dirent = dirent.h; then
14787   echo "$as_me:14787: checking for opendir in -ldir" >&5
14788 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
14789 if test "${ac_cv_lib_dir_opendir+set}" = set; then
14790   echo $ECHO_N "(cached) $ECHO_C" >&6
14791 else
14792   ac_check_lib_save_LIBS=$LIBS
14793 LIBS="-ldir  $LIBS"
14794 cat >conftest.$ac_ext <<_ACEOF
14795 #line 14795 "configure"
14796 #include "confdefs.h"
14797
14798 /* Override any gcc2 internal prototype to avoid an error.  */
14799 #ifdef __cplusplus
14800 extern "C"
14801 #endif
14802 /* We use char because int might match the return type of a gcc2
14803    builtin and then its argument prototype would still apply.  */
14804 char opendir ();
14805 int
14806 main (void)
14807 {
14808 opendir ();
14809   ;
14810   return 0;
14811 }
14812 _ACEOF
14813 rm -f conftest.$ac_objext conftest$ac_exeext
14814 if { (eval echo "$as_me:14814: \"$ac_link\"") >&5
14815   (eval $ac_link) 2>&5
14816   ac_status=$?
14817   echo "$as_me:14817: \$? = $ac_status" >&5
14818   (exit $ac_status); } &&
14819          { ac_try='test -s conftest$ac_exeext'
14820   { (eval echo "$as_me:14820: \"$ac_try\"") >&5
14821   (eval $ac_try) 2>&5
14822   ac_status=$?
14823   echo "$as_me:14823: \$? = $ac_status" >&5
14824   (exit $ac_status); }; }; then
14825   ac_cv_lib_dir_opendir=yes
14826 else
14827   echo "$as_me: failed program was:" >&5
14828 cat conftest.$ac_ext >&5
14829 ac_cv_lib_dir_opendir=no
14830 fi
14831 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14832 LIBS=$ac_check_lib_save_LIBS
14833 fi
14834 echo "$as_me:14834: result: $ac_cv_lib_dir_opendir" >&5
14835 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
14836 if test $ac_cv_lib_dir_opendir = yes; then
14837   LIBS="$LIBS -ldir"
14838 fi
14839
14840 else
14841   echo "$as_me:14841: checking for opendir in -lx" >&5
14842 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
14843 if test "${ac_cv_lib_x_opendir+set}" = set; then
14844   echo $ECHO_N "(cached) $ECHO_C" >&6
14845 else
14846   ac_check_lib_save_LIBS=$LIBS
14847 LIBS="-lx  $LIBS"
14848 cat >conftest.$ac_ext <<_ACEOF
14849 #line 14849 "configure"
14850 #include "confdefs.h"
14851
14852 /* Override any gcc2 internal prototype to avoid an error.  */
14853 #ifdef __cplusplus
14854 extern "C"
14855 #endif
14856 /* We use char because int might match the return type of a gcc2
14857    builtin and then its argument prototype would still apply.  */
14858 char opendir ();
14859 int
14860 main (void)
14861 {
14862 opendir ();
14863   ;
14864   return 0;
14865 }
14866 _ACEOF
14867 rm -f conftest.$ac_objext conftest$ac_exeext
14868 if { (eval echo "$as_me:14868: \"$ac_link\"") >&5
14869   (eval $ac_link) 2>&5
14870   ac_status=$?
14871   echo "$as_me:14871: \$? = $ac_status" >&5
14872   (exit $ac_status); } &&
14873          { ac_try='test -s conftest$ac_exeext'
14874   { (eval echo "$as_me:14874: \"$ac_try\"") >&5
14875   (eval $ac_try) 2>&5
14876   ac_status=$?
14877   echo "$as_me:14877: \$? = $ac_status" >&5
14878   (exit $ac_status); }; }; then
14879   ac_cv_lib_x_opendir=yes
14880 else
14881   echo "$as_me: failed program was:" >&5
14882 cat conftest.$ac_ext >&5
14883 ac_cv_lib_x_opendir=no
14884 fi
14885 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14886 LIBS=$ac_check_lib_save_LIBS
14887 fi
14888 echo "$as_me:14888: result: $ac_cv_lib_x_opendir" >&5
14889 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
14890 if test $ac_cv_lib_x_opendir = yes; then
14891   LIBS="$LIBS -lx"
14892 fi
14893
14894 fi
14895
14896 echo "$as_me:14896: checking whether time.h and sys/time.h may both be included" >&5
14897 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14898 if test "${ac_cv_header_time+set}" = set; then
14899   echo $ECHO_N "(cached) $ECHO_C" >&6
14900 else
14901   cat >conftest.$ac_ext <<_ACEOF
14902 #line 14902 "configure"
14903 #include "confdefs.h"
14904 #include <sys/types.h>
14905 #include <sys/time.h>
14906 #include <time.h>
14907
14908 int
14909 main (void)
14910 {
14911 if ((struct tm *) 0)
14912 return 0;
14913   ;
14914   return 0;
14915 }
14916 _ACEOF
14917 rm -f conftest.$ac_objext
14918 if { (eval echo "$as_me:14918: \"$ac_compile\"") >&5
14919   (eval $ac_compile) 2>&5
14920   ac_status=$?
14921   echo "$as_me:14921: \$? = $ac_status" >&5
14922   (exit $ac_status); } &&
14923          { ac_try='test -s conftest.$ac_objext'
14924   { (eval echo "$as_me:14924: \"$ac_try\"") >&5
14925   (eval $ac_try) 2>&5
14926   ac_status=$?
14927   echo "$as_me:14927: \$? = $ac_status" >&5
14928   (exit $ac_status); }; }; then
14929   ac_cv_header_time=yes
14930 else
14931   echo "$as_me: failed program was:" >&5
14932 cat conftest.$ac_ext >&5
14933 ac_cv_header_time=no
14934 fi
14935 rm -f conftest.$ac_objext conftest.$ac_ext
14936 fi
14937 echo "$as_me:14937: result: $ac_cv_header_time" >&5
14938 echo "${ECHO_T}$ac_cv_header_time" >&6
14939 if test $ac_cv_header_time = yes; then
14940
14941 cat >>confdefs.h <<\EOF
14942 #define TIME_WITH_SYS_TIME 1
14943 EOF
14944
14945 fi
14946
14947 ###     checks for compiler characteristics
14948 ac_ext=c
14949 ac_cpp='$CPP $CPPFLAGS'
14950 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14951 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14952 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14953 ac_main_return=return
14954
14955 echo "$as_me:14955: checking for an ANSI C-conforming const" >&5
14956 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
14957 if test "${ac_cv_c_const+set}" = set; then
14958   echo $ECHO_N "(cached) $ECHO_C" >&6
14959 else
14960   cat >conftest.$ac_ext <<_ACEOF
14961 #line 14961 "configure"
14962 #include "confdefs.h"
14963
14964 int
14965 main (void)
14966 {
14967 /* FIXME: Include the comments suggested by Paul. */
14968 #ifndef __cplusplus
14969   /* Ultrix mips cc rejects this.  */
14970   typedef int charset[2];
14971   const charset x;
14972   /* SunOS 4.1.1 cc rejects this.  */
14973   char const *const *ccp;
14974   char **p;
14975   /* NEC SVR4.0.2 mips cc rejects this.  */
14976   struct point {int x, y;};
14977   static struct point const zero = {0,0};
14978   /* AIX XL C 1.02.0.0 rejects this.
14979      It does not let you subtract one const X* pointer from another in
14980      an arm of an if-expression whose if-part is not a constant
14981      expression */
14982   const char *g = "string";
14983   ccp = &g + (g ? g-g : 0);
14984   /* HPUX 7.0 cc rejects these. */
14985   ++ccp;
14986   p = (char**) ccp;
14987   ccp = (char const *const *) p;
14988   { /* SCO 3.2v4 cc rejects this.  */
14989     char *t;
14990     char const *s = 0 ? (char *) 0 : (char const *) 0;
14991
14992     *t++ = 0;
14993   }
14994   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
14995     int x[] = {25, 17};
14996     const int *foo = &x[0];
14997     ++foo;
14998   }
14999   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15000     typedef const int *iptr;
15001     iptr p = 0;
15002     ++p;
15003   }
15004   { /* AIX XL C 1.02.0.0 rejects this saying
15005        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15006     struct s { int j; const int *ap[3]; };
15007     struct s *b; b->j = 5;
15008   }
15009   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15010     const int foo = 10;
15011   }
15012 #endif
15013
15014   ;
15015   return 0;
15016 }
15017 _ACEOF
15018 rm -f conftest.$ac_objext
15019 if { (eval echo "$as_me:15019: \"$ac_compile\"") >&5
15020   (eval $ac_compile) 2>&5
15021   ac_status=$?
15022   echo "$as_me:15022: \$? = $ac_status" >&5
15023   (exit $ac_status); } &&
15024          { ac_try='test -s conftest.$ac_objext'
15025   { (eval echo "$as_me:15025: \"$ac_try\"") >&5
15026   (eval $ac_try) 2>&5
15027   ac_status=$?
15028   echo "$as_me:15028: \$? = $ac_status" >&5
15029   (exit $ac_status); }; }; then
15030   ac_cv_c_const=yes
15031 else
15032   echo "$as_me: failed program was:" >&5
15033 cat conftest.$ac_ext >&5
15034 ac_cv_c_const=no
15035 fi
15036 rm -f conftest.$ac_objext conftest.$ac_ext
15037 fi
15038 echo "$as_me:15038: result: $ac_cv_c_const" >&5
15039 echo "${ECHO_T}$ac_cv_c_const" >&6
15040 if test $ac_cv_c_const = no; then
15041
15042 cat >>confdefs.h <<\EOF
15043 #define const
15044 EOF
15045
15046 fi
15047
15048 ###     Checks for external-data
15049
15050 echo "$as_me:15050: checking if data-only library module links" >&5
15051 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
15052 if test "${cf_cv_link_dataonly+set}" = set; then
15053   echo $ECHO_N "(cached) $ECHO_C" >&6
15054 else
15055
15056         rm -f conftest.a
15057         cat >conftest.$ac_ext <<EOF
15058 #line 15058 "configure"
15059 int     testdata[3] = { 123, 456, 789 };
15060 EOF
15061         if { (eval echo "$as_me:15061: \"$ac_compile\"") >&5
15062   (eval $ac_compile) 2>&5
15063   ac_status=$?
15064   echo "$as_me:15064: \$? = $ac_status" >&5
15065   (exit $ac_status); } ; then
15066                 mv conftest.o data.o && \
15067                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
15068         fi
15069         rm -f conftest.$ac_ext data.o
15070         cat >conftest.$ac_ext <<EOF
15071 #line 15071 "configure"
15072 int     testfunc(void)
15073 {
15074 #if defined(NeXT)
15075         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
15076 #else
15077         extern int testdata[3];
15078         return testdata[0] == 123
15079            &&  testdata[1] == 456
15080            &&  testdata[2] == 789;
15081 #endif
15082 }
15083 EOF
15084         if { (eval echo "$as_me:15084: \"$ac_compile\"") >&5
15085   (eval $ac_compile) 2>&5
15086   ac_status=$?
15087   echo "$as_me:15087: \$? = $ac_status" >&5
15088   (exit $ac_status); }; then
15089                 mv conftest.o func.o && \
15090                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
15091         fi
15092         rm -f conftest.$ac_ext func.o
15093         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
15094         cf_saveLIBS="$LIBS"
15095         LIBS="conftest.a $LIBS"
15096         if test "$cross_compiling" = yes; then
15097   cf_cv_link_dataonly=unknown
15098 else
15099   cat >conftest.$ac_ext <<_ACEOF
15100 #line 15100 "configure"
15101 #include "confdefs.h"
15102
15103         int main(void)
15104         {
15105                 extern int testfunc();
15106                 ${cf_cv_main_return:-return} (!testfunc());
15107         }
15108
15109 _ACEOF
15110 rm -f conftest$ac_exeext
15111 if { (eval echo "$as_me:15111: \"$ac_link\"") >&5
15112   (eval $ac_link) 2>&5
15113   ac_status=$?
15114   echo "$as_me:15114: \$? = $ac_status" >&5
15115   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15116   { (eval echo "$as_me:15116: \"$ac_try\"") >&5
15117   (eval $ac_try) 2>&5
15118   ac_status=$?
15119   echo "$as_me:15119: \$? = $ac_status" >&5
15120   (exit $ac_status); }; }; then
15121   cf_cv_link_dataonly=yes
15122 else
15123   echo "$as_me: program exited with status $ac_status" >&5
15124 echo "$as_me: failed program was:" >&5
15125 cat conftest.$ac_ext >&5
15126 cf_cv_link_dataonly=no
15127 fi
15128 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15129 fi
15130         LIBS="$cf_saveLIBS"
15131
15132 fi
15133
15134 echo "$as_me:15134: result: $cf_cv_link_dataonly" >&5
15135 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
15136
15137 if test "$cf_cv_link_dataonly" = no ; then
15138
15139 cat >>confdefs.h <<\EOF
15140 #define BROKEN_LINKER 1
15141 EOF
15142
15143         BROKEN_LINKER=1
15144 fi
15145
15146 ###     Checks for library functions.
15147
15148 for ac_header in \
15149 unistd.h \
15150
15151 do
15152 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15153 echo "$as_me:15153: checking for $ac_header" >&5
15154 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15155 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15156   echo $ECHO_N "(cached) $ECHO_C" >&6
15157 else
15158   cat >conftest.$ac_ext <<_ACEOF
15159 #line 15159 "configure"
15160 #include "confdefs.h"
15161 #include <$ac_header>
15162 _ACEOF
15163 if { (eval echo "$as_me:15163: \"$ac_cpp conftest.$ac_ext\"") >&5
15164   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15165   ac_status=$?
15166   egrep -v '^ *\+' conftest.er1 >conftest.err
15167   rm -f conftest.er1
15168   cat conftest.err >&5
15169   echo "$as_me:15169: \$? = $ac_status" >&5
15170   (exit $ac_status); } >/dev/null; then
15171   if test -s conftest.err; then
15172     ac_cpp_err=$ac_c_preproc_warn_flag
15173   else
15174     ac_cpp_err=
15175   fi
15176 else
15177   ac_cpp_err=yes
15178 fi
15179 if test -z "$ac_cpp_err"; then
15180   eval "$as_ac_Header=yes"
15181 else
15182   echo "$as_me: failed program was:" >&5
15183   cat conftest.$ac_ext >&5
15184   eval "$as_ac_Header=no"
15185 fi
15186 rm -f conftest.err conftest.$ac_ext
15187 fi
15188 echo "$as_me:15188: result: `eval echo '${'$as_ac_Header'}'`" >&5
15189 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15190 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15191   cat >>confdefs.h <<EOF
15192 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15193 EOF
15194
15195 fi
15196 done
15197
15198 echo "$as_me:15198: checking for working mkstemp" >&5
15199 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
15200 if test "${cf_cv_func_mkstemp+set}" = set; then
15201   echo $ECHO_N "(cached) $ECHO_C" >&6
15202 else
15203
15204 rm -rf conftest*
15205 if test "$cross_compiling" = yes; then
15206   cf_cv_func_mkstemp=maybe
15207 else
15208   cat >conftest.$ac_ext <<_ACEOF
15209 #line 15209 "configure"
15210 #include "confdefs.h"
15211
15212 #include <sys/types.h>
15213 #ifdef HAVE_UNISTD_H
15214 #include <unistd.h>
15215 #endif
15216 #include <stdlib.h>
15217 #include <stdio.h>
15218 #include <string.h>
15219 #include <sys/stat.h>
15220 int main(void)
15221 {
15222         char *tmpl = "conftestXXXXXX";
15223         char name[2][80];
15224         int n;
15225         int result = 0;
15226         int fd;
15227         struct stat sb;
15228
15229         umask(077);
15230         for (n = 0; n < 2; ++n) {
15231                 strcpy(name[n], tmpl);
15232                 if ((fd = mkstemp(name[n])) >= 0) {
15233                         if (!strcmp(name[n], tmpl)
15234                          || stat(name[n], &sb) != 0
15235                          || (sb.st_mode & S_IFMT) != S_IFREG
15236                          || (sb.st_mode & 077) != 0) {
15237                                 result = 1;
15238                         }
15239                         close(fd);
15240                 }
15241         }
15242         if (result == 0
15243          && !strcmp(name[0], name[1]))
15244                 result = 1;
15245         ${cf_cv_main_return:-return}(result);
15246 }
15247
15248 _ACEOF
15249 rm -f conftest$ac_exeext
15250 if { (eval echo "$as_me:15250: \"$ac_link\"") >&5
15251   (eval $ac_link) 2>&5
15252   ac_status=$?
15253   echo "$as_me:15253: \$? = $ac_status" >&5
15254   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15255   { (eval echo "$as_me:15255: \"$ac_try\"") >&5
15256   (eval $ac_try) 2>&5
15257   ac_status=$?
15258   echo "$as_me:15258: \$? = $ac_status" >&5
15259   (exit $ac_status); }; }; then
15260   cf_cv_func_mkstemp=yes
15261
15262 else
15263   echo "$as_me: program exited with status $ac_status" >&5
15264 echo "$as_me: failed program was:" >&5
15265 cat conftest.$ac_ext >&5
15266 cf_cv_func_mkstemp=no
15267
15268 fi
15269 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15270 fi
15271
15272 fi
15273 echo "$as_me:15273: result: $cf_cv_func_mkstemp" >&5
15274 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
15275 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
15276         echo "$as_me:15276: checking for mkstemp" >&5
15277 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
15278 if test "${ac_cv_func_mkstemp+set}" = set; then
15279   echo $ECHO_N "(cached) $ECHO_C" >&6
15280 else
15281   cat >conftest.$ac_ext <<_ACEOF
15282 #line 15282 "configure"
15283 #include "confdefs.h"
15284 /* System header to define __stub macros and hopefully few prototypes,
15285     which can conflict with char mkstemp (); below.  */
15286 #include <assert.h>
15287 /* Override any gcc2 internal prototype to avoid an error.  */
15288 #ifdef __cplusplus
15289 extern "C"
15290 #endif
15291 /* We use char because int might match the return type of a gcc2
15292    builtin and then its argument prototype would still apply.  */
15293 char mkstemp ();
15294 char (*f) ();
15295
15296 int
15297 main (void)
15298 {
15299 /* The GNU C library defines this for functions which it implements
15300     to always fail with ENOSYS.  Some functions are actually named
15301     something starting with __ and the normal name is an alias.  */
15302 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
15303 choke me
15304 #else
15305 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15306 #endif
15307
15308   ;
15309   return 0;
15310 }
15311 _ACEOF
15312 rm -f conftest.$ac_objext conftest$ac_exeext
15313 if { (eval echo "$as_me:15313: \"$ac_link\"") >&5
15314   (eval $ac_link) 2>&5
15315   ac_status=$?
15316   echo "$as_me:15316: \$? = $ac_status" >&5
15317   (exit $ac_status); } &&
15318          { ac_try='test -s conftest$ac_exeext'
15319   { (eval echo "$as_me:15319: \"$ac_try\"") >&5
15320   (eval $ac_try) 2>&5
15321   ac_status=$?
15322   echo "$as_me:15322: \$? = $ac_status" >&5
15323   (exit $ac_status); }; }; then
15324   ac_cv_func_mkstemp=yes
15325 else
15326   echo "$as_me: failed program was:" >&5
15327 cat conftest.$ac_ext >&5
15328 ac_cv_func_mkstemp=no
15329 fi
15330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15331 fi
15332 echo "$as_me:15332: result: $ac_cv_func_mkstemp" >&5
15333 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
15334
15335 fi
15336 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
15337
15338 cat >>confdefs.h <<\EOF
15339 #define HAVE_MKSTEMP 1
15340 EOF
15341
15342 fi
15343
15344 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
15345         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15346         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15347 fi
15348
15349 cf_with_ada=yes
15350 if test "$cf_with_ada" != "no" ; then
15351
15352 cf_ada_make=gnatmake
15353 cf_ada_config="#"
15354 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
15355 set dummy $cf_ada_make; ac_word=$2
15356 echo "$as_me:15356: checking for $ac_word" >&5
15357 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15358 if test "${ac_cv_prog_gnatmake_exists+set}" = set; then
15359   echo $ECHO_N "(cached) $ECHO_C" >&6
15360 else
15361   if test -n "$gnatmake_exists"; then
15362   ac_cv_prog_gnatmake_exists="$gnatmake_exists" # Let the user override the test.
15363 else
15364   ac_save_IFS=$IFS; IFS=$ac_path_separator
15365 ac_dummy="$PATH"
15366 for ac_dir in $ac_dummy; do
15367   IFS=$ac_save_IFS
15368   test -z "$ac_dir" && ac_dir=.
15369   $as_executable_p "$ac_dir/$ac_word" || continue
15370 ac_cv_prog_gnatmake_exists="yes"
15371 echo "$as_me:15371: found $ac_dir/$ac_word" >&5
15372 break
15373 done
15374
15375   test -z "$ac_cv_prog_gnatmake_exists" && ac_cv_prog_gnatmake_exists="no"
15376 fi
15377 fi
15378 gnatmake_exists=$ac_cv_prog_gnatmake_exists
15379 if test -n "$gnatmake_exists"; then
15380   echo "$as_me:15380: result: $gnatmake_exists" >&5
15381 echo "${ECHO_T}$gnatmake_exists" >&6
15382 else
15383   echo "$as_me:15383: result: no" >&5
15384 echo "${ECHO_T}no" >&6
15385 fi
15386
15387 if test "$ac_cv_prog_gnatmake_exists" = no; then
15388         cf_ada_make=
15389         cf_cv_prog_gnat_correct=no
15390 else
15391         # Extract the first word of "gprconfig", so it can be a program name with args.
15392 set dummy gprconfig; ac_word=$2
15393 echo "$as_me:15393: checking for $ac_word" >&5
15394 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15395 if test "${ac_cv_prog_gprconfig_exists+set}" = set; then
15396   echo $ECHO_N "(cached) $ECHO_C" >&6
15397 else
15398   if test -n "$gprconfig_exists"; then
15399   ac_cv_prog_gprconfig_exists="$gprconfig_exists" # Let the user override the test.
15400 else
15401   ac_save_IFS=$IFS; IFS=$ac_path_separator
15402 ac_dummy="$PATH"
15403 for ac_dir in $ac_dummy; do
15404   IFS=$ac_save_IFS
15405   test -z "$ac_dir" && ac_dir=.
15406   $as_executable_p "$ac_dir/$ac_word" || continue
15407 ac_cv_prog_gprconfig_exists="yes"
15408 echo "$as_me:15408: found $ac_dir/$ac_word" >&5
15409 break
15410 done
15411
15412   test -z "$ac_cv_prog_gprconfig_exists" && ac_cv_prog_gprconfig_exists="no"
15413 fi
15414 fi
15415 gprconfig_exists=$ac_cv_prog_gprconfig_exists
15416 if test -n "$gprconfig_exists"; then
15417   echo "$as_me:15417: result: $gprconfig_exists" >&5
15418 echo "${ECHO_T}$gprconfig_exists" >&6
15419 else
15420   echo "$as_me:15420: result: no" >&5
15421 echo "${ECHO_T}no" >&6
15422 fi
15423
15424         if test "$ac_cv_prog_gprconfig_exists" = yes
15425         then
15426                 rm -rf conftest* *~conftest*
15427                 if mkdir conftest.src
15428                 then
15429                         cf_ada_config=""
15430                         cd conftest.src
15431                         for cf_gprconfig in Ada C
15432                         do
15433                                 echo "$as_me:15433: checking for gprconfig name for $cf_gprconfig" >&5
15434 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
15435                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15436                                 if test -n "$cf_gprconfig_value"
15437                                 then
15438                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
15439                                         echo "$as_me:15439: result: $cf_gprconfig_value" >&5
15440 echo "${ECHO_T}$cf_gprconfig_value" >&6
15441                                 else
15442                                         echo "$as_me:15442: result: missing" >&5
15443 echo "${ECHO_T}missing" >&6
15444                                         cf_ada_config="#"
15445                                         break
15446                                 fi
15447                         done
15448                         cd ..
15449                         rm -rf conftest* *~conftest*
15450                 fi
15451         else
15452                 # gprconfig is newer than gnatmake; we can continue...
15453                 cf_ada_config="##"
15454         fi
15455         if test "x$cf_ada_config" != "x#"
15456         then
15457
15458 echo "$as_me:15458: checking for gnat version" >&5
15459 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
15460 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
15461         grep '[0-9].[0-9][0-9]*' |\
15462         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
15463 echo "$as_me:15463: result: $cf_gnat_version" >&5
15464 echo "${ECHO_T}$cf_gnat_version" >&6
15465
15466 case $cf_gnat_version in
15467 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
15468         cf_cv_prog_gnat_correct=yes
15469         ;;
15470 (*)
15471         { echo "$as_me:15471: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
15472 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
15473         cf_cv_prog_gnat_correct=no
15474         ;;
15475 esac
15476
15477                 # Extract the first word of "m4", so it can be a program name with args.
15478 set dummy m4; ac_word=$2
15479 echo "$as_me:15479: checking for $ac_word" >&5
15480 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15481 if test "${ac_cv_prog_M4_exists+set}" = set; then
15482   echo $ECHO_N "(cached) $ECHO_C" >&6
15483 else
15484   if test -n "$M4_exists"; then
15485   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
15486 else
15487   ac_save_IFS=$IFS; IFS=$ac_path_separator
15488 ac_dummy="$PATH"
15489 for ac_dir in $ac_dummy; do
15490   IFS=$ac_save_IFS
15491   test -z "$ac_dir" && ac_dir=.
15492   $as_executable_p "$ac_dir/$ac_word" || continue
15493 ac_cv_prog_M4_exists="yes"
15494 echo "$as_me:15494: found $ac_dir/$ac_word" >&5
15495 break
15496 done
15497
15498   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
15499 fi
15500 fi
15501 M4_exists=$ac_cv_prog_M4_exists
15502 if test -n "$M4_exists"; then
15503   echo "$as_me:15503: result: $M4_exists" >&5
15504 echo "${ECHO_T}$M4_exists" >&6
15505 else
15506   echo "$as_me:15506: result: no" >&5
15507 echo "${ECHO_T}no" >&6
15508 fi
15509
15510                 if test "$ac_cv_prog_M4_exists" = no; then
15511                         cf_cv_prog_gnat_correct=no
15512                         echo Ada95 binding required program m4 not found. Ada95 binding disabled.
15513                 fi
15514                 if test "$cf_cv_prog_gnat_correct" = yes; then
15515                         echo "$as_me:15515: checking if GNAT works" >&5
15516 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
15517
15518 rm -rf conftest* *~conftest*
15519 cat >>conftest.ads <<CF_EOF
15520 procedure conftest;
15521 CF_EOF
15522 cat >>conftest.adb <<CF_EOF
15523 with Text_IO;
15524 with GNAT.OS_Lib;
15525 procedure conftest is
15526 begin
15527    Text_IO.Put ("Hello World");
15528    Text_IO.New_Line;
15529    GNAT.OS_Lib.OS_Exit (0);
15530 end conftest;
15531 CF_EOF
15532 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15533    if ( ./conftest 1>&5 2>&1 ) ; then
15534       cf_cv_prog_gnat_correct=yes
15535    else
15536       cf_cv_prog_gnat_correct=no
15537    fi
15538 else
15539    cf_cv_prog_gnat_correct=no
15540 fi
15541 rm -rf conftest* *~conftest*
15542
15543                         echo "$as_me:15543: result: $cf_cv_prog_gnat_correct" >&5
15544 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
15545                 fi
15546         else
15547                 cf_cv_prog_gnat_correct=no
15548         fi
15549 fi
15550
15551         if test "$cf_cv_prog_gnat_correct" = yes; then
15552
15553         echo "$as_me:15553: checking optimization options for ADAFLAGS" >&5
15554 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
15555         case "$CFLAGS" in
15556         (*-g*)
15557
15558         ADAFLAGS="$ADAFLAGS -g"
15559
15560                 ;;
15561         esac
15562         case "$CFLAGS" in
15563         (*-O*)
15564                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
15565
15566         ADAFLAGS="$ADAFLAGS $cf_O_flag"
15567
15568                 ;;
15569         esac
15570         echo "$as_me:15570: result: $ADAFLAGS" >&5
15571 echo "${ECHO_T}$ADAFLAGS" >&6
15572
15573 echo "$as_me:15573: checking if GNATPREP supports -T option" >&5
15574 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
15575 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
15576   echo $ECHO_N "(cached) $ECHO_C" >&6
15577 else
15578
15579 cf_cv_gnatprep_opt_t=no
15580 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
15581
15582 fi
15583 echo "$as_me:15583: result: $cf_cv_gnatprep_opt_t" >&5
15584 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
15585 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
15586
15587 echo "$as_me:15587: checking if GNAT supports generics" >&5
15588 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
15589 case $cf_gnat_version in
15590 (3.[1-9]*|[4-9].*)
15591         cf_gnat_generics=yes
15592         ;;
15593 (*)
15594         cf_gnat_generics=no
15595         ;;
15596 esac
15597 echo "$as_me:15597: result: $cf_gnat_generics" >&5
15598 echo "${ECHO_T}$cf_gnat_generics" >&6
15599
15600 if test "$cf_gnat_generics" = yes
15601 then
15602         cf_compile_generics=generics
15603         cf_generic_objects="\${GENOBJS}"
15604 else
15605         cf_compile_generics=
15606         cf_generic_objects=
15607 fi
15608
15609 echo "$as_me:15609: checking if GNAT supports SIGINT" >&5
15610 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
15611 if test "${cf_cv_gnat_sigint+set}" = set; then
15612   echo $ECHO_N "(cached) $ECHO_C" >&6
15613 else
15614
15615 rm -rf conftest* *~conftest*
15616 cat >>conftest.ads <<CF_EOF
15617 with Ada.Interrupts.Names;
15618
15619 package ConfTest is
15620
15621    pragma Warnings (Off);  --  the next pragma exists since 3.11p
15622    pragma Unreserve_All_Interrupts;
15623    pragma Warnings (On);
15624
15625    protected Process is
15626       procedure Stop;
15627       function Continue return Boolean;
15628       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
15629    private
15630       Done : Boolean := False;
15631    end Process;
15632
15633 end ConfTest;
15634 CF_EOF
15635 cat >>conftest.adb <<CF_EOF
15636 package body ConfTest is
15637    protected body Process is
15638       procedure Stop is
15639       begin
15640          Done := True;
15641       end Stop;
15642       function Continue return Boolean is
15643       begin
15644          return not Done;
15645       end Continue;
15646    end Process;
15647 end ConfTest;
15648 CF_EOF
15649 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15650       cf_cv_gnat_sigint=yes
15651 else
15652    cf_cv_gnat_sigint=no
15653 fi
15654 rm -rf conftest* *~conftest*
15655
15656 fi
15657 echo "$as_me:15657: result: $cf_cv_gnat_sigint" >&5
15658 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
15659
15660 if test $cf_cv_gnat_sigint = yes ; then
15661         USE_GNAT_SIGINT=""
15662 else
15663         USE_GNAT_SIGINT="#"
15664 fi
15665
15666 cf_gnat_libraries=no
15667 cf_gnat_projects=no
15668
15669 if test "$enable_gnat_projects" != no ; then
15670 echo "$as_me:15670: checking if GNAT supports project files" >&5
15671 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
15672 case $cf_gnat_version in
15673 (3.[0-9]*)
15674         ;;
15675 (*)
15676         case $cf_cv_system_name in
15677         (cygwin*|msys*)
15678                 ;;
15679         (*)
15680                 rm -rf conftest* *~conftest*
15681                 if mkdir conftest.src conftest.bin conftest.lib
15682                 then
15683                         cd conftest.src
15684                         rm -rf conftest* *~conftest*
15685                         cat >>library.gpr <<CF_EOF
15686 project Library is
15687   Kind := External ("LIB_KIND");
15688   for Library_Name use "ConfTest";
15689   for Object_Dir use ".";
15690   for Library_ALI_Dir use External("LIBRARY_DIR");
15691   for Library_Version use External ("SONAME");
15692   for Library_Kind use Kind;
15693   for Library_Dir use External("BUILD_DIR");
15694   Source_Dir := External ("SOURCE_DIR");
15695   for Source_Dirs use (Source_Dir);
15696 end Library;
15697 CF_EOF
15698                         cat >>confpackage.ads <<CF_EOF
15699 package ConfPackage is
15700    procedure conftest;
15701 end ConfPackage;
15702 CF_EOF
15703                         cat >>confpackage.adb <<CF_EOF
15704 with Text_IO;
15705 package body ConfPackage is
15706    procedure conftest is
15707    begin
15708       Text_IO.Put ("Hello World");
15709       Text_IO.New_Line;
15710    end conftest;
15711 end ConfPackage;
15712 CF_EOF
15713                         if ( $cf_ada_make $ADAFLAGS \
15714                                         -Plibrary.gpr \
15715                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
15716                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
15717                                         -XSOURCE_DIR=`pwd` \
15718                                         -XSONAME=libConfTest.so.1 \
15719                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
15720                                 cf_gnat_projects=yes
15721                         fi
15722                         cd ..
15723                 fi
15724                 if test -f conftest.lib/confpackage.ali
15725                 then
15726                         cf_gnat_libraries=yes
15727                 fi
15728                 rm -rf conftest* *~conftest*
15729                 ;;
15730         esac
15731         ;;
15732 esac
15733 echo "$as_me:15733: result: $cf_gnat_projects" >&5
15734 echo "${ECHO_T}$cf_gnat_projects" >&6
15735 fi # enable_gnat_projects
15736
15737 if test $cf_gnat_projects = yes
15738 then
15739         echo "$as_me:15739: checking if GNAT supports libraries" >&5
15740 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
15741         echo "$as_me:15741: result: $cf_gnat_libraries" >&5
15742 echo "${ECHO_T}$cf_gnat_libraries" >&6
15743 fi
15744
15745 if test "$cf_gnat_projects" = yes
15746 then
15747         USE_OLD_MAKERULES="#"
15748         USE_GNAT_PROJECTS=""
15749 else
15750         USE_OLD_MAKERULES=""
15751         USE_GNAT_PROJECTS="#"
15752 fi
15753
15754 if test "$cf_gnat_libraries" = yes
15755 then
15756         USE_GNAT_LIBRARIES=""
15757 else
15758         USE_GNAT_LIBRARIES="#"
15759 fi
15760
15761 echo "$as_me:15761: checking for ada-compiler" >&5
15762 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
15763
15764 # Check whether --with-ada-compiler or --without-ada-compiler was given.
15765 if test "${with_ada_compiler+set}" = set; then
15766   withval="$with_ada_compiler"
15767   cf_ada_compiler=$withval
15768 else
15769   cf_ada_compiler=gnatmake
15770 fi;
15771
15772 echo "$as_me:15772: result: $cf_ada_compiler" >&5
15773 echo "${ECHO_T}$cf_ada_compiler" >&6
15774
15775                 cf_ada_package=terminal_interface
15776
15777 echo "$as_me:15777: checking for ada-include" >&5
15778 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
15779
15780 # Check whether --with-ada-include or --without-ada-include was given.
15781 if test "${with_ada_include+set}" = set; then
15782   withval="$with_ada_include"
15783
15784 else
15785   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
15786 fi; if test -n "$prefix/share/ada/adainclude" ; then
15787
15788 if test "x$prefix" != xNONE; then
15789         cf_path_syntax="$prefix"
15790 else
15791         cf_path_syntax="$ac_default_prefix"
15792 fi
15793
15794 case ".$withval" in
15795 (.\$\(*\)*|.\'*\'*)
15796         ;;
15797 (..|./*|.\\*)
15798         ;;
15799 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15800         ;;
15801 (.\${*prefix}*|.\${*dir}*)
15802         eval withval="$withval"
15803         case ".$withval" in
15804         (.NONE/*)
15805                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15806                 ;;
15807         esac
15808         ;;
15809 (.no|.NONE/*)
15810         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15811         ;;
15812 (*)
15813         { { echo "$as_me:15813: error: expected a pathname, not \"$withval\"" >&5
15814 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
15815    { (exit 1); exit 1; }; }
15816         ;;
15817 esac
15818
15819 fi
15820 eval ADA_INCLUDE="$withval"
15821
15822 echo "$as_me:15822: result: $ADA_INCLUDE" >&5
15823 echo "${ECHO_T}$ADA_INCLUDE" >&6
15824
15825 echo "$as_me:15825: checking for ada-objects" >&5
15826 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
15827
15828 # Check whether --with-ada-objects or --without-ada-objects was given.
15829 if test "${with_ada_objects+set}" = set; then
15830   withval="$with_ada_objects"
15831
15832 else
15833   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
15834 fi; if test -n "$prefix/lib/ada/adalib" ; then
15835
15836 if test "x$prefix" != xNONE; then
15837         cf_path_syntax="$prefix"
15838 else
15839         cf_path_syntax="$ac_default_prefix"
15840 fi
15841
15842 case ".$withval" in
15843 (.\$\(*\)*|.\'*\'*)
15844         ;;
15845 (..|./*|.\\*)
15846         ;;
15847 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15848         ;;
15849 (.\${*prefix}*|.\${*dir}*)
15850         eval withval="$withval"
15851         case ".$withval" in
15852         (.NONE/*)
15853                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15854                 ;;
15855         esac
15856         ;;
15857 (.no|.NONE/*)
15858         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15859         ;;
15860 (*)
15861         { { echo "$as_me:15861: error: expected a pathname, not \"$withval\"" >&5
15862 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
15863    { (exit 1); exit 1; }; }
15864         ;;
15865 esac
15866
15867 fi
15868 eval ADA_OBJECTS="$withval"
15869
15870 echo "$as_me:15870: result: $ADA_OBJECTS" >&5
15871 echo "${ECHO_T}$ADA_OBJECTS" >&6
15872
15873 echo "$as_me:15873: checking if an Ada95 shared-library should be built" >&5
15874 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
15875
15876 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
15877 if test "${with_ada_sharedlib+set}" = set; then
15878   withval="$with_ada_sharedlib"
15879   with_ada_sharedlib=$withval
15880 else
15881   with_ada_sharedlib=no
15882 fi;
15883 echo "$as_me:15883: result: $with_ada_sharedlib" >&5
15884 echo "${ECHO_T}$with_ada_sharedlib" >&6
15885
15886 if test "x$with_ada_sharedlib" != xno
15887 then
15888         if test "x$cf_gnat_projects" != xyes
15889         then
15890                 { echo "$as_me:15890: WARNING: disabling shared-library since GNAT projects are not supported" >&5
15891 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
15892                 with_ada_sharedlib=no
15893         fi
15894 fi
15895
15896 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
15897 MAKE_ADA_SHAREDLIB="#"
15898
15899 if test "x$with_ada_sharedlib" != xno
15900 then
15901         MAKE_ADA_SHAREDLIB=
15902         if test "x$with_ada_sharedlib" != xyes
15903         then
15904                 ADA_SHAREDLIB="$with_ada_sharedlib"
15905         fi
15906 fi
15907
15908         else
15909                 { { echo "$as_me:15909: error: No usable Ada compiler found" >&5
15910 echo "$as_me: error: No usable Ada compiler found" >&2;}
15911    { (exit 1); exit 1; }; }
15912         fi
15913 else
15914         { { echo "$as_me:15914: error: The Ada compiler is needed for this package" >&5
15915 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
15916    { (exit 1); exit 1; }; }
15917 fi
15918
15919 ################################################################################
15920
15921 # not needed
15922 TINFO_LDFLAGS2=
15923
15924 TINFO_LIBS=
15925
15926 ### Construct the list of include-directories to be generated
15927
15928 if test "$srcdir" != "."; then
15929         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
15930 fi
15931 CPPFLAGS="-I../include $CPPFLAGS"
15932 if test "$srcdir" != "."; then
15933         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
15934 fi
15935 CPPFLAGS="-I. $CPPFLAGS"
15936
15937 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
15938 if test "$srcdir" != "."; then
15939         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
15940 fi
15941 if test "$GCC" != yes; then
15942         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
15943 elif test "$includedir" != "/usr/include"; then
15944         if test "$includedir" = '${prefix}/include' ; then
15945                 if test x$prefix != x/usr ; then
15946                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
15947                 fi
15948         else
15949                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
15950         fi
15951 fi
15952
15953 ### Build up pieces for makefile rules
15954 echo "$as_me:15954: checking default library suffix" >&5
15955 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
15956
15957         case $DFT_LWR_MODEL in
15958         (libtool) DFT_ARG_SUFFIX=''   ;;
15959         (normal)  DFT_ARG_SUFFIX=''   ;;
15960         (debug)   DFT_ARG_SUFFIX='_g' ;;
15961         (profile) DFT_ARG_SUFFIX='_p' ;;
15962         (shared)  DFT_ARG_SUFFIX=''   ;;
15963         esac
15964         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
15965 echo "$as_me:15965: result: $DFT_ARG_SUFFIX" >&5
15966 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
15967
15968 echo "$as_me:15968: checking default library-dependency suffix" >&5
15969 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
15970
15971         case X$DFT_LWR_MODEL in
15972         (Xlibtool)
15973                 DFT_LIB_SUFFIX='.la'
15974                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15975                 ;;
15976         (Xdebug)
15977                 DFT_LIB_SUFFIX='_g.a'
15978                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15979                 ;;
15980         (Xprofile)
15981                 DFT_LIB_SUFFIX='_p.a'
15982                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15983                 ;;
15984         (Xshared)
15985                 case $cf_cv_system_name in
15986                 (aix[5-7]*)
15987                         DFT_LIB_SUFFIX='.so'
15988                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15989                         ;;
15990                 (cygwin*|msys*|mingw*)
15991                         DFT_LIB_SUFFIX='.dll'
15992                         DFT_DEP_SUFFIX='.dll.a'
15993                         ;;
15994                 (darwin*)
15995                         DFT_LIB_SUFFIX='.dylib'
15996                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15997                         ;;
15998                 (hpux*)
15999                         case $target in
16000                         (ia64*)
16001                                 DFT_LIB_SUFFIX='.so'
16002                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16003                                 ;;
16004                         (*)
16005                                 DFT_LIB_SUFFIX='.sl'
16006                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16007                                 ;;
16008                         esac
16009                         ;;
16010                 (*)
16011                         DFT_LIB_SUFFIX='.so'
16012                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16013                         ;;
16014                 esac
16015                 ;;
16016         (*)
16017                 DFT_LIB_SUFFIX='.a'
16018                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16019                 ;;
16020         esac
16021         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
16022         then
16023                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
16024                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
16025         fi
16026 echo "$as_me:16026: result: $DFT_DEP_SUFFIX" >&5
16027 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
16028
16029 echo "$as_me:16029: checking default object directory" >&5
16030 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
16031
16032         case $DFT_LWR_MODEL in
16033         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
16034         (normal)  DFT_OBJ_SUBDIR='objects' ;;
16035         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
16036         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
16037         (shared)
16038                 case $cf_cv_system_name in
16039                 (cygwin|msys)
16040                         DFT_OBJ_SUBDIR='objects' ;;
16041                 (*)
16042                         DFT_OBJ_SUBDIR='obj_s' ;;
16043                 esac
16044         esac
16045 echo "$as_me:16045: result: $DFT_OBJ_SUBDIR" >&5
16046 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
16047
16048 ### Set up low-level terminfo dependencies for makefiles.
16049
16050 if test "$DFT_LWR_MODEL" = shared ; then
16051         case $cf_cv_system_name in
16052         (cygwin*)
16053                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
16054                 ;;
16055         (msys*)
16056                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
16057                 ;;
16058         esac
16059 fi
16060
16061 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
16062
16063 ### Construct the list of subdirectories for which we'll customize makefiles
16064 ### with the appropriate compile-rules.
16065
16066 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
16067
16068 cat >>confdefs.h <<EOF
16069 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
16070 EOF
16071
16072 ### Now that we're done running tests, add the compiler-warnings, if any
16073
16074 cf_fix_cppflags=no
16075 cf_new_cflags=
16076 cf_new_cppflags=
16077 cf_new_extra_cppflags=
16078
16079 for cf_add_cflags in $EXTRA_CFLAGS
16080 do
16081 case $cf_fix_cppflags in
16082 (no)
16083         case $cf_add_cflags in
16084         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16085                 case $cf_add_cflags in
16086                 (-D*)
16087                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16088
16089                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16090                                 && test -z "${cf_tst_cflags}" \
16091                                 && cf_fix_cppflags=yes
16092
16093                         if test $cf_fix_cppflags = yes ; then
16094
16095         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16096         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16097
16098                                 continue
16099                         elif test "${cf_tst_cflags}" = "\"'" ; then
16100
16101         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16102         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16103
16104                                 continue
16105                         fi
16106                         ;;
16107                 esac
16108                 case "$CPPFLAGS" in
16109                 (*$cf_add_cflags)
16110                         ;;
16111                 (*)
16112                         case $cf_add_cflags in
16113                         (-D*)
16114                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16115
16116 CPPFLAGS=`echo "$CPPFLAGS" | \
16117         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16118                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16119
16120                                 ;;
16121                         esac
16122
16123         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16124         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16125
16126                         ;;
16127                 esac
16128                 ;;
16129         (*)
16130
16131         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16132         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16133
16134                 ;;
16135         esac
16136         ;;
16137 (yes)
16138
16139         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16140         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16141
16142         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16143
16144         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16145                 && test -z "${cf_tst_cflags}" \
16146                 && cf_fix_cppflags=no
16147         ;;
16148 esac
16149 done
16150
16151 if test -n "$cf_new_cflags" ; then
16152
16153         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16154         CFLAGS="${CFLAGS}$cf_new_cflags"
16155
16156 fi
16157
16158 if test -n "$cf_new_cppflags" ; then
16159
16160         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16161         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16162
16163 fi
16164
16165 if test -n "$cf_new_extra_cppflags" ; then
16166
16167         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16168         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16169
16170 fi
16171
16172 ################################################################################
16173
16174 TEST_ARG2=
16175
16176 TEST_LIBS2=
16177
16178 NCURSES_SHLIB2="sh -c"
16179
16180 ADA_SUBDIRS="include gen src doc"
16181 if test "x$cf_with_tests" != "xno" ; then
16182         ADA_SUBDIRS="$ADA_SUBDIRS samples"
16183 fi
16184 for cf_dir in $ADA_SUBDIRS
16185 do
16186         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
16187 done
16188
16189 NCURSES_TREE="#"
16190
16191 EXTERNAL_TREE=
16192
16193 # match layout used by make-tar.sh
16194 ADAHTML_DIR=../doc/ada
16195
16196 if test "x$cross_compiling" = xyes ; then
16197         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
16198 else
16199         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
16200 fi
16201
16202 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
16203 ac_config_commands="$ac_config_commands default"
16204 cat >confcache <<\_ACEOF
16205 # This file is a shell script that caches the results of configure
16206 # tests run on this system so they can be shared between configure
16207 # scripts and configure runs, see configure's option --config-cache.
16208 # It is not useful on other systems.  If it contains results you don't
16209 # want to keep, you may remove or edit it.
16210 #
16211 # config.status only pays attention to the cache file if you give it
16212 # the --recheck option to rerun configure.
16213 #
16214 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16215 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16216 # following values.
16217
16218 _ACEOF
16219
16220 # The following way of writing the cache mishandles newlines in values,
16221 # but we know of no workaround that is simple, portable, and efficient.
16222 # So, don't put newlines in cache variables' values.
16223 # Ultrix sh set writes to stderr and can't be redirected directly,
16224 # and sets the high bit in the cache file unless we assign to the vars.
16225 {
16226   (set) 2>&1 |
16227     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16228     *ac_space=\ *)
16229       # `set' does not quote correctly, so add quotes (double-quote
16230       # substitution turns \\\\ into \\, and sed turns \\ into \).
16231       sed -n \
16232         "s/'/'\\\\''/g;
16233           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16234       ;;
16235     *)
16236       # `set' quotes correctly as required by POSIX, so do not add quotes.
16237       sed -n \
16238         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16239       ;;
16240     esac;
16241 } |
16242   sed '
16243      t clear
16244      : clear
16245      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16246      t end
16247      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16248      : end' >>confcache
16249 if cmp -s $cache_file confcache; then :; else
16250   if test -w $cache_file; then
16251     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16252     cat confcache >$cache_file
16253   else
16254     echo "not updating unwritable cache $cache_file"
16255   fi
16256 fi
16257 rm -f confcache
16258
16259 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16260 # Let make expand exec_prefix.
16261 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16262
16263 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16264 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16265 # trailing colons and then remove the whole line if VPATH becomes empty
16266 # (actually we leave an empty line to preserve line numbers).
16267 if test "x$srcdir" = x.; then
16268   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16269 s/:*\$(srcdir):*/:/;
16270 s/:*\${srcdir}:*/:/;
16271 s/:*@srcdir@:*/:/;
16272 s/^\([^=]*=[    ]*\):*/\1/;
16273 s/:*$//;
16274 s/^[^=]*=[      ]*$//;
16275 }'
16276 fi
16277
16278 DEFS=-DHAVE_CONFIG_H
16279
16280 : ${CONFIG_STATUS=./config.status}
16281 ac_clean_files_save=$ac_clean_files
16282 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16283 { echo "$as_me:16283: creating $CONFIG_STATUS" >&5
16284 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16285 cat >$CONFIG_STATUS <<_ACEOF
16286 #! $SHELL
16287 # Generated automatically by configure.
16288 # Run this file to recreate the current configuration.
16289 # Compiler output produced by configure, useful for debugging
16290 # configure, is in config.log if it exists.
16291
16292 debug=false
16293 SHELL=\${CONFIG_SHELL-$SHELL}
16294 ac_cs_invocation="\$0 \$@"
16295
16296 _ACEOF
16297
16298 cat >>$CONFIG_STATUS <<\_ACEOF
16299 # Be Bourne compatible
16300 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16301   emulate sh
16302   NULLCMD=:
16303 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16304   set -o posix
16305 fi
16306
16307 # Name of the executable.
16308 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16309
16310 if expr a : '\(a\)' >/dev/null 2>&1; then
16311   as_expr=expr
16312 else
16313   as_expr=false
16314 fi
16315
16316 rm -f conf$$ conf$$.exe conf$$.file
16317 echo >conf$$.file
16318 if ln -s conf$$.file conf$$ 2>/dev/null; then
16319   # We could just check for DJGPP; but this test a) works b) is more generic
16320   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16321   if test -f conf$$.exe; then
16322     # Don't use ln at all; we don't have any links
16323     as_ln_s='cp -p'
16324   else
16325     as_ln_s='ln -s'
16326   fi
16327 elif ln conf$$.file conf$$ 2>/dev/null; then
16328   as_ln_s=ln
16329 else
16330   as_ln_s='cp -p'
16331 fi
16332 rm -f conf$$ conf$$.exe conf$$.file
16333
16334 as_executable_p="test -f"
16335
16336 # Support unset when possible.
16337 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16338   as_unset=unset
16339 else
16340   as_unset=false
16341 fi
16342
16343 # NLS nuisances.
16344 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16345 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16346 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16347 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16348 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16349 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16350 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16351 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16352
16353 # IFS
16354 # We need space, tab and new line, in precisely that order.
16355 as_nl='
16356 '
16357 IFS="   $as_nl"
16358
16359 # CDPATH.
16360 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16361
16362 exec 6>&1
16363
16364 _ACEOF
16365
16366 # Files that config.status was made for.
16367 if test -n "$ac_config_files"; then
16368   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16369 fi
16370
16371 if test -n "$ac_config_headers"; then
16372   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16373 fi
16374
16375 if test -n "$ac_config_links"; then
16376   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16377 fi
16378
16379 if test -n "$ac_config_commands"; then
16380   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16381 fi
16382
16383 cat >>$CONFIG_STATUS <<\EOF
16384
16385 ac_cs_usage="\
16386 \`$as_me' instantiates files from templates according to the
16387 current configuration.
16388
16389 Usage: $0 [OPTIONS] [FILE]...
16390
16391   -h, --help       print this help, then exit
16392   -V, --version    print version number, then exit
16393   -d, --debug      don't remove temporary files
16394       --recheck    update $as_me by reconfiguring in the same conditions
16395   --file=FILE[:TEMPLATE]
16396                    instantiate the configuration file FILE
16397   --header=FILE[:TEMPLATE]
16398                    instantiate the configuration header FILE
16399
16400 Configuration files:
16401 $config_files
16402
16403 Configuration headers:
16404 $config_headers
16405
16406 Configuration commands:
16407 $config_commands
16408
16409 Report bugs to <dickey@invisible-island.net>."
16410 EOF
16411
16412 cat >>$CONFIG_STATUS <<EOF
16413 ac_cs_version="\\
16414 config.status
16415 configured by $0, generated by GNU Autoconf 2.52.20170501,
16416   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16417
16418 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16419 Free Software Foundation, Inc.
16420 This config.status script is free software; the Free Software Foundation
16421 gives unlimited permission to copy, distribute and modify it."
16422 srcdir=$srcdir
16423 INSTALL="$INSTALL"
16424 EOF
16425
16426 cat >>$CONFIG_STATUS <<\EOF
16427 # If no file are specified by the user, then we need to provide default
16428 # value.  By we need to know if files were specified by the user.
16429 ac_need_defaults=:
16430 while test $# != 0
16431 do
16432   case $1 in
16433   --*=*)
16434     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16435     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16436     shift
16437     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16438     shift
16439     ;;
16440   -*);;
16441   *) # This is not an option, so the user has probably given explicit
16442      # arguments.
16443      ac_need_defaults=false;;
16444   esac
16445
16446   case $1 in
16447   # Handling of the options.
16448 EOF
16449 cat >>$CONFIG_STATUS <<EOF
16450   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16451     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16452     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16453 EOF
16454 cat >>$CONFIG_STATUS <<\EOF
16455   --version | --vers* | -V )
16456     echo "$ac_cs_version"; exit 0 ;;
16457   --he | --h)
16458     # Conflict between --help and --header
16459     { { echo "$as_me:16459: error: ambiguous option: $1
16460 Try \`$0 --help' for more information." >&5
16461 echo "$as_me: error: ambiguous option: $1
16462 Try \`$0 --help' for more information." >&2;}
16463    { (exit 1); exit 1; }; };;
16464   --help | --hel | -h )
16465     echo "$ac_cs_usage"; exit 0 ;;
16466   --debug | --d* | -d )
16467     debug=: ;;
16468   --file | --fil | --fi | --f )
16469     shift
16470     CONFIG_FILES="$CONFIG_FILES $1"
16471     ac_need_defaults=false;;
16472   --header | --heade | --head | --hea )
16473     shift
16474     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16475     ac_need_defaults=false;;
16476
16477   # This is an error.
16478   -*) { { echo "$as_me:16478: error: unrecognized option: $1
16479 Try \`$0 --help' for more information." >&5
16480 echo "$as_me: error: unrecognized option: $1
16481 Try \`$0 --help' for more information." >&2;}
16482    { (exit 1); exit 1; }; } ;;
16483
16484   *) ac_config_targets="$ac_config_targets $1" ;;
16485
16486   esac
16487   shift
16488 done
16489
16490 exec 5>>config.log
16491 cat >&5 << _ACEOF
16492
16493 ## ----------------------- ##
16494 ## Running config.status.  ##
16495 ## ----------------------- ##
16496
16497 This file was extended by $as_me 2.52.20170501, executed with
16498   CONFIG_FILES    = $CONFIG_FILES
16499   CONFIG_HEADERS  = $CONFIG_HEADERS
16500   CONFIG_LINKS    = $CONFIG_LINKS
16501   CONFIG_COMMANDS = $CONFIG_COMMANDS
16502   > $ac_cs_invocation
16503 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16504
16505 _ACEOF
16506 EOF
16507
16508 cat >>$CONFIG_STATUS <<EOF
16509 #
16510 # INIT-COMMANDS section.
16511 #
16512
16513 ### Special initialization commands, used to pass information from the
16514 ### configuration-run into config.status
16515
16516 AWK="$AWK"
16517 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
16518 DFT_LWR_MODEL="$DFT_LWR_MODEL"
16519 LIB_NAME="$LIB_NAME"
16520 LIB_PREFIX="$LIB_PREFIX"
16521 LIB_SUFFIX="$LIB_SUFFIX"
16522 LN_S="$LN_S"
16523 NCURSES_MAJOR="$NCURSES_MAJOR"
16524 NCURSES_MINOR="$NCURSES_MINOR"
16525 NCURSES_PATCH="$NCURSES_PATCH"
16526 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
16527 cf_cv_abi_version="$cf_cv_abi_version"
16528 cf_cv_rel_version="$cf_cv_rel_version"
16529 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
16530 cf_cv_shared_soname='$cf_cv_shared_soname'
16531 cf_cv_shlib_version="$cf_cv_shlib_version"
16532 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
16533 cf_cv_system_name="$cf_cv_system_name"
16534 host="$host"
16535 target="$target"
16536
16537 EOF
16538
16539 cat >>$CONFIG_STATUS <<\EOF
16540 for ac_config_target in $ac_config_targets
16541 do
16542   case "$ac_config_target" in
16543   # Handling of arguments.
16544   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
16545   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
16546   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16547   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16548   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
16549   *) { { echo "$as_me:16549: error: invalid argument: $ac_config_target" >&5
16550 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16551    { (exit 1); exit 1; }; };;
16552   esac
16553 done
16554
16555 # If the user did not use the arguments to specify the items to instantiate,
16556 # then the envvar interface is used.  Set only those that are not.
16557 # We use the long form for the default assignment because of an extremely
16558 # bizarre bug on SunOS 4.1.3.
16559 if $ac_need_defaults; then
16560   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16561   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16562   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16563 fi
16564
16565 # Create a temporary directory, and hook for its removal unless debugging.
16566 $debug ||
16567 {
16568   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16569   trap '{ (exit 1); exit 1; }' 1 2 13 15
16570 }
16571
16572 # Create a (secure) tmp directory for tmp files.
16573 : ${TMPDIR=/tmp}
16574 {
16575   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16576   test -n "$tmp" && test -d "$tmp"
16577 }  ||
16578 {
16579   tmp=$TMPDIR/cs$$-$RANDOM
16580   (umask 077 && mkdir $tmp)
16581 } ||
16582 {
16583    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16584    { (exit 1); exit 1; }
16585 }
16586
16587 EOF
16588
16589 cat >>$CONFIG_STATUS <<EOF
16590
16591 #
16592 # CONFIG_FILES section.
16593 #
16594
16595 # No need to generate the scripts if there are no CONFIG_FILES.
16596 # This happens for instance when ./config.status config.h
16597 if test -n "\$CONFIG_FILES"; then
16598   # Protect against being on the right side of a sed subst in config.status.
16599   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16600    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16601 s,@SHELL@,$SHELL,;t t
16602 s,@exec_prefix@,$exec_prefix,;t t
16603 s,@prefix@,$prefix,;t t
16604 s,@program_transform_name@,$program_transform_name,;t t
16605 s,@bindir@,$bindir,;t t
16606 s,@sbindir@,$sbindir,;t t
16607 s,@libexecdir@,$libexecdir,;t t
16608 s,@datarootdir@,$datarootdir,;t t
16609 s,@datadir@,$datadir,;t t
16610 s,@sysconfdir@,$sysconfdir,;t t
16611 s,@sharedstatedir@,$sharedstatedir,;t t
16612 s,@localstatedir@,$localstatedir,;t t
16613 s,@libdir@,$libdir,;t t
16614 s,@includedir@,$includedir,;t t
16615 s,@oldincludedir@,$oldincludedir,;t t
16616 s,@infodir@,$infodir,;t t
16617 s,@mandir@,$mandir,;t t
16618 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16619 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16620 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16621 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16622 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16623 s,@build_alias@,$build_alias,;t t
16624 s,@host_alias@,$host_alias,;t t
16625 s,@target_alias@,$target_alias,;t t
16626 s,@ECHO_C@,$ECHO_C,;t t
16627 s,@ECHO_N@,$ECHO_N,;t t
16628 s,@ECHO_T@,$ECHO_T,;t t
16629 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16630 s,@DEFS@,$DEFS,;t t
16631 s,@LIBS@,$LIBS,;t t
16632 s,@top_builddir@,$top_builddir,;t t
16633 s,@build@,$build,;t t
16634 s,@build_cpu@,$build_cpu,;t t
16635 s,@build_vendor@,$build_vendor,;t t
16636 s,@build_os@,$build_os,;t t
16637 s,@host@,$host,;t t
16638 s,@host_cpu@,$host_cpu,;t t
16639 s,@host_vendor@,$host_vendor,;t t
16640 s,@host_os@,$host_os,;t t
16641 s,@target@,$target,;t t
16642 s,@target_cpu@,$target_cpu,;t t
16643 s,@target_vendor@,$target_vendor,;t t
16644 s,@target_os@,$target_os,;t t
16645 s,@CC@,$CC,;t t
16646 s,@CFLAGS@,$CFLAGS,;t t
16647 s,@LDFLAGS@,$LDFLAGS,;t t
16648 s,@CPPFLAGS@,$CPPFLAGS,;t t
16649 s,@ac_ct_CC@,$ac_ct_CC,;t t
16650 s,@EXEEXT@,$EXEEXT,;t t
16651 s,@OBJEXT@,$OBJEXT,;t t
16652 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16653 s,@CPP@,$CPP,;t t
16654 s,@AWK@,$AWK,;t t
16655 s,@EGREP@,$EGREP,;t t
16656 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16657 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16658 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16659 s,@LN_S@,$LN_S,;t t
16660 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
16661 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
16662 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16663 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16664 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
16665 s,@SET_MAKE@,$SET_MAKE,;t t
16666 s,@CTAGS@,$CTAGS,;t t
16667 s,@ETAGS@,$ETAGS,;t t
16668 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16669 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16670 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
16671 s,@RANLIB@,$RANLIB,;t t
16672 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
16673 s,@LD@,$LD,;t t
16674 s,@ac_ct_LD@,$ac_ct_LD,;t t
16675 s,@AR@,$AR,;t t
16676 s,@ac_ct_AR@,$ac_ct_AR,;t t
16677 s,@ARFLAGS@,$ARFLAGS,;t t
16678 s,@DESTDIR@,$DESTDIR,;t t
16679 s,@BUILD_CC@,$BUILD_CC,;t t
16680 s,@BUILD_CPP@,$BUILD_CPP,;t t
16681 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
16682 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
16683 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
16684 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
16685 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
16686 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
16687 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
16688 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16689 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16690 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16691 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
16692 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
16693 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
16694 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16695 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16696 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
16697 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
16698 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
16699 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
16700 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
16701 s,@CC_G_OPT@,$CC_G_OPT,;t t
16702 s,@LD_MODEL@,$LD_MODEL,;t t
16703 s,@shlibdir@,$shlibdir,;t t
16704 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
16705 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16706 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
16707 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16708 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
16709 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
16710 s,@LINK_PROGS@,$LINK_PROGS,;t t
16711 s,@LINK_TESTS@,$LINK_TESTS,;t t
16712 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16713 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16714 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
16715 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
16716 s,@RPATH_LIST@,$RPATH_LIST,;t t
16717 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
16718 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
16719 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
16720 s,@PTHREAD@,$PTHREAD,;t t
16721 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
16722 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16723 s,@ECHO_LT@,$ECHO_LT,;t t
16724 s,@ECHO_LD@,$ECHO_LD,;t t
16725 s,@RULE_CC@,$RULE_CC,;t t
16726 s,@SHOW_CC@,$SHOW_CC,;t t
16727 s,@ECHO_CC@,$ECHO_CC,;t t
16728 s,@ADAFLAGS@,$ADAFLAGS,;t t
16729 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16730 s,@ADA_TRACE@,$ADA_TRACE,;t t
16731 s,@gnatmake_exists@,$gnatmake_exists,;t t
16732 s,@gprconfig_exists@,$gprconfig_exists,;t t
16733 s,@M4_exists@,$M4_exists,;t t
16734 s,@cf_ada_make@,$cf_ada_make,;t t
16735 s,@cf_ada_config@,$cf_ada_config,;t t
16736 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
16737 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
16738 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
16739 s,@cf_compile_generics@,$cf_compile_generics,;t t
16740 s,@cf_generic_objects@,$cf_generic_objects,;t t
16741 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
16742 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
16743 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
16744 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
16745 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
16746 s,@cf_ada_package@,$cf_ada_package,;t t
16747 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
16748 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
16749 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
16750 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
16751 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
16752 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16753 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
16754 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
16755 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16756 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16757 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
16758 s,@TEST_ARG2@,$TEST_ARG2,;t t
16759 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
16760 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
16761 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
16762 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
16763 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
16764 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
16765 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
16766 CEOF
16767
16768 EOF
16769
16770   cat >>$CONFIG_STATUS <<\EOF
16771   # Split the substitutions into bite-sized pieces for seds with
16772   # small command number limits, like on Digital OSF/1 and HP-UX.
16773   ac_max_sed_lines=48
16774   ac_sed_frag=1 # Number of current file.
16775   ac_beg=1 # First line for current file.
16776   ac_end=$ac_max_sed_lines # Line after last line for current file.
16777   ac_more_lines=:
16778   ac_sed_cmds=
16779   while $ac_more_lines; do
16780     if test $ac_beg -gt 1; then
16781       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16782     else
16783       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16784     fi
16785     if test ! -s $tmp/subs.frag; then
16786       ac_more_lines=false
16787     else
16788       # The purpose of the label and of the branching condition is to
16789       # speed up the sed processing (if there are no `@' at all, there
16790       # is no need to browse any of the substitutions).
16791       # These are the two extra sed commands mentioned above.
16792       (echo ':t
16793   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16794       # It is possible to make a multiline substitution using escaped newlines.
16795       # Ensure that we do not split the substitution between script fragments.
16796       ac_BEG=$ac_end
16797       ac_END=`expr $ac_end + $ac_max_sed_lines`
16798       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
16799       if test -s $tmp/subs.next; then
16800         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
16801         if test ! -s $tmp/subs.edit; then
16802           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
16803           if test ! -s $tmp/subs.edit; then
16804             if test $ac_beg -gt 1; then
16805               ac_end=`expr $ac_end - 1`
16806               continue
16807             fi
16808           fi
16809         fi
16810       fi
16811
16812       if test -z "$ac_sed_cmds"; then
16813         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16814       else
16815         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16816       fi
16817       ac_sed_frag=`expr $ac_sed_frag + 1`
16818       ac_beg=$ac_end
16819       ac_end=`expr $ac_end + $ac_max_sed_lines`
16820     fi
16821   done
16822   if test -z "$ac_sed_cmds"; then
16823     ac_sed_cmds=cat
16824   fi
16825 fi # test -n "$CONFIG_FILES"
16826
16827 EOF
16828 cat >>$CONFIG_STATUS <<\EOF
16829 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16830   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16831   case $ac_file in
16832   - | *:- | *:-:* ) # input from stdin
16833         cat >$tmp/stdin
16834         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16835         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16836   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16837         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16838   * )   ac_file_in=$ac_file.in ;;
16839   esac
16840
16841   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16842   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16843          X"$ac_file" : 'X\(//\)[^/]' \| \
16844          X"$ac_file" : 'X\(//\)$' \| \
16845          X"$ac_file" : 'X\(/\)' \| \
16846          .     : '\(.\)' 2>/dev/null ||
16847 echo X"$ac_file" |
16848     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16849           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16850           /^X\(\/\/\)$/{ s//\1/; q; }
16851           /^X\(\/\).*/{ s//\1/; q; }
16852           s/.*/./; q'`
16853   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16854     { case "$ac_dir" in
16855   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16856   *)                      as_incr_dir=.;;
16857 esac
16858 as_dummy="$ac_dir"
16859 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16860   case $as_mkdir_dir in
16861     # Skip DOS drivespec
16862     ?:) as_incr_dir=$as_mkdir_dir ;;
16863     *)
16864       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16865       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16866     ;;
16867   esac
16868 done; }
16869
16870     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16871     # A "../" for each directory in $ac_dir_suffix.
16872     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16873   else
16874     ac_dir_suffix= ac_dots=
16875   fi
16876
16877   case $srcdir in
16878   .)  ac_srcdir=.
16879       if test -z "$ac_dots"; then
16880          ac_top_srcdir=.
16881       else
16882          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16883       fi ;;
16884   [\\/]* | ?:[\\/]* )
16885       ac_srcdir=$srcdir$ac_dir_suffix;
16886       ac_top_srcdir=$srcdir ;;
16887   *) # Relative path.
16888     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16889     ac_top_srcdir=$ac_dots$srcdir ;;
16890   esac
16891
16892   case $INSTALL in
16893   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16894   *) ac_INSTALL=$ac_dots$INSTALL ;;
16895   esac
16896
16897   if test x"$ac_file" != x-; then
16898     { echo "$as_me:16898: creating $ac_file" >&5
16899 echo "$as_me: creating $ac_file" >&6;}
16900     rm -f "$ac_file"
16901   fi
16902   # Let's still pretend it is `configure' which instantiates (i.e., don't
16903   # use $as_me), people would be surprised to read:
16904   #    /* config.h.  Generated automatically by config.status.  */
16905   configure_input="Generated automatically from `echo $ac_file_in |
16906                                                  sed 's,.*/,,'` by configure."
16907
16908   # First look for the input files in the build tree, otherwise in the
16909   # src tree.
16910   ac_file_inputs=`IFS=:
16911     for f in $ac_file_in; do
16912       case $f in
16913       -) echo $tmp/stdin ;;
16914       [\\/$]*)
16915          # Absolute (can't be DOS-style, as IFS=:)
16916          test -f "$f" || { { echo "$as_me:16916: error: cannot find input file: $f" >&5
16917 echo "$as_me: error: cannot find input file: $f" >&2;}
16918    { (exit 1); exit 1; }; }
16919          echo $f;;
16920       *) # Relative
16921          if test -f "$f"; then
16922            # Build tree
16923            echo $f
16924          elif test -f "$srcdir/$f"; then
16925            # Source tree
16926            echo $srcdir/$f
16927          else
16928            # /dev/null tree
16929            { { echo "$as_me:16929: error: cannot find input file: $f" >&5
16930 echo "$as_me: error: cannot find input file: $f" >&2;}
16931    { (exit 1); exit 1; }; }
16932          fi;;
16933       esac
16934     done` || { (exit 1); exit 1; }
16935 EOF
16936 cat >>$CONFIG_STATUS <<\EOF
16937   ac_warn_datarootdir=no
16938   if test x"$ac_file" != x-; then
16939     for ac_item in $ac_file_inputs
16940     do
16941       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
16942       if test -n "$ac_seen"; then
16943         ac_used=`grep '@datarootdir@' $ac_item`
16944         if test -z "$ac_used"; then
16945           { echo "$as_me:16945: WARNING: datarootdir was used implicitly but not set:
16946 $ac_seen" >&5
16947 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
16948 $ac_seen" >&2;}
16949           ac_warn_datarootdir=yes
16950         fi
16951       fi
16952       ac_seen=`grep '${datarootdir}' $ac_item`
16953       if test -n "$ac_seen"; then
16954         { echo "$as_me:16954: WARNING: datarootdir was used explicitly but not set:
16955 $ac_seen" >&5
16956 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
16957 $ac_seen" >&2;}
16958         ac_warn_datarootdir=yes
16959       fi
16960     done
16961   fi
16962
16963 if test "x$ac_warn_datarootdir" = xyes; then
16964   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
16965 fi
16966
16967 EOF
16968 cat >>$CONFIG_STATUS <<EOF
16969   sed "$ac_vpsub
16970 $extrasub
16971 EOF
16972 cat >>$CONFIG_STATUS <<\EOF
16973 :t
16974 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16975 s,@configure_input@,$configure_input,;t t
16976 s,@srcdir@,$ac_srcdir,;t t
16977 s,@top_srcdir@,$ac_top_srcdir,;t t
16978 s,@INSTALL@,$ac_INSTALL,;t t
16979 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16980   rm -f $tmp/stdin
16981   if test x"$ac_file" != x-; then
16982     cp $tmp/out $ac_file
16983
16984     for ac_name in prefix exec_prefix datarootdir
16985     do
16986         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
16987         if test -n "$ac_seen"; then
16988             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
16989             if test -z "$ac_init"; then
16990               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
16991               { echo "$as_me:16991: WARNING: Variable $ac_name is used but was not set:
16992 $ac_seen" >&5
16993 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
16994 $ac_seen" >&2;}
16995             fi
16996         fi
16997     done
16998     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
16999     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17000     if test -s $tmp/out; then
17001       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17002       { echo "$as_me:17002: WARNING: Some variables may not be substituted:
17003 $ac_seen" >&5
17004 echo "$as_me: WARNING: Some variables may not be substituted:
17005 $ac_seen" >&2;}
17006     fi
17007   else
17008     cat $tmp/out
17009   fi
17010   rm -f $tmp/out
17011
17012 done
17013 EOF
17014 cat >>$CONFIG_STATUS <<\EOF
17015
17016 #
17017 # CONFIG_HEADER section.
17018 #
17019
17020 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17021 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17022 #
17023 # ac_d sets the value in "#define NAME VALUE" lines.
17024 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17025 ac_dB='[        ].*$,\1#\2'
17026 ac_dC=' '
17027 ac_dD=',;t'
17028 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17029 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17030 ac_iB='\([      ]\),\1#\2define\3'
17031 ac_iC=' '
17032 ac_iD='\4,;t'
17033 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17034 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17035 ac_uB='$,\1#\2define\3'
17036 ac_uC=' '
17037 ac_uD=',;t'
17038
17039 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17040   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17041   case $ac_file in
17042   - | *:- | *:-:* ) # input from stdin
17043         cat >$tmp/stdin
17044         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17045         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17046   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17047         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17048   * )   ac_file_in=$ac_file.in ;;
17049   esac
17050
17051   test x"$ac_file" != x- && { echo "$as_me:17051: creating $ac_file" >&5
17052 echo "$as_me: creating $ac_file" >&6;}
17053
17054   # First look for the input files in the build tree, otherwise in the
17055   # src tree.
17056   ac_file_inputs=`IFS=:
17057     for f in $ac_file_in; do
17058       case $f in
17059       -) echo $tmp/stdin ;;
17060       [\\/$]*)
17061          # Absolute (can't be DOS-style, as IFS=:)
17062          test -f "$f" || { { echo "$as_me:17062: error: cannot find input file: $f" >&5
17063 echo "$as_me: error: cannot find input file: $f" >&2;}
17064    { (exit 1); exit 1; }; }
17065          echo $f;;
17066       *) # Relative
17067          if test -f "$f"; then
17068            # Build tree
17069            echo $f
17070          elif test -f "$srcdir/$f"; then
17071            # Source tree
17072            echo $srcdir/$f
17073          else
17074            # /dev/null tree
17075            { { echo "$as_me:17075: error: cannot find input file: $f" >&5
17076 echo "$as_me: error: cannot find input file: $f" >&2;}
17077    { (exit 1); exit 1; }; }
17078          fi;;
17079       esac
17080     done` || { (exit 1); exit 1; }
17081   # Remove the trailing spaces.
17082   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17083
17084 EOF
17085
17086 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17087 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17088 # be either 'cat' or 'sort'.
17089 cat confdefs.h | uniq >conftest.vals
17090
17091 # Break up conftest.vals because some shells have a limit on
17092 # the size of here documents, and old seds have small limits too.
17093
17094 rm -f conftest.tail
17095 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17096 while grep . conftest.vals >/dev/null
17097 do
17098   # Write chunks of a limited-size here document to conftest.frag.
17099   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17100   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17101   echo 'CEOF' >> $CONFIG_STATUS
17102   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17103   rm -f conftest.vals
17104   mv conftest.tail conftest.vals
17105 done
17106 rm -f conftest.vals
17107
17108 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17109 # marker @DEFS@.
17110 echo '  cat >> conftest.edit <<CEOF
17111 /@DEFS@/r conftest.frag
17112 /@DEFS@/d
17113 CEOF
17114 sed -f conftest.edit $tmp/in > $tmp/out
17115 rm -f $tmp/in
17116 mv $tmp/out $tmp/in
17117 rm -f conftest.edit conftest.frag
17118 ' >> $CONFIG_STATUS
17119
17120 cat >>$CONFIG_STATUS <<\EOF
17121   # Let's still pretend it is `configure' which instantiates (i.e., don't
17122   # use $as_me), people would be surprised to read:
17123   #    /* config.h.  Generated automatically by config.status.  */
17124   if test x"$ac_file" = x-; then
17125     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17126   else
17127     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17128   fi
17129   cat $tmp/in >>$tmp/config.h
17130   rm -f $tmp/in
17131   if test x"$ac_file" != x-; then
17132     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17133       { echo "$as_me:17133: $ac_file is unchanged" >&5
17134 echo "$as_me: $ac_file is unchanged" >&6;}
17135     else
17136       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17137          X"$ac_file" : 'X\(//\)[^/]' \| \
17138          X"$ac_file" : 'X\(//\)$' \| \
17139          X"$ac_file" : 'X\(/\)' \| \
17140          .     : '\(.\)' 2>/dev/null ||
17141 echo X"$ac_file" |
17142     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17143           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17144           /^X\(\/\/\)$/{ s//\1/; q; }
17145           /^X\(\/\).*/{ s//\1/; q; }
17146           s/.*/./; q'`
17147       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17148         { case "$ac_dir" in
17149   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17150   *)                      as_incr_dir=.;;
17151 esac
17152 as_dummy="$ac_dir"
17153 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17154   case $as_mkdir_dir in
17155     # Skip DOS drivespec
17156     ?:) as_incr_dir=$as_mkdir_dir ;;
17157     *)
17158       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17159       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17160     ;;
17161   esac
17162 done; }
17163
17164       fi
17165       rm -f $ac_file
17166       mv $tmp/config.h $ac_file
17167     fi
17168   else
17169     cat $tmp/config.h
17170     rm -f $tmp/config.h
17171   fi
17172 done
17173 EOF
17174 cat >>$CONFIG_STATUS <<\EOF
17175 #
17176 # CONFIG_COMMANDS section.
17177 #
17178 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17179   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17180   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17181
17182   case $ac_dest in
17183     default )
17184 if test -z "$USE_OLD_MAKERULES" ; then
17185         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
17186 fi
17187  ;;
17188   esac
17189 done
17190 EOF
17191
17192 cat >>$CONFIG_STATUS <<\EOF
17193
17194 { (exit 0); exit 0; }
17195 EOF
17196 chmod +x $CONFIG_STATUS
17197 ac_clean_files=$ac_clean_files_save
17198
17199 # configure is writing to config.log, and then calls config.status.
17200 # config.status does its own redirection, appending to config.log.
17201 # Unfortunately, on DOS this fails, as config.log is still kept open
17202 # by configure, so config.status won't be able to write to it; its
17203 # output is simply discarded.  So we exec the FD to /dev/null,
17204 # effectively closing config.log, so it can be properly (re)opened and
17205 # appended to by config.status.  When coming back to configure, we
17206 # need to make the FD available again.
17207 if test "$no_create" != yes; then
17208   ac_cs_success=:
17209   exec 5>/dev/null
17210   $SHELL $CONFIG_STATUS || ac_cs_success=false
17211   exec 5>>config.log
17212   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17213   # would make configure fail if this is the last instruction.
17214   $ac_cs_success || { (exit 1); exit 1; }
17215 fi
17216 ${MAKE:-make} preinstall