]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
4ef850a0e619bc3ef8ee303e1b63e38a48d93e73
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.60 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20141204.
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
110 # Initialize some variables set by options.
111 ac_init_help=
112 ac_init_version=false
113 # The variables have the same names as the options, with
114 # dashes changed to underlines.
115 cache_file=/dev/null
116 exec_prefix=NONE
117 no_create=
118 no_recursion=
119 prefix=NONE
120 program_prefix=NONE
121 program_suffix=NONE
122 program_transform_name=s,x,x,
123 silent=
124 site=
125 srcdir=
126 verbose=
127 x_includes=NONE
128 x_libraries=NONE
129
130 # Installation directory options.
131 # These are left unexpanded so users can "make install exec_prefix=/foo"
132 # and all the variables that are supposed to be based on exec_prefix
133 # by default will actually change.
134 # Use braces instead of parens because sh, perl, etc. also accept them.
135 bindir='${exec_prefix}/bin'
136 sbindir='${exec_prefix}/sbin'
137 libexecdir='${exec_prefix}/libexec'
138 datarootdir='${prefix}/share'
139 datadir='${datarootdir}'
140 sysconfdir='${prefix}/etc'
141 sharedstatedir='${prefix}/com'
142 localstatedir='${prefix}/var'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
286     ac_prev=mandir ;;
287   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
288     mandir=$ac_optarg ;;
289
290   -nfp | --nfp | --nf)
291     # Obsolete; use --without-fp.
292     with_fp=no ;;
293
294   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
295   | --no-cr | --no-c)
296     no_create=yes ;;
297
298   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
299   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
300     no_recursion=yes ;;
301
302   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
303   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
304   | --oldin | --oldi | --old | --ol | --o)
305     ac_prev=oldincludedir ;;
306   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
307   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
308   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
309     oldincludedir=$ac_optarg ;;
310
311   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
312     ac_prev=prefix ;;
313   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
314     prefix=$ac_optarg ;;
315
316   -program-prefix | --program-prefix | --program-prefi | --program-pref \
317   | --program-pre | --program-pr | --program-p)
318     ac_prev=program_prefix ;;
319   -program-prefix=* | --program-prefix=* | --program-prefi=* \
320   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
321     program_prefix=$ac_optarg ;;
322
323   -program-suffix | --program-suffix | --program-suffi | --program-suff \
324   | --program-suf | --program-su | --program-s)
325     ac_prev=program_suffix ;;
326   -program-suffix=* | --program-suffix=* | --program-suffi=* \
327   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
328     program_suffix=$ac_optarg ;;
329
330   -program-transform-name | --program-transform-name \
331   | --program-transform-nam | --program-transform-na \
332   | --program-transform-n | --program-transform- \
333   | --program-transform | --program-transfor \
334   | --program-transfo | --program-transf \
335   | --program-trans | --program-tran \
336   | --progr-tra | --program-tr | --program-t)
337     ac_prev=program_transform_name ;;
338   -program-transform-name=* | --program-transform-name=* \
339   | --program-transform-nam=* | --program-transform-na=* \
340   | --program-transform-n=* | --program-transform-=* \
341   | --program-transform=* | --program-transfor=* \
342   | --program-transfo=* | --program-transf=* \
343   | --program-trans=* | --program-tran=* \
344   | --progr-tra=* | --program-tr=* | --program-t=*)
345     program_transform_name=$ac_optarg ;;
346
347   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
348   | -silent | --silent | --silen | --sile | --sil)
349     silent=yes ;;
350
351   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
352     ac_prev=sbindir ;;
353   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
354   | --sbi=* | --sb=*)
355     sbindir=$ac_optarg ;;
356
357   -sharedstatedir | --sharedstatedir | --sharedstatedi \
358   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
359   | --sharedst | --shareds | --shared | --share | --shar \
360   | --sha | --sh)
361     ac_prev=sharedstatedir ;;
362   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
363   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
364   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
365   | --sha=* | --sh=*)
366     sharedstatedir=$ac_optarg ;;
367
368   -site | --site | --sit)
369     ac_prev=site ;;
370   -site=* | --site=* | --sit=*)
371     site=$ac_optarg ;;
372
373   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
374     ac_prev=srcdir ;;
375   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
376     srcdir=$ac_optarg ;;
377
378   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
379   | --syscon | --sysco | --sysc | --sys | --sy)
380     ac_prev=sysconfdir ;;
381   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
382   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
383     sysconfdir=$ac_optarg ;;
384
385   -target | --target | --targe | --targ | --tar | --ta | --t)
386     ac_prev=target_alias ;;
387   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
388     target_alias=$ac_optarg ;;
389
390   -v | -verbose | --verbose | --verbos | --verbo | --verb)
391     verbose=yes ;;
392
393   -version | --version | --versio | --versi | --vers | -V)
394     ac_init_version=: ;;
395
396   -with-* | --with-*)
397     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
398     # Reject names that are not valid shell variable names.
399     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
400       { echo "$as_me: error: invalid package name: $ac_package" >&2
401    { (exit 1); exit 1; }; }
402     ac_package=`echo $ac_package| sed 's/-/_/g'`
403     case $ac_option in
404       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
405       *) ac_optarg=yes ;;
406     esac
407     eval "with_$ac_package='$ac_optarg'" ;;
408
409   -without-* | --without-*)
410     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
411     # Reject names that are not valid shell variable names.
412     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
413       { echo "$as_me: error: invalid package name: $ac_package" >&2
414    { (exit 1); exit 1; }; }
415     ac_package=`echo $ac_package | sed 's/-/_/g'`
416     eval "with_$ac_package=no" ;;
417
418   --x)
419     # Obsolete; use --with-x.
420     with_x=yes ;;
421
422   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
423   | --x-incl | --x-inc | --x-in | --x-i)
424     ac_prev=x_includes ;;
425   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
426   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
427     x_includes=$ac_optarg ;;
428
429   -x-libraries | --x-libraries | --x-librarie | --x-librari \
430   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
431     ac_prev=x_libraries ;;
432   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
433   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
434     x_libraries=$ac_optarg ;;
435
436   -*) { echo "$as_me: error: unrecognized option: $ac_option
437 Try \`$0 --help' for more information." >&2
438    { (exit 1); exit 1; }; }
439     ;;
440
441   *=*)
442     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
443     # Reject names that are not valid shell variable names.
444     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
445       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
446    { (exit 1); exit 1; }; }
447     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
448     eval "$ac_envvar='$ac_optarg'"
449     export $ac_envvar ;;
450
451   *)
452     # FIXME: should be removed in autoconf 3.0.
453     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
454     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
455       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
456     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
457     ;;
458
459   esac
460 done
461
462 if test -n "$ac_prev"; then
463   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
464   { echo "$as_me: error: missing argument to $ac_option" >&2
465    { (exit 1); exit 1; }; }
466 fi
467
468 # Be sure to have absolute paths.
469 for ac_var in exec_prefix prefix
470 do
471   eval ac_val=$`echo $ac_var`
472   case $ac_val in
473     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
474     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
475    { (exit 1); exit 1; }; };;
476   esac
477 done
478
479 # Be sure to have absolute paths.
480 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
481               localstatedir libdir includedir oldincludedir infodir mandir
482 do
483   eval ac_val=$`echo $ac_var`
484   case $ac_val in
485     [\\/$]* | ?:[\\/]* ) ;;
486     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
487    { (exit 1); exit 1; }; };;
488   esac
489 done
490
491 # There might be people who depend on the old broken behavior: `$host'
492 # used to hold the argument of --host etc.
493 build=$build_alias
494 host=$host_alias
495 target=$target_alias
496
497 # FIXME: should be removed in autoconf 3.0.
498 if test "x$host_alias" != x; then
499   if test "x$build_alias" = x; then
500     cross_compiling=maybe
501     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
502     If a cross compiler is detected then cross compile mode will be used." >&2
503   elif test "x$build_alias" != "x$host_alias"; then
504     cross_compiling=yes
505   fi
506 fi
507
508 ac_tool_prefix=
509 test -n "$host_alias" && ac_tool_prefix=$host_alias-
510
511 test "$silent" = yes && exec 6>/dev/null
512
513 # Find the source files, if location was not specified.
514 if test -z "$srcdir"; then
515   ac_srcdir_defaulted=yes
516   # Try the directory containing this script, then its parent.
517   ac_prog=$0
518   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
519   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
520   srcdir=$ac_confdir
521   if test ! -r $srcdir/$ac_unique_file; then
522     srcdir=..
523   fi
524 else
525   ac_srcdir_defaulted=no
526 fi
527 if test ! -r $srcdir/$ac_unique_file; then
528   if test "$ac_srcdir_defaulted" = yes; then
529     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
530    { (exit 1); exit 1; }; }
531   else
532     { echo "$as_me: error: cannot find sources in $srcdir" >&2
533    { (exit 1); exit 1; }; }
534   fi
535 fi
536 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
537 ac_env_build_alias_set=${build_alias+set}
538 ac_env_build_alias_value=$build_alias
539 ac_cv_env_build_alias_set=${build_alias+set}
540 ac_cv_env_build_alias_value=$build_alias
541 ac_env_host_alias_set=${host_alias+set}
542 ac_env_host_alias_value=$host_alias
543 ac_cv_env_host_alias_set=${host_alias+set}
544 ac_cv_env_host_alias_value=$host_alias
545 ac_env_target_alias_set=${target_alias+set}
546 ac_env_target_alias_value=$target_alias
547 ac_cv_env_target_alias_set=${target_alias+set}
548 ac_cv_env_target_alias_value=$target_alias
549 ac_env_CC_set=${CC+set}
550 ac_env_CC_value=$CC
551 ac_cv_env_CC_set=${CC+set}
552 ac_cv_env_CC_value=$CC
553 ac_env_CFLAGS_set=${CFLAGS+set}
554 ac_env_CFLAGS_value=$CFLAGS
555 ac_cv_env_CFLAGS_set=${CFLAGS+set}
556 ac_cv_env_CFLAGS_value=$CFLAGS
557 ac_env_LDFLAGS_set=${LDFLAGS+set}
558 ac_env_LDFLAGS_value=$LDFLAGS
559 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
560 ac_cv_env_LDFLAGS_value=$LDFLAGS
561 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
562 ac_env_CPPFLAGS_value=$CPPFLAGS
563 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
564 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
565 ac_env_CPP_set=${CPP+set}
566 ac_env_CPP_value=$CPP
567 ac_cv_env_CPP_set=${CPP+set}
568 ac_cv_env_CPP_value=$CPP
569
570 #
571 # Report the --help message.
572 #
573 if test "$ac_init_help" = "long"; then
574   # Omit some internal or obsolete options to make the list less imposing.
575   # This message is too long to be a string in the A/UX 3.1 sh.
576   cat <<EOF
577 \`configure' configures this package to adapt to many kinds of systems.
578
579 Usage: $0 [OPTION]... [VAR=VALUE]...
580
581 To assign environment variables (e.g., CC, CFLAGS...), specify them as
582 VAR=VALUE.  See below for descriptions of some of the useful variables.
583
584 Defaults for the options are specified in brackets.
585
586 Configuration:
587   -h, --help              display this help and exit
588       --help=short        display options specific to this package
589       --help=recursive    display the short help of all the included packages
590   -V, --version           display version information and exit
591   -q, --quiet, --silent   do not print \`checking...' messages
592       --cache-file=FILE   cache test results in FILE [disabled]
593   -C, --config-cache      alias for \`--cache-file=config.cache'
594   -n, --no-create         do not create output files
595       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
596
597 EOF
598
599   cat <<EOF
600 Installation directories:
601   --prefix=PREFIX         install architecture-independent files in PREFIX
602                           [$ac_default_prefix]
603   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
604                           [PREFIX]
605
606 By default, \`make install' will install all the files in
607 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
608 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
609 for instance \`--prefix=\$HOME'.
610
611 For better control, use the options below.
612
613 Fine tuning of the installation directories:
614   --bindir=DIR            user executables [EPREFIX/bin]
615   --sbindir=DIR           system admin executables [EPREFIX/sbin]
616   --libexecdir=DIR        program executables [EPREFIX/libexec]
617   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
618   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
619   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
620   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
621   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
622   --libdir=DIR            object code libraries [EPREFIX/lib]
623   --includedir=DIR        C header files [PREFIX/include]
624   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
625   --infodir=DIR           info documentation [DATAROOTDIR/info]
626   --mandir=DIR            man documentation [DATAROOTDIR/man]
627 EOF
628
629   cat <<\EOF
630
631 Program names:
632   --program-prefix=PREFIX            prepend PREFIX to installed program names
633   --program-suffix=SUFFIX            append SUFFIX to installed program names
634   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
635
636 System types:
637   --build=BUILD           configure for building on BUILD [guessed]
638   --host=HOST       build programs to run on HOST [BUILD]
639   --target=TARGET   configure for building compilers for TARGET [HOST]
640 EOF
641 fi
642
643 if test -n "$ac_init_help"; then
644
645   cat <<\EOF
646
647 Optional Packages:
648   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
649   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
650
651 Optional Features:
652   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
653   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
654
655   --with-system-type=XXX  test: override derived host system-type
656   --with-pkg-config{=path} enable/disable use of pkg-config
657   --with-pkg-config-libdir=XXX use given directory for installing pc-files
658   --without-tests         suppress build with test-programs
659   --enable-mixed-case     tic should assume mixed-case filenames
660   --with-install-prefix   prefixes actual install-location ($DESTDIR)
661 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
662   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
663   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
664   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
665   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
666   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
667   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
668 Options to Specify the Libraries Built/Used:
669   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
670   --enable-widec          compile with wide-char/UTF-8 code
671   --with-curses-dir=DIR   directory in which (n)curses is installed
672   --with-lib-prefix       override library-prefix
673   --with-shlib-version=X  Specify rel or abi version for shared libs
674   --enable-rpath-link     link sample programs with rpath option
675 Fine-Tuning Your Configuration:
676   --enable-broken_linker  compile with broken-linker support code
677   --disable-largefile     omit support for large files
678   --with-rcs-ids          compile-in RCS identifiers
679 Extensions:
680   --disable-ext-funcs     disable function-extensions
681   --enable-const          compile with extra/non-standard const
682 Development Code:
683   --without-develop       disable development options
684 Experimental Code:
685   --with-pthread          use POSIX thread library
686   --enable-weak-symbols   enable weak-symbols for pthreads
687   --enable-reentrant      compile with experimental reentrant code
688   --with-wrap-prefix=XXX  override prefix used for public variables
689 Testing/development Options:
690   --disable-echo          do not display "compiling" commands
691   --enable-warnings       build: turn on GCC compiler warnings
692   --enable-assertions     test: turn on generation of assertion code
693   --enable-expanded       test: generate functions for certain macros
694   --disable-macros        test: use functions rather than macros
695   --with-trace            test: add trace() function to all models of ncurses
696   --disable-gnat-projects test: disable GNAT projects even if usable
697 Ada95 Binding Options:
698   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
699   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
700   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
701   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
702
703 Some influential environment variables:
704   CC          C compiler command
705   CFLAGS      C compiler flags
706   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
707               nonstandard directory <lib dir>
708   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
709               headers in a nonstandard directory <include dir>
710   CPP         C preprocessor
711
712 Use these variables to override the choices made by `configure' or to help
713 it to find libraries and programs with nonstandard names/locations.
714
715 EOF
716 fi
717
718 if test "$ac_init_help" = "recursive"; then
719   # If there are subdirs, report their specific --help.
720   ac_popdir=`pwd`
721   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
722     cd $ac_subdir
723     # A "../" for each directory in /$ac_subdir.
724     ac_dots=`echo $ac_subdir |
725              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
726
727     case $srcdir in
728     .) # No --srcdir option.  We are building in place.
729       ac_sub_srcdir=$srcdir ;;
730     [\\/]* | ?:[\\/]* ) # Absolute path.
731       ac_sub_srcdir=$srcdir/$ac_subdir ;;
732     *) # Relative path.
733       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
734     esac
735
736     # Check for guested configure; otherwise get Cygnus style configure.
737     if test -f $ac_sub_srcdir/configure.gnu; then
738       echo
739       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
740     elif test -f $ac_sub_srcdir/configure; then
741       echo
742       $SHELL $ac_sub_srcdir/configure  --help=recursive
743     elif test -f $ac_sub_srcdir/configure.ac ||
744            test -f $ac_sub_srcdir/configure.in; then
745       echo
746       $ac_configure --help
747     else
748       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
749     fi
750     cd $ac_popdir
751   done
752 fi
753
754 test -n "$ac_init_help" && exit 0
755 if $ac_init_version; then
756   cat <<\EOF
757
758 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
759 Free Software Foundation, Inc.
760 This configure script is free software; the Free Software Foundation
761 gives unlimited permission to copy, distribute and modify it.
762 EOF
763   exit 0
764 fi
765 exec 5>config.log
766 cat >&5 <<EOF
767 This file contains any messages produced by compilers while
768 running configure, to aid debugging if configure makes a mistake.
769
770 It was created by $as_me, which was
771 generated by GNU Autoconf 2.52.20141204.  Invocation command line was
772
773   $ $0 $@
774
775 EOF
776 {
777 cat <<_ASUNAME
778 ## ---------- ##
779 ## Platform.  ##
780 ## ---------- ##
781
782 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
783 uname -m = `(uname -m) 2>/dev/null || echo unknown`
784 uname -r = `(uname -r) 2>/dev/null || echo unknown`
785 uname -s = `(uname -s) 2>/dev/null || echo unknown`
786 uname -v = `(uname -v) 2>/dev/null || echo unknown`
787
788 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
789 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
790
791 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
792 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
793 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
794 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
795 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
796 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
797 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
798
799 PATH = $PATH
800
801 _ASUNAME
802 } >&5
803
804 cat >&5 <<EOF
805 ## ------------ ##
806 ## Core tests.  ##
807 ## ------------ ##
808
809 EOF
810
811 # Keep a trace of the command line.
812 # Strip out --no-create and --no-recursion so they do not pile up.
813 # Also quote any args containing shell meta-characters.
814 ac_configure_args=
815 ac_sep=
816 for ac_arg
817 do
818   case $ac_arg in
819   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
820   | --no-cr | --no-c) ;;
821   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
822   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
823   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
824     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
825     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
826     ac_sep=" " ;;
827   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
828      ac_sep=" " ;;
829   esac
830   # Get rid of the leading space.
831 done
832
833 # When interrupted or exit'd, cleanup temporary files, and complete
834 # config.log.  We remove comments because anyway the quotes in there
835 # would cause problems or look ugly.
836 trap 'exit_status=$?
837   # Save into config.log some information that might help in debugging.
838   echo >&5
839   echo "## ----------------- ##" >&5
840   echo "## Cache variables.  ##" >&5
841   echo "## ----------------- ##" >&5
842   echo >&5
843   # The following way of writing the cache mishandles newlines in values,
844 {
845   (set) 2>&1 |
846     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
847     *ac_space=\ *)
848       sed -n \
849         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
850           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
851       ;;
852     *)
853       sed -n \
854         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
855       ;;
856     esac;
857 } >&5
858   sed "/^$/d" confdefs.h >conftest.log
859   if test -s conftest.log; then
860     echo >&5
861     echo "## ------------ ##" >&5
862     echo "## confdefs.h.  ##" >&5
863     echo "## ------------ ##" >&5
864     echo >&5
865     cat conftest.log >&5
866   fi
867   (echo; echo) >&5
868   test "$ac_signal" != 0 &&
869     echo "$as_me: caught signal $ac_signal" >&5
870   echo "$as_me: exit $exit_status" >&5
871   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
872     exit $exit_status
873      ' 0
874 for ac_signal in 1 2 13 15; do
875   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
876 done
877 ac_signal=0
878
879 # confdefs.h avoids OS command line length limits that DEFS can exceed.
880 rm -rf conftest* confdefs.h
881 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
882 echo >confdefs.h
883
884 # Let the site file select an alternate cache file if it wants to.
885 # Prefer explicitly selected file to automatically selected ones.
886 if test -z "$CONFIG_SITE"; then
887   if test "x$prefix" != xNONE; then
888     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
889   else
890     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
891   fi
892 fi
893 for ac_site_file in $CONFIG_SITE; do
894   if test -r "$ac_site_file"; then
895     { echo "$as_me:895: loading site script $ac_site_file" >&5
896 echo "$as_me: loading site script $ac_site_file" >&6;}
897     cat "$ac_site_file" >&5
898     . "$ac_site_file"
899   fi
900 done
901
902 if test -r "$cache_file"; then
903   # Some versions of bash will fail to source /dev/null (special
904   # files actually), so we avoid doing that.
905   if test -f "$cache_file"; then
906     { echo "$as_me:906: loading cache $cache_file" >&5
907 echo "$as_me: loading cache $cache_file" >&6;}
908     case $cache_file in
909       [\\/]* | ?:[\\/]* ) . $cache_file;;
910       *)                      . ./$cache_file;;
911     esac
912   fi
913 else
914   { echo "$as_me:914: creating cache $cache_file" >&5
915 echo "$as_me: creating cache $cache_file" >&6;}
916   >$cache_file
917 fi
918
919 # Check that the precious variables saved in the cache have kept the same
920 # value.
921 ac_cache_corrupted=false
922 for ac_var in `(set) 2>&1 |
923                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
924   eval ac_old_set=\$ac_cv_env_${ac_var}_set
925   eval ac_new_set=\$ac_env_${ac_var}_set
926   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
927   eval ac_new_val="\$ac_env_${ac_var}_value"
928   case $ac_old_set,$ac_new_set in
929     set,)
930       { echo "$as_me:930: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
931 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
932       ac_cache_corrupted=: ;;
933     ,set)
934       { echo "$as_me:934: error: \`$ac_var' was not set in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,);;
938     *)
939       if test "x$ac_old_val" != "x$ac_new_val"; then
940         { echo "$as_me:940: error: \`$ac_var' has changed since the previous run:" >&5
941 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
942         { echo "$as_me:942:   former value:  $ac_old_val" >&5
943 echo "$as_me:   former value:  $ac_old_val" >&2;}
944         { echo "$as_me:944:   current value: $ac_new_val" >&5
945 echo "$as_me:   current value: $ac_new_val" >&2;}
946         ac_cache_corrupted=:
947       fi;;
948   esac
949   # Pass precious variables to config.status.  It doesn't matter if
950   # we pass some twice (in addition to the command line arguments).
951   if test "$ac_new_set" = set; then
952     case $ac_new_val in
953     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
954       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
955       ac_configure_args="$ac_configure_args '$ac_arg'"
956       ;;
957     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
958        ;;
959     esac
960   fi
961 done
962 if $ac_cache_corrupted; then
963   { echo "$as_me:963: error: changes in the environment can compromise the build" >&5
964 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
965   { { echo "$as_me:965: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
966 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
967    { (exit 1); exit 1; }; }
968 fi
969
970 ac_ext=c
971 ac_cpp='$CPP $CPPFLAGS'
972 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
973 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
974 ac_compiler_gnu=$ac_cv_c_compiler_gnu
975 ac_main_return=return
976
977 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
978   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
979                    ECHO_T='     ' ;;
980   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
981   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
982 esac
983 echo "#! $SHELL" >conftest.sh
984 echo  "exit 0"   >>conftest.sh
985 chmod +x conftest.sh
986 if { (echo "$as_me:986: PATH=\".;.\"; conftest.sh") >&5
987   (PATH=".;."; conftest.sh) 2>&5
988   ac_status=$?
989   echo "$as_me:989: \$? = $ac_status" >&5
990   (exit $ac_status); }; then
991   ac_path_separator=';'
992 else
993   ac_path_separator=:
994 fi
995 PATH_SEPARATOR="$ac_path_separator"
996 rm -f conftest.sh
997
998 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
999
1000 top_builddir=`pwd`
1001
1002 ac_aux_dir=
1003 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1004   if test -f $ac_dir/install-sh; then
1005     ac_aux_dir=$ac_dir
1006     ac_install_sh="$ac_aux_dir/install-sh -c"
1007     break
1008   elif test -f $ac_dir/install.sh; then
1009     ac_aux_dir=$ac_dir
1010     ac_install_sh="$ac_aux_dir/install.sh -c"
1011     break
1012   elif test -f $ac_dir/shtool; then
1013     ac_aux_dir=$ac_dir
1014     ac_install_sh="$ac_aux_dir/shtool install -c"
1015     break
1016   fi
1017 done
1018 if test -z "$ac_aux_dir"; then
1019   { { echo "$as_me:1019: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1020 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1024 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1025 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1026
1027 # Make sure we can run config.sub.
1028 $ac_config_sub sun4 >/dev/null 2>&1 ||
1029   { { echo "$as_me:1029: error: cannot run $ac_config_sub" >&5
1030 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1031    { (exit 1); exit 1; }; }
1032
1033 echo "$as_me:1033: checking build system type" >&5
1034 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1035 if test "${ac_cv_build+set}" = set; then
1036   echo $ECHO_N "(cached) $ECHO_C" >&6
1037 else
1038   ac_cv_build_alias=$build_alias
1039 test -z "$ac_cv_build_alias" &&
1040   ac_cv_build_alias=`$ac_config_guess`
1041 test -z "$ac_cv_build_alias" &&
1042   { { echo "$as_me:1042: error: cannot guess build type; you must specify one" >&5
1043 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1044    { (exit 1); exit 1; }; }
1045 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1046   { { echo "$as_me:1046: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1047 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1048    { (exit 1); exit 1; }; }
1049
1050 fi
1051 echo "$as_me:1051: result: $ac_cv_build" >&5
1052 echo "${ECHO_T}$ac_cv_build" >&6
1053 build=$ac_cv_build
1054 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1055 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1056 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1057
1058 echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1080         echo "$as_me:1080: checking target system type" >&5
1081 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1082 if test "${ac_cv_target+set}" = set; then
1083   echo $ECHO_N "(cached) $ECHO_C" >&6
1084 else
1085   ac_cv_target_alias=$target_alias
1086 test "x$ac_cv_target_alias" = "x" &&
1087   ac_cv_target_alias=$ac_cv_host_alias
1088 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1089   { { echo "$as_me:1089: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1090 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1091    { (exit 1); exit 1; }; }
1092
1093 fi
1094 echo "$as_me:1094: result: $ac_cv_target" >&5
1095 echo "${ECHO_T}$ac_cv_target" >&6
1096 target=$ac_cv_target
1097 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1098 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1099 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1100
1101 # The aliases save the names the user supplied, while $host etc.
1102 # will get canonicalized.
1103 test -n "$target_alias" &&
1104   test "$program_prefix$program_suffix$program_transform_name" = \
1105     NONENONEs,x,x, &&
1106   program_prefix=${target_alias}-
1107         system_name="$host_os"
1108 else
1109         system_name="`(uname -s -r) 2>/dev/null`"
1110         if test -z "$system_name" ; then
1111                 system_name="`(hostname) 2>/dev/null`"
1112         fi
1113 fi
1114 test -n "$system_name" &&
1115 cat >>confdefs.h <<EOF
1116 #define SYSTEM_NAME "$system_name"
1117 EOF
1118
1119 if test "${cf_cv_system_name+set}" = set; then
1120   echo $ECHO_N "(cached) $ECHO_C" >&6
1121 else
1122   cf_cv_system_name="$system_name"
1123 fi
1124
1125 test -z "$system_name" && system_name="$cf_cv_system_name"
1126 test -n "$cf_cv_system_name" && echo "$as_me:1126: result: Configuring for $cf_cv_system_name" >&5
1127 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1128
1129 if test ".$system_name" != ".$cf_cv_system_name" ; then
1130         echo "$as_me:1130: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1131 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1132         { { echo "$as_me:1132: error: \"Please remove config.cache and try again.\"" >&5
1133 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1134    { (exit 1); exit 1; }; }
1135 fi
1136
1137 # Check whether --with-system-type or --without-system-type was given.
1138 if test "${with_system_type+set}" = set; then
1139   withval="$with_system_type"
1140   { echo "$as_me:1140: WARNING: overriding system type to $withval" >&5
1141 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1142         cf_cv_system_name=$withval
1143         host_os=$withval
1144
1145 fi;
1146
1147 ###     Save the given $CFLAGS to allow user-override.
1148 cf_user_CFLAGS="$CFLAGS"
1149
1150 ###     Default install-location
1151
1152 echo "$as_me:1152: checking for prefix" >&5
1153 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1154 if test "x$prefix" = "xNONE" ; then
1155         case "$cf_cv_system_name" in
1156                 # non-vendor systems don't have a conflict
1157         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1158                 prefix=/usr
1159                 ;;
1160         (*)     prefix=$ac_default_prefix
1161                 ;;
1162         esac
1163 fi
1164 echo "$as_me:1164: result: $prefix" >&5
1165 echo "${ECHO_T}$prefix" >&6
1166
1167 if test "x$prefix" = "xNONE" ; then
1168 echo "$as_me:1168: checking for default include-directory" >&5
1169 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1170 test -n "$verbose" && echo 1>&6
1171 for cf_symbol in \
1172         $includedir \
1173         $includedir/ncurses \
1174         $prefix/include \
1175         $prefix/include/ncurses \
1176         /usr/local/include \
1177         /usr/local/include/ncurses \
1178         /usr/include \
1179         /usr/include/ncurses
1180 do
1181         cf_dir=`eval echo $cf_symbol`
1182         if test -f $cf_dir/curses.h ; then
1183         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1184                 includedir="$cf_symbol"
1185                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1186                 break
1187         fi
1188         fi
1189         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1190 done
1191 echo "$as_me:1191: result: $includedir" >&5
1192 echo "${ECHO_T}$includedir" >&6
1193 fi
1194
1195 ###     Checks for programs.
1196
1197 ac_ext=c
1198 ac_cpp='$CPP $CPPFLAGS'
1199 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1200 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1201 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1202 ac_main_return=return
1203 if test -n "$ac_tool_prefix"; then
1204   for ac_prog in gnatgcc gcc cc
1205   do
1206     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1207 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1208 echo "$as_me:1208: checking for $ac_word" >&5
1209 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1210 if test "${ac_cv_prog_CC+set}" = set; then
1211   echo $ECHO_N "(cached) $ECHO_C" >&6
1212 else
1213   if test -n "$CC"; then
1214   ac_cv_prog_CC="$CC" # Let the user override the test.
1215 else
1216   ac_save_IFS=$IFS; IFS=$ac_path_separator
1217 ac_dummy="$PATH"
1218 for ac_dir in $ac_dummy; do
1219   IFS=$ac_save_IFS
1220   test -z "$ac_dir" && ac_dir=.
1221   $as_executable_p "$ac_dir/$ac_word" || continue
1222 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1223 echo "$as_me:1223: found $ac_dir/$ac_word" >&5
1224 break
1225 done
1226
1227 fi
1228 fi
1229 CC=$ac_cv_prog_CC
1230 if test -n "$CC"; then
1231   echo "$as_me:1231: result: $CC" >&5
1232 echo "${ECHO_T}$CC" >&6
1233 else
1234   echo "$as_me:1234: result: no" >&5
1235 echo "${ECHO_T}no" >&6
1236 fi
1237
1238     test -n "$CC" && break
1239   done
1240 fi
1241 if test -z "$CC"; then
1242   ac_ct_CC=$CC
1243   for ac_prog in gnatgcc gcc cc
1244 do
1245   # Extract the first word of "$ac_prog", so it can be a program name with args.
1246 set dummy $ac_prog; ac_word=$2
1247 echo "$as_me:1247: checking for $ac_word" >&5
1248 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1249 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1250   echo $ECHO_N "(cached) $ECHO_C" >&6
1251 else
1252   if test -n "$ac_ct_CC"; then
1253   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1254 else
1255   ac_save_IFS=$IFS; IFS=$ac_path_separator
1256 ac_dummy="$PATH"
1257 for ac_dir in $ac_dummy; do
1258   IFS=$ac_save_IFS
1259   test -z "$ac_dir" && ac_dir=.
1260   $as_executable_p "$ac_dir/$ac_word" || continue
1261 ac_cv_prog_ac_ct_CC="$ac_prog"
1262 echo "$as_me:1262: found $ac_dir/$ac_word" >&5
1263 break
1264 done
1265
1266 fi
1267 fi
1268 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1269 if test -n "$ac_ct_CC"; then
1270   echo "$as_me:1270: result: $ac_ct_CC" >&5
1271 echo "${ECHO_T}$ac_ct_CC" >&6
1272 else
1273   echo "$as_me:1273: result: no" >&5
1274 echo "${ECHO_T}no" >&6
1275 fi
1276
1277   test -n "$ac_ct_CC" && break
1278 done
1279
1280   CC=$ac_ct_CC
1281 fi
1282
1283 test -z "$CC" && { { echo "$as_me:1283: error: no acceptable cc found in \$PATH" >&5
1284 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1285    { (exit 1); exit 1; }; }
1286
1287 # Provide some information about the compiler.
1288 echo "$as_me:1288:" \
1289      "checking for C compiler version" >&5
1290 ac_compiler=`set X $ac_compile; echo $2`
1291 { (eval echo "$as_me:1291: \"$ac_compiler --version </dev/null >&5\"") >&5
1292   (eval $ac_compiler --version </dev/null >&5) 2>&5
1293   ac_status=$?
1294   echo "$as_me:1294: \$? = $ac_status" >&5
1295   (exit $ac_status); }
1296 { (eval echo "$as_me:1296: \"$ac_compiler -v </dev/null >&5\"") >&5
1297   (eval $ac_compiler -v </dev/null >&5) 2>&5
1298   ac_status=$?
1299   echo "$as_me:1299: \$? = $ac_status" >&5
1300   (exit $ac_status); }
1301 { (eval echo "$as_me:1301: \"$ac_compiler -V </dev/null >&5\"") >&5
1302   (eval $ac_compiler -V </dev/null >&5) 2>&5
1303   ac_status=$?
1304   echo "$as_me:1304: \$? = $ac_status" >&5
1305   (exit $ac_status); }
1306
1307 cat >conftest.$ac_ext <<_ACEOF
1308 #line 1308 "configure"
1309 #include "confdefs.h"
1310
1311 int
1312 main ()
1313 {
1314
1315   ;
1316   return 0;
1317 }
1318 _ACEOF
1319 ac_clean_files_save=$ac_clean_files
1320 ac_clean_files="$ac_clean_files a.out a.exe"
1321 # Try to create an executable without -o first, disregard a.out.
1322 # It will help us diagnose broken compilers, and finding out an intuition
1323 # of exeext.
1324 echo "$as_me:1324: checking for C compiler default output" >&5
1325 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1326 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1327 if { (eval echo "$as_me:1327: \"$ac_link_default\"") >&5
1328   (eval $ac_link_default) 2>&5
1329   ac_status=$?
1330   echo "$as_me:1330: \$? = $ac_status" >&5
1331   (exit $ac_status); }; then
1332   # Find the output, starting from the most likely.  This scheme is
1333 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1334 # resort.
1335 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1336                 ls a.out conftest 2>/dev/null;
1337                 ls a.* conftest.* 2>/dev/null`; do
1338   case $ac_file in
1339     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1340     a.out ) # We found the default executable, but exeext='' is most
1341             # certainly right.
1342             break;;
1343     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1344           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1345           export ac_cv_exeext
1346           break;;
1347     * ) break;;
1348   esac
1349 done
1350 else
1351   echo "$as_me: failed program was:" >&5
1352 cat conftest.$ac_ext >&5
1353 { { echo "$as_me:1353: error: C compiler cannot create executables" >&5
1354 echo "$as_me: error: C compiler cannot create executables" >&2;}
1355    { (exit 77); exit 77; }; }
1356 fi
1357
1358 ac_exeext=$ac_cv_exeext
1359 echo "$as_me:1359: result: $ac_file" >&5
1360 echo "${ECHO_T}$ac_file" >&6
1361
1362 # Check the compiler produces executables we can run.  If not, either
1363 # the compiler is broken, or we cross compile.
1364 echo "$as_me:1364: checking whether the C compiler works" >&5
1365 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1366 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1367 # If not cross compiling, check that we can run a simple program.
1368 if test "$cross_compiling" != yes; then
1369   if { ac_try='./$ac_file'
1370   { (eval echo "$as_me:1370: \"$ac_try\"") >&5
1371   (eval $ac_try) 2>&5
1372   ac_status=$?
1373   echo "$as_me:1373: \$? = $ac_status" >&5
1374   (exit $ac_status); }; }; then
1375     cross_compiling=no
1376   else
1377     if test "$cross_compiling" = maybe; then
1378         cross_compiling=yes
1379     else
1380         { { echo "$as_me:1380: error: cannot run C compiled programs.
1381 If you meant to cross compile, use \`--host'." >&5
1382 echo "$as_me: error: cannot run C compiled programs.
1383 If you meant to cross compile, use \`--host'." >&2;}
1384    { (exit 1); exit 1; }; }
1385     fi
1386   fi
1387 fi
1388 echo "$as_me:1388: result: yes" >&5
1389 echo "${ECHO_T}yes" >&6
1390
1391 rm -f a.out a.exe conftest$ac_cv_exeext
1392 ac_clean_files=$ac_clean_files_save
1393 # Check the compiler produces executables we can run.  If not, either
1394 # the compiler is broken, or we cross compile.
1395 echo "$as_me:1395: checking whether we are cross compiling" >&5
1396 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1397 echo "$as_me:1397: result: $cross_compiling" >&5
1398 echo "${ECHO_T}$cross_compiling" >&6
1399
1400 echo "$as_me:1400: checking for executable suffix" >&5
1401 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1402 if { (eval echo "$as_me:1402: \"$ac_link\"") >&5
1403   (eval $ac_link) 2>&5
1404   ac_status=$?
1405   echo "$as_me:1405: \$? = $ac_status" >&5
1406   (exit $ac_status); }; then
1407   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1408 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1409 # work properly (i.e., refer to `conftest.exe'), while it won't with
1410 # `rm'.
1411 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1412   case $ac_file in
1413     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1414     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1415           export ac_cv_exeext
1416           break;;
1417     * ) break;;
1418   esac
1419 done
1420 else
1421   { { echo "$as_me:1421: error: cannot compute EXEEXT: cannot compile and link" >&5
1422 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1423    { (exit 1); exit 1; }; }
1424 fi
1425
1426 rm -f conftest$ac_cv_exeext
1427 echo "$as_me:1427: result: $ac_cv_exeext" >&5
1428 echo "${ECHO_T}$ac_cv_exeext" >&6
1429
1430 rm -f conftest.$ac_ext
1431 EXEEXT=$ac_cv_exeext
1432 ac_exeext=$EXEEXT
1433 echo "$as_me:1433: checking for object suffix" >&5
1434 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1435 if test "${ac_cv_objext+set}" = set; then
1436   echo $ECHO_N "(cached) $ECHO_C" >&6
1437 else
1438   cat >conftest.$ac_ext <<_ACEOF
1439 #line 1439 "configure"
1440 #include "confdefs.h"
1441
1442 int
1443 main ()
1444 {
1445
1446   ;
1447   return 0;
1448 }
1449 _ACEOF
1450 rm -f conftest.o conftest.obj
1451 if { (eval echo "$as_me:1451: \"$ac_compile\"") >&5
1452   (eval $ac_compile) 2>&5
1453   ac_status=$?
1454   echo "$as_me:1454: \$? = $ac_status" >&5
1455   (exit $ac_status); }; then
1456   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1457   case $ac_file in
1458     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1459     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1460        break;;
1461   esac
1462 done
1463 else
1464   echo "$as_me: failed program was:" >&5
1465 cat conftest.$ac_ext >&5
1466 { { echo "$as_me:1466: error: cannot compute OBJEXT: cannot compile" >&5
1467 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1468    { (exit 1); exit 1; }; }
1469 fi
1470
1471 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1472 fi
1473 echo "$as_me:1473: result: $ac_cv_objext" >&5
1474 echo "${ECHO_T}$ac_cv_objext" >&6
1475 OBJEXT=$ac_cv_objext
1476 ac_objext=$OBJEXT
1477 echo "$as_me:1477: checking whether we are using the GNU C compiler" >&5
1478 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1479 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1480   echo $ECHO_N "(cached) $ECHO_C" >&6
1481 else
1482   cat >conftest.$ac_ext <<_ACEOF
1483 #line 1483 "configure"
1484 #include "confdefs.h"
1485
1486 int
1487 main ()
1488 {
1489 #ifndef __GNUC__
1490        choke me
1491 #endif
1492
1493   ;
1494   return 0;
1495 }
1496 _ACEOF
1497 rm -f conftest.$ac_objext
1498 if { (eval echo "$as_me:1498: \"$ac_compile\"") >&5
1499   (eval $ac_compile) 2>&5
1500   ac_status=$?
1501   echo "$as_me:1501: \$? = $ac_status" >&5
1502   (exit $ac_status); } &&
1503          { ac_try='test -s conftest.$ac_objext'
1504   { (eval echo "$as_me:1504: \"$ac_try\"") >&5
1505   (eval $ac_try) 2>&5
1506   ac_status=$?
1507   echo "$as_me:1507: \$? = $ac_status" >&5
1508   (exit $ac_status); }; }; then
1509   ac_compiler_gnu=yes
1510 else
1511   echo "$as_me: failed program was:" >&5
1512 cat conftest.$ac_ext >&5
1513 ac_compiler_gnu=no
1514 fi
1515 rm -f conftest.$ac_objext conftest.$ac_ext
1516 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1517
1518 fi
1519 echo "$as_me:1519: result: $ac_cv_c_compiler_gnu" >&5
1520 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1521 GCC=`test $ac_compiler_gnu = yes && echo yes`
1522 ac_test_CFLAGS=${CFLAGS+set}
1523 ac_save_CFLAGS=$CFLAGS
1524 CFLAGS="-g"
1525 echo "$as_me:1525: checking whether $CC accepts -g" >&5
1526 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1527 if test "${ac_cv_prog_cc_g+set}" = set; then
1528   echo $ECHO_N "(cached) $ECHO_C" >&6
1529 else
1530   cat >conftest.$ac_ext <<_ACEOF
1531 #line 1531 "configure"
1532 #include "confdefs.h"
1533
1534 int
1535 main ()
1536 {
1537
1538   ;
1539   return 0;
1540 }
1541 _ACEOF
1542 rm -f conftest.$ac_objext
1543 if { (eval echo "$as_me:1543: \"$ac_compile\"") >&5
1544   (eval $ac_compile) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); } &&
1548          { ac_try='test -s conftest.$ac_objext'
1549   { (eval echo "$as_me:1549: \"$ac_try\"") >&5
1550   (eval $ac_try) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); }; }; then
1554   ac_cv_prog_cc_g=yes
1555 else
1556   echo "$as_me: failed program was:" >&5
1557 cat conftest.$ac_ext >&5
1558 ac_cv_prog_cc_g=no
1559 fi
1560 rm -f conftest.$ac_objext conftest.$ac_ext
1561 fi
1562 echo "$as_me:1562: result: $ac_cv_prog_cc_g" >&5
1563 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1564 if test "$ac_test_CFLAGS" = set; then
1565   CFLAGS=$ac_save_CFLAGS
1566 elif test $ac_cv_prog_cc_g = yes; then
1567   if test "$GCC" = yes; then
1568     CFLAGS="-g -O2"
1569   else
1570     CFLAGS="-g"
1571   fi
1572 else
1573   if test "$GCC" = yes; then
1574     CFLAGS="-O2"
1575   else
1576     CFLAGS=
1577   fi
1578 fi
1579 # Some people use a C++ compiler to compile C.  Since we use `exit',
1580 # in C++ we need to declare it.  In case someone uses the same compiler
1581 # for both compiling C and C++ we need to have the C++ compiler decide
1582 # the declaration of exit, since it's the most demanding environment.
1583 cat >conftest.$ac_ext <<_ACEOF
1584 #ifndef __cplusplus
1585   choke me
1586 #endif
1587 _ACEOF
1588 rm -f conftest.$ac_objext
1589 if { (eval echo "$as_me:1589: \"$ac_compile\"") >&5
1590   (eval $ac_compile) 2>&5
1591   ac_status=$?
1592   echo "$as_me:1592: \$? = $ac_status" >&5
1593   (exit $ac_status); } &&
1594          { ac_try='test -s conftest.$ac_objext'
1595   { (eval echo "$as_me:1595: \"$ac_try\"") >&5
1596   (eval $ac_try) 2>&5
1597   ac_status=$?
1598   echo "$as_me:1598: \$? = $ac_status" >&5
1599   (exit $ac_status); }; }; then
1600   for ac_declaration in \
1601    ''\
1602    '#include <stdlib.h>' \
1603    'extern "C" void std::exit (int) throw (); using std::exit;' \
1604    'extern "C" void std::exit (int); using std::exit;' \
1605    'extern "C" void exit (int) throw ();' \
1606    'extern "C" void exit (int);' \
1607    'void exit (int);'
1608 do
1609   cat >conftest.$ac_ext <<_ACEOF
1610 #line 1610 "configure"
1611 #include "confdefs.h"
1612 #include <stdlib.h>
1613 $ac_declaration
1614 int
1615 main ()
1616 {
1617 exit (42);
1618   ;
1619   return 0;
1620 }
1621 _ACEOF
1622 rm -f conftest.$ac_objext
1623 if { (eval echo "$as_me:1623: \"$ac_compile\"") >&5
1624   (eval $ac_compile) 2>&5
1625   ac_status=$?
1626   echo "$as_me:1626: \$? = $ac_status" >&5
1627   (exit $ac_status); } &&
1628          { ac_try='test -s conftest.$ac_objext'
1629   { (eval echo "$as_me:1629: \"$ac_try\"") >&5
1630   (eval $ac_try) 2>&5
1631   ac_status=$?
1632   echo "$as_me:1632: \$? = $ac_status" >&5
1633   (exit $ac_status); }; }; then
1634   :
1635 else
1636   echo "$as_me: failed program was:" >&5
1637 cat conftest.$ac_ext >&5
1638 continue
1639 fi
1640 rm -f conftest.$ac_objext conftest.$ac_ext
1641   cat >conftest.$ac_ext <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644 $ac_declaration
1645 int
1646 main ()
1647 {
1648 exit (42);
1649   ;
1650   return 0;
1651 }
1652 _ACEOF
1653 rm -f conftest.$ac_objext
1654 if { (eval echo "$as_me:1654: \"$ac_compile\"") >&5
1655   (eval $ac_compile) 2>&5
1656   ac_status=$?
1657   echo "$as_me:1657: \$? = $ac_status" >&5
1658   (exit $ac_status); } &&
1659          { ac_try='test -s conftest.$ac_objext'
1660   { (eval echo "$as_me:1660: \"$ac_try\"") >&5
1661   (eval $ac_try) 2>&5
1662   ac_status=$?
1663   echo "$as_me:1663: \$? = $ac_status" >&5
1664   (exit $ac_status); }; }; then
1665   break
1666 else
1667   echo "$as_me: failed program was:" >&5
1668 cat conftest.$ac_ext >&5
1669 fi
1670 rm -f conftest.$ac_objext conftest.$ac_ext
1671 done
1672 rm -rf conftest*
1673 if test -n "$ac_declaration"; then
1674   echo '#ifdef __cplusplus' >>confdefs.h
1675   echo $ac_declaration      >>confdefs.h
1676   echo '#endif'             >>confdefs.h
1677 fi
1678
1679 else
1680   echo "$as_me: failed program was:" >&5
1681 cat conftest.$ac_ext >&5
1682 fi
1683 rm -f conftest.$ac_objext conftest.$ac_ext
1684 ac_ext=c
1685 ac_cpp='$CPP $CPPFLAGS'
1686 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1687 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1688 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1689 ac_main_return=return
1690
1691 GCC_VERSION=none
1692 if test "$GCC" = yes ; then
1693         echo "$as_me:1693: checking version of $CC" >&5
1694 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1695         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.].*//'`"
1696         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1697         echo "$as_me:1697: result: $GCC_VERSION" >&5
1698 echo "${ECHO_T}$GCC_VERSION" >&6
1699 fi
1700
1701 echo "$as_me:1701: checking for $CC option to accept ANSI C" >&5
1702 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1703 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1704   echo $ECHO_N "(cached) $ECHO_C" >&6
1705 else
1706   ac_cv_prog_cc_stdc=no
1707 ac_save_CC=$CC
1708 cat >conftest.$ac_ext <<_ACEOF
1709 #line 1709 "configure"
1710 #include "confdefs.h"
1711 #include <stdarg.h>
1712 #include <stdio.h>
1713 #include <sys/types.h>
1714 #include <sys/stat.h>
1715 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1716 struct buf { int x; };
1717 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1718 static char *e (p, i)
1719      char **p;
1720      int i;
1721 {
1722   return p[i];
1723 }
1724 static char *f (char * (*g) (char **, int), char **p, ...)
1725 {
1726   char *s;
1727   va_list v;
1728   va_start (v,p);
1729   s = g (p, va_arg (v,int));
1730   va_end (v);
1731   return s;
1732 }
1733 int test (int i, double x);
1734 struct s1 {int (*f) (int a);};
1735 struct s2 {int (*f) (double a);};
1736 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1737 int argc;
1738 char **argv;
1739 int
1740 main ()
1741 {
1742 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1743   ;
1744   return 0;
1745 }
1746 _ACEOF
1747 # Don't try gcc -ansi; that turns off useful extensions and
1748 # breaks some systems' header files.
1749 # AIX                   -qlanglvl=ansi
1750 # Ultrix and OSF/1      -std1
1751 # HP-UX 10.20 and later -Ae
1752 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1753 # SVR4                  -Xc -D__EXTENSIONS__
1754 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1755 do
1756   CC="$ac_save_CC $ac_arg"
1757   rm -f conftest.$ac_objext
1758 if { (eval echo "$as_me:1758: \"$ac_compile\"") >&5
1759   (eval $ac_compile) 2>&5
1760   ac_status=$?
1761   echo "$as_me:1761: \$? = $ac_status" >&5
1762   (exit $ac_status); } &&
1763          { ac_try='test -s conftest.$ac_objext'
1764   { (eval echo "$as_me:1764: \"$ac_try\"") >&5
1765   (eval $ac_try) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); }; }; then
1769   ac_cv_prog_cc_stdc=$ac_arg
1770 break
1771 else
1772   echo "$as_me: failed program was:" >&5
1773 cat conftest.$ac_ext >&5
1774 fi
1775 rm -f conftest.$ac_objext
1776 done
1777 rm -f conftest.$ac_ext conftest.$ac_objext
1778 CC=$ac_save_CC
1779
1780 fi
1781
1782 case "x$ac_cv_prog_cc_stdc" in
1783   x|xno)
1784     echo "$as_me:1784: result: none needed" >&5
1785 echo "${ECHO_T}none needed" >&6 ;;
1786   *)
1787     echo "$as_me:1787: result: $ac_cv_prog_cc_stdc" >&5
1788 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1789     CC="$CC $ac_cv_prog_cc_stdc" ;;
1790 esac
1791
1792 # This should have been defined by AC_PROG_CC
1793 : ${CC:=cc}
1794
1795 echo "$as_me:1795: checking \$CC variable" >&5
1796 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1797 case "$CC" in
1798 (*[\ \  ]-[IUD]*)
1799         echo "$as_me:1799: result: broken" >&5
1800 echo "${ECHO_T}broken" >&6
1801         { echo "$as_me:1801: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1802 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1803         # humor him...
1804         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1805         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1806
1807 cf_fix_cppflags=no
1808 cf_new_cflags=
1809 cf_new_cppflags=
1810 cf_new_extra_cppflags=
1811
1812 for cf_add_cflags in $cf_flags
1813 do
1814 case $cf_fix_cppflags in
1815 (no)
1816         case $cf_add_cflags in
1817         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1818                 case $cf_add_cflags in
1819                 (-D*)
1820                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1821
1822                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1823                                 && test -z "${cf_tst_cflags}" \
1824                                 && cf_fix_cppflags=yes
1825
1826                         if test $cf_fix_cppflags = yes ; then
1827                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1828                                 continue
1829                         elif test "${cf_tst_cflags}" = "\"'" ; then
1830                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1831                                 continue
1832                         fi
1833                         ;;
1834                 esac
1835                 case "$CPPFLAGS" in
1836                 (*$cf_add_cflags)
1837                         ;;
1838                 (*)
1839                         case $cf_add_cflags in
1840                         (-D*)
1841                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1842
1843 CPPFLAGS=`echo "$CPPFLAGS" | \
1844         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1845                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1846
1847                                 ;;
1848                         esac
1849                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1850                         ;;
1851                 esac
1852                 ;;
1853         (*)
1854                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1855                 ;;
1856         esac
1857         ;;
1858 (yes)
1859         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1860
1861         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1862
1863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1864                 && test -z "${cf_tst_cflags}" \
1865                 && cf_fix_cppflags=no
1866         ;;
1867 esac
1868 done
1869
1870 if test -n "$cf_new_cflags" ; then
1871
1872         CFLAGS="$CFLAGS $cf_new_cflags"
1873 fi
1874
1875 if test -n "$cf_new_cppflags" ; then
1876
1877         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1878 fi
1879
1880 if test -n "$cf_new_extra_cppflags" ; then
1881
1882         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1883 fi
1884
1885         ;;
1886 (*)
1887         echo "$as_me:1887: result: ok" >&5
1888 echo "${ECHO_T}ok" >&6
1889         ;;
1890 esac
1891
1892 ac_ext=c
1893 ac_cpp='$CPP $CPPFLAGS'
1894 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1895 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1896 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1897 ac_main_return=return
1898 echo "$as_me:1898: checking how to run the C preprocessor" >&5
1899 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1900 # On Suns, sometimes $CPP names a directory.
1901 if test -n "$CPP" && test -d "$CPP"; then
1902   CPP=
1903 fi
1904 if test -z "$CPP"; then
1905   if test "${ac_cv_prog_CPP+set}" = set; then
1906   echo $ECHO_N "(cached) $ECHO_C" >&6
1907 else
1908       # Double quotes because CPP needs to be expanded
1909     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1910     do
1911       ac_preproc_ok=false
1912 for ac_c_preproc_warn_flag in '' yes
1913 do
1914   # Use a header file that comes with gcc, so configuring glibc
1915   # with a fresh cross-compiler works.
1916   # On the NeXT, cc -E runs the code through the compiler's parser,
1917   # not just through cpp. "Syntax error" is here to catch this case.
1918   cat >conftest.$ac_ext <<_ACEOF
1919 #line 1919 "configure"
1920 #include "confdefs.h"
1921 #include <assert.h>
1922                      Syntax error
1923 _ACEOF
1924 if { (eval echo "$as_me:1924: \"$ac_cpp conftest.$ac_ext\"") >&5
1925   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1926   ac_status=$?
1927   egrep -v '^ *\+' conftest.er1 >conftest.err
1928   rm -f conftest.er1
1929   cat conftest.err >&5
1930   echo "$as_me:1930: \$? = $ac_status" >&5
1931   (exit $ac_status); } >/dev/null; then
1932   if test -s conftest.err; then
1933     ac_cpp_err=$ac_c_preproc_warn_flag
1934   else
1935     ac_cpp_err=
1936   fi
1937 else
1938   ac_cpp_err=yes
1939 fi
1940 if test -z "$ac_cpp_err"; then
1941   :
1942 else
1943   echo "$as_me: failed program was:" >&5
1944   cat conftest.$ac_ext >&5
1945   # Broken: fails on valid input.
1946 continue
1947 fi
1948 rm -f conftest.err conftest.$ac_ext
1949
1950   # OK, works on sane cases.  Now check whether non-existent headers
1951   # can be detected and how.
1952   cat >conftest.$ac_ext <<_ACEOF
1953 #line 1953 "configure"
1954 #include "confdefs.h"
1955 #include <ac_nonexistent.h>
1956 _ACEOF
1957 if { (eval echo "$as_me:1957: \"$ac_cpp conftest.$ac_ext\"") >&5
1958   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1959   ac_status=$?
1960   egrep -v '^ *\+' conftest.er1 >conftest.err
1961   rm -f conftest.er1
1962   cat conftest.err >&5
1963   echo "$as_me:1963: \$? = $ac_status" >&5
1964   (exit $ac_status); } >/dev/null; then
1965   if test -s conftest.err; then
1966     ac_cpp_err=$ac_c_preproc_warn_flag
1967   else
1968     ac_cpp_err=
1969   fi
1970 else
1971   ac_cpp_err=yes
1972 fi
1973 if test -z "$ac_cpp_err"; then
1974   # Broken: success on invalid input.
1975 continue
1976 else
1977   echo "$as_me: failed program was:" >&5
1978   cat conftest.$ac_ext >&5
1979   # Passes both tests.
1980 ac_preproc_ok=:
1981 break
1982 fi
1983 rm -f conftest.err conftest.$ac_ext
1984
1985 done
1986 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1987 rm -f conftest.err conftest.$ac_ext
1988 if $ac_preproc_ok; then
1989   break
1990 fi
1991
1992     done
1993     ac_cv_prog_CPP=$CPP
1994
1995 fi
1996   CPP=$ac_cv_prog_CPP
1997 else
1998   ac_cv_prog_CPP=$CPP
1999 fi
2000 echo "$as_me:2000: result: $CPP" >&5
2001 echo "${ECHO_T}$CPP" >&6
2002 ac_preproc_ok=false
2003 for ac_c_preproc_warn_flag in '' yes
2004 do
2005   # Use a header file that comes with gcc, so configuring glibc
2006   # with a fresh cross-compiler works.
2007   # On the NeXT, cc -E runs the code through the compiler's parser,
2008   # not just through cpp. "Syntax error" is here to catch this case.
2009   cat >conftest.$ac_ext <<_ACEOF
2010 #line 2010 "configure"
2011 #include "confdefs.h"
2012 #include <assert.h>
2013                      Syntax error
2014 _ACEOF
2015 if { (eval echo "$as_me:2015: \"$ac_cpp conftest.$ac_ext\"") >&5
2016   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2017   ac_status=$?
2018   egrep -v '^ *\+' conftest.er1 >conftest.err
2019   rm -f conftest.er1
2020   cat conftest.err >&5
2021   echo "$as_me:2021: \$? = $ac_status" >&5
2022   (exit $ac_status); } >/dev/null; then
2023   if test -s conftest.err; then
2024     ac_cpp_err=$ac_c_preproc_warn_flag
2025   else
2026     ac_cpp_err=
2027   fi
2028 else
2029   ac_cpp_err=yes
2030 fi
2031 if test -z "$ac_cpp_err"; then
2032   :
2033 else
2034   echo "$as_me: failed program was:" >&5
2035   cat conftest.$ac_ext >&5
2036   # Broken: fails on valid input.
2037 continue
2038 fi
2039 rm -f conftest.err conftest.$ac_ext
2040
2041   # OK, works on sane cases.  Now check whether non-existent headers
2042   # can be detected and how.
2043   cat >conftest.$ac_ext <<_ACEOF
2044 #line 2044 "configure"
2045 #include "confdefs.h"
2046 #include <ac_nonexistent.h>
2047 _ACEOF
2048 if { (eval echo "$as_me:2048: \"$ac_cpp conftest.$ac_ext\"") >&5
2049   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2050   ac_status=$?
2051   egrep -v '^ *\+' conftest.er1 >conftest.err
2052   rm -f conftest.er1
2053   cat conftest.err >&5
2054   echo "$as_me:2054: \$? = $ac_status" >&5
2055   (exit $ac_status); } >/dev/null; then
2056   if test -s conftest.err; then
2057     ac_cpp_err=$ac_c_preproc_warn_flag
2058   else
2059     ac_cpp_err=
2060   fi
2061 else
2062   ac_cpp_err=yes
2063 fi
2064 if test -z "$ac_cpp_err"; then
2065   # Broken: success on invalid input.
2066 continue
2067 else
2068   echo "$as_me: failed program was:" >&5
2069   cat conftest.$ac_ext >&5
2070   # Passes both tests.
2071 ac_preproc_ok=:
2072 break
2073 fi
2074 rm -f conftest.err conftest.$ac_ext
2075
2076 done
2077 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2078 rm -f conftest.err conftest.$ac_ext
2079 if $ac_preproc_ok; then
2080   :
2081 else
2082   { { echo "$as_me:2082: error: C preprocessor \"$CPP\" fails sanity check" >&5
2083 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2084    { (exit 1); exit 1; }; }
2085 fi
2086
2087 ac_ext=c
2088 ac_cpp='$CPP $CPPFLAGS'
2089 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2090 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2091 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2092 ac_main_return=return
2093
2094 if test $ac_cv_c_compiler_gnu = yes; then
2095     echo "$as_me:2095: checking whether $CC needs -traditional" >&5
2096 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2097 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2098   echo $ECHO_N "(cached) $ECHO_C" >&6
2099 else
2100     ac_pattern="Autoconf.*'x'"
2101   cat >conftest.$ac_ext <<_ACEOF
2102 #line 2102 "configure"
2103 #include "confdefs.h"
2104 #include <sgtty.h>
2105 int Autoconf = TIOCGETP;
2106 _ACEOF
2107 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2108   egrep "$ac_pattern" >/dev/null 2>&1; then
2109   ac_cv_prog_gcc_traditional=yes
2110 else
2111   ac_cv_prog_gcc_traditional=no
2112 fi
2113 rm -rf conftest*
2114
2115   if test $ac_cv_prog_gcc_traditional = no; then
2116     cat >conftest.$ac_ext <<_ACEOF
2117 #line 2117 "configure"
2118 #include "confdefs.h"
2119 #include <termio.h>
2120 int Autoconf = TCGETA;
2121 _ACEOF
2122 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2123   egrep "$ac_pattern" >/dev/null 2>&1; then
2124   ac_cv_prog_gcc_traditional=yes
2125 fi
2126 rm -rf conftest*
2127
2128   fi
2129 fi
2130 echo "$as_me:2130: result: $ac_cv_prog_gcc_traditional" >&5
2131 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2132   if test $ac_cv_prog_gcc_traditional = yes; then
2133     CC="$CC -traditional"
2134   fi
2135 fi
2136
2137 echo "$as_me:2137: checking whether $CC understands -c and -o together" >&5
2138 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2139 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2140   echo $ECHO_N "(cached) $ECHO_C" >&6
2141 else
2142
2143 cat > conftest.$ac_ext <<CF_EOF
2144 #include <stdio.h>
2145 int main()
2146 {
2147         ${cf_cv_main_return:-return}(0);
2148 }
2149 CF_EOF
2150 # We do the test twice because some compilers refuse to overwrite an
2151 # existing .o file with -o, though they will create one.
2152 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2153 if { (eval echo "$as_me:2153: \"$ac_try\"") >&5
2154   (eval $ac_try) 2>&5
2155   ac_status=$?
2156   echo "$as_me:2156: \$? = $ac_status" >&5
2157   (exit $ac_status); } &&
2158   test -f conftest2.$ac_objext && { (eval echo "$as_me:2158: \"$ac_try\"") >&5
2159   (eval $ac_try) 2>&5
2160   ac_status=$?
2161   echo "$as_me:2161: \$? = $ac_status" >&5
2162   (exit $ac_status); };
2163 then
2164   eval cf_cv_prog_CC_c_o=yes
2165 else
2166   eval cf_cv_prog_CC_c_o=no
2167 fi
2168 rm -rf conftest*
2169
2170 fi
2171 if test $cf_cv_prog_CC_c_o = yes; then
2172   echo "$as_me:2172: result: yes" >&5
2173 echo "${ECHO_T}yes" >&6
2174 else
2175   echo "$as_me:2175: result: no" >&5
2176 echo "${ECHO_T}no" >&6
2177 fi
2178
2179 test "$program_prefix" != NONE &&
2180   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2181 # Use a double $ so make ignores it.
2182 test "$program_suffix" != NONE &&
2183   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2184 # Double any \ or $.  echo might interpret backslashes.
2185 # By default was `s,x,x', remove it if useless.
2186 cat <<\_ACEOF >conftest.sed
2187 s/[\\$]/&&/g;s/;s,x,x,$//
2188 _ACEOF
2189 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2190 rm conftest.sed
2191
2192 for ac_prog in mawk gawk nawk awk
2193 do
2194   # Extract the first word of "$ac_prog", so it can be a program name with args.
2195 set dummy $ac_prog; ac_word=$2
2196 echo "$as_me:2196: checking for $ac_word" >&5
2197 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2198 if test "${ac_cv_prog_AWK+set}" = set; then
2199   echo $ECHO_N "(cached) $ECHO_C" >&6
2200 else
2201   if test -n "$AWK"; then
2202   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2203 else
2204   ac_save_IFS=$IFS; IFS=$ac_path_separator
2205 ac_dummy="$PATH"
2206 for ac_dir in $ac_dummy; do
2207   IFS=$ac_save_IFS
2208   test -z "$ac_dir" && ac_dir=.
2209   $as_executable_p "$ac_dir/$ac_word" || continue
2210 ac_cv_prog_AWK="$ac_prog"
2211 echo "$as_me:2211: found $ac_dir/$ac_word" >&5
2212 break
2213 done
2214
2215 fi
2216 fi
2217 AWK=$ac_cv_prog_AWK
2218 if test -n "$AWK"; then
2219   echo "$as_me:2219: result: $AWK" >&5
2220 echo "${ECHO_T}$AWK" >&6
2221 else
2222   echo "$as_me:2222: result: no" >&5
2223 echo "${ECHO_T}no" >&6
2224 fi
2225
2226   test -n "$AWK" && break
2227 done
2228
2229 test -z "$AWK" && { { echo "$as_me:2229: error: No awk program found" >&5
2230 echo "$as_me: error: No awk program found" >&2;}
2231    { (exit 1); exit 1; }; }
2232
2233 echo "$as_me:2233: checking for egrep" >&5
2234 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2235 if test "${ac_cv_prog_egrep+set}" = set; then
2236   echo $ECHO_N "(cached) $ECHO_C" >&6
2237 else
2238   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2239                 then ac_cv_prog_egrep='grep -E'
2240                 else ac_cv_prog_egrep='egrep'
2241         fi
2242 fi
2243 echo "$as_me:2243: result: $ac_cv_prog_egrep" >&5
2244 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2245         EGREP=$ac_cv_prog_egrep
2246
2247         test -z "$EGREP" && { { echo "$as_me:2247: error: No egrep program found" >&5
2248 echo "$as_me: error: No egrep program found" >&2;}
2249    { (exit 1); exit 1; }; }
2250
2251 # Find a good install program.  We prefer a C program (faster),
2252 # so one script is as good as another.  But avoid the broken or
2253 # incompatible versions:
2254 # SysV /etc/install, /usr/sbin/install
2255 # SunOS /usr/etc/install
2256 # IRIX /sbin/install
2257 # AIX /bin/install
2258 # AmigaOS /C/install, which installs bootblocks on floppy discs
2259 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2260 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2261 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2262 # ./install, which can be erroneously created by make from ./install.sh.
2263 echo "$as_me:2263: checking for a BSD compatible install" >&5
2264 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2265 if test -z "$INSTALL"; then
2266 if test "${ac_cv_path_install+set}" = set; then
2267   echo $ECHO_N "(cached) $ECHO_C" >&6
2268 else
2269     ac_save_IFS=$IFS; IFS=$ac_path_separator
2270   for ac_dir in $PATH; do
2271     IFS=$ac_save_IFS
2272     # Account for people who put trailing slashes in PATH elements.
2273     case $ac_dir/ in
2274     / | ./ | .// | /cC/* \
2275     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2276     | /usr/ucb/* ) ;;
2277     *)
2278       # OSF1 and SCO ODT 3.0 have their own names for install.
2279       # Don't use installbsd from OSF since it installs stuff as root
2280       # by default.
2281       for ac_prog in ginstall scoinst install; do
2282         if $as_executable_p "$ac_dir/$ac_prog"; then
2283           if test $ac_prog = install &&
2284             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2285             # AIX install.  It has an incompatible calling convention.
2286             :
2287           elif test $ac_prog = install &&
2288             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2289             # program-specific install script used by HP pwplus--don't use.
2290             :
2291           else
2292             ac_cv_path_install="$ac_dir/$ac_prog -c"
2293             break 2
2294           fi
2295         fi
2296       done
2297       ;;
2298     esac
2299   done
2300
2301 fi
2302   if test "${ac_cv_path_install+set}" = set; then
2303     INSTALL=$ac_cv_path_install
2304   else
2305     # As a last resort, use the slow shell script.  We don't cache a
2306     # path for INSTALL within a source directory, because that will
2307     # break other packages using the cache if that directory is
2308     # removed, or if the path is relative.
2309     INSTALL=$ac_install_sh
2310   fi
2311 fi
2312 echo "$as_me:2312: result: $INSTALL" >&5
2313 echo "${ECHO_T}$INSTALL" >&6
2314
2315 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2316 # It thinks the first close brace ends the variable substitution.
2317 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2318
2319 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2320
2321 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2322
2323 echo "$as_me:2323: checking whether ln -s works" >&5
2324 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2325 LN_S=$as_ln_s
2326 if test "$LN_S" = "ln -s"; then
2327   echo "$as_me:2327: result: yes" >&5
2328 echo "${ECHO_T}yes" >&6
2329 else
2330   echo "$as_me:2330: result: no, using $LN_S" >&5
2331 echo "${ECHO_T}no, using $LN_S" >&6
2332 fi
2333
2334 echo "$as_me:2334: checking if $LN_S -f options work" >&5
2335 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2336
2337 rm -f conf$$.src conf$$dst
2338 echo >conf$$.dst
2339 echo first >conf$$.src
2340 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2341         cf_prog_ln_sf=yes
2342 else
2343         cf_prog_ln_sf=no
2344 fi
2345 rm -f conf$$.dst conf$$src
2346 echo "$as_me:2346: result: $cf_prog_ln_sf" >&5
2347 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2348
2349 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2350
2351 echo "$as_me:2351: checking for long file names" >&5
2352 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2353 if test "${ac_cv_sys_long_file_names+set}" = set; then
2354   echo $ECHO_N "(cached) $ECHO_C" >&6
2355 else
2356   ac_cv_sys_long_file_names=yes
2357 # Test for long file names in all the places we know might matter:
2358 #      .                the current directory, where building will happen
2359 #      $prefix/lib      where we will be installing things
2360 #      $exec_prefix/lib likewise
2361 # eval it to expand exec_prefix.
2362 #      $TMPDIR          if set, where it might want to write temporary files
2363 # if $TMPDIR is not set:
2364 #      /tmp             where it might want to write temporary files
2365 #      /var/tmp         likewise
2366 #      /usr/tmp         likewise
2367 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2368   ac_tmpdirs=$TMPDIR
2369 else
2370   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2371 fi
2372 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2373   test -d $ac_dir || continue
2374   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2375   ac_xdir=$ac_dir/cf$$
2376   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2377   ac_tf1=$ac_xdir/conftest9012345
2378   ac_tf2=$ac_xdir/conftest9012346
2379   (echo 1 >$ac_tf1) 2>/dev/null
2380   (echo 2 >$ac_tf2) 2>/dev/null
2381   ac_val=`cat $ac_tf1 2>/dev/null`
2382   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2383     ac_cv_sys_long_file_names=no
2384     rm -rf $ac_xdir 2>/dev/null
2385     break
2386   fi
2387   rm -rf $ac_xdir 2>/dev/null
2388 done
2389 fi
2390 echo "$as_me:2390: result: $ac_cv_sys_long_file_names" >&5
2391 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2392 if test $ac_cv_sys_long_file_names = yes; then
2393
2394 cat >>confdefs.h <<\EOF
2395 #define HAVE_LONG_FILE_NAMES 1
2396 EOF
2397
2398 fi
2399
2400 # if we find pkg-config, check if we should install the ".pc" files.
2401
2402 echo "$as_me:2402: checking if you want to use pkg-config" >&5
2403 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2404
2405 # Check whether --with-pkg-config or --without-pkg-config was given.
2406 if test "${with_pkg_config+set}" = set; then
2407   withval="$with_pkg_config"
2408   cf_pkg_config=$withval
2409 else
2410   cf_pkg_config=yes
2411 fi;
2412 echo "$as_me:2412: result: $cf_pkg_config" >&5
2413 echo "${ECHO_T}$cf_pkg_config" >&6
2414
2415 case $cf_pkg_config in
2416 (no)
2417         PKG_CONFIG=none
2418         ;;
2419 (yes)
2420
2421 if test -n "$ac_tool_prefix"; then
2422   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2423 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2424 echo "$as_me:2424: checking for $ac_word" >&5
2425 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2426 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2427   echo $ECHO_N "(cached) $ECHO_C" >&6
2428 else
2429   case $PKG_CONFIG in
2430   [\\/]* | ?:[\\/]*)
2431   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2432   ;;
2433   *)
2434   ac_save_IFS=$IFS; IFS=$ac_path_separator
2435 ac_dummy="$PATH"
2436 for ac_dir in $ac_dummy; do
2437   IFS=$ac_save_IFS
2438   test -z "$ac_dir" && ac_dir=.
2439   if $as_executable_p "$ac_dir/$ac_word"; then
2440    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2441    echo "$as_me:2441: found $ac_dir/$ac_word" >&5
2442    break
2443 fi
2444 done
2445
2446   ;;
2447 esac
2448 fi
2449 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2450
2451 if test -n "$PKG_CONFIG"; then
2452   echo "$as_me:2452: result: $PKG_CONFIG" >&5
2453 echo "${ECHO_T}$PKG_CONFIG" >&6
2454 else
2455   echo "$as_me:2455: result: no" >&5
2456 echo "${ECHO_T}no" >&6
2457 fi
2458
2459 fi
2460 if test -z "$ac_cv_path_PKG_CONFIG"; then
2461   ac_pt_PKG_CONFIG=$PKG_CONFIG
2462   # Extract the first word of "pkg-config", so it can be a program name with args.
2463 set dummy pkg-config; ac_word=$2
2464 echo "$as_me:2464: checking for $ac_word" >&5
2465 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2466 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2467   echo $ECHO_N "(cached) $ECHO_C" >&6
2468 else
2469   case $ac_pt_PKG_CONFIG in
2470   [\\/]* | ?:[\\/]*)
2471   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2472   ;;
2473   *)
2474   ac_save_IFS=$IFS; IFS=$ac_path_separator
2475 ac_dummy="$PATH"
2476 for ac_dir in $ac_dummy; do
2477   IFS=$ac_save_IFS
2478   test -z "$ac_dir" && ac_dir=.
2479   if $as_executable_p "$ac_dir/$ac_word"; then
2480    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2481    echo "$as_me:2481: found $ac_dir/$ac_word" >&5
2482    break
2483 fi
2484 done
2485
2486   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2487   ;;
2488 esac
2489 fi
2490 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2491
2492 if test -n "$ac_pt_PKG_CONFIG"; then
2493   echo "$as_me:2493: result: $ac_pt_PKG_CONFIG" >&5
2494 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2495 else
2496   echo "$as_me:2496: result: no" >&5
2497 echo "${ECHO_T}no" >&6
2498 fi
2499
2500   PKG_CONFIG=$ac_pt_PKG_CONFIG
2501 else
2502   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2503 fi
2504
2505         ;;
2506 (*)
2507         PKG_CONFIG=$withval
2508         ;;
2509 esac
2510
2511 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2512 if test "$PKG_CONFIG" != none ; then
2513
2514 if test "x$prefix" != xNONE; then
2515         cf_path_syntax="$prefix"
2516 else
2517         cf_path_syntax="$ac_default_prefix"
2518 fi
2519
2520 case ".$PKG_CONFIG" in
2521 (.\$\(*\)*|.\'*\'*)
2522         ;;
2523 (..|./*|.\\*)
2524         ;;
2525 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2526         ;;
2527 (.\${*prefix}*|.\${*dir}*)
2528         eval PKG_CONFIG="$PKG_CONFIG"
2529         case ".$PKG_CONFIG" in
2530         (.NONE/*)
2531                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2532                 ;;
2533         esac
2534         ;;
2535 (.no|.NONE/*)
2536         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2537         ;;
2538 (*)
2539         { { echo "$as_me:2539: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2540 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2541    { (exit 1); exit 1; }; }
2542         ;;
2543 esac
2544
2545 else
2546         { echo "$as_me:2546: WARNING: pkg-config is not installed" >&5
2547 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2548 fi
2549
2550 echo "$as_me:2550: checking for $PKG_CONFIG library directory" >&5
2551 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2552
2553 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2554 if test "${with_pkg_config_libdir+set}" = set; then
2555   withval="$with_pkg_config_libdir"
2556   PKG_CONFIG_LIBDIR=$withval
2557 else
2558   PKG_CONFIG_LIBDIR=yes
2559 fi;
2560
2561 case x$PKG_CONFIG_LIBDIR in
2562 (x/*)
2563         ;;
2564 (xyes)
2565         # Look for the library directory using the same prefix as the executable
2566         if test "x$PKG_CONFIG" = xnone
2567         then
2568                 cf_path=$prefix
2569         else
2570                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2571         fi
2572
2573         # If you don't like using the default architecture, you have to specify the
2574         # intended library directory and corresponding compiler/linker options.
2575         #
2576         # This case allows for Debian's 2014-flavor of multiarch, along with the
2577         # most common variations before that point.  Some other variants spell the
2578         # directory differently, e.g., "pkg-config", and put it in unusual places.
2579         # pkg-config has always been poorly standardized, which is ironic...
2580         case x`(arch) 2>/dev/null` in
2581         (*64)
2582                 cf_search_path="\
2583                         $cf_path/lib/*64-linux-gnu \
2584                         $cf_path/share \
2585                         $cf_path/lib64 \
2586                         $cf_path/lib32 \
2587                         $cf_path/lib"
2588                 ;;
2589         (*)
2590                 cf_search_path="\
2591                         $cf_path/lib/*-linux-gnu \
2592                         $cf_path/share \
2593                         $cf_path/lib32 \
2594                         $cf_path/lib \
2595                         $cf_path/libdata"
2596                 ;;
2597         esac
2598
2599         test -n "$verbose" && echo "    list..." 1>&6
2600
2601 echo "${as_me:-configure}:2601: testing list... ..." 1>&5
2602
2603         for cf_config in $cf_search_path
2604         do
2605                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2606
2607 echo "${as_me:-configure}:2607: testing checking $cf_config/pkgconfig ..." 1>&5
2608
2609                 if test -d $cf_config/pkgconfig
2610                 then
2611                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2612                         echo "$as_me:2612: checking done" >&5
2613 echo $ECHO_N "checking done... $ECHO_C" >&6
2614                         break
2615                 fi
2616         done
2617         ;;
2618 (*)
2619         ;;
2620 esac
2621
2622 echo "$as_me:2622: result: $PKG_CONFIG_LIBDIR" >&5
2623 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2624
2625 echo "$as_me:2625: checking if you want to build test-programs" >&5
2626 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2627
2628 # Check whether --with-tests or --without-tests was given.
2629 if test "${with_tests+set}" = set; then
2630   withval="$with_tests"
2631   cf_with_tests=$withval
2632 else
2633   cf_with_tests=yes
2634 fi;
2635 echo "$as_me:2635: result: $cf_with_tests" >&5
2636 echo "${ECHO_T}$cf_with_tests" >&6
2637
2638 echo "$as_me:2638: checking if we should assume mixed-case filenames" >&5
2639 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2640
2641 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2642 if test "${enable_mixed_case+set}" = set; then
2643   enableval="$enable_mixed_case"
2644   enable_mixedcase=$enableval
2645 else
2646   enable_mixedcase=auto
2647 fi;
2648 echo "$as_me:2648: result: $enable_mixedcase" >&5
2649 echo "${ECHO_T}$enable_mixedcase" >&6
2650 if test "$enable_mixedcase" = "auto" ; then
2651
2652 echo "$as_me:2652: checking if filesystem supports mixed-case filenames" >&5
2653 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2654 if test "${cf_cv_mixedcase+set}" = set; then
2655   echo $ECHO_N "(cached) $ECHO_C" >&6
2656 else
2657
2658 if test "$cross_compiling" = yes ; then
2659         case $target_alias in
2660         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2661                 cf_cv_mixedcase=no
2662                 ;;
2663         (*)
2664                 cf_cv_mixedcase=yes
2665                 ;;
2666         esac
2667 else
2668         rm -f conftest CONFTEST
2669         echo test >conftest
2670         if test -f CONFTEST ; then
2671                 cf_cv_mixedcase=no
2672         else
2673                 cf_cv_mixedcase=yes
2674         fi
2675         rm -f conftest CONFTEST
2676 fi
2677
2678 fi
2679 echo "$as_me:2679: result: $cf_cv_mixedcase" >&5
2680 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2681 test "$cf_cv_mixedcase" = yes &&
2682 cat >>confdefs.h <<\EOF
2683 #define MIXEDCASE_FILENAMES 1
2684 EOF
2685
2686 else
2687         cf_cv_mixedcase=$enable_mixedcase
2688         if test "$enable_mixedcase" = "yes" ; then
2689                 cat >>confdefs.h <<\EOF
2690 #define MIXEDCASE_FILENAMES 1
2691 EOF
2692
2693         fi
2694 fi
2695
2696 # do this after mixed-case option (tags/TAGS is not as important as tic).
2697 echo "$as_me:2697: checking whether ${MAKE-make} sets \${MAKE}" >&5
2698 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2699 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2700 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2701   echo $ECHO_N "(cached) $ECHO_C" >&6
2702 else
2703   cat >conftest.make <<\EOF
2704 all:
2705         @echo 'ac_maketemp="${MAKE}"'
2706 EOF
2707 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2708 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2709 if test -n "$ac_maketemp"; then
2710   eval ac_cv_prog_make_${ac_make}_set=yes
2711 else
2712   eval ac_cv_prog_make_${ac_make}_set=no
2713 fi
2714 rm -f conftest.make
2715 fi
2716 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2717   echo "$as_me:2717: result: yes" >&5
2718 echo "${ECHO_T}yes" >&6
2719   SET_MAKE=
2720 else
2721   echo "$as_me:2721: result: no" >&5
2722 echo "${ECHO_T}no" >&6
2723   SET_MAKE="MAKE=${MAKE-make}"
2724 fi
2725
2726 for ac_prog in exctags ctags
2727 do
2728   # Extract the first word of "$ac_prog", so it can be a program name with args.
2729 set dummy $ac_prog; ac_word=$2
2730 echo "$as_me:2730: checking for $ac_word" >&5
2731 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2732 if test "${ac_cv_prog_CTAGS+set}" = set; then
2733   echo $ECHO_N "(cached) $ECHO_C" >&6
2734 else
2735   if test -n "$CTAGS"; then
2736   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2737 else
2738   ac_save_IFS=$IFS; IFS=$ac_path_separator
2739 ac_dummy="$PATH"
2740 for ac_dir in $ac_dummy; do
2741   IFS=$ac_save_IFS
2742   test -z "$ac_dir" && ac_dir=.
2743   $as_executable_p "$ac_dir/$ac_word" || continue
2744 ac_cv_prog_CTAGS="$ac_prog"
2745 echo "$as_me:2745: found $ac_dir/$ac_word" >&5
2746 break
2747 done
2748
2749 fi
2750 fi
2751 CTAGS=$ac_cv_prog_CTAGS
2752 if test -n "$CTAGS"; then
2753   echo "$as_me:2753: result: $CTAGS" >&5
2754 echo "${ECHO_T}$CTAGS" >&6
2755 else
2756   echo "$as_me:2756: result: no" >&5
2757 echo "${ECHO_T}no" >&6
2758 fi
2759
2760   test -n "$CTAGS" && break
2761 done
2762
2763 for ac_prog in exetags etags
2764 do
2765   # Extract the first word of "$ac_prog", so it can be a program name with args.
2766 set dummy $ac_prog; ac_word=$2
2767 echo "$as_me:2767: checking for $ac_word" >&5
2768 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2769 if test "${ac_cv_prog_ETAGS+set}" = set; then
2770   echo $ECHO_N "(cached) $ECHO_C" >&6
2771 else
2772   if test -n "$ETAGS"; then
2773   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2774 else
2775   ac_save_IFS=$IFS; IFS=$ac_path_separator
2776 ac_dummy="$PATH"
2777 for ac_dir in $ac_dummy; do
2778   IFS=$ac_save_IFS
2779   test -z "$ac_dir" && ac_dir=.
2780   $as_executable_p "$ac_dir/$ac_word" || continue
2781 ac_cv_prog_ETAGS="$ac_prog"
2782 echo "$as_me:2782: found $ac_dir/$ac_word" >&5
2783 break
2784 done
2785
2786 fi
2787 fi
2788 ETAGS=$ac_cv_prog_ETAGS
2789 if test -n "$ETAGS"; then
2790   echo "$as_me:2790: result: $ETAGS" >&5
2791 echo "${ECHO_T}$ETAGS" >&6
2792 else
2793   echo "$as_me:2793: result: no" >&5
2794 echo "${ECHO_T}no" >&6
2795 fi
2796
2797   test -n "$ETAGS" && break
2798 done
2799
2800 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2801 set dummy ${CTAGS:-ctags}; ac_word=$2
2802 echo "$as_me:2802: checking for $ac_word" >&5
2803 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2804 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2805   echo $ECHO_N "(cached) $ECHO_C" >&6
2806 else
2807   if test -n "$MAKE_LOWER_TAGS"; then
2808   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2809 else
2810   ac_save_IFS=$IFS; IFS=$ac_path_separator
2811 ac_dummy="$PATH"
2812 for ac_dir in $ac_dummy; do
2813   IFS=$ac_save_IFS
2814   test -z "$ac_dir" && ac_dir=.
2815   $as_executable_p "$ac_dir/$ac_word" || continue
2816 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2817 echo "$as_me:2817: found $ac_dir/$ac_word" >&5
2818 break
2819 done
2820
2821   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2822 fi
2823 fi
2824 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2825 if test -n "$MAKE_LOWER_TAGS"; then
2826   echo "$as_me:2826: result: $MAKE_LOWER_TAGS" >&5
2827 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2828 else
2829   echo "$as_me:2829: result: no" >&5
2830 echo "${ECHO_T}no" >&6
2831 fi
2832
2833 if test "$cf_cv_mixedcase" = yes ; then
2834         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2835 set dummy ${ETAGS:-etags}; ac_word=$2
2836 echo "$as_me:2836: checking for $ac_word" >&5
2837 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2838 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2839   echo $ECHO_N "(cached) $ECHO_C" >&6
2840 else
2841   if test -n "$MAKE_UPPER_TAGS"; then
2842   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2843 else
2844   ac_save_IFS=$IFS; IFS=$ac_path_separator
2845 ac_dummy="$PATH"
2846 for ac_dir in $ac_dummy; do
2847   IFS=$ac_save_IFS
2848   test -z "$ac_dir" && ac_dir=.
2849   $as_executable_p "$ac_dir/$ac_word" || continue
2850 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2851 echo "$as_me:2851: found $ac_dir/$ac_word" >&5
2852 break
2853 done
2854
2855   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2856 fi
2857 fi
2858 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2859 if test -n "$MAKE_UPPER_TAGS"; then
2860   echo "$as_me:2860: result: $MAKE_UPPER_TAGS" >&5
2861 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2862 else
2863   echo "$as_me:2863: result: no" >&5
2864 echo "${ECHO_T}no" >&6
2865 fi
2866
2867 else
2868         MAKE_UPPER_TAGS=no
2869 fi
2870
2871 if test "$MAKE_UPPER_TAGS" = yes ; then
2872         MAKE_UPPER_TAGS=
2873 else
2874         MAKE_UPPER_TAGS="#"
2875 fi
2876
2877 if test "$MAKE_LOWER_TAGS" = yes ; then
2878         MAKE_LOWER_TAGS=
2879 else
2880         MAKE_LOWER_TAGS="#"
2881 fi
2882
2883 echo "$as_me:2883: checking for makeflags variable" >&5
2884 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2885 if test "${cf_cv_makeflags+set}" = set; then
2886   echo $ECHO_N "(cached) $ECHO_C" >&6
2887 else
2888
2889         cf_cv_makeflags=''
2890         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2891         do
2892                 cat >cf_makeflags.tmp <<CF_EOF
2893 SHELL = /bin/sh
2894 all :
2895         @ echo '.$cf_option'
2896 CF_EOF
2897                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2898                 case "$cf_result" in
2899                 (.*k|.*kw)
2900                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2901                         case "$cf_result" in
2902                         (.*CC=*)        cf_cv_makeflags=
2903                                 ;;
2904                         (*)     cf_cv_makeflags=$cf_option
2905                                 ;;
2906                         esac
2907                         break
2908                         ;;
2909                 (.-)    ;;
2910                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
2911                         ;;
2912                 esac
2913         done
2914         rm -f cf_makeflags.tmp
2915
2916 fi
2917 echo "$as_me:2917: result: $cf_cv_makeflags" >&5
2918 echo "${ECHO_T}$cf_cv_makeflags" >&6
2919
2920 if test -n "$ac_tool_prefix"; then
2921   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2922 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2923 echo "$as_me:2923: checking for $ac_word" >&5
2924 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2925 if test "${ac_cv_prog_RANLIB+set}" = set; then
2926   echo $ECHO_N "(cached) $ECHO_C" >&6
2927 else
2928   if test -n "$RANLIB"; then
2929   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2930 else
2931   ac_save_IFS=$IFS; IFS=$ac_path_separator
2932 ac_dummy="$PATH"
2933 for ac_dir in $ac_dummy; do
2934   IFS=$ac_save_IFS
2935   test -z "$ac_dir" && ac_dir=.
2936   $as_executable_p "$ac_dir/$ac_word" || continue
2937 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2938 echo "$as_me:2938: found $ac_dir/$ac_word" >&5
2939 break
2940 done
2941
2942 fi
2943 fi
2944 RANLIB=$ac_cv_prog_RANLIB
2945 if test -n "$RANLIB"; then
2946   echo "$as_me:2946: result: $RANLIB" >&5
2947 echo "${ECHO_T}$RANLIB" >&6
2948 else
2949   echo "$as_me:2949: result: no" >&5
2950 echo "${ECHO_T}no" >&6
2951 fi
2952
2953 fi
2954 if test -z "$ac_cv_prog_RANLIB"; then
2955   ac_ct_RANLIB=$RANLIB
2956   # Extract the first word of "ranlib", so it can be a program name with args.
2957 set dummy ranlib; ac_word=$2
2958 echo "$as_me:2958: checking for $ac_word" >&5
2959 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2960 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2961   echo $ECHO_N "(cached) $ECHO_C" >&6
2962 else
2963   if test -n "$ac_ct_RANLIB"; then
2964   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2965 else
2966   ac_save_IFS=$IFS; IFS=$ac_path_separator
2967 ac_dummy="$PATH"
2968 for ac_dir in $ac_dummy; do
2969   IFS=$ac_save_IFS
2970   test -z "$ac_dir" && ac_dir=.
2971   $as_executable_p "$ac_dir/$ac_word" || continue
2972 ac_cv_prog_ac_ct_RANLIB="ranlib"
2973 echo "$as_me:2973: found $ac_dir/$ac_word" >&5
2974 break
2975 done
2976
2977   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
2978 fi
2979 fi
2980 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2981 if test -n "$ac_ct_RANLIB"; then
2982   echo "$as_me:2982: result: $ac_ct_RANLIB" >&5
2983 echo "${ECHO_T}$ac_ct_RANLIB" >&6
2984 else
2985   echo "$as_me:2985: result: no" >&5
2986 echo "${ECHO_T}no" >&6
2987 fi
2988
2989   RANLIB=$ac_ct_RANLIB
2990 else
2991   RANLIB="$ac_cv_prog_RANLIB"
2992 fi
2993
2994 if test -n "$ac_tool_prefix"; then
2995   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
2996 set dummy ${ac_tool_prefix}ld; ac_word=$2
2997 echo "$as_me:2997: checking for $ac_word" >&5
2998 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2999 if test "${ac_cv_prog_LD+set}" = set; then
3000   echo $ECHO_N "(cached) $ECHO_C" >&6
3001 else
3002   if test -n "$LD"; then
3003   ac_cv_prog_LD="$LD" # Let the user override the test.
3004 else
3005   ac_save_IFS=$IFS; IFS=$ac_path_separator
3006 ac_dummy="$PATH"
3007 for ac_dir in $ac_dummy; do
3008   IFS=$ac_save_IFS
3009   test -z "$ac_dir" && ac_dir=.
3010   $as_executable_p "$ac_dir/$ac_word" || continue
3011 ac_cv_prog_LD="${ac_tool_prefix}ld"
3012 echo "$as_me:3012: found $ac_dir/$ac_word" >&5
3013 break
3014 done
3015
3016 fi
3017 fi
3018 LD=$ac_cv_prog_LD
3019 if test -n "$LD"; then
3020   echo "$as_me:3020: result: $LD" >&5
3021 echo "${ECHO_T}$LD" >&6
3022 else
3023   echo "$as_me:3023: result: no" >&5
3024 echo "${ECHO_T}no" >&6
3025 fi
3026
3027 fi
3028 if test -z "$ac_cv_prog_LD"; then
3029   ac_ct_LD=$LD
3030   # Extract the first word of "ld", so it can be a program name with args.
3031 set dummy ld; ac_word=$2
3032 echo "$as_me:3032: checking for $ac_word" >&5
3033 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3034 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3035   echo $ECHO_N "(cached) $ECHO_C" >&6
3036 else
3037   if test -n "$ac_ct_LD"; then
3038   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3039 else
3040   ac_save_IFS=$IFS; IFS=$ac_path_separator
3041 ac_dummy="$PATH"
3042 for ac_dir in $ac_dummy; do
3043   IFS=$ac_save_IFS
3044   test -z "$ac_dir" && ac_dir=.
3045   $as_executable_p "$ac_dir/$ac_word" || continue
3046 ac_cv_prog_ac_ct_LD="ld"
3047 echo "$as_me:3047: found $ac_dir/$ac_word" >&5
3048 break
3049 done
3050
3051   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3052 fi
3053 fi
3054 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3055 if test -n "$ac_ct_LD"; then
3056   echo "$as_me:3056: result: $ac_ct_LD" >&5
3057 echo "${ECHO_T}$ac_ct_LD" >&6
3058 else
3059   echo "$as_me:3059: result: no" >&5
3060 echo "${ECHO_T}no" >&6
3061 fi
3062
3063   LD=$ac_ct_LD
3064 else
3065   LD="$ac_cv_prog_LD"
3066 fi
3067
3068 if test -n "$ac_tool_prefix"; then
3069   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3070 set dummy ${ac_tool_prefix}ar; ac_word=$2
3071 echo "$as_me:3071: checking for $ac_word" >&5
3072 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3073 if test "${ac_cv_prog_AR+set}" = set; then
3074   echo $ECHO_N "(cached) $ECHO_C" >&6
3075 else
3076   if test -n "$AR"; then
3077   ac_cv_prog_AR="$AR" # Let the user override the test.
3078 else
3079   ac_save_IFS=$IFS; IFS=$ac_path_separator
3080 ac_dummy="$PATH"
3081 for ac_dir in $ac_dummy; do
3082   IFS=$ac_save_IFS
3083   test -z "$ac_dir" && ac_dir=.
3084   $as_executable_p "$ac_dir/$ac_word" || continue
3085 ac_cv_prog_AR="${ac_tool_prefix}ar"
3086 echo "$as_me:3086: found $ac_dir/$ac_word" >&5
3087 break
3088 done
3089
3090 fi
3091 fi
3092 AR=$ac_cv_prog_AR
3093 if test -n "$AR"; then
3094   echo "$as_me:3094: result: $AR" >&5
3095 echo "${ECHO_T}$AR" >&6
3096 else
3097   echo "$as_me:3097: result: no" >&5
3098 echo "${ECHO_T}no" >&6
3099 fi
3100
3101 fi
3102 if test -z "$ac_cv_prog_AR"; then
3103   ac_ct_AR=$AR
3104   # Extract the first word of "ar", so it can be a program name with args.
3105 set dummy ar; ac_word=$2
3106 echo "$as_me:3106: checking for $ac_word" >&5
3107 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3108 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3109   echo $ECHO_N "(cached) $ECHO_C" >&6
3110 else
3111   if test -n "$ac_ct_AR"; then
3112   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3113 else
3114   ac_save_IFS=$IFS; IFS=$ac_path_separator
3115 ac_dummy="$PATH"
3116 for ac_dir in $ac_dummy; do
3117   IFS=$ac_save_IFS
3118   test -z "$ac_dir" && ac_dir=.
3119   $as_executable_p "$ac_dir/$ac_word" || continue
3120 ac_cv_prog_ac_ct_AR="ar"
3121 echo "$as_me:3121: found $ac_dir/$ac_word" >&5
3122 break
3123 done
3124
3125   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3126 fi
3127 fi
3128 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3129 if test -n "$ac_ct_AR"; then
3130   echo "$as_me:3130: result: $ac_ct_AR" >&5
3131 echo "${ECHO_T}$ac_ct_AR" >&6
3132 else
3133   echo "$as_me:3133: result: no" >&5
3134 echo "${ECHO_T}no" >&6
3135 fi
3136
3137   AR=$ac_ct_AR
3138 else
3139   AR="$ac_cv_prog_AR"
3140 fi
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}ar; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_prog_AR+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   if test -n "$AR"; then
3151   ac_cv_prog_AR="$AR" # Let the user override the test.
3152 else
3153   ac_save_IFS=$IFS; IFS=$ac_path_separator
3154 ac_dummy="$PATH"
3155 for ac_dir in $ac_dummy; do
3156   IFS=$ac_save_IFS
3157   test -z "$ac_dir" && ac_dir=.
3158   $as_executable_p "$ac_dir/$ac_word" || continue
3159 ac_cv_prog_AR="${ac_tool_prefix}ar"
3160 echo "$as_me:3160: found $ac_dir/$ac_word" >&5
3161 break
3162 done
3163
3164 fi
3165 fi
3166 AR=$ac_cv_prog_AR
3167 if test -n "$AR"; then
3168   echo "$as_me:3168: result: $AR" >&5
3169 echo "${ECHO_T}$AR" >&6
3170 else
3171   echo "$as_me:3171: result: no" >&5
3172 echo "${ECHO_T}no" >&6
3173 fi
3174
3175 fi
3176 if test -z "$ac_cv_prog_AR"; then
3177   ac_ct_AR=$AR
3178   # Extract the first word of "ar", so it can be a program name with args.
3179 set dummy ar; ac_word=$2
3180 echo "$as_me:3180: checking for $ac_word" >&5
3181 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3182 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3183   echo $ECHO_N "(cached) $ECHO_C" >&6
3184 else
3185   if test -n "$ac_ct_AR"; then
3186   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3187 else
3188   ac_save_IFS=$IFS; IFS=$ac_path_separator
3189 ac_dummy="$PATH"
3190 for ac_dir in $ac_dummy; do
3191   IFS=$ac_save_IFS
3192   test -z "$ac_dir" && ac_dir=.
3193   $as_executable_p "$ac_dir/$ac_word" || continue
3194 ac_cv_prog_ac_ct_AR="ar"
3195 echo "$as_me:3195: found $ac_dir/$ac_word" >&5
3196 break
3197 done
3198
3199   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3200 fi
3201 fi
3202 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3203 if test -n "$ac_ct_AR"; then
3204   echo "$as_me:3204: result: $ac_ct_AR" >&5
3205 echo "${ECHO_T}$ac_ct_AR" >&6
3206 else
3207   echo "$as_me:3207: result: no" >&5
3208 echo "${ECHO_T}no" >&6
3209 fi
3210
3211   AR=$ac_ct_AR
3212 else
3213   AR="$ac_cv_prog_AR"
3214 fi
3215
3216 echo "$as_me:3216: checking for options to update archives" >&5
3217 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3218 if test "${cf_cv_ar_flags+set}" = set; then
3219   echo $ECHO_N "(cached) $ECHO_C" >&6
3220 else
3221
3222         cf_cv_ar_flags=unknown
3223         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3224         do
3225
3226                 # check if $ARFLAGS already contains this choice
3227                 if test "x$ARFLAGS" != "x" ; then
3228                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3229                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3230                                 cf_cv_ar_flags=
3231                                 break
3232                         fi
3233                 fi
3234
3235                 rm -f conftest.$ac_cv_objext
3236                 rm -f conftest.a
3237
3238                 cat >conftest.$ac_ext <<EOF
3239 #line 3239 "configure"
3240 int     testdata[3] = { 123, 456, 789 };
3241 EOF
3242                 if { (eval echo "$as_me:3242: \"$ac_compile\"") >&5
3243   (eval $ac_compile) 2>&5
3244   ac_status=$?
3245   echo "$as_me:3245: \$? = $ac_status" >&5
3246   (exit $ac_status); } ; then
3247                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3248                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3249                         if test -f conftest.a ; then
3250                                 cf_cv_ar_flags=$cf_ar_flags
3251                                 break
3252                         fi
3253                 else
3254                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3255
3256 echo "${as_me:-configure}:3256: testing cannot compile test-program ..." 1>&5
3257
3258                         break
3259                 fi
3260         done
3261         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3262
3263 fi
3264 echo "$as_me:3264: result: $cf_cv_ar_flags" >&5
3265 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3266
3267 if test -n "$ARFLAGS" ; then
3268         if test -n "$cf_cv_ar_flags" ; then
3269                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3270         fi
3271 else
3272         ARFLAGS=$cf_cv_ar_flags
3273 fi
3274
3275         echo "$as_me:3275: checking for PATH separator" >&5
3276 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3277         case $cf_cv_system_name in
3278         (os2*)  PATH_SEPARATOR=';'  ;;
3279         (*)     ${PATH_SEPARATOR:=':'}  ;;
3280         esac
3281
3282         echo "$as_me:3282: result: $PATH_SEPARATOR" >&5
3283 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3284
3285 echo "$as_me:3285: checking if you have specified an install-prefix" >&5
3286 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3287
3288 # Check whether --with-install-prefix or --without-install-prefix was given.
3289 if test "${with_install_prefix+set}" = set; then
3290   withval="$with_install_prefix"
3291   case "$withval" in
3292         (yes|no)
3293                 ;;
3294         (*)     DESTDIR="$withval"
3295                 ;;
3296         esac
3297 fi;
3298 echo "$as_me:3298: result: $DESTDIR" >&5
3299 echo "${ECHO_T}$DESTDIR" >&6
3300
3301 ###############################################################################
3302
3303 # If we're cross-compiling, allow the user to override the tools and their
3304 # options.  The configure script is oriented toward identifying the host
3305 # compiler, etc., but we need a build compiler to generate parts of the source.
3306
3307 if test "$cross_compiling" = yes ; then
3308
3309         # defaults that we might want to override
3310         : ${BUILD_CFLAGS:=''}
3311         : ${BUILD_CPPFLAGS:=''}
3312         : ${BUILD_LDFLAGS:=''}
3313         : ${BUILD_LIBS:=''}
3314         : ${BUILD_EXEEXT:='$x'}
3315         : ${BUILD_OBJEXT:='o'}
3316
3317 # Check whether --with-build-cc or --without-build-cc was given.
3318 if test "${with_build_cc+set}" = set; then
3319   withval="$with_build_cc"
3320   BUILD_CC="$withval"
3321 else
3322   for ac_prog in gcc cc cl
3323 do
3324   # Extract the first word of "$ac_prog", so it can be a program name with args.
3325 set dummy $ac_prog; ac_word=$2
3326 echo "$as_me:3326: checking for $ac_word" >&5
3327 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3328 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3329   echo $ECHO_N "(cached) $ECHO_C" >&6
3330 else
3331   if test -n "$BUILD_CC"; then
3332   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3333 else
3334   ac_save_IFS=$IFS; IFS=$ac_path_separator
3335 ac_dummy="$PATH"
3336 for ac_dir in $ac_dummy; do
3337   IFS=$ac_save_IFS
3338   test -z "$ac_dir" && ac_dir=.
3339   $as_executable_p "$ac_dir/$ac_word" || continue
3340 ac_cv_prog_BUILD_CC="$ac_prog"
3341 echo "$as_me:3341: found $ac_dir/$ac_word" >&5
3342 break
3343 done
3344
3345 fi
3346 fi
3347 BUILD_CC=$ac_cv_prog_BUILD_CC
3348 if test -n "$BUILD_CC"; then
3349   echo "$as_me:3349: result: $BUILD_CC" >&5
3350 echo "${ECHO_T}$BUILD_CC" >&6
3351 else
3352   echo "$as_me:3352: result: no" >&5
3353 echo "${ECHO_T}no" >&6
3354 fi
3355
3356   test -n "$BUILD_CC" && break
3357 done
3358
3359 fi;
3360         echo "$as_me:3360: checking for native build C compiler" >&5
3361 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3362         echo "$as_me:3362: result: $BUILD_CC" >&5
3363 echo "${ECHO_T}$BUILD_CC" >&6
3364
3365         echo "$as_me:3365: checking for native build C preprocessor" >&5
3366 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3367
3368 # Check whether --with-build-cpp or --without-build-cpp was given.
3369 if test "${with_build_cpp+set}" = set; then
3370   withval="$with_build_cpp"
3371   BUILD_CPP="$withval"
3372 else
3373   BUILD_CPP='${BUILD_CC} -E'
3374 fi;
3375         echo "$as_me:3375: result: $BUILD_CPP" >&5
3376 echo "${ECHO_T}$BUILD_CPP" >&6
3377
3378         echo "$as_me:3378: checking for native build C flags" >&5
3379 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3380
3381 # Check whether --with-build-cflags or --without-build-cflags was given.
3382 if test "${with_build_cflags+set}" = set; then
3383   withval="$with_build_cflags"
3384   BUILD_CFLAGS="$withval"
3385 fi;
3386         echo "$as_me:3386: result: $BUILD_CFLAGS" >&5
3387 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3388
3389         echo "$as_me:3389: checking for native build C preprocessor-flags" >&5
3390 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3391
3392 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3393 if test "${with_build_cppflags+set}" = set; then
3394   withval="$with_build_cppflags"
3395   BUILD_CPPFLAGS="$withval"
3396 fi;
3397         echo "$as_me:3397: result: $BUILD_CPPFLAGS" >&5
3398 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3399
3400         echo "$as_me:3400: checking for native build linker-flags" >&5
3401 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3402
3403 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3404 if test "${with_build_ldflags+set}" = set; then
3405   withval="$with_build_ldflags"
3406   BUILD_LDFLAGS="$withval"
3407 fi;
3408         echo "$as_me:3408: result: $BUILD_LDFLAGS" >&5
3409 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3410
3411         echo "$as_me:3411: checking for native build linker-libraries" >&5
3412 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3413
3414 # Check whether --with-build-libs or --without-build-libs was given.
3415 if test "${with_build_libs+set}" = set; then
3416   withval="$with_build_libs"
3417   BUILD_LIBS="$withval"
3418 fi;
3419         echo "$as_me:3419: result: $BUILD_LIBS" >&5
3420 echo "${ECHO_T}$BUILD_LIBS" >&6
3421
3422         # this assumes we're on Unix.
3423         BUILD_EXEEXT=
3424         BUILD_OBJEXT=o
3425
3426         : ${BUILD_CC:='${CC}'}
3427
3428         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3429                 { { echo "$as_me:3429: error: Cross-build requires two compilers.
3430 Use --with-build-cc to specify the native compiler." >&5
3431 echo "$as_me: error: Cross-build requires two compilers.
3432 Use --with-build-cc to specify the native compiler." >&2;}
3433    { (exit 1); exit 1; }; }
3434         fi
3435
3436 else
3437         : ${BUILD_CC:='${CC}'}
3438         : ${BUILD_CPP:='${CPP}'}
3439         : ${BUILD_CFLAGS:='${CFLAGS}'}
3440         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3441         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3442         : ${BUILD_LIBS:='${LIBS}'}
3443         : ${BUILD_EXEEXT:='$x'}
3444         : ${BUILD_OBJEXT:='o'}
3445 fi
3446
3447 ###############################################################################
3448
3449 ### Options to allow the user to specify the set of libraries which are used.
3450 ### Use "--without-normal --with-shared" to allow the default model to be
3451 ### shared, for example.
3452 cf_list_models=""
3453
3454 echo "$as_me:3454: checking if you want to build shared C-objects" >&5
3455 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3456
3457 # Check whether --with-shared or --without-shared was given.
3458 if test "${with_shared+set}" = set; then
3459   withval="$with_shared"
3460   with_shared=$withval
3461 else
3462   with_shared=no
3463 fi;
3464 echo "$as_me:3464: result: $with_shared" >&5
3465 echo "${ECHO_T}$with_shared" >&6
3466 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3467
3468 echo "$as_me:3468: checking for specified models" >&5
3469 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3470 test -z "$cf_list_models" && cf_list_models=normal
3471 echo "$as_me:3471: result: $cf_list_models" >&5
3472 echo "${ECHO_T}$cf_list_models" >&6
3473
3474 ### Use the first model as the default, and save its suffix for use in building
3475 ### up test-applications.
3476 echo "$as_me:3476: checking for default model" >&5
3477 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3478 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3479 echo "$as_me:3479: result: $DFT_LWR_MODEL" >&5
3480 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3481
3482 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3483
3484 echo "$as_me:3484: checking for specific curses-directory" >&5
3485 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3486
3487 # Check whether --with-curses-dir or --without-curses-dir was given.
3488 if test "${with_curses_dir+set}" = set; then
3489   withval="$with_curses_dir"
3490   cf_cv_curses_dir=$withval
3491 else
3492   cf_cv_curses_dir=no
3493 fi;
3494 echo "$as_me:3494: result: $cf_cv_curses_dir" >&5
3495 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3496
3497 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3498 then
3499
3500 if test "x$prefix" != xNONE; then
3501         cf_path_syntax="$prefix"
3502 else
3503         cf_path_syntax="$ac_default_prefix"
3504 fi
3505
3506 case ".$withval" in
3507 (.\$\(*\)*|.\'*\'*)
3508         ;;
3509 (..|./*|.\\*)
3510         ;;
3511 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3512         ;;
3513 (.\${*prefix}*|.\${*dir}*)
3514         eval withval="$withval"
3515         case ".$withval" in
3516         (.NONE/*)
3517                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3518                 ;;
3519         esac
3520         ;;
3521 (.no|.NONE/*)
3522         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3523         ;;
3524 (*)
3525         { { echo "$as_me:3525: error: expected a pathname, not \"$withval\"" >&5
3526 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3527    { (exit 1); exit 1; }; }
3528         ;;
3529 esac
3530
3531         if test -d "$cf_cv_curses_dir"
3532         then
3533
3534 if test -n "$cf_cv_curses_dir/include" ; then
3535   for cf_add_incdir in $cf_cv_curses_dir/include
3536   do
3537         while test $cf_add_incdir != /usr/include
3538         do
3539           if test -d $cf_add_incdir
3540           then
3541                 cf_have_incdir=no
3542                 if test -n "$CFLAGS$CPPFLAGS" ; then
3543                   # a loop is needed to ensure we can add subdirs of existing dirs
3544                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3545                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3546                           cf_have_incdir=yes; break
3547                         fi
3548                   done
3549                 fi
3550
3551                 if test "$cf_have_incdir" = no ; then
3552                   if test "$cf_add_incdir" = /usr/local/include ; then
3553                         if test "$GCC" = yes
3554                         then
3555                           cf_save_CPPFLAGS=$CPPFLAGS
3556                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3557                           cat >conftest.$ac_ext <<_ACEOF
3558 #line 3558 "configure"
3559 #include "confdefs.h"
3560 #include <stdio.h>
3561 int
3562 main ()
3563 {
3564 printf("Hello")
3565   ;
3566   return 0;
3567 }
3568 _ACEOF
3569 rm -f conftest.$ac_objext
3570 if { (eval echo "$as_me:3570: \"$ac_compile\"") >&5
3571   (eval $ac_compile) 2>&5
3572   ac_status=$?
3573   echo "$as_me:3573: \$? = $ac_status" >&5
3574   (exit $ac_status); } &&
3575          { ac_try='test -s conftest.$ac_objext'
3576   { (eval echo "$as_me:3576: \"$ac_try\"") >&5
3577   (eval $ac_try) 2>&5
3578   ac_status=$?
3579   echo "$as_me:3579: \$? = $ac_status" >&5
3580   (exit $ac_status); }; }; then
3581   :
3582 else
3583   echo "$as_me: failed program was:" >&5
3584 cat conftest.$ac_ext >&5
3585 cf_have_incdir=yes
3586 fi
3587 rm -f conftest.$ac_objext conftest.$ac_ext
3588                           CPPFLAGS=$cf_save_CPPFLAGS
3589                         fi
3590                   fi
3591                 fi
3592
3593                 if test "$cf_have_incdir" = no ; then
3594                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3595
3596 echo "${as_me:-configure}:3596: testing adding $cf_add_incdir to include-path ..." 1>&5
3597
3598                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3599
3600                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3601                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3602                   cf_add_incdir="$cf_top_incdir"
3603                 else
3604                   break
3605                 fi
3606           fi
3607         done
3608   done
3609 fi
3610
3611 if test -n "$cf_cv_curses_dir/lib" ; then
3612         for cf_add_libdir in $cf_cv_curses_dir/lib
3613         do
3614                 if test $cf_add_libdir = /usr/lib ; then
3615                         :
3616                 elif test -d $cf_add_libdir
3617                 then
3618                         cf_have_libdir=no
3619                         if test -n "$LDFLAGS$LIBS" ; then
3620                                 # a loop is needed to ensure we can add subdirs of existing dirs
3621                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3622                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3623                                                 cf_have_libdir=yes; break
3624                                         fi
3625                                 done
3626                         fi
3627                         if test "$cf_have_libdir" = no ; then
3628                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3629
3630 echo "${as_me:-configure}:3630: testing adding $cf_add_libdir to library-path ..." 1>&5
3631
3632                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3633                         fi
3634                 fi
3635         done
3636 fi
3637
3638         fi
3639 fi
3640
3641 echo "$as_me:3641: checking if you want wide-character code" >&5
3642 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3643
3644 # Check whether --enable-widec or --disable-widec was given.
3645 if test "${enable_widec+set}" = set; then
3646   enableval="$enable_widec"
3647   with_widec=$enableval
3648 else
3649   with_widec=no
3650 fi;
3651 echo "$as_me:3651: result: $with_widec" >&5
3652 echo "${ECHO_T}$with_widec" >&6
3653 if test "$with_widec" = yes ; then
3654
3655 echo "$as_me:3655: checking for multibyte character support" >&5
3656 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3657 if test "${cf_cv_utf8_lib+set}" = set; then
3658   echo $ECHO_N "(cached) $ECHO_C" >&6
3659 else
3660
3661         cf_save_LIBS="$LIBS"
3662         cat >conftest.$ac_ext <<_ACEOF
3663 #line 3663 "configure"
3664 #include "confdefs.h"
3665
3666 #include <stdlib.h>
3667 int
3668 main ()
3669 {
3670 putwc(0,0);
3671   ;
3672   return 0;
3673 }
3674 _ACEOF
3675 rm -f conftest.$ac_objext conftest$ac_exeext
3676 if { (eval echo "$as_me:3676: \"$ac_link\"") >&5
3677   (eval $ac_link) 2>&5
3678   ac_status=$?
3679   echo "$as_me:3679: \$? = $ac_status" >&5
3680   (exit $ac_status); } &&
3681          { ac_try='test -s conftest$ac_exeext'
3682   { (eval echo "$as_me:3682: \"$ac_try\"") >&5
3683   (eval $ac_try) 2>&5
3684   ac_status=$?
3685   echo "$as_me:3685: \$? = $ac_status" >&5
3686   (exit $ac_status); }; }; then
3687   cf_cv_utf8_lib=yes
3688 else
3689   echo "$as_me: failed program was:" >&5
3690 cat conftest.$ac_ext >&5
3691
3692 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3693 # will be set on completion of the AC_TRY_LINK below.
3694 cf_cv_header_path_utf8=
3695 cf_cv_library_path_utf8=
3696
3697 echo "${as_me:-configure}:3697: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3698
3699 cf_save_LIBS="$LIBS"
3700
3701 cat >conftest.$ac_ext <<_ACEOF
3702 #line 3702 "configure"
3703 #include "confdefs.h"
3704
3705 #include <libutf8.h>
3706 int
3707 main ()
3708 {
3709 putwc(0,0);
3710   ;
3711   return 0;
3712 }
3713 _ACEOF
3714 rm -f conftest.$ac_objext conftest$ac_exeext
3715 if { (eval echo "$as_me:3715: \"$ac_link\"") >&5
3716   (eval $ac_link) 2>&5
3717   ac_status=$?
3718   echo "$as_me:3718: \$? = $ac_status" >&5
3719   (exit $ac_status); } &&
3720          { ac_try='test -s conftest$ac_exeext'
3721   { (eval echo "$as_me:3721: \"$ac_try\"") >&5
3722   (eval $ac_try) 2>&5
3723   ac_status=$?
3724   echo "$as_me:3724: \$? = $ac_status" >&5
3725   (exit $ac_status); }; }; then
3726
3727         cf_cv_find_linkage_utf8=yes
3728         cf_cv_header_path_utf8=/usr/include
3729         cf_cv_library_path_utf8=/usr/lib
3730
3731 else
3732   echo "$as_me: failed program was:" >&5
3733 cat conftest.$ac_ext >&5
3734
3735 LIBS="-lutf8  $cf_save_LIBS"
3736
3737 cat >conftest.$ac_ext <<_ACEOF
3738 #line 3738 "configure"
3739 #include "confdefs.h"
3740
3741 #include <libutf8.h>
3742 int
3743 main ()
3744 {
3745 putwc(0,0);
3746   ;
3747   return 0;
3748 }
3749 _ACEOF
3750 rm -f conftest.$ac_objext conftest$ac_exeext
3751 if { (eval echo "$as_me:3751: \"$ac_link\"") >&5
3752   (eval $ac_link) 2>&5
3753   ac_status=$?
3754   echo "$as_me:3754: \$? = $ac_status" >&5
3755   (exit $ac_status); } &&
3756          { ac_try='test -s conftest$ac_exeext'
3757   { (eval echo "$as_me:3757: \"$ac_try\"") >&5
3758   (eval $ac_try) 2>&5
3759   ac_status=$?
3760   echo "$as_me:3760: \$? = $ac_status" >&5
3761   (exit $ac_status); }; }; then
3762
3763         cf_cv_find_linkage_utf8=yes
3764         cf_cv_header_path_utf8=/usr/include
3765         cf_cv_library_path_utf8=/usr/lib
3766         cf_cv_library_file_utf8="-lutf8"
3767
3768 else
3769   echo "$as_me: failed program was:" >&5
3770 cat conftest.$ac_ext >&5
3771
3772         cf_cv_find_linkage_utf8=no
3773         LIBS="$cf_save_LIBS"
3774
3775         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
3776
3777 echo "${as_me:-configure}:3777: testing find linkage for utf8 library ..." 1>&5
3778
3779 echo "${as_me:-configure}:3779: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3780
3781         cf_save_CPPFLAGS="$CPPFLAGS"
3782         cf_test_CPPFLAGS="$CPPFLAGS"
3783
3784 cf_search=
3785
3786 # collect the current set of include-directories from compiler flags
3787 cf_header_path_list=""
3788 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3789         for cf_header_path in $CPPFLAGS $CFLAGS
3790         do
3791                 case $cf_header_path in
3792                 (-I*)
3793                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3794
3795 test "x$cf_header_path" != "xNONE" && \
3796 test -d "$cf_header_path" && \
3797  {
3798         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3799         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3800         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
3801         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
3802         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
3803         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
3804 }
3805
3806                         cf_header_path_list="$cf_header_path_list $cf_search"
3807                         ;;
3808                 esac
3809         done
3810 fi
3811
3812 # add the variations for the package we are looking for
3813
3814 cf_search=
3815
3816 test "x$prefix" != "xNONE" && \
3817 test -d "$prefix" && \
3818  {
3819         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3820         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3821         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
3822         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
3823         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
3824         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
3825 }
3826
3827 for cf_subdir_prefix in \
3828         /usr \
3829         /usr/local \
3830         /usr/pkg \
3831         /opt \
3832         /opt/local \
3833         $HOME
3834 do
3835
3836 test "x$cf_subdir_prefix" != "x$prefix" && \
3837 test -d "$cf_subdir_prefix" && \
3838 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
3839         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
3840         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
3841         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
3842         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
3843         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
3844         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
3845 }
3846
3847 done
3848
3849 test "$includedir" != NONE && \
3850 test "$includedir" != "/usr/include" && \
3851 test -d "$includedir" && {
3852         test -d $includedir &&    cf_search="$cf_search $includedir"
3853         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
3854 }
3855
3856 test "$oldincludedir" != NONE && \
3857 test "$oldincludedir" != "/usr/include" && \
3858 test -d "$oldincludedir" && {
3859         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3860         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
3861 }
3862
3863 cf_search="$cf_search $cf_header_path_list"
3864
3865         for cf_cv_header_path_utf8 in $cf_search
3866         do
3867                 if test -d $cf_cv_header_path_utf8 ; then
3868                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
3869
3870 echo "${as_me:-configure}:3870: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
3871
3872                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
3873                         cat >conftest.$ac_ext <<_ACEOF
3874 #line 3874 "configure"
3875 #include "confdefs.h"
3876
3877 #include <libutf8.h>
3878 int
3879 main ()
3880 {
3881 putwc(0,0);
3882   ;
3883   return 0;
3884 }
3885 _ACEOF
3886 rm -f conftest.$ac_objext
3887 if { (eval echo "$as_me:3887: \"$ac_compile\"") >&5
3888   (eval $ac_compile) 2>&5
3889   ac_status=$?
3890   echo "$as_me:3890: \$? = $ac_status" >&5
3891   (exit $ac_status); } &&
3892          { ac_try='test -s conftest.$ac_objext'
3893   { (eval echo "$as_me:3893: \"$ac_try\"") >&5
3894   (eval $ac_try) 2>&5
3895   ac_status=$?
3896   echo "$as_me:3896: \$? = $ac_status" >&5
3897   (exit $ac_status); }; }; then
3898
3899                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
3900
3901 echo "${as_me:-configure}:3901: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
3902
3903                                 cf_cv_find_linkage_utf8=maybe
3904                                 cf_test_CPPFLAGS="$CPPFLAGS"
3905                                 break
3906 else
3907   echo "$as_me: failed program was:" >&5
3908 cat conftest.$ac_ext >&5
3909
3910                                 CPPFLAGS="$cf_save_CPPFLAGS"
3911
3912 fi
3913 rm -f conftest.$ac_objext conftest.$ac_ext
3914                 fi
3915         done
3916
3917         if test "$cf_cv_find_linkage_utf8" = maybe ; then
3918
3919 echo "${as_me:-configure}:3919: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
3920
3921                 cf_save_LIBS="$LIBS"
3922                 cf_save_LDFLAGS="$LDFLAGS"
3923
3924                 if test "$cf_cv_find_linkage_utf8" != yes ; then
3925
3926 cf_search=
3927 cf_library_path_list=""
3928 if test -n "${LDFLAGS}${LIBS}" ; then
3929         for cf_library_path in $LDFLAGS $LIBS
3930         do
3931                 case $cf_library_path in
3932                 (-L*)
3933                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
3934
3935 test "x$cf_library_path" != "xNONE" && \
3936 test -d "$cf_library_path" && \
3937  {
3938         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
3939         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
3940         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
3941         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
3942         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
3943         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
3944 }
3945
3946                         cf_library_path_list="$cf_library_path_list $cf_search"
3947                         ;;
3948                 esac
3949         done
3950 fi
3951
3952 cf_search=
3953
3954 test "x$prefix" != "xNONE" && \
3955 test -d "$prefix" && \
3956  {
3957         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
3958         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
3959         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
3960         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
3961         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
3962         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
3963 }
3964
3965 for cf_subdir_prefix in \
3966         /usr \
3967         /usr/local \
3968         /usr/pkg \
3969         /opt \
3970         /opt/local \
3971         $HOME
3972 do
3973
3974 test "x$cf_subdir_prefix" != "x$prefix" && \
3975 test -d "$cf_subdir_prefix" && \
3976 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
3977         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
3978         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
3979         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
3980         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
3981         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
3982         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
3983 }
3984
3985 done
3986
3987 cf_search="$cf_library_path_list $cf_search"
3988
3989                         for cf_cv_library_path_utf8 in $cf_search
3990                         do
3991                                 if test -d $cf_cv_library_path_utf8 ; then
3992                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
3993
3994 echo "${as_me:-configure}:3994: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
3995
3996                                         CPPFLAGS="$cf_test_CPPFLAGS"
3997                                         LIBS="-lutf8  $cf_save_LIBS"
3998                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
3999                                         cat >conftest.$ac_ext <<_ACEOF
4000 #line 4000 "configure"
4001 #include "confdefs.h"
4002
4003 #include <libutf8.h>
4004 int
4005 main ()
4006 {
4007 putwc(0,0);
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext conftest$ac_exeext
4013 if { (eval echo "$as_me:4013: \"$ac_link\"") >&5
4014   (eval $ac_link) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest$ac_exeext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024
4025                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4026
4027 echo "${as_me:-configure}:4027: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4028
4029                                         cf_cv_find_linkage_utf8=yes
4030                                         cf_cv_library_file_utf8="-lutf8"
4031                                         break
4032 else
4033   echo "$as_me: failed program was:" >&5
4034 cat conftest.$ac_ext >&5
4035
4036                                         CPPFLAGS="$cf_save_CPPFLAGS"
4037                                         LIBS="$cf_save_LIBS"
4038                                         LDFLAGS="$cf_save_LDFLAGS"
4039
4040 fi
4041 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4042                                 fi
4043                         done
4044                         CPPFLAGS="$cf_save_CPPFLAGS"
4045                         LDFLAGS="$cf_save_LDFLAGS"
4046                 fi
4047
4048         else
4049                 cf_cv_find_linkage_utf8=no
4050         fi
4051
4052 fi
4053 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4054
4055 fi
4056 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4057
4058 LIBS="$cf_save_LIBS"
4059
4060 if test "$cf_cv_find_linkage_utf8" = yes ; then
4061 cf_cv_utf8_lib=add-on
4062 else
4063 cf_cv_utf8_lib=no
4064 fi
4065
4066 fi
4067 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4068 fi
4069 echo "$as_me:4069: result: $cf_cv_utf8_lib" >&5
4070 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4071
4072 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4073 # ncurses/ncursesw:
4074 if test "$cf_cv_utf8_lib" = "add-on" ; then
4075
4076 cat >>confdefs.h <<\EOF
4077 #define HAVE_LIBUTF8_H 1
4078 EOF
4079
4080 if test -n "$cf_cv_header_path_utf8" ; then
4081   for cf_add_incdir in $cf_cv_header_path_utf8
4082   do
4083         while test $cf_add_incdir != /usr/include
4084         do
4085           if test -d $cf_add_incdir
4086           then
4087                 cf_have_incdir=no
4088                 if test -n "$CFLAGS$CPPFLAGS" ; then
4089                   # a loop is needed to ensure we can add subdirs of existing dirs
4090                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4091                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4092                           cf_have_incdir=yes; break
4093                         fi
4094                   done
4095                 fi
4096
4097                 if test "$cf_have_incdir" = no ; then
4098                   if test "$cf_add_incdir" = /usr/local/include ; then
4099                         if test "$GCC" = yes
4100                         then
4101                           cf_save_CPPFLAGS=$CPPFLAGS
4102                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4103                           cat >conftest.$ac_ext <<_ACEOF
4104 #line 4104 "configure"
4105 #include "confdefs.h"
4106 #include <stdio.h>
4107 int
4108 main ()
4109 {
4110 printf("Hello")
4111   ;
4112   return 0;
4113 }
4114 _ACEOF
4115 rm -f conftest.$ac_objext
4116 if { (eval echo "$as_me:4116: \"$ac_compile\"") >&5
4117   (eval $ac_compile) 2>&5
4118   ac_status=$?
4119   echo "$as_me:4119: \$? = $ac_status" >&5
4120   (exit $ac_status); } &&
4121          { ac_try='test -s conftest.$ac_objext'
4122   { (eval echo "$as_me:4122: \"$ac_try\"") >&5
4123   (eval $ac_try) 2>&5
4124   ac_status=$?
4125   echo "$as_me:4125: \$? = $ac_status" >&5
4126   (exit $ac_status); }; }; then
4127   :
4128 else
4129   echo "$as_me: failed program was:" >&5
4130 cat conftest.$ac_ext >&5
4131 cf_have_incdir=yes
4132 fi
4133 rm -f conftest.$ac_objext conftest.$ac_ext
4134                           CPPFLAGS=$cf_save_CPPFLAGS
4135                         fi
4136                   fi
4137                 fi
4138
4139                 if test "$cf_have_incdir" = no ; then
4140                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4141
4142 echo "${as_me:-configure}:4142: testing adding $cf_add_incdir to include-path ..." 1>&5
4143
4144                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4145
4146                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4147                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4148                   cf_add_incdir="$cf_top_incdir"
4149                 else
4150                   break
4151                 fi
4152           fi
4153         done
4154   done
4155 fi
4156
4157 if test -n "$cf_cv_library_path_utf8" ; then
4158         for cf_add_libdir in $cf_cv_library_path_utf8
4159         do
4160                 if test $cf_add_libdir = /usr/lib ; then
4161                         :
4162                 elif test -d $cf_add_libdir
4163                 then
4164                         cf_have_libdir=no
4165                         if test -n "$LDFLAGS$LIBS" ; then
4166                                 # a loop is needed to ensure we can add subdirs of existing dirs
4167                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4168                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4169                                                 cf_have_libdir=yes; break
4170                                         fi
4171                                 done
4172                         fi
4173                         if test "$cf_have_libdir" = no ; then
4174                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4175
4176 echo "${as_me:-configure}:4176: testing adding $cf_add_libdir to library-path ..." 1>&5
4177
4178                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4179                         fi
4180                 fi
4181         done
4182 fi
4183
4184 cf_add_libs="$cf_cv_library_file_utf8"
4185 # Filter out duplicates - this happens with badly-designed ".pc" files...
4186 for cf_add_1lib in $LIBS
4187 do
4188         for cf_add_2lib in $cf_add_libs
4189         do
4190                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4191                 then
4192                         cf_add_1lib=
4193                         break
4194                 fi
4195         done
4196         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4197 done
4198 LIBS="$cf_add_libs"
4199
4200 fi
4201
4202 cf_ncuconfig_root=ncursesw
4203 cf_have_ncuconfig=no
4204
4205 if test "x$PKG_CONFIG" != xnone; then
4206         echo "$as_me:4206: checking pkg-config for $cf_ncuconfig_root" >&5
4207 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4208         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4209                 echo "$as_me:4209: result: yes" >&5
4210 echo "${ECHO_T}yes" >&6
4211
4212                 echo "$as_me:4212: checking if the $cf_ncuconfig_root package files work" >&5
4213 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4214                 cf_have_ncuconfig=unknown
4215
4216                 cf_save_CPPFLAGS="$CPPFLAGS"
4217                 cf_save_LIBS="$LIBS"
4218
4219                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4220
4221 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4222 # Filter out duplicates - this happens with badly-designed ".pc" files...
4223 for cf_add_1lib in $LIBS
4224 do
4225         for cf_add_2lib in $cf_add_libs
4226         do
4227                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4228                 then
4229                         cf_add_1lib=
4230                         break
4231                 fi
4232         done
4233         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4234 done
4235 LIBS="$cf_add_libs"
4236
4237                 cat >conftest.$ac_ext <<_ACEOF
4238 #line 4238 "configure"
4239 #include "confdefs.h"
4240 #include <${cf_cv_ncurses_header:-curses.h}>
4241 int
4242 main ()
4243 {
4244 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4245   ;
4246   return 0;
4247 }
4248 _ACEOF
4249 rm -f conftest.$ac_objext conftest$ac_exeext
4250 if { (eval echo "$as_me:4250: \"$ac_link\"") >&5
4251   (eval $ac_link) 2>&5
4252   ac_status=$?
4253   echo "$as_me:4253: \$? = $ac_status" >&5
4254   (exit $ac_status); } &&
4255          { ac_try='test -s conftest$ac_exeext'
4256   { (eval echo "$as_me:4256: \"$ac_try\"") >&5
4257   (eval $ac_try) 2>&5
4258   ac_status=$?
4259   echo "$as_me:4259: \$? = $ac_status" >&5
4260   (exit $ac_status); }; }; then
4261   if test "$cross_compiling" = yes; then
4262   { { echo "$as_me:4262: error: cannot run test program while cross compiling" >&5
4263 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
4264    { (exit 1); exit 1; }; }
4265 else
4266   cat >conftest.$ac_ext <<_ACEOF
4267 #line 4267 "configure"
4268 #include "confdefs.h"
4269 #include <${cf_cv_ncurses_header:-curses.h}>
4270                                 int main(void)
4271                                 { char *xx = curses_version(); return (xx == 0); }
4272 _ACEOF
4273 rm -f conftest$ac_exeext
4274 if { (eval echo "$as_me:4274: \"$ac_link\"") >&5
4275   (eval $ac_link) 2>&5
4276   ac_status=$?
4277   echo "$as_me:4277: \$? = $ac_status" >&5
4278   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4279   { (eval echo "$as_me:4279: \"$ac_try\"") >&5
4280   (eval $ac_try) 2>&5
4281   ac_status=$?
4282   echo "$as_me:4282: \$? = $ac_status" >&5
4283   (exit $ac_status); }; }; then
4284   cf_have_ncuconfig=yes
4285 else
4286   echo "$as_me: program exited with status $ac_status" >&5
4287 echo "$as_me: failed program was:" >&5
4288 cat conftest.$ac_ext >&5
4289 cf_have_ncuconfig=no
4290 fi
4291 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4292 fi
4293 else
4294   echo "$as_me: failed program was:" >&5
4295 cat conftest.$ac_ext >&5
4296 cf_have_ncuconfig=no
4297 fi
4298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4299
4300                 echo "$as_me:4300: result: $cf_have_ncuconfig" >&5
4301 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4302                 if test "$cf_have_ncuconfig" != "yes"
4303                 then
4304                         CPPFLAGS="$cf_save_CPPFLAGS"
4305                         LIBS="$cf_save_LIBS"
4306                 else
4307
4308 cat >>confdefs.h <<\EOF
4309 #define NCURSES 1
4310 EOF
4311
4312                 fi
4313
4314         else
4315                 echo "$as_me:4315: result: no" >&5
4316 echo "${ECHO_T}no" >&6
4317         fi
4318 fi
4319
4320 if test "x$cf_have_ncuconfig" = "xno"; then
4321         echo "Looking for ${cf_ncuconfig_root}-config"
4322
4323 if test -n "$ac_tool_prefix"; then
4324   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4325   do
4326     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4327 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4328 echo "$as_me:4328: checking for $ac_word" >&5
4329 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4330 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4331   echo $ECHO_N "(cached) $ECHO_C" >&6
4332 else
4333   if test -n "$NCURSES_CONFIG"; then
4334   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4335 else
4336   ac_save_IFS=$IFS; IFS=$ac_path_separator
4337 ac_dummy="$PATH"
4338 for ac_dir in $ac_dummy; do
4339   IFS=$ac_save_IFS
4340   test -z "$ac_dir" && ac_dir=.
4341   $as_executable_p "$ac_dir/$ac_word" || continue
4342 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4343 echo "$as_me:4343: found $ac_dir/$ac_word" >&5
4344 break
4345 done
4346
4347 fi
4348 fi
4349 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4350 if test -n "$NCURSES_CONFIG"; then
4351   echo "$as_me:4351: result: $NCURSES_CONFIG" >&5
4352 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4353 else
4354   echo "$as_me:4354: result: no" >&5
4355 echo "${ECHO_T}no" >&6
4356 fi
4357
4358     test -n "$NCURSES_CONFIG" && break
4359   done
4360 fi
4361 if test -z "$NCURSES_CONFIG"; then
4362   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4363   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4364 do
4365   # Extract the first word of "$ac_prog", so it can be a program name with args.
4366 set dummy $ac_prog; ac_word=$2
4367 echo "$as_me:4367: checking for $ac_word" >&5
4368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4369 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4370   echo $ECHO_N "(cached) $ECHO_C" >&6
4371 else
4372   if test -n "$ac_ct_NCURSES_CONFIG"; then
4373   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4374 else
4375   ac_save_IFS=$IFS; IFS=$ac_path_separator
4376 ac_dummy="$PATH"
4377 for ac_dir in $ac_dummy; do
4378   IFS=$ac_save_IFS
4379   test -z "$ac_dir" && ac_dir=.
4380   $as_executable_p "$ac_dir/$ac_word" || continue
4381 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4382 echo "$as_me:4382: found $ac_dir/$ac_word" >&5
4383 break
4384 done
4385
4386 fi
4387 fi
4388 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4389 if test -n "$ac_ct_NCURSES_CONFIG"; then
4390   echo "$as_me:4390: result: $ac_ct_NCURSES_CONFIG" >&5
4391 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4392 else
4393   echo "$as_me:4393: result: no" >&5
4394 echo "${ECHO_T}no" >&6
4395 fi
4396
4397   test -n "$ac_ct_NCURSES_CONFIG" && break
4398 done
4399 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4400
4401   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4402 fi
4403
4404         if test "$NCURSES_CONFIG" != none ; then
4405
4406                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4407
4408 cf_add_libs="`$NCURSES_CONFIG --libs`"
4409 # Filter out duplicates - this happens with badly-designed ".pc" files...
4410 for cf_add_1lib in $LIBS
4411 do
4412         for cf_add_2lib in $cf_add_libs
4413         do
4414                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4415                 then
4416                         cf_add_1lib=
4417                         break
4418                 fi
4419         done
4420         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4421 done
4422 LIBS="$cf_add_libs"
4423
4424                 # even with config script, some packages use no-override for curses.h
4425
4426 echo "$as_me:4426: checking if we have identified curses headers" >&5
4427 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4428 if test "${cf_cv_ncurses_header+set}" = set; then
4429   echo $ECHO_N "(cached) $ECHO_C" >&6
4430 else
4431
4432 cf_cv_ncurses_header=none
4433 for cf_header in \
4434         ncurses.h ncursesw/ncurses.h \
4435         curses.h ncursesw/curses.h
4436 do
4437 cat >conftest.$ac_ext <<_ACEOF
4438 #line 4438 "configure"
4439 #include "confdefs.h"
4440 #include <${cf_header}>
4441 int
4442 main ()
4443 {
4444 initscr(); tgoto("?", 0,0)
4445   ;
4446   return 0;
4447 }
4448 _ACEOF
4449 rm -f conftest.$ac_objext
4450 if { (eval echo "$as_me:4450: \"$ac_compile\"") >&5
4451   (eval $ac_compile) 2>&5
4452   ac_status=$?
4453   echo "$as_me:4453: \$? = $ac_status" >&5
4454   (exit $ac_status); } &&
4455          { ac_try='test -s conftest.$ac_objext'
4456   { (eval echo "$as_me:4456: \"$ac_try\"") >&5
4457   (eval $ac_try) 2>&5
4458   ac_status=$?
4459   echo "$as_me:4459: \$? = $ac_status" >&5
4460   (exit $ac_status); }; }; then
4461   cf_cv_ncurses_header=$cf_header; break
4462 else
4463   echo "$as_me: failed program was:" >&5
4464 cat conftest.$ac_ext >&5
4465 fi
4466 rm -f conftest.$ac_objext conftest.$ac_ext
4467 done
4468
4469 fi
4470 echo "$as_me:4470: result: $cf_cv_ncurses_header" >&5
4471 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4472
4473 if test "$cf_cv_ncurses_header" = none ; then
4474         { { echo "$as_me:4474: error: No curses header-files found" >&5
4475 echo "$as_me: error: No curses header-files found" >&2;}
4476    { (exit 1); exit 1; }; }
4477 fi
4478
4479 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4480
4481 for ac_header in $cf_cv_ncurses_header
4482 do
4483 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4484 echo "$as_me:4484: checking for $ac_header" >&5
4485 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4486 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4487   echo $ECHO_N "(cached) $ECHO_C" >&6
4488 else
4489   cat >conftest.$ac_ext <<_ACEOF
4490 #line 4490 "configure"
4491 #include "confdefs.h"
4492 #include <$ac_header>
4493 _ACEOF
4494 if { (eval echo "$as_me:4494: \"$ac_cpp conftest.$ac_ext\"") >&5
4495   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4496   ac_status=$?
4497   egrep -v '^ *\+' conftest.er1 >conftest.err
4498   rm -f conftest.er1
4499   cat conftest.err >&5
4500   echo "$as_me:4500: \$? = $ac_status" >&5
4501   (exit $ac_status); } >/dev/null; then
4502   if test -s conftest.err; then
4503     ac_cpp_err=$ac_c_preproc_warn_flag
4504   else
4505     ac_cpp_err=
4506   fi
4507 else
4508   ac_cpp_err=yes
4509 fi
4510 if test -z "$ac_cpp_err"; then
4511   eval "$as_ac_Header=yes"
4512 else
4513   echo "$as_me: failed program was:" >&5
4514   cat conftest.$ac_ext >&5
4515   eval "$as_ac_Header=no"
4516 fi
4517 rm -f conftest.err conftest.$ac_ext
4518 fi
4519 echo "$as_me:4519: result: `eval echo '${'$as_ac_Header'}'`" >&5
4520 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4521 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4522   cat >>confdefs.h <<EOF
4523 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4524 EOF
4525
4526 fi
4527 done
4528
4529 cat >>confdefs.h <<\EOF
4530 #define NCURSES 1
4531 EOF
4532
4533 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4534
4535                 cat >>confdefs.h <<EOF
4536 #define $cf_nculib_ROOT 1
4537 EOF
4538
4539                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4540
4541         else
4542
4543 cf_ncuhdr_root=ncursesw
4544
4545 test -n "$cf_cv_curses_dir" && \
4546 test "$cf_cv_curses_dir" != "no" && { \
4547
4548 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4549   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4550   do
4551         while test $cf_add_incdir != /usr/include
4552         do
4553           if test -d $cf_add_incdir
4554           then
4555                 cf_have_incdir=no
4556                 if test -n "$CFLAGS$CPPFLAGS" ; then
4557                   # a loop is needed to ensure we can add subdirs of existing dirs
4558                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4559                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4560                           cf_have_incdir=yes; break
4561                         fi
4562                   done
4563                 fi
4564
4565                 if test "$cf_have_incdir" = no ; then
4566                   if test "$cf_add_incdir" = /usr/local/include ; then
4567                         if test "$GCC" = yes
4568                         then
4569                           cf_save_CPPFLAGS=$CPPFLAGS
4570                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4571                           cat >conftest.$ac_ext <<_ACEOF
4572 #line 4572 "configure"
4573 #include "confdefs.h"
4574 #include <stdio.h>
4575 int
4576 main ()
4577 {
4578 printf("Hello")
4579   ;
4580   return 0;
4581 }
4582 _ACEOF
4583 rm -f conftest.$ac_objext
4584 if { (eval echo "$as_me:4584: \"$ac_compile\"") >&5
4585   (eval $ac_compile) 2>&5
4586   ac_status=$?
4587   echo "$as_me:4587: \$? = $ac_status" >&5
4588   (exit $ac_status); } &&
4589          { ac_try='test -s conftest.$ac_objext'
4590   { (eval echo "$as_me:4590: \"$ac_try\"") >&5
4591   (eval $ac_try) 2>&5
4592   ac_status=$?
4593   echo "$as_me:4593: \$? = $ac_status" >&5
4594   (exit $ac_status); }; }; then
4595   :
4596 else
4597   echo "$as_me: failed program was:" >&5
4598 cat conftest.$ac_ext >&5
4599 cf_have_incdir=yes
4600 fi
4601 rm -f conftest.$ac_objext conftest.$ac_ext
4602                           CPPFLAGS=$cf_save_CPPFLAGS
4603                         fi
4604                   fi
4605                 fi
4606
4607                 if test "$cf_have_incdir" = no ; then
4608                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4609
4610 echo "${as_me:-configure}:4610: testing adding $cf_add_incdir to include-path ..." 1>&5
4611
4612                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4613
4614                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4615                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4616                   cf_add_incdir="$cf_top_incdir"
4617                 else
4618                   break
4619                 fi
4620           fi
4621         done
4622   done
4623 fi
4624
4625 }
4626
4627 echo "$as_me:4627: checking for $cf_ncuhdr_root header in include-path" >&5
4628 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4629 if test "${cf_cv_ncurses_h+set}" = set; then
4630   echo $ECHO_N "(cached) $ECHO_C" >&6
4631 else
4632
4633         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4634         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4635         for cf_header in $cf_header_list
4636         do
4637
4638         cat >conftest.$ac_ext <<_ACEOF
4639 #line 4639 "configure"
4640 #include "confdefs.h"
4641
4642 #define _XOPEN_SOURCE_EXTENDED
4643 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4644 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4645
4646 #include <$cf_header>
4647 int
4648 main ()
4649 {
4650
4651 #ifdef NCURSES_VERSION
4652
4653 #ifndef WACS_BSSB
4654         make an error
4655 #endif
4656
4657 printf("%s\n", NCURSES_VERSION);
4658 #else
4659 #ifdef __NCURSES_H
4660 printf("old\n");
4661 #else
4662         make an error
4663 #endif
4664 #endif
4665
4666   ;
4667   return 0;
4668 }
4669 _ACEOF
4670 rm -f conftest.$ac_objext
4671 if { (eval echo "$as_me:4671: \"$ac_compile\"") >&5
4672   (eval $ac_compile) 2>&5
4673   ac_status=$?
4674   echo "$as_me:4674: \$? = $ac_status" >&5
4675   (exit $ac_status); } &&
4676          { ac_try='test -s conftest.$ac_objext'
4677   { (eval echo "$as_me:4677: \"$ac_try\"") >&5
4678   (eval $ac_try) 2>&5
4679   ac_status=$?
4680   echo "$as_me:4680: \$? = $ac_status" >&5
4681   (exit $ac_status); }; }; then
4682   cf_cv_ncurses_h=$cf_header
4683
4684 else
4685   echo "$as_me: failed program was:" >&5
4686 cat conftest.$ac_ext >&5
4687 cf_cv_ncurses_h=no
4688 fi
4689 rm -f conftest.$ac_objext conftest.$ac_ext
4690
4691                 test "$cf_cv_ncurses_h" != no && break
4692         done
4693
4694 fi
4695 echo "$as_me:4695: result: $cf_cv_ncurses_h" >&5
4696 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4697
4698 if test "$cf_cv_ncurses_h" != no ; then
4699         cf_cv_ncurses_header=$cf_cv_ncurses_h
4700 else
4701
4702 echo "$as_me:4702: checking for $cf_ncuhdr_root include-path" >&5
4703 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4704 if test "${cf_cv_ncurses_h2+set}" = set; then
4705   echo $ECHO_N "(cached) $ECHO_C" >&6
4706 else
4707
4708         test -n "$verbose" && echo
4709
4710 cf_search=
4711
4712 # collect the current set of include-directories from compiler flags
4713 cf_header_path_list=""
4714 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4715         for cf_header_path in $CPPFLAGS $CFLAGS
4716         do
4717                 case $cf_header_path in
4718                 (-I*)
4719                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4720
4721 test "x$cf_header_path" != "xNONE" && \
4722 test -d "$cf_header_path" && \
4723  {
4724         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4725         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4726         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4727         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4728         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4729         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"
4730 }
4731
4732                         cf_header_path_list="$cf_header_path_list $cf_search"
4733                         ;;
4734                 esac
4735         done
4736 fi
4737
4738 # add the variations for the package we are looking for
4739
4740 cf_search=
4741
4742 test "x$prefix" != "xNONE" && \
4743 test -d "$prefix" && \
4744  {
4745         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4746         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4747         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4748         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4749         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4750         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4751 }
4752
4753 for cf_subdir_prefix in \
4754         /usr \
4755         /usr/local \
4756         /usr/pkg \
4757         /opt \
4758         /opt/local \
4759         $HOME
4760 do
4761
4762 test "x$cf_subdir_prefix" != "x$prefix" && \
4763 test -d "$cf_subdir_prefix" && \
4764 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4765         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4766         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4767         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4768         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4769         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4770         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"
4771 }
4772
4773 done
4774
4775 test "$includedir" != NONE && \
4776 test "$includedir" != "/usr/include" && \
4777 test -d "$includedir" && {
4778         test -d $includedir &&    cf_search="$cf_search $includedir"
4779         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4780 }
4781
4782 test "$oldincludedir" != NONE && \
4783 test "$oldincludedir" != "/usr/include" && \
4784 test -d "$oldincludedir" && {
4785         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4786         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4787 }
4788
4789 cf_search="$cf_search $cf_header_path_list"
4790
4791         test -n "$verbose" && echo search path $cf_search
4792         cf_save2_CPPFLAGS="$CPPFLAGS"
4793         for cf_incdir in $cf_search
4794         do
4795
4796 if test -n "$cf_incdir" ; then
4797   for cf_add_incdir in $cf_incdir
4798   do
4799         while test $cf_add_incdir != /usr/include
4800         do
4801           if test -d $cf_add_incdir
4802           then
4803                 cf_have_incdir=no
4804                 if test -n "$CFLAGS$CPPFLAGS" ; then
4805                   # a loop is needed to ensure we can add subdirs of existing dirs
4806                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4807                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4808                           cf_have_incdir=yes; break
4809                         fi
4810                   done
4811                 fi
4812
4813                 if test "$cf_have_incdir" = no ; then
4814                   if test "$cf_add_incdir" = /usr/local/include ; then
4815                         if test "$GCC" = yes
4816                         then
4817                           cf_save_CPPFLAGS=$CPPFLAGS
4818                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4819                           cat >conftest.$ac_ext <<_ACEOF
4820 #line 4820 "configure"
4821 #include "confdefs.h"
4822 #include <stdio.h>
4823 int
4824 main ()
4825 {
4826 printf("Hello")
4827   ;
4828   return 0;
4829 }
4830 _ACEOF
4831 rm -f conftest.$ac_objext
4832 if { (eval echo "$as_me:4832: \"$ac_compile\"") >&5
4833   (eval $ac_compile) 2>&5
4834   ac_status=$?
4835   echo "$as_me:4835: \$? = $ac_status" >&5
4836   (exit $ac_status); } &&
4837          { ac_try='test -s conftest.$ac_objext'
4838   { (eval echo "$as_me:4838: \"$ac_try\"") >&5
4839   (eval $ac_try) 2>&5
4840   ac_status=$?
4841   echo "$as_me:4841: \$? = $ac_status" >&5
4842   (exit $ac_status); }; }; then
4843   :
4844 else
4845   echo "$as_me: failed program was:" >&5
4846 cat conftest.$ac_ext >&5
4847 cf_have_incdir=yes
4848 fi
4849 rm -f conftest.$ac_objext conftest.$ac_ext
4850                           CPPFLAGS=$cf_save_CPPFLAGS
4851                         fi
4852                   fi
4853                 fi
4854
4855                 if test "$cf_have_incdir" = no ; then
4856                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4857
4858 echo "${as_me:-configure}:4858: testing adding $cf_add_incdir to include-path ..." 1>&5
4859
4860                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4861
4862                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4863                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4864                   cf_add_incdir="$cf_top_incdir"
4865                 else
4866                   break
4867                 fi
4868           fi
4869         done
4870   done
4871 fi
4872
4873                 for cf_header in \
4874                         ncurses.h \
4875                         curses.h
4876                 do
4877
4878         cat >conftest.$ac_ext <<_ACEOF
4879 #line 4879 "configure"
4880 #include "confdefs.h"
4881
4882 #include <$cf_header>
4883 int
4884 main ()
4885 {
4886
4887 #ifdef NCURSES_VERSION
4888
4889 printf("%s\n", NCURSES_VERSION);
4890 #else
4891 #ifdef __NCURSES_H
4892 printf("old\n");
4893 #else
4894         make an error
4895 #endif
4896 #endif
4897
4898   ;
4899   return 0;
4900 }
4901 _ACEOF
4902 rm -f conftest.$ac_objext
4903 if { (eval echo "$as_me:4903: \"$ac_compile\"") >&5
4904   (eval $ac_compile) 2>&5
4905   ac_status=$?
4906   echo "$as_me:4906: \$? = $ac_status" >&5
4907   (exit $ac_status); } &&
4908          { ac_try='test -s conftest.$ac_objext'
4909   { (eval echo "$as_me:4909: \"$ac_try\"") >&5
4910   (eval $ac_try) 2>&5
4911   ac_status=$?
4912   echo "$as_me:4912: \$? = $ac_status" >&5
4913   (exit $ac_status); }; }; then
4914   cf_cv_ncurses_h2=$cf_header
4915
4916 else
4917   echo "$as_me: failed program was:" >&5
4918 cat conftest.$ac_ext >&5
4919 cf_cv_ncurses_h2=no
4920 fi
4921 rm -f conftest.$ac_objext conftest.$ac_ext
4922
4923                         if test "$cf_cv_ncurses_h2" != no ; then
4924                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4925                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4926                                 break
4927                         fi
4928                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4929                 done
4930                 CPPFLAGS="$cf_save2_CPPFLAGS"
4931                 test "$cf_cv_ncurses_h2" != no && break
4932         done
4933         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4933: error: not found" >&5
4934 echo "$as_me: error: not found" >&2;}
4935    { (exit 1); exit 1; }; }
4936
4937 fi
4938 echo "$as_me:4938: result: $cf_cv_ncurses_h2" >&5
4939 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4940
4941         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4942         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4943         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4944                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4945         fi
4946
4947 if test -n "$cf_1st_incdir" ; then
4948   for cf_add_incdir in $cf_1st_incdir
4949   do
4950         while test $cf_add_incdir != /usr/include
4951         do
4952           if test -d $cf_add_incdir
4953           then
4954                 cf_have_incdir=no
4955                 if test -n "$CFLAGS$CPPFLAGS" ; then
4956                   # a loop is needed to ensure we can add subdirs of existing dirs
4957                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4958                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4959                           cf_have_incdir=yes; break
4960                         fi
4961                   done
4962                 fi
4963
4964                 if test "$cf_have_incdir" = no ; then
4965                   if test "$cf_add_incdir" = /usr/local/include ; then
4966                         if test "$GCC" = yes
4967                         then
4968                           cf_save_CPPFLAGS=$CPPFLAGS
4969                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4970                           cat >conftest.$ac_ext <<_ACEOF
4971 #line 4971 "configure"
4972 #include "confdefs.h"
4973 #include <stdio.h>
4974 int
4975 main ()
4976 {
4977 printf("Hello")
4978   ;
4979   return 0;
4980 }
4981 _ACEOF
4982 rm -f conftest.$ac_objext
4983 if { (eval echo "$as_me:4983: \"$ac_compile\"") >&5
4984   (eval $ac_compile) 2>&5
4985   ac_status=$?
4986   echo "$as_me:4986: \$? = $ac_status" >&5
4987   (exit $ac_status); } &&
4988          { ac_try='test -s conftest.$ac_objext'
4989   { (eval echo "$as_me:4989: \"$ac_try\"") >&5
4990   (eval $ac_try) 2>&5
4991   ac_status=$?
4992   echo "$as_me:4992: \$? = $ac_status" >&5
4993   (exit $ac_status); }; }; then
4994   :
4995 else
4996   echo "$as_me: failed program was:" >&5
4997 cat conftest.$ac_ext >&5
4998 cf_have_incdir=yes
4999 fi
5000 rm -f conftest.$ac_objext conftest.$ac_ext
5001                           CPPFLAGS=$cf_save_CPPFLAGS
5002                         fi
5003                   fi
5004                 fi
5005
5006                 if test "$cf_have_incdir" = no ; then
5007                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5008
5009 echo "${as_me:-configure}:5009: testing adding $cf_add_incdir to include-path ..." 1>&5
5010
5011                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5012
5013                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5014                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5015                   cf_add_incdir="$cf_top_incdir"
5016                 else
5017                   break
5018                 fi
5019           fi
5020         done
5021   done
5022 fi
5023
5024 fi
5025
5026 # Set definitions to allow ifdef'ing for ncurses.h
5027
5028 case $cf_cv_ncurses_header in
5029 (*ncurses.h)
5030
5031 cat >>confdefs.h <<\EOF
5032 #define HAVE_NCURSES_H 1
5033 EOF
5034
5035         ;;
5036 esac
5037
5038 case $cf_cv_ncurses_header in
5039 (ncurses/curses.h|ncurses/ncurses.h)
5040
5041 cat >>confdefs.h <<\EOF
5042 #define HAVE_NCURSES_NCURSES_H 1
5043 EOF
5044
5045         ;;
5046 (ncursesw/curses.h|ncursesw/ncurses.h)
5047
5048 cat >>confdefs.h <<\EOF
5049 #define HAVE_NCURSESW_NCURSES_H 1
5050 EOF
5051
5052         ;;
5053 esac
5054
5055 echo "$as_me:5055: checking for terminfo header" >&5
5056 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5057 if test "${cf_cv_term_header+set}" = set; then
5058   echo $ECHO_N "(cached) $ECHO_C" >&6
5059 else
5060
5061 case ${cf_cv_ncurses_header} in
5062 (*/ncurses.h|*/ncursesw.h)
5063         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5064         ;;
5065 (*)
5066         cf_term_header=term.h
5067         ;;
5068 esac
5069
5070 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5071 do
5072 cat >conftest.$ac_ext <<_ACEOF
5073 #line 5073 "configure"
5074 #include "confdefs.h"
5075 #include <stdio.h>
5076 #include <${cf_cv_ncurses_header:-curses.h}>
5077 #include <$cf_test>
5078
5079 int
5080 main ()
5081 {
5082 int x = auto_left_margin
5083   ;
5084   return 0;
5085 }
5086 _ACEOF
5087 rm -f conftest.$ac_objext
5088 if { (eval echo "$as_me:5088: \"$ac_compile\"") >&5
5089   (eval $ac_compile) 2>&5
5090   ac_status=$?
5091   echo "$as_me:5091: \$? = $ac_status" >&5
5092   (exit $ac_status); } &&
5093          { ac_try='test -s conftest.$ac_objext'
5094   { (eval echo "$as_me:5094: \"$ac_try\"") >&5
5095   (eval $ac_try) 2>&5
5096   ac_status=$?
5097   echo "$as_me:5097: \$? = $ac_status" >&5
5098   (exit $ac_status); }; }; then
5099
5100         cf_cv_term_header="$cf_test"
5101 else
5102   echo "$as_me: failed program was:" >&5
5103 cat conftest.$ac_ext >&5
5104
5105         cf_cv_term_header=unknown
5106
5107 fi
5108 rm -f conftest.$ac_objext conftest.$ac_ext
5109         test "$cf_cv_term_header" != unknown && break
5110 done
5111
5112 fi
5113 echo "$as_me:5113: result: $cf_cv_term_header" >&5
5114 echo "${ECHO_T}$cf_cv_term_header" >&6
5115
5116 # Set definitions to allow ifdef'ing to accommodate subdirectories
5117
5118 case $cf_cv_term_header in
5119 (*term.h)
5120
5121 cat >>confdefs.h <<\EOF
5122 #define HAVE_TERM_H 1
5123 EOF
5124
5125         ;;
5126 esac
5127
5128 case $cf_cv_term_header in
5129 (ncurses/term.h)
5130
5131 cat >>confdefs.h <<\EOF
5132 #define HAVE_NCURSES_TERM_H 1
5133 EOF
5134
5135         ;;
5136 (ncursesw/term.h)
5137
5138 cat >>confdefs.h <<\EOF
5139 #define HAVE_NCURSESW_TERM_H 1
5140 EOF
5141
5142         ;;
5143 esac
5144
5145 # some applications need this, but should check for NCURSES_VERSION
5146
5147 cat >>confdefs.h <<\EOF
5148 #define NCURSES 1
5149 EOF
5150
5151 echo "$as_me:5151: checking for ncurses version" >&5
5152 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5153 if test "${cf_cv_ncurses_version+set}" = set; then
5154   echo $ECHO_N "(cached) $ECHO_C" >&6
5155 else
5156
5157         cf_cv_ncurses_version=no
5158         cf_tempfile=out$$
5159         rm -f $cf_tempfile
5160         if test "$cross_compiling" = yes; then
5161
5162         # This will not work if the preprocessor splits the line after the
5163         # Autoconf token.  The 'unproto' program does that.
5164         cat > conftest.$ac_ext <<EOF
5165 #include <${cf_cv_ncurses_header:-curses.h}>
5166 #undef Autoconf
5167 #ifdef NCURSES_VERSION
5168 Autoconf NCURSES_VERSION
5169 #else
5170 #ifdef __NCURSES_H
5171 Autoconf "old"
5172 #endif
5173 ;
5174 #endif
5175 EOF
5176         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5177         { (eval echo "$as_me:5177: \"$cf_try\"") >&5
5178   (eval $cf_try) 2>&5
5179   ac_status=$?
5180   echo "$as_me:5180: \$? = $ac_status" >&5
5181   (exit $ac_status); }
5182         if test -f conftest.out ; then
5183                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5184                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5185                 rm -f conftest.out
5186         fi
5187
5188 else
5189   cat >conftest.$ac_ext <<_ACEOF
5190 #line 5190 "configure"
5191 #include "confdefs.h"
5192
5193 #include <${cf_cv_ncurses_header:-curses.h}>
5194 #include <stdio.h>
5195 int main()
5196 {
5197         FILE *fp = fopen("$cf_tempfile", "w");
5198 #ifdef NCURSES_VERSION
5199 # ifdef NCURSES_VERSION_PATCH
5200         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5201 # else
5202         fprintf(fp, "%s\n", NCURSES_VERSION);
5203 # endif
5204 #else
5205 # ifdef __NCURSES_H
5206         fprintf(fp, "old\n");
5207 # else
5208         make an error
5209 # endif
5210 #endif
5211         ${cf_cv_main_return:-return}(0);
5212 }
5213 _ACEOF
5214 rm -f conftest$ac_exeext
5215 if { (eval echo "$as_me:5215: \"$ac_link\"") >&5
5216   (eval $ac_link) 2>&5
5217   ac_status=$?
5218   echo "$as_me:5218: \$? = $ac_status" >&5
5219   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5220   { (eval echo "$as_me:5220: \"$ac_try\"") >&5
5221   (eval $ac_try) 2>&5
5222   ac_status=$?
5223   echo "$as_me:5223: \$? = $ac_status" >&5
5224   (exit $ac_status); }; }; then
5225
5226         cf_cv_ncurses_version=`cat $cf_tempfile`
5227 else
5228   echo "$as_me: program exited with status $ac_status" >&5
5229 echo "$as_me: failed program was:" >&5
5230 cat conftest.$ac_ext >&5
5231 fi
5232 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5233 fi
5234         rm -f $cf_tempfile
5235
5236 fi
5237 echo "$as_me:5237: result: $cf_cv_ncurses_version" >&5
5238 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5239 test "$cf_cv_ncurses_version" = no ||
5240 cat >>confdefs.h <<\EOF
5241 #define NCURSES 1
5242 EOF
5243
5244 cf_nculib_root=ncursesw
5245         # This works, except for the special case where we find gpm, but
5246         # ncurses is in a nonstandard location via $LIBS, and we really want
5247         # to link gpm.
5248 cf_ncurses_LIBS=""
5249 cf_ncurses_SAVE="$LIBS"
5250 echo "$as_me:5250: checking for Gpm_Open in -lgpm" >&5
5251 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5252 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5253   echo $ECHO_N "(cached) $ECHO_C" >&6
5254 else
5255   ac_check_lib_save_LIBS=$LIBS
5256 LIBS="-lgpm  $LIBS"
5257 cat >conftest.$ac_ext <<_ACEOF
5258 #line 5258 "configure"
5259 #include "confdefs.h"
5260
5261 /* Override any gcc2 internal prototype to avoid an error.  */
5262 #ifdef __cplusplus
5263 extern "C"
5264 #endif
5265 /* We use char because int might match the return type of a gcc2
5266    builtin and then its argument prototype would still apply.  */
5267 char Gpm_Open ();
5268 int
5269 main ()
5270 {
5271 Gpm_Open ();
5272   ;
5273   return 0;
5274 }
5275 _ACEOF
5276 rm -f conftest.$ac_objext conftest$ac_exeext
5277 if { (eval echo "$as_me:5277: \"$ac_link\"") >&5
5278   (eval $ac_link) 2>&5
5279   ac_status=$?
5280   echo "$as_me:5280: \$? = $ac_status" >&5
5281   (exit $ac_status); } &&
5282          { ac_try='test -s conftest$ac_exeext'
5283   { (eval echo "$as_me:5283: \"$ac_try\"") >&5
5284   (eval $ac_try) 2>&5
5285   ac_status=$?
5286   echo "$as_me:5286: \$? = $ac_status" >&5
5287   (exit $ac_status); }; }; then
5288   ac_cv_lib_gpm_Gpm_Open=yes
5289 else
5290   echo "$as_me: failed program was:" >&5
5291 cat conftest.$ac_ext >&5
5292 ac_cv_lib_gpm_Gpm_Open=no
5293 fi
5294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5295 LIBS=$ac_check_lib_save_LIBS
5296 fi
5297 echo "$as_me:5297: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5298 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5299 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5300   echo "$as_me:5300: checking for initscr in -lgpm" >&5
5301 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5302 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5303   echo $ECHO_N "(cached) $ECHO_C" >&6
5304 else
5305   ac_check_lib_save_LIBS=$LIBS
5306 LIBS="-lgpm  $LIBS"
5307 cat >conftest.$ac_ext <<_ACEOF
5308 #line 5308 "configure"
5309 #include "confdefs.h"
5310
5311 /* Override any gcc2 internal prototype to avoid an error.  */
5312 #ifdef __cplusplus
5313 extern "C"
5314 #endif
5315 /* We use char because int might match the return type of a gcc2
5316    builtin and then its argument prototype would still apply.  */
5317 char initscr ();
5318 int
5319 main ()
5320 {
5321 initscr ();
5322   ;
5323   return 0;
5324 }
5325 _ACEOF
5326 rm -f conftest.$ac_objext conftest$ac_exeext
5327 if { (eval echo "$as_me:5327: \"$ac_link\"") >&5
5328   (eval $ac_link) 2>&5
5329   ac_status=$?
5330   echo "$as_me:5330: \$? = $ac_status" >&5
5331   (exit $ac_status); } &&
5332          { ac_try='test -s conftest$ac_exeext'
5333   { (eval echo "$as_me:5333: \"$ac_try\"") >&5
5334   (eval $ac_try) 2>&5
5335   ac_status=$?
5336   echo "$as_me:5336: \$? = $ac_status" >&5
5337   (exit $ac_status); }; }; then
5338   ac_cv_lib_gpm_initscr=yes
5339 else
5340   echo "$as_me: failed program was:" >&5
5341 cat conftest.$ac_ext >&5
5342 ac_cv_lib_gpm_initscr=no
5343 fi
5344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5345 LIBS=$ac_check_lib_save_LIBS
5346 fi
5347 echo "$as_me:5347: result: $ac_cv_lib_gpm_initscr" >&5
5348 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5349 if test $ac_cv_lib_gpm_initscr = yes; then
5350   LIBS="$cf_ncurses_SAVE"
5351 else
5352   cf_ncurses_LIBS="-lgpm"
5353 fi
5354
5355 fi
5356
5357 case $host_os in
5358 (freebsd*)
5359         # This is only necessary if you are linking against an obsolete
5360         # version of ncurses (but it should do no harm, since it's static).
5361         if test "$cf_nculib_root" = ncurses ; then
5362                 echo "$as_me:5362: checking for tgoto in -lmytinfo" >&5
5363 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5364 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5365   echo $ECHO_N "(cached) $ECHO_C" >&6
5366 else
5367   ac_check_lib_save_LIBS=$LIBS
5368 LIBS="-lmytinfo  $LIBS"
5369 cat >conftest.$ac_ext <<_ACEOF
5370 #line 5370 "configure"
5371 #include "confdefs.h"
5372
5373 /* Override any gcc2 internal prototype to avoid an error.  */
5374 #ifdef __cplusplus
5375 extern "C"
5376 #endif
5377 /* We use char because int might match the return type of a gcc2
5378    builtin and then its argument prototype would still apply.  */
5379 char tgoto ();
5380 int
5381 main ()
5382 {
5383 tgoto ();
5384   ;
5385   return 0;
5386 }
5387 _ACEOF
5388 rm -f conftest.$ac_objext conftest$ac_exeext
5389 if { (eval echo "$as_me:5389: \"$ac_link\"") >&5
5390   (eval $ac_link) 2>&5
5391   ac_status=$?
5392   echo "$as_me:5392: \$? = $ac_status" >&5
5393   (exit $ac_status); } &&
5394          { ac_try='test -s conftest$ac_exeext'
5395   { (eval echo "$as_me:5395: \"$ac_try\"") >&5
5396   (eval $ac_try) 2>&5
5397   ac_status=$?
5398   echo "$as_me:5398: \$? = $ac_status" >&5
5399   (exit $ac_status); }; }; then
5400   ac_cv_lib_mytinfo_tgoto=yes
5401 else
5402   echo "$as_me: failed program was:" >&5
5403 cat conftest.$ac_ext >&5
5404 ac_cv_lib_mytinfo_tgoto=no
5405 fi
5406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5407 LIBS=$ac_check_lib_save_LIBS
5408 fi
5409 echo "$as_me:5409: result: $ac_cv_lib_mytinfo_tgoto" >&5
5410 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5411 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5412   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5413 fi
5414
5415         fi
5416         ;;
5417 esac
5418
5419 cf_add_libs="$cf_ncurses_LIBS"
5420 # Filter out duplicates - this happens with badly-designed ".pc" files...
5421 for cf_add_1lib in $LIBS
5422 do
5423         for cf_add_2lib in $cf_add_libs
5424         do
5425                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5426                 then
5427                         cf_add_1lib=
5428                         break
5429                 fi
5430         done
5431         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5432 done
5433 LIBS="$cf_add_libs"
5434
5435 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5436 then
5437
5438 cf_add_libs="-l$cf_nculib_root"
5439 # Filter out duplicates - this happens with badly-designed ".pc" files...
5440 for cf_add_1lib in $LIBS
5441 do
5442         for cf_add_2lib in $cf_add_libs
5443         do
5444                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5445                 then
5446                         cf_add_1lib=
5447                         break
5448                 fi
5449         done
5450         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5451 done
5452 LIBS="$cf_add_libs"
5453
5454 else
5455
5456         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5457         cf_libdir=""
5458         echo "$as_me:5458: checking for initscr" >&5
5459 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5460 if test "${ac_cv_func_initscr+set}" = set; then
5461   echo $ECHO_N "(cached) $ECHO_C" >&6
5462 else
5463   cat >conftest.$ac_ext <<_ACEOF
5464 #line 5464 "configure"
5465 #include "confdefs.h"
5466 /* System header to define __stub macros and hopefully few prototypes,
5467     which can conflict with char initscr (); below.  */
5468 #include <assert.h>
5469 /* Override any gcc2 internal prototype to avoid an error.  */
5470 #ifdef __cplusplus
5471 extern "C"
5472 #endif
5473 /* We use char because int might match the return type of a gcc2
5474    builtin and then its argument prototype would still apply.  */
5475 char initscr ();
5476 char (*f) ();
5477
5478 int
5479 main ()
5480 {
5481 /* The GNU C library defines this for functions which it implements
5482     to always fail with ENOSYS.  Some functions are actually named
5483     something starting with __ and the normal name is an alias.  */
5484 #if defined (__stub_initscr) || defined (__stub___initscr)
5485 choke me
5486 #else
5487 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5488 #endif
5489
5490   ;
5491   return 0;
5492 }
5493 _ACEOF
5494 rm -f conftest.$ac_objext conftest$ac_exeext
5495 if { (eval echo "$as_me:5495: \"$ac_link\"") >&5
5496   (eval $ac_link) 2>&5
5497   ac_status=$?
5498   echo "$as_me:5498: \$? = $ac_status" >&5
5499   (exit $ac_status); } &&
5500          { ac_try='test -s conftest$ac_exeext'
5501   { (eval echo "$as_me:5501: \"$ac_try\"") >&5
5502   (eval $ac_try) 2>&5
5503   ac_status=$?
5504   echo "$as_me:5504: \$? = $ac_status" >&5
5505   (exit $ac_status); }; }; then
5506   ac_cv_func_initscr=yes
5507 else
5508   echo "$as_me: failed program was:" >&5
5509 cat conftest.$ac_ext >&5
5510 ac_cv_func_initscr=no
5511 fi
5512 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5513 fi
5514 echo "$as_me:5514: result: $ac_cv_func_initscr" >&5
5515 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5516 if test $ac_cv_func_initscr = yes; then
5517   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5518 else
5519
5520                 cf_save_LIBS="$LIBS"
5521                 echo "$as_me:5521: checking for initscr in -l$cf_nculib_root" >&5
5522 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5523                 LIBS="-l$cf_nculib_root $LIBS"
5524                 cat >conftest.$ac_ext <<_ACEOF
5525 #line 5525 "configure"
5526 #include "confdefs.h"
5527 #include <${cf_cv_ncurses_header:-curses.h}>
5528 int
5529 main ()
5530 {
5531 initscr()
5532   ;
5533   return 0;
5534 }
5535 _ACEOF
5536 rm -f conftest.$ac_objext conftest$ac_exeext
5537 if { (eval echo "$as_me:5537: \"$ac_link\"") >&5
5538   (eval $ac_link) 2>&5
5539   ac_status=$?
5540   echo "$as_me:5540: \$? = $ac_status" >&5
5541   (exit $ac_status); } &&
5542          { ac_try='test -s conftest$ac_exeext'
5543   { (eval echo "$as_me:5543: \"$ac_try\"") >&5
5544   (eval $ac_try) 2>&5
5545   ac_status=$?
5546   echo "$as_me:5546: \$? = $ac_status" >&5
5547   (exit $ac_status); }; }; then
5548   echo "$as_me:5548: result: yes" >&5
5549 echo "${ECHO_T}yes" >&6
5550                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5551
5552 else
5553   echo "$as_me: failed program was:" >&5
5554 cat conftest.$ac_ext >&5
5555 echo "$as_me:5555: result: no" >&5
5556 echo "${ECHO_T}no" >&6
5557
5558 cf_search=
5559 cf_library_path_list=""
5560 if test -n "${LDFLAGS}${LIBS}" ; then
5561         for cf_library_path in $LDFLAGS $LIBS
5562         do
5563                 case $cf_library_path in
5564                 (-L*)
5565                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5566
5567 test "x$cf_library_path" != "xNONE" && \
5568 test -d "$cf_library_path" && \
5569  {
5570         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5571         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5572         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5573         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5574         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5575         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"
5576 }
5577
5578                         cf_library_path_list="$cf_library_path_list $cf_search"
5579                         ;;
5580                 esac
5581         done
5582 fi
5583
5584 cf_search=
5585
5586 test "x$prefix" != "xNONE" && \
5587 test -d "$prefix" && \
5588  {
5589         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5590         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5591         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5592         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5593         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5594         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5595 }
5596
5597 for cf_subdir_prefix in \
5598         /usr \
5599         /usr/local \
5600         /usr/pkg \
5601         /opt \
5602         /opt/local \
5603         $HOME
5604 do
5605
5606 test "x$cf_subdir_prefix" != "x$prefix" && \
5607 test -d "$cf_subdir_prefix" && \
5608 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5609         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5610         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5611         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5612         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5613         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5614         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"
5615 }
5616
5617 done
5618
5619 cf_search="$cf_library_path_list $cf_search"
5620
5621                         for cf_libdir in $cf_search
5622                         do
5623                                 echo "$as_me:5623: checking for -l$cf_nculib_root in $cf_libdir" >&5
5624 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5625                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5626                                 cat >conftest.$ac_ext <<_ACEOF
5627 #line 5627 "configure"
5628 #include "confdefs.h"
5629 #include <${cf_cv_ncurses_header:-curses.h}>
5630 int
5631 main ()
5632 {
5633 initscr()
5634   ;
5635   return 0;
5636 }
5637 _ACEOF
5638 rm -f conftest.$ac_objext conftest$ac_exeext
5639 if { (eval echo "$as_me:5639: \"$ac_link\"") >&5
5640   (eval $ac_link) 2>&5
5641   ac_status=$?
5642   echo "$as_me:5642: \$? = $ac_status" >&5
5643   (exit $ac_status); } &&
5644          { ac_try='test -s conftest$ac_exeext'
5645   { (eval echo "$as_me:5645: \"$ac_try\"") >&5
5646   (eval $ac_try) 2>&5
5647   ac_status=$?
5648   echo "$as_me:5648: \$? = $ac_status" >&5
5649   (exit $ac_status); }; }; then
5650   echo "$as_me:5650: result: yes" >&5
5651 echo "${ECHO_T}yes" >&6
5652                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5653                                          break
5654 else
5655   echo "$as_me: failed program was:" >&5
5656 cat conftest.$ac_ext >&5
5657 echo "$as_me:5657: result: no" >&5
5658 echo "${ECHO_T}no" >&6
5659                                          LIBS="$cf_save_LIBS"
5660 fi
5661 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5662                         done
5663
5664 fi
5665 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5666
5667 fi
5668
5669 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5670
5671 if test $cf_found_library = no ; then
5672         { { echo "$as_me:5672: error: Cannot link $cf_nculib_root library" >&5
5673 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5674    { (exit 1); exit 1; }; }
5675 fi
5676
5677 fi
5678
5679 if test -n "$cf_ncurses_LIBS" ; then
5680         echo "$as_me:5680: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5681 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5682         cf_ncurses_SAVE="$LIBS"
5683         for p in $cf_ncurses_LIBS ; do
5684                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5685                 if test "$q" != "$LIBS" ; then
5686                         LIBS="$q"
5687                 fi
5688         done
5689         cat >conftest.$ac_ext <<_ACEOF
5690 #line 5690 "configure"
5691 #include "confdefs.h"
5692 #include <${cf_cv_ncurses_header:-curses.h}>
5693 int
5694 main ()
5695 {
5696 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5697   ;
5698   return 0;
5699 }
5700 _ACEOF
5701 rm -f conftest.$ac_objext conftest$ac_exeext
5702 if { (eval echo "$as_me:5702: \"$ac_link\"") >&5
5703   (eval $ac_link) 2>&5
5704   ac_status=$?
5705   echo "$as_me:5705: \$? = $ac_status" >&5
5706   (exit $ac_status); } &&
5707          { ac_try='test -s conftest$ac_exeext'
5708   { (eval echo "$as_me:5708: \"$ac_try\"") >&5
5709   (eval $ac_try) 2>&5
5710   ac_status=$?
5711   echo "$as_me:5711: \$? = $ac_status" >&5
5712   (exit $ac_status); }; }; then
5713   echo "$as_me:5713: result: yes" >&5
5714 echo "${ECHO_T}yes" >&6
5715 else
5716   echo "$as_me: failed program was:" >&5
5717 cat conftest.$ac_ext >&5
5718 echo "$as_me:5718: result: no" >&5
5719 echo "${ECHO_T}no" >&6
5720                  LIBS="$cf_ncurses_SAVE"
5721 fi
5722 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5723 fi
5724
5725 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5726
5727 cat >>confdefs.h <<EOF
5728 #define $cf_nculib_ROOT 1
5729 EOF
5730
5731         fi
5732 fi
5733
5734 else
5735
5736 cf_ncuconfig_root=ncurses
5737 cf_have_ncuconfig=no
5738
5739 if test "x$PKG_CONFIG" != xnone; then
5740         echo "$as_me:5740: checking pkg-config for $cf_ncuconfig_root" >&5
5741 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5742         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5743                 echo "$as_me:5743: result: yes" >&5
5744 echo "${ECHO_T}yes" >&6
5745
5746                 echo "$as_me:5746: checking if the $cf_ncuconfig_root package files work" >&5
5747 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5748                 cf_have_ncuconfig=unknown
5749
5750                 cf_save_CPPFLAGS="$CPPFLAGS"
5751                 cf_save_LIBS="$LIBS"
5752
5753                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5754
5755 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5756 # Filter out duplicates - this happens with badly-designed ".pc" files...
5757 for cf_add_1lib in $LIBS
5758 do
5759         for cf_add_2lib in $cf_add_libs
5760         do
5761                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5762                 then
5763                         cf_add_1lib=
5764                         break
5765                 fi
5766         done
5767         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5768 done
5769 LIBS="$cf_add_libs"
5770
5771                 cat >conftest.$ac_ext <<_ACEOF
5772 #line 5772 "configure"
5773 #include "confdefs.h"
5774 #include <${cf_cv_ncurses_header:-curses.h}>
5775 int
5776 main ()
5777 {
5778 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5779   ;
5780   return 0;
5781 }
5782 _ACEOF
5783 rm -f conftest.$ac_objext conftest$ac_exeext
5784 if { (eval echo "$as_me:5784: \"$ac_link\"") >&5
5785   (eval $ac_link) 2>&5
5786   ac_status=$?
5787   echo "$as_me:5787: \$? = $ac_status" >&5
5788   (exit $ac_status); } &&
5789          { ac_try='test -s conftest$ac_exeext'
5790   { (eval echo "$as_me:5790: \"$ac_try\"") >&5
5791   (eval $ac_try) 2>&5
5792   ac_status=$?
5793   echo "$as_me:5793: \$? = $ac_status" >&5
5794   (exit $ac_status); }; }; then
5795   if test "$cross_compiling" = yes; then
5796   { { echo "$as_me:5796: error: cannot run test program while cross compiling" >&5
5797 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
5798    { (exit 1); exit 1; }; }
5799 else
5800   cat >conftest.$ac_ext <<_ACEOF
5801 #line 5801 "configure"
5802 #include "confdefs.h"
5803 #include <${cf_cv_ncurses_header:-curses.h}>
5804                                 int main(void)
5805                                 { char *xx = curses_version(); return (xx == 0); }
5806 _ACEOF
5807 rm -f conftest$ac_exeext
5808 if { (eval echo "$as_me:5808: \"$ac_link\"") >&5
5809   (eval $ac_link) 2>&5
5810   ac_status=$?
5811   echo "$as_me:5811: \$? = $ac_status" >&5
5812   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5813   { (eval echo "$as_me:5813: \"$ac_try\"") >&5
5814   (eval $ac_try) 2>&5
5815   ac_status=$?
5816   echo "$as_me:5816: \$? = $ac_status" >&5
5817   (exit $ac_status); }; }; then
5818   cf_have_ncuconfig=yes
5819 else
5820   echo "$as_me: program exited with status $ac_status" >&5
5821 echo "$as_me: failed program was:" >&5
5822 cat conftest.$ac_ext >&5
5823 cf_have_ncuconfig=no
5824 fi
5825 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5826 fi
5827 else
5828   echo "$as_me: failed program was:" >&5
5829 cat conftest.$ac_ext >&5
5830 cf_have_ncuconfig=no
5831 fi
5832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5833
5834                 echo "$as_me:5834: result: $cf_have_ncuconfig" >&5
5835 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5836                 if test "$cf_have_ncuconfig" != "yes"
5837                 then
5838                         CPPFLAGS="$cf_save_CPPFLAGS"
5839                         LIBS="$cf_save_LIBS"
5840                 else
5841
5842 cat >>confdefs.h <<\EOF
5843 #define NCURSES 1
5844 EOF
5845
5846                 fi
5847
5848         else
5849                 echo "$as_me:5849: result: no" >&5
5850 echo "${ECHO_T}no" >&6
5851         fi
5852 fi
5853
5854 if test "x$cf_have_ncuconfig" = "xno"; then
5855         echo "Looking for ${cf_ncuconfig_root}-config"
5856
5857 if test -n "$ac_tool_prefix"; then
5858   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5859   do
5860     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5861 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5862 echo "$as_me:5862: checking for $ac_word" >&5
5863 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5864 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5865   echo $ECHO_N "(cached) $ECHO_C" >&6
5866 else
5867   if test -n "$NCURSES_CONFIG"; then
5868   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5869 else
5870   ac_save_IFS=$IFS; IFS=$ac_path_separator
5871 ac_dummy="$PATH"
5872 for ac_dir in $ac_dummy; do
5873   IFS=$ac_save_IFS
5874   test -z "$ac_dir" && ac_dir=.
5875   $as_executable_p "$ac_dir/$ac_word" || continue
5876 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5877 echo "$as_me:5877: found $ac_dir/$ac_word" >&5
5878 break
5879 done
5880
5881 fi
5882 fi
5883 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5884 if test -n "$NCURSES_CONFIG"; then
5885   echo "$as_me:5885: result: $NCURSES_CONFIG" >&5
5886 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5887 else
5888   echo "$as_me:5888: result: no" >&5
5889 echo "${ECHO_T}no" >&6
5890 fi
5891
5892     test -n "$NCURSES_CONFIG" && break
5893   done
5894 fi
5895 if test -z "$NCURSES_CONFIG"; then
5896   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5897   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5898 do
5899   # Extract the first word of "$ac_prog", so it can be a program name with args.
5900 set dummy $ac_prog; ac_word=$2
5901 echo "$as_me:5901: checking for $ac_word" >&5
5902 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5903 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5904   echo $ECHO_N "(cached) $ECHO_C" >&6
5905 else
5906   if test -n "$ac_ct_NCURSES_CONFIG"; then
5907   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5908 else
5909   ac_save_IFS=$IFS; IFS=$ac_path_separator
5910 ac_dummy="$PATH"
5911 for ac_dir in $ac_dummy; do
5912   IFS=$ac_save_IFS
5913   test -z "$ac_dir" && ac_dir=.
5914   $as_executable_p "$ac_dir/$ac_word" || continue
5915 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5916 echo "$as_me:5916: found $ac_dir/$ac_word" >&5
5917 break
5918 done
5919
5920 fi
5921 fi
5922 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5923 if test -n "$ac_ct_NCURSES_CONFIG"; then
5924   echo "$as_me:5924: result: $ac_ct_NCURSES_CONFIG" >&5
5925 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5926 else
5927   echo "$as_me:5927: result: no" >&5
5928 echo "${ECHO_T}no" >&6
5929 fi
5930
5931   test -n "$ac_ct_NCURSES_CONFIG" && break
5932 done
5933 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5934
5935   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5936 fi
5937
5938         if test "$NCURSES_CONFIG" != none ; then
5939
5940                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5941
5942 cf_add_libs="`$NCURSES_CONFIG --libs`"
5943 # Filter out duplicates - this happens with badly-designed ".pc" files...
5944 for cf_add_1lib in $LIBS
5945 do
5946         for cf_add_2lib in $cf_add_libs
5947         do
5948                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5949                 then
5950                         cf_add_1lib=
5951                         break
5952                 fi
5953         done
5954         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5955 done
5956 LIBS="$cf_add_libs"
5957
5958                 # even with config script, some packages use no-override for curses.h
5959
5960 echo "$as_me:5960: checking if we have identified curses headers" >&5
5961 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5962 if test "${cf_cv_ncurses_header+set}" = set; then
5963   echo $ECHO_N "(cached) $ECHO_C" >&6
5964 else
5965
5966 cf_cv_ncurses_header=none
5967 for cf_header in \
5968         ncurses.h ncurses/ncurses.h \
5969         curses.h ncurses/curses.h
5970 do
5971 cat >conftest.$ac_ext <<_ACEOF
5972 #line 5972 "configure"
5973 #include "confdefs.h"
5974 #include <${cf_header}>
5975 int
5976 main ()
5977 {
5978 initscr(); tgoto("?", 0,0)
5979   ;
5980   return 0;
5981 }
5982 _ACEOF
5983 rm -f conftest.$ac_objext
5984 if { (eval echo "$as_me:5984: \"$ac_compile\"") >&5
5985   (eval $ac_compile) 2>&5
5986   ac_status=$?
5987   echo "$as_me:5987: \$? = $ac_status" >&5
5988   (exit $ac_status); } &&
5989          { ac_try='test -s conftest.$ac_objext'
5990   { (eval echo "$as_me:5990: \"$ac_try\"") >&5
5991   (eval $ac_try) 2>&5
5992   ac_status=$?
5993   echo "$as_me:5993: \$? = $ac_status" >&5
5994   (exit $ac_status); }; }; then
5995   cf_cv_ncurses_header=$cf_header; break
5996 else
5997   echo "$as_me: failed program was:" >&5
5998 cat conftest.$ac_ext >&5
5999 fi
6000 rm -f conftest.$ac_objext conftest.$ac_ext
6001 done
6002
6003 fi
6004 echo "$as_me:6004: result: $cf_cv_ncurses_header" >&5
6005 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6006
6007 if test "$cf_cv_ncurses_header" = none ; then
6008         { { echo "$as_me:6008: error: No curses header-files found" >&5
6009 echo "$as_me: error: No curses header-files found" >&2;}
6010    { (exit 1); exit 1; }; }
6011 fi
6012
6013 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6014
6015 for ac_header in $cf_cv_ncurses_header
6016 do
6017 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6018 echo "$as_me:6018: checking for $ac_header" >&5
6019 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6020 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6021   echo $ECHO_N "(cached) $ECHO_C" >&6
6022 else
6023   cat >conftest.$ac_ext <<_ACEOF
6024 #line 6024 "configure"
6025 #include "confdefs.h"
6026 #include <$ac_header>
6027 _ACEOF
6028 if { (eval echo "$as_me:6028: \"$ac_cpp conftest.$ac_ext\"") >&5
6029   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6030   ac_status=$?
6031   egrep -v '^ *\+' conftest.er1 >conftest.err
6032   rm -f conftest.er1
6033   cat conftest.err >&5
6034   echo "$as_me:6034: \$? = $ac_status" >&5
6035   (exit $ac_status); } >/dev/null; then
6036   if test -s conftest.err; then
6037     ac_cpp_err=$ac_c_preproc_warn_flag
6038   else
6039     ac_cpp_err=
6040   fi
6041 else
6042   ac_cpp_err=yes
6043 fi
6044 if test -z "$ac_cpp_err"; then
6045   eval "$as_ac_Header=yes"
6046 else
6047   echo "$as_me: failed program was:" >&5
6048   cat conftest.$ac_ext >&5
6049   eval "$as_ac_Header=no"
6050 fi
6051 rm -f conftest.err conftest.$ac_ext
6052 fi
6053 echo "$as_me:6053: result: `eval echo '${'$as_ac_Header'}'`" >&5
6054 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6055 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6056   cat >>confdefs.h <<EOF
6057 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6058 EOF
6059
6060 fi
6061 done
6062
6063 cat >>confdefs.h <<\EOF
6064 #define NCURSES 1
6065 EOF
6066
6067 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6068
6069                 cat >>confdefs.h <<EOF
6070 #define $cf_nculib_ROOT 1
6071 EOF
6072
6073                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6074
6075         else
6076
6077 cf_ncuhdr_root=ncurses
6078
6079 test -n "$cf_cv_curses_dir" && \
6080 test "$cf_cv_curses_dir" != "no" && { \
6081
6082 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6083   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6084   do
6085         while test $cf_add_incdir != /usr/include
6086         do
6087           if test -d $cf_add_incdir
6088           then
6089                 cf_have_incdir=no
6090                 if test -n "$CFLAGS$CPPFLAGS" ; then
6091                   # a loop is needed to ensure we can add subdirs of existing dirs
6092                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6093                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6094                           cf_have_incdir=yes; break
6095                         fi
6096                   done
6097                 fi
6098
6099                 if test "$cf_have_incdir" = no ; then
6100                   if test "$cf_add_incdir" = /usr/local/include ; then
6101                         if test "$GCC" = yes
6102                         then
6103                           cf_save_CPPFLAGS=$CPPFLAGS
6104                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6105                           cat >conftest.$ac_ext <<_ACEOF
6106 #line 6106 "configure"
6107 #include "confdefs.h"
6108 #include <stdio.h>
6109 int
6110 main ()
6111 {
6112 printf("Hello")
6113   ;
6114   return 0;
6115 }
6116 _ACEOF
6117 rm -f conftest.$ac_objext
6118 if { (eval echo "$as_me:6118: \"$ac_compile\"") >&5
6119   (eval $ac_compile) 2>&5
6120   ac_status=$?
6121   echo "$as_me:6121: \$? = $ac_status" >&5
6122   (exit $ac_status); } &&
6123          { ac_try='test -s conftest.$ac_objext'
6124   { (eval echo "$as_me:6124: \"$ac_try\"") >&5
6125   (eval $ac_try) 2>&5
6126   ac_status=$?
6127   echo "$as_me:6127: \$? = $ac_status" >&5
6128   (exit $ac_status); }; }; then
6129   :
6130 else
6131   echo "$as_me: failed program was:" >&5
6132 cat conftest.$ac_ext >&5
6133 cf_have_incdir=yes
6134 fi
6135 rm -f conftest.$ac_objext conftest.$ac_ext
6136                           CPPFLAGS=$cf_save_CPPFLAGS
6137                         fi
6138                   fi
6139                 fi
6140
6141                 if test "$cf_have_incdir" = no ; then
6142                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6143
6144 echo "${as_me:-configure}:6144: testing adding $cf_add_incdir to include-path ..." 1>&5
6145
6146                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6147
6148                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6149                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6150                   cf_add_incdir="$cf_top_incdir"
6151                 else
6152                   break
6153                 fi
6154           fi
6155         done
6156   done
6157 fi
6158
6159 }
6160
6161 echo "$as_me:6161: checking for $cf_ncuhdr_root header in include-path" >&5
6162 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6163 if test "${cf_cv_ncurses_h+set}" = set; then
6164   echo $ECHO_N "(cached) $ECHO_C" >&6
6165 else
6166
6167         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6168         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6169         for cf_header in $cf_header_list
6170         do
6171
6172         cat >conftest.$ac_ext <<_ACEOF
6173 #line 6173 "configure"
6174 #include "confdefs.h"
6175
6176 #include <$cf_header>
6177 int
6178 main ()
6179 {
6180
6181 #ifdef NCURSES_VERSION
6182
6183 printf("%s\n", NCURSES_VERSION);
6184 #else
6185 #ifdef __NCURSES_H
6186 printf("old\n");
6187 #else
6188         make an error
6189 #endif
6190 #endif
6191
6192   ;
6193   return 0;
6194 }
6195 _ACEOF
6196 rm -f conftest.$ac_objext
6197 if { (eval echo "$as_me:6197: \"$ac_compile\"") >&5
6198   (eval $ac_compile) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit $ac_status); } &&
6202          { ac_try='test -s conftest.$ac_objext'
6203   { (eval echo "$as_me:6203: \"$ac_try\"") >&5
6204   (eval $ac_try) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit $ac_status); }; }; then
6208   cf_cv_ncurses_h=$cf_header
6209
6210 else
6211   echo "$as_me: failed program was:" >&5
6212 cat conftest.$ac_ext >&5
6213 cf_cv_ncurses_h=no
6214 fi
6215 rm -f conftest.$ac_objext conftest.$ac_ext
6216
6217                 test "$cf_cv_ncurses_h" != no && break
6218         done
6219
6220 fi
6221 echo "$as_me:6221: result: $cf_cv_ncurses_h" >&5
6222 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6223
6224 if test "$cf_cv_ncurses_h" != no ; then
6225         cf_cv_ncurses_header=$cf_cv_ncurses_h
6226 else
6227
6228 echo "$as_me:6228: checking for $cf_ncuhdr_root include-path" >&5
6229 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6230 if test "${cf_cv_ncurses_h2+set}" = set; then
6231   echo $ECHO_N "(cached) $ECHO_C" >&6
6232 else
6233
6234         test -n "$verbose" && echo
6235
6236 cf_search=
6237
6238 # collect the current set of include-directories from compiler flags
6239 cf_header_path_list=""
6240 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6241         for cf_header_path in $CPPFLAGS $CFLAGS
6242         do
6243                 case $cf_header_path in
6244                 (-I*)
6245                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6246
6247 test "x$cf_header_path" != "xNONE" && \
6248 test -d "$cf_header_path" && \
6249  {
6250         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6251         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6252         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6253         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6254         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6255         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"
6256 }
6257
6258                         cf_header_path_list="$cf_header_path_list $cf_search"
6259                         ;;
6260                 esac
6261         done
6262 fi
6263
6264 # add the variations for the package we are looking for
6265
6266 cf_search=
6267
6268 test "x$prefix" != "xNONE" && \
6269 test -d "$prefix" && \
6270  {
6271         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6272         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6273         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6274         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6275         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6276         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6277 }
6278
6279 for cf_subdir_prefix in \
6280         /usr \
6281         /usr/local \
6282         /usr/pkg \
6283         /opt \
6284         /opt/local \
6285         $HOME
6286 do
6287
6288 test "x$cf_subdir_prefix" != "x$prefix" && \
6289 test -d "$cf_subdir_prefix" && \
6290 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6291         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6292         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6293         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6294         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6295         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6296         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"
6297 }
6298
6299 done
6300
6301 test "$includedir" != NONE && \
6302 test "$includedir" != "/usr/include" && \
6303 test -d "$includedir" && {
6304         test -d $includedir &&    cf_search="$cf_search $includedir"
6305         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6306 }
6307
6308 test "$oldincludedir" != NONE && \
6309 test "$oldincludedir" != "/usr/include" && \
6310 test -d "$oldincludedir" && {
6311         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6312         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6313 }
6314
6315 cf_search="$cf_search $cf_header_path_list"
6316
6317         test -n "$verbose" && echo search path $cf_search
6318         cf_save2_CPPFLAGS="$CPPFLAGS"
6319         for cf_incdir in $cf_search
6320         do
6321
6322 if test -n "$cf_incdir" ; then
6323   for cf_add_incdir in $cf_incdir
6324   do
6325         while test $cf_add_incdir != /usr/include
6326         do
6327           if test -d $cf_add_incdir
6328           then
6329                 cf_have_incdir=no
6330                 if test -n "$CFLAGS$CPPFLAGS" ; then
6331                   # a loop is needed to ensure we can add subdirs of existing dirs
6332                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6333                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6334                           cf_have_incdir=yes; break
6335                         fi
6336                   done
6337                 fi
6338
6339                 if test "$cf_have_incdir" = no ; then
6340                   if test "$cf_add_incdir" = /usr/local/include ; then
6341                         if test "$GCC" = yes
6342                         then
6343                           cf_save_CPPFLAGS=$CPPFLAGS
6344                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6345                           cat >conftest.$ac_ext <<_ACEOF
6346 #line 6346 "configure"
6347 #include "confdefs.h"
6348 #include <stdio.h>
6349 int
6350 main ()
6351 {
6352 printf("Hello")
6353   ;
6354   return 0;
6355 }
6356 _ACEOF
6357 rm -f conftest.$ac_objext
6358 if { (eval echo "$as_me:6358: \"$ac_compile\"") >&5
6359   (eval $ac_compile) 2>&5
6360   ac_status=$?
6361   echo "$as_me:6361: \$? = $ac_status" >&5
6362   (exit $ac_status); } &&
6363          { ac_try='test -s conftest.$ac_objext'
6364   { (eval echo "$as_me:6364: \"$ac_try\"") >&5
6365   (eval $ac_try) 2>&5
6366   ac_status=$?
6367   echo "$as_me:6367: \$? = $ac_status" >&5
6368   (exit $ac_status); }; }; then
6369   :
6370 else
6371   echo "$as_me: failed program was:" >&5
6372 cat conftest.$ac_ext >&5
6373 cf_have_incdir=yes
6374 fi
6375 rm -f conftest.$ac_objext conftest.$ac_ext
6376                           CPPFLAGS=$cf_save_CPPFLAGS
6377                         fi
6378                   fi
6379                 fi
6380
6381                 if test "$cf_have_incdir" = no ; then
6382                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6383
6384 echo "${as_me:-configure}:6384: testing adding $cf_add_incdir to include-path ..." 1>&5
6385
6386                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6387
6388                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6389                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6390                   cf_add_incdir="$cf_top_incdir"
6391                 else
6392                   break
6393                 fi
6394           fi
6395         done
6396   done
6397 fi
6398
6399                 for cf_header in \
6400                         ncurses.h \
6401                         curses.h
6402                 do
6403
6404         cat >conftest.$ac_ext <<_ACEOF
6405 #line 6405 "configure"
6406 #include "confdefs.h"
6407
6408 #include <$cf_header>
6409 int
6410 main ()
6411 {
6412
6413 #ifdef NCURSES_VERSION
6414
6415 printf("%s\n", NCURSES_VERSION);
6416 #else
6417 #ifdef __NCURSES_H
6418 printf("old\n");
6419 #else
6420         make an error
6421 #endif
6422 #endif
6423
6424   ;
6425   return 0;
6426 }
6427 _ACEOF
6428 rm -f conftest.$ac_objext
6429 if { (eval echo "$as_me:6429: \"$ac_compile\"") >&5
6430   (eval $ac_compile) 2>&5
6431   ac_status=$?
6432   echo "$as_me:6432: \$? = $ac_status" >&5
6433   (exit $ac_status); } &&
6434          { ac_try='test -s conftest.$ac_objext'
6435   { (eval echo "$as_me:6435: \"$ac_try\"") >&5
6436   (eval $ac_try) 2>&5
6437   ac_status=$?
6438   echo "$as_me:6438: \$? = $ac_status" >&5
6439   (exit $ac_status); }; }; then
6440   cf_cv_ncurses_h2=$cf_header
6441
6442 else
6443   echo "$as_me: failed program was:" >&5
6444 cat conftest.$ac_ext >&5
6445 cf_cv_ncurses_h2=no
6446 fi
6447 rm -f conftest.$ac_objext conftest.$ac_ext
6448
6449                         if test "$cf_cv_ncurses_h2" != no ; then
6450                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6451                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6452                                 break
6453                         fi
6454                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6455                 done
6456                 CPPFLAGS="$cf_save2_CPPFLAGS"
6457                 test "$cf_cv_ncurses_h2" != no && break
6458         done
6459         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6459: error: not found" >&5
6460 echo "$as_me: error: not found" >&2;}
6461    { (exit 1); exit 1; }; }
6462
6463 fi
6464 echo "$as_me:6464: result: $cf_cv_ncurses_h2" >&5
6465 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6466
6467         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6468         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6469         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6470                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6471         fi
6472
6473 if test -n "$cf_1st_incdir" ; then
6474   for cf_add_incdir in $cf_1st_incdir
6475   do
6476         while test $cf_add_incdir != /usr/include
6477         do
6478           if test -d $cf_add_incdir
6479           then
6480                 cf_have_incdir=no
6481                 if test -n "$CFLAGS$CPPFLAGS" ; then
6482                   # a loop is needed to ensure we can add subdirs of existing dirs
6483                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6484                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6485                           cf_have_incdir=yes; break
6486                         fi
6487                   done
6488                 fi
6489
6490                 if test "$cf_have_incdir" = no ; then
6491                   if test "$cf_add_incdir" = /usr/local/include ; then
6492                         if test "$GCC" = yes
6493                         then
6494                           cf_save_CPPFLAGS=$CPPFLAGS
6495                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6496                           cat >conftest.$ac_ext <<_ACEOF
6497 #line 6497 "configure"
6498 #include "confdefs.h"
6499 #include <stdio.h>
6500 int
6501 main ()
6502 {
6503 printf("Hello")
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 else
6522   echo "$as_me: failed program was:" >&5
6523 cat conftest.$ac_ext >&5
6524 cf_have_incdir=yes
6525 fi
6526 rm -f conftest.$ac_objext conftest.$ac_ext
6527                           CPPFLAGS=$cf_save_CPPFLAGS
6528                         fi
6529                   fi
6530                 fi
6531
6532                 if test "$cf_have_incdir" = no ; then
6533                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6534
6535 echo "${as_me:-configure}:6535: testing adding $cf_add_incdir to include-path ..." 1>&5
6536
6537                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6538
6539                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6540                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6541                   cf_add_incdir="$cf_top_incdir"
6542                 else
6543                   break
6544                 fi
6545           fi
6546         done
6547   done
6548 fi
6549
6550 fi
6551
6552 # Set definitions to allow ifdef'ing for ncurses.h
6553
6554 case $cf_cv_ncurses_header in
6555 (*ncurses.h)
6556
6557 cat >>confdefs.h <<\EOF
6558 #define HAVE_NCURSES_H 1
6559 EOF
6560
6561         ;;
6562 esac
6563
6564 case $cf_cv_ncurses_header in
6565 (ncurses/curses.h|ncurses/ncurses.h)
6566
6567 cat >>confdefs.h <<\EOF
6568 #define HAVE_NCURSES_NCURSES_H 1
6569 EOF
6570
6571         ;;
6572 (ncursesw/curses.h|ncursesw/ncurses.h)
6573
6574 cat >>confdefs.h <<\EOF
6575 #define HAVE_NCURSESW_NCURSES_H 1
6576 EOF
6577
6578         ;;
6579 esac
6580
6581 echo "$as_me:6581: checking for terminfo header" >&5
6582 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6583 if test "${cf_cv_term_header+set}" = set; then
6584   echo $ECHO_N "(cached) $ECHO_C" >&6
6585 else
6586
6587 case ${cf_cv_ncurses_header} in
6588 (*/ncurses.h|*/ncursesw.h)
6589         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6590         ;;
6591 (*)
6592         cf_term_header=term.h
6593         ;;
6594 esac
6595
6596 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6597 do
6598 cat >conftest.$ac_ext <<_ACEOF
6599 #line 6599 "configure"
6600 #include "confdefs.h"
6601 #include <stdio.h>
6602 #include <${cf_cv_ncurses_header:-curses.h}>
6603 #include <$cf_test>
6604
6605 int
6606 main ()
6607 {
6608 int x = auto_left_margin
6609   ;
6610   return 0;
6611 }
6612 _ACEOF
6613 rm -f conftest.$ac_objext
6614 if { (eval echo "$as_me:6614: \"$ac_compile\"") >&5
6615   (eval $ac_compile) 2>&5
6616   ac_status=$?
6617   echo "$as_me:6617: \$? = $ac_status" >&5
6618   (exit $ac_status); } &&
6619          { ac_try='test -s conftest.$ac_objext'
6620   { (eval echo "$as_me:6620: \"$ac_try\"") >&5
6621   (eval $ac_try) 2>&5
6622   ac_status=$?
6623   echo "$as_me:6623: \$? = $ac_status" >&5
6624   (exit $ac_status); }; }; then
6625
6626         cf_cv_term_header="$cf_test"
6627 else
6628   echo "$as_me: failed program was:" >&5
6629 cat conftest.$ac_ext >&5
6630
6631         cf_cv_term_header=unknown
6632
6633 fi
6634 rm -f conftest.$ac_objext conftest.$ac_ext
6635         test "$cf_cv_term_header" != unknown && break
6636 done
6637
6638 fi
6639 echo "$as_me:6639: result: $cf_cv_term_header" >&5
6640 echo "${ECHO_T}$cf_cv_term_header" >&6
6641
6642 # Set definitions to allow ifdef'ing to accommodate subdirectories
6643
6644 case $cf_cv_term_header in
6645 (*term.h)
6646
6647 cat >>confdefs.h <<\EOF
6648 #define HAVE_TERM_H 1
6649 EOF
6650
6651         ;;
6652 esac
6653
6654 case $cf_cv_term_header in
6655 (ncurses/term.h)
6656
6657 cat >>confdefs.h <<\EOF
6658 #define HAVE_NCURSES_TERM_H 1
6659 EOF
6660
6661         ;;
6662 (ncursesw/term.h)
6663
6664 cat >>confdefs.h <<\EOF
6665 #define HAVE_NCURSESW_TERM_H 1
6666 EOF
6667
6668         ;;
6669 esac
6670
6671 # some applications need this, but should check for NCURSES_VERSION
6672
6673 cat >>confdefs.h <<\EOF
6674 #define NCURSES 1
6675 EOF
6676
6677 echo "$as_me:6677: checking for ncurses version" >&5
6678 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6679 if test "${cf_cv_ncurses_version+set}" = set; then
6680   echo $ECHO_N "(cached) $ECHO_C" >&6
6681 else
6682
6683         cf_cv_ncurses_version=no
6684         cf_tempfile=out$$
6685         rm -f $cf_tempfile
6686         if test "$cross_compiling" = yes; then
6687
6688         # This will not work if the preprocessor splits the line after the
6689         # Autoconf token.  The 'unproto' program does that.
6690         cat > conftest.$ac_ext <<EOF
6691 #include <${cf_cv_ncurses_header:-curses.h}>
6692 #undef Autoconf
6693 #ifdef NCURSES_VERSION
6694 Autoconf NCURSES_VERSION
6695 #else
6696 #ifdef __NCURSES_H
6697 Autoconf "old"
6698 #endif
6699 ;
6700 #endif
6701 EOF
6702         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6703         { (eval echo "$as_me:6703: \"$cf_try\"") >&5
6704   (eval $cf_try) 2>&5
6705   ac_status=$?
6706   echo "$as_me:6706: \$? = $ac_status" >&5
6707   (exit $ac_status); }
6708         if test -f conftest.out ; then
6709                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6710                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6711                 rm -f conftest.out
6712         fi
6713
6714 else
6715   cat >conftest.$ac_ext <<_ACEOF
6716 #line 6716 "configure"
6717 #include "confdefs.h"
6718
6719 #include <${cf_cv_ncurses_header:-curses.h}>
6720 #include <stdio.h>
6721 int main()
6722 {
6723         FILE *fp = fopen("$cf_tempfile", "w");
6724 #ifdef NCURSES_VERSION
6725 # ifdef NCURSES_VERSION_PATCH
6726         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6727 # else
6728         fprintf(fp, "%s\n", NCURSES_VERSION);
6729 # endif
6730 #else
6731 # ifdef __NCURSES_H
6732         fprintf(fp, "old\n");
6733 # else
6734         make an error
6735 # endif
6736 #endif
6737         ${cf_cv_main_return:-return}(0);
6738 }
6739 _ACEOF
6740 rm -f conftest$ac_exeext
6741 if { (eval echo "$as_me:6741: \"$ac_link\"") >&5
6742   (eval $ac_link) 2>&5
6743   ac_status=$?
6744   echo "$as_me:6744: \$? = $ac_status" >&5
6745   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6746   { (eval echo "$as_me:6746: \"$ac_try\"") >&5
6747   (eval $ac_try) 2>&5
6748   ac_status=$?
6749   echo "$as_me:6749: \$? = $ac_status" >&5
6750   (exit $ac_status); }; }; then
6751
6752         cf_cv_ncurses_version=`cat $cf_tempfile`
6753 else
6754   echo "$as_me: program exited with status $ac_status" >&5
6755 echo "$as_me: failed program was:" >&5
6756 cat conftest.$ac_ext >&5
6757 fi
6758 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6759 fi
6760         rm -f $cf_tempfile
6761
6762 fi
6763 echo "$as_me:6763: result: $cf_cv_ncurses_version" >&5
6764 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6765 test "$cf_cv_ncurses_version" = no ||
6766 cat >>confdefs.h <<\EOF
6767 #define NCURSES 1
6768 EOF
6769
6770 cf_nculib_root=ncurses
6771         # This works, except for the special case where we find gpm, but
6772         # ncurses is in a nonstandard location via $LIBS, and we really want
6773         # to link gpm.
6774 cf_ncurses_LIBS=""
6775 cf_ncurses_SAVE="$LIBS"
6776 echo "$as_me:6776: checking for Gpm_Open in -lgpm" >&5
6777 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6778 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6779   echo $ECHO_N "(cached) $ECHO_C" >&6
6780 else
6781   ac_check_lib_save_LIBS=$LIBS
6782 LIBS="-lgpm  $LIBS"
6783 cat >conftest.$ac_ext <<_ACEOF
6784 #line 6784 "configure"
6785 #include "confdefs.h"
6786
6787 /* Override any gcc2 internal prototype to avoid an error.  */
6788 #ifdef __cplusplus
6789 extern "C"
6790 #endif
6791 /* We use char because int might match the return type of a gcc2
6792    builtin and then its argument prototype would still apply.  */
6793 char Gpm_Open ();
6794 int
6795 main ()
6796 {
6797 Gpm_Open ();
6798   ;
6799   return 0;
6800 }
6801 _ACEOF
6802 rm -f conftest.$ac_objext conftest$ac_exeext
6803 if { (eval echo "$as_me:6803: \"$ac_link\"") >&5
6804   (eval $ac_link) 2>&5
6805   ac_status=$?
6806   echo "$as_me:6806: \$? = $ac_status" >&5
6807   (exit $ac_status); } &&
6808          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_lib_gpm_Gpm_Open=yes
6815 else
6816   echo "$as_me: failed program was:" >&5
6817 cat conftest.$ac_ext >&5
6818 ac_cv_lib_gpm_Gpm_Open=no
6819 fi
6820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6821 LIBS=$ac_check_lib_save_LIBS
6822 fi
6823 echo "$as_me:6823: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6824 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6825 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6826   echo "$as_me:6826: checking for initscr in -lgpm" >&5
6827 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6828 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6829   echo $ECHO_N "(cached) $ECHO_C" >&6
6830 else
6831   ac_check_lib_save_LIBS=$LIBS
6832 LIBS="-lgpm  $LIBS"
6833 cat >conftest.$ac_ext <<_ACEOF
6834 #line 6834 "configure"
6835 #include "confdefs.h"
6836
6837 /* Override any gcc2 internal prototype to avoid an error.  */
6838 #ifdef __cplusplus
6839 extern "C"
6840 #endif
6841 /* We use char because int might match the return type of a gcc2
6842    builtin and then its argument prototype would still apply.  */
6843 char initscr ();
6844 int
6845 main ()
6846 {
6847 initscr ();
6848   ;
6849   return 0;
6850 }
6851 _ACEOF
6852 rm -f conftest.$ac_objext conftest$ac_exeext
6853 if { (eval echo "$as_me:6853: \"$ac_link\"") >&5
6854   (eval $ac_link) 2>&5
6855   ac_status=$?
6856   echo "$as_me:6856: \$? = $ac_status" >&5
6857   (exit $ac_status); } &&
6858          { ac_try='test -s conftest$ac_exeext'
6859   { (eval echo "$as_me:6859: \"$ac_try\"") >&5
6860   (eval $ac_try) 2>&5
6861   ac_status=$?
6862   echo "$as_me:6862: \$? = $ac_status" >&5
6863   (exit $ac_status); }; }; then
6864   ac_cv_lib_gpm_initscr=yes
6865 else
6866   echo "$as_me: failed program was:" >&5
6867 cat conftest.$ac_ext >&5
6868 ac_cv_lib_gpm_initscr=no
6869 fi
6870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6871 LIBS=$ac_check_lib_save_LIBS
6872 fi
6873 echo "$as_me:6873: result: $ac_cv_lib_gpm_initscr" >&5
6874 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6875 if test $ac_cv_lib_gpm_initscr = yes; then
6876   LIBS="$cf_ncurses_SAVE"
6877 else
6878   cf_ncurses_LIBS="-lgpm"
6879 fi
6880
6881 fi
6882
6883 case $host_os in
6884 (freebsd*)
6885         # This is only necessary if you are linking against an obsolete
6886         # version of ncurses (but it should do no harm, since it's static).
6887         if test "$cf_nculib_root" = ncurses ; then
6888                 echo "$as_me:6888: checking for tgoto in -lmytinfo" >&5
6889 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6890 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6891   echo $ECHO_N "(cached) $ECHO_C" >&6
6892 else
6893   ac_check_lib_save_LIBS=$LIBS
6894 LIBS="-lmytinfo  $LIBS"
6895 cat >conftest.$ac_ext <<_ACEOF
6896 #line 6896 "configure"
6897 #include "confdefs.h"
6898
6899 /* Override any gcc2 internal prototype to avoid an error.  */
6900 #ifdef __cplusplus
6901 extern "C"
6902 #endif
6903 /* We use char because int might match the return type of a gcc2
6904    builtin and then its argument prototype would still apply.  */
6905 char tgoto ();
6906 int
6907 main ()
6908 {
6909 tgoto ();
6910   ;
6911   return 0;
6912 }
6913 _ACEOF
6914 rm -f conftest.$ac_objext conftest$ac_exeext
6915 if { (eval echo "$as_me:6915: \"$ac_link\"") >&5
6916   (eval $ac_link) 2>&5
6917   ac_status=$?
6918   echo "$as_me:6918: \$? = $ac_status" >&5
6919   (exit $ac_status); } &&
6920          { ac_try='test -s conftest$ac_exeext'
6921   { (eval echo "$as_me:6921: \"$ac_try\"") >&5
6922   (eval $ac_try) 2>&5
6923   ac_status=$?
6924   echo "$as_me:6924: \$? = $ac_status" >&5
6925   (exit $ac_status); }; }; then
6926   ac_cv_lib_mytinfo_tgoto=yes
6927 else
6928   echo "$as_me: failed program was:" >&5
6929 cat conftest.$ac_ext >&5
6930 ac_cv_lib_mytinfo_tgoto=no
6931 fi
6932 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6933 LIBS=$ac_check_lib_save_LIBS
6934 fi
6935 echo "$as_me:6935: result: $ac_cv_lib_mytinfo_tgoto" >&5
6936 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6937 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6938   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6939 fi
6940
6941         fi
6942         ;;
6943 esac
6944
6945 cf_add_libs="$cf_ncurses_LIBS"
6946 # Filter out duplicates - this happens with badly-designed ".pc" files...
6947 for cf_add_1lib in $LIBS
6948 do
6949         for cf_add_2lib in $cf_add_libs
6950         do
6951                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6952                 then
6953                         cf_add_1lib=
6954                         break
6955                 fi
6956         done
6957         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6958 done
6959 LIBS="$cf_add_libs"
6960
6961 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6962 then
6963
6964 cf_add_libs="-l$cf_nculib_root"
6965 # Filter out duplicates - this happens with badly-designed ".pc" files...
6966 for cf_add_1lib in $LIBS
6967 do
6968         for cf_add_2lib in $cf_add_libs
6969         do
6970                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6971                 then
6972                         cf_add_1lib=
6973                         break
6974                 fi
6975         done
6976         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6977 done
6978 LIBS="$cf_add_libs"
6979
6980 else
6981
6982         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6983         cf_libdir=""
6984         echo "$as_me:6984: checking for initscr" >&5
6985 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6986 if test "${ac_cv_func_initscr+set}" = set; then
6987   echo $ECHO_N "(cached) $ECHO_C" >&6
6988 else
6989   cat >conftest.$ac_ext <<_ACEOF
6990 #line 6990 "configure"
6991 #include "confdefs.h"
6992 /* System header to define __stub macros and hopefully few prototypes,
6993     which can conflict with char initscr (); below.  */
6994 #include <assert.h>
6995 /* Override any gcc2 internal prototype to avoid an error.  */
6996 #ifdef __cplusplus
6997 extern "C"
6998 #endif
6999 /* We use char because int might match the return type of a gcc2
7000    builtin and then its argument prototype would still apply.  */
7001 char initscr ();
7002 char (*f) ();
7003
7004 int
7005 main ()
7006 {
7007 /* The GNU C library defines this for functions which it implements
7008     to always fail with ENOSYS.  Some functions are actually named
7009     something starting with __ and the normal name is an alias.  */
7010 #if defined (__stub_initscr) || defined (__stub___initscr)
7011 choke me
7012 #else
7013 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7014 #endif
7015
7016   ;
7017   return 0;
7018 }
7019 _ACEOF
7020 rm -f conftest.$ac_objext conftest$ac_exeext
7021 if { (eval echo "$as_me:7021: \"$ac_link\"") >&5
7022   (eval $ac_link) 2>&5
7023   ac_status=$?
7024   echo "$as_me:7024: \$? = $ac_status" >&5
7025   (exit $ac_status); } &&
7026          { ac_try='test -s conftest$ac_exeext'
7027   { (eval echo "$as_me:7027: \"$ac_try\"") >&5
7028   (eval $ac_try) 2>&5
7029   ac_status=$?
7030   echo "$as_me:7030: \$? = $ac_status" >&5
7031   (exit $ac_status); }; }; then
7032   ac_cv_func_initscr=yes
7033 else
7034   echo "$as_me: failed program was:" >&5
7035 cat conftest.$ac_ext >&5
7036 ac_cv_func_initscr=no
7037 fi
7038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7039 fi
7040 echo "$as_me:7040: result: $ac_cv_func_initscr" >&5
7041 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7042 if test $ac_cv_func_initscr = yes; then
7043   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7044 else
7045
7046                 cf_save_LIBS="$LIBS"
7047                 echo "$as_me:7047: checking for initscr in -l$cf_nculib_root" >&5
7048 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7049                 LIBS="-l$cf_nculib_root $LIBS"
7050                 cat >conftest.$ac_ext <<_ACEOF
7051 #line 7051 "configure"
7052 #include "confdefs.h"
7053 #include <${cf_cv_ncurses_header:-curses.h}>
7054 int
7055 main ()
7056 {
7057 initscr()
7058   ;
7059   return 0;
7060 }
7061 _ACEOF
7062 rm -f conftest.$ac_objext conftest$ac_exeext
7063 if { (eval echo "$as_me:7063: \"$ac_link\"") >&5
7064   (eval $ac_link) 2>&5
7065   ac_status=$?
7066   echo "$as_me:7066: \$? = $ac_status" >&5
7067   (exit $ac_status); } &&
7068          { ac_try='test -s conftest$ac_exeext'
7069   { (eval echo "$as_me:7069: \"$ac_try\"") >&5
7070   (eval $ac_try) 2>&5
7071   ac_status=$?
7072   echo "$as_me:7072: \$? = $ac_status" >&5
7073   (exit $ac_status); }; }; then
7074   echo "$as_me:7074: result: yes" >&5
7075 echo "${ECHO_T}yes" >&6
7076                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7077
7078 else
7079   echo "$as_me: failed program was:" >&5
7080 cat conftest.$ac_ext >&5
7081 echo "$as_me:7081: result: no" >&5
7082 echo "${ECHO_T}no" >&6
7083
7084 cf_search=
7085 cf_library_path_list=""
7086 if test -n "${LDFLAGS}${LIBS}" ; then
7087         for cf_library_path in $LDFLAGS $LIBS
7088         do
7089                 case $cf_library_path in
7090                 (-L*)
7091                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7092
7093 test "x$cf_library_path" != "xNONE" && \
7094 test -d "$cf_library_path" && \
7095  {
7096         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7097         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7098         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7099         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7100         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7101         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"
7102 }
7103
7104                         cf_library_path_list="$cf_library_path_list $cf_search"
7105                         ;;
7106                 esac
7107         done
7108 fi
7109
7110 cf_search=
7111
7112 test "x$prefix" != "xNONE" && \
7113 test -d "$prefix" && \
7114  {
7115         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7116         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7117         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7118         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7119         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7120         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7121 }
7122
7123 for cf_subdir_prefix in \
7124         /usr \
7125         /usr/local \
7126         /usr/pkg \
7127         /opt \
7128         /opt/local \
7129         $HOME
7130 do
7131
7132 test "x$cf_subdir_prefix" != "x$prefix" && \
7133 test -d "$cf_subdir_prefix" && \
7134 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7135         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7136         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7137         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7138         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7139         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7140         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"
7141 }
7142
7143 done
7144
7145 cf_search="$cf_library_path_list $cf_search"
7146
7147                         for cf_libdir in $cf_search
7148                         do
7149                                 echo "$as_me:7149: checking for -l$cf_nculib_root in $cf_libdir" >&5
7150 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7151                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7152                                 cat >conftest.$ac_ext <<_ACEOF
7153 #line 7153 "configure"
7154 #include "confdefs.h"
7155 #include <${cf_cv_ncurses_header:-curses.h}>
7156 int
7157 main ()
7158 {
7159 initscr()
7160   ;
7161   return 0;
7162 }
7163 _ACEOF
7164 rm -f conftest.$ac_objext conftest$ac_exeext
7165 if { (eval echo "$as_me:7165: \"$ac_link\"") >&5
7166   (eval $ac_link) 2>&5
7167   ac_status=$?
7168   echo "$as_me:7168: \$? = $ac_status" >&5
7169   (exit $ac_status); } &&
7170          { ac_try='test -s conftest$ac_exeext'
7171   { (eval echo "$as_me:7171: \"$ac_try\"") >&5
7172   (eval $ac_try) 2>&5
7173   ac_status=$?
7174   echo "$as_me:7174: \$? = $ac_status" >&5
7175   (exit $ac_status); }; }; then
7176   echo "$as_me:7176: result: yes" >&5
7177 echo "${ECHO_T}yes" >&6
7178                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7179                                          break
7180 else
7181   echo "$as_me: failed program was:" >&5
7182 cat conftest.$ac_ext >&5
7183 echo "$as_me:7183: result: no" >&5
7184 echo "${ECHO_T}no" >&6
7185                                          LIBS="$cf_save_LIBS"
7186 fi
7187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7188                         done
7189
7190 fi
7191 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7192
7193 fi
7194
7195 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7196
7197 if test $cf_found_library = no ; then
7198         { { echo "$as_me:7198: error: Cannot link $cf_nculib_root library" >&5
7199 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7200    { (exit 1); exit 1; }; }
7201 fi
7202
7203 fi
7204
7205 if test -n "$cf_ncurses_LIBS" ; then
7206         echo "$as_me:7206: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7207 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7208         cf_ncurses_SAVE="$LIBS"
7209         for p in $cf_ncurses_LIBS ; do
7210                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7211                 if test "$q" != "$LIBS" ; then
7212                         LIBS="$q"
7213                 fi
7214         done
7215         cat >conftest.$ac_ext <<_ACEOF
7216 #line 7216 "configure"
7217 #include "confdefs.h"
7218 #include <${cf_cv_ncurses_header:-curses.h}>
7219 int
7220 main ()
7221 {
7222 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7223   ;
7224   return 0;
7225 }
7226 _ACEOF
7227 rm -f conftest.$ac_objext conftest$ac_exeext
7228 if { (eval echo "$as_me:7228: \"$ac_link\"") >&5
7229   (eval $ac_link) 2>&5
7230   ac_status=$?
7231   echo "$as_me:7231: \$? = $ac_status" >&5
7232   (exit $ac_status); } &&
7233          { ac_try='test -s conftest$ac_exeext'
7234   { (eval echo "$as_me:7234: \"$ac_try\"") >&5
7235   (eval $ac_try) 2>&5
7236   ac_status=$?
7237   echo "$as_me:7237: \$? = $ac_status" >&5
7238   (exit $ac_status); }; }; then
7239   echo "$as_me:7239: result: yes" >&5
7240 echo "${ECHO_T}yes" >&6
7241 else
7242   echo "$as_me: failed program was:" >&5
7243 cat conftest.$ac_ext >&5
7244 echo "$as_me:7244: result: no" >&5
7245 echo "${ECHO_T}no" >&6
7246                  LIBS="$cf_ncurses_SAVE"
7247 fi
7248 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7249 fi
7250
7251 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7252
7253 cat >>confdefs.h <<EOF
7254 #define $cf_nculib_ROOT 1
7255 EOF
7256
7257         fi
7258 fi
7259
7260 fi
7261
7262 if test "$NCURSES_CONFIG" != none ; then
7263
7264 cf_version=`$NCURSES_CONFIG --version`
7265
7266 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7267 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
7268 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
7269
7270 # ABI version is not available from headers
7271 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7272
7273 else
7274
7275 for cf_name in MAJOR MINOR PATCH
7276 do
7277 cat >conftest.$ac_ext <<CF_EOF
7278 #include <${cf_cv_ncurses_header:-curses.h}>
7279 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7280 CF_EOF
7281         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7282         { (eval echo "$as_me:7282: \"$cf_try\"") >&5
7283   (eval $cf_try) 2>&5
7284   ac_status=$?
7285   echo "$as_me:7285: \$? = $ac_status" >&5
7286   (exit $ac_status); }
7287         if test -f conftest.out ; then
7288                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
7289                 eval NCURSES_$cf_name=\"$cf_result\"
7290                 # cat conftest.$ac_ext
7291                 # cat conftest.out
7292         fi
7293 done
7294
7295 cf_cv_abi_version=${NCURSES_MAJOR}
7296
7297 fi
7298
7299 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7300
7301 cf_cv_timestamp=`date`
7302
7303 echo "$as_me:7303: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7304 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7305
7306 echo "$as_me:7306: checking if you want to have a library-prefix" >&5
7307 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
7308
7309 # Check whether --with-lib-prefix or --without-lib-prefix was given.
7310 if test "${with_lib_prefix+set}" = set; then
7311   withval="$with_lib_prefix"
7312   with_lib_prefix=$withval
7313 else
7314   with_lib_prefix=auto
7315 fi;
7316 echo "$as_me:7316: result: $with_lib_prefix" >&5
7317 echo "${ECHO_T}$with_lib_prefix" >&6
7318
7319 if test $with_lib_prefix = auto
7320 then
7321
7322         case $cf_cv_system_name in
7323         (OS/2*|os2*)
7324                 LIB_PREFIX=''
7325                 ;;
7326         (*)     LIB_PREFIX='lib'
7327                 ;;
7328         esac
7329 cf_prefix=$LIB_PREFIX
7330
7331 elif test $with_lib_prefix = no
7332 then
7333         LIB_PREFIX=
7334 else
7335         LIB_PREFIX=$with_lib_prefix
7336 fi
7337
7338 LIB_SUFFIX=
7339
7340 ###############################################################################
7341
7342 if test X"$CC_G_OPT" = X"" ; then
7343         CC_G_OPT='-g'
7344         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7345 fi
7346
7347 echo "$as_me:7347: checking for default loader flags" >&5
7348 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7349 case $DFT_LWR_MODEL in
7350 (normal)  LD_MODEL=''   ;;
7351 (debug)   LD_MODEL=$CC_G_OPT ;;
7352 (profile) LD_MODEL='-pg';;
7353 (shared)  LD_MODEL=''   ;;
7354 esac
7355 echo "$as_me:7355: result: $LD_MODEL" >&5
7356 echo "${ECHO_T}$LD_MODEL" >&6
7357
7358 LD_RPATH_OPT=
7359 echo "$as_me:7359: checking for an rpath option" >&5
7360 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7361 case $cf_cv_system_name in
7362 (irix*)
7363         if test "$GCC" = yes; then
7364                 LD_RPATH_OPT="-Wl,-rpath,"
7365         else
7366                 LD_RPATH_OPT="-rpath "
7367         fi
7368         ;;
7369 (linux*|gnu*|k*bsd*-gnu)
7370         LD_RPATH_OPT="-Wl,-rpath,"
7371         ;;
7372 (openbsd[2-9].*|mirbsd*)
7373         LD_RPATH_OPT="-Wl,-rpath,"
7374         ;;
7375 (dragonfly*|freebsd*)
7376         LD_RPATH_OPT="-rpath "
7377         ;;
7378 (netbsd*)
7379         LD_RPATH_OPT="-Wl,-rpath,"
7380         ;;
7381 (osf*|mls+*)
7382         LD_RPATH_OPT="-rpath "
7383         ;;
7384 (solaris2*)
7385         LD_RPATH_OPT="-R"
7386         ;;
7387 (*)
7388         ;;
7389 esac
7390 echo "$as_me:7390: result: $LD_RPATH_OPT" >&5
7391 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7392
7393 case "x$LD_RPATH_OPT" in
7394 (x-R*)
7395         echo "$as_me:7395: checking if we need a space after rpath option" >&5
7396 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7397         cf_save_LIBS="$LIBS"
7398
7399 cf_add_libs="${LD_RPATH_OPT}$libdir"
7400 # Filter out duplicates - this happens with badly-designed ".pc" files...
7401 for cf_add_1lib in $LIBS
7402 do
7403         for cf_add_2lib in $cf_add_libs
7404         do
7405                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7406                 then
7407                         cf_add_1lib=
7408                         break
7409                 fi
7410         done
7411         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7412 done
7413 LIBS="$cf_add_libs"
7414
7415         cat >conftest.$ac_ext <<_ACEOF
7416 #line 7416 "configure"
7417 #include "confdefs.h"
7418
7419 int
7420 main ()
7421 {
7422
7423   ;
7424   return 0;
7425 }
7426 _ACEOF
7427 rm -f conftest.$ac_objext conftest$ac_exeext
7428 if { (eval echo "$as_me:7428: \"$ac_link\"") >&5
7429   (eval $ac_link) 2>&5
7430   ac_status=$?
7431   echo "$as_me:7431: \$? = $ac_status" >&5
7432   (exit $ac_status); } &&
7433          { ac_try='test -s conftest$ac_exeext'
7434   { (eval echo "$as_me:7434: \"$ac_try\"") >&5
7435   (eval $ac_try) 2>&5
7436   ac_status=$?
7437   echo "$as_me:7437: \$? = $ac_status" >&5
7438   (exit $ac_status); }; }; then
7439   cf_rpath_space=no
7440 else
7441   echo "$as_me: failed program was:" >&5
7442 cat conftest.$ac_ext >&5
7443 cf_rpath_space=yes
7444 fi
7445 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7446         LIBS="$cf_save_LIBS"
7447         echo "$as_me:7447: result: $cf_rpath_space" >&5
7448 echo "${ECHO_T}$cf_rpath_space" >&6
7449         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7450         ;;
7451 esac
7452
7453         RM_SHARED_OPTS=
7454         LOCAL_LDFLAGS=
7455         LOCAL_LDFLAGS2=
7456         LD_SHARED_OPTS=
7457         INSTALL_LIB="-m 644"
7458         : ${rel_builddir:=.}
7459
7460         shlibdir=$libdir
7461
7462         MAKE_DLLS="#"
7463
7464         cf_cv_do_symlinks=no
7465         cf_ld_rpath_opt=
7466         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7467
7468         echo "$as_me:7468: checking if release/abi version should be used for shared libs" >&5
7469 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7470
7471 # Check whether --with-shlib-version or --without-shlib-version was given.
7472 if test "${with_shlib_version+set}" = set; then
7473   withval="$with_shlib_version"
7474   test -z "$withval" && withval=auto
7475         case $withval in
7476         (yes)
7477                 cf_cv_shlib_version=auto
7478                 ;;
7479         (rel|abi|auto|no)
7480                 cf_cv_shlib_version=$withval
7481                 ;;
7482         (*)
7483                 { { echo "$as_me:7483: error: option value must be one of: rel, abi, auto or no" >&5
7484 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7485    { (exit 1); exit 1; }; }
7486                 ;;
7487         esac
7488
7489 else
7490   cf_cv_shlib_version=auto
7491 fi;
7492         echo "$as_me:7492: result: $cf_cv_shlib_version" >&5
7493 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7494
7495         cf_cv_rm_so_locs=no
7496         cf_try_cflags=
7497
7498         # Some less-capable ports of gcc support only -fpic
7499         CC_SHARED_OPTS=
7500         if test "$GCC" = yes
7501         then
7502                 echo "$as_me:7502: checking which $CC option to use" >&5
7503 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7504                 cf_save_CFLAGS="$CFLAGS"
7505                 for CC_SHARED_OPTS in -fPIC -fpic ''
7506                 do
7507                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7508                         cat >conftest.$ac_ext <<_ACEOF
7509 #line 7509 "configure"
7510 #include "confdefs.h"
7511 #include <stdio.h>
7512 int
7513 main ()
7514 {
7515 int x = 1
7516   ;
7517   return 0;
7518 }
7519 _ACEOF
7520 rm -f conftest.$ac_objext
7521 if { (eval echo "$as_me:7521: \"$ac_compile\"") >&5
7522   (eval $ac_compile) 2>&5
7523   ac_status=$?
7524   echo "$as_me:7524: \$? = $ac_status" >&5
7525   (exit $ac_status); } &&
7526          { ac_try='test -s conftest.$ac_objext'
7527   { (eval echo "$as_me:7527: \"$ac_try\"") >&5
7528   (eval $ac_try) 2>&5
7529   ac_status=$?
7530   echo "$as_me:7530: \$? = $ac_status" >&5
7531   (exit $ac_status); }; }; then
7532   break
7533 else
7534   echo "$as_me: failed program was:" >&5
7535 cat conftest.$ac_ext >&5
7536 fi
7537 rm -f conftest.$ac_objext conftest.$ac_ext
7538                 done
7539                 echo "$as_me:7539: result: $CC_SHARED_OPTS" >&5
7540 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7541                 CFLAGS="$cf_save_CFLAGS"
7542         fi
7543
7544         cf_cv_shlib_version_infix=no
7545
7546         case $cf_cv_system_name in
7547         (aix4.3-9*|aix[5-7]*)
7548                 if test "$GCC" = yes; then
7549                         CC_SHARED_OPTS='-Wl,-brtl'
7550                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7551                 else
7552                         CC_SHARED_OPTS='-brtl'
7553                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
7554                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7555                 fi
7556                 ;;
7557         (beos*)
7558                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7559                 ;;
7560         (cygwin*)
7561                 CC_SHARED_OPTS=
7562                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7563                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7564                 cf_cv_shlib_version=cygdll
7565                 cf_cv_shlib_version_infix=cygdll
7566                 shlibdir=$bindir
7567                 MAKE_DLLS=
7568                 cat >mk_shared_lib.sh <<-CF_EOF
7569                 #!/bin/sh
7570                 SHARED_LIB=\$1
7571                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7572                 shift
7573                 cat <<-EOF
7574                 Linking shared library
7575                 ** SHARED_LIB \$SHARED_LIB
7576                 ** IMPORT_LIB \$IMPORT_LIB
7577 EOF
7578                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7579 CF_EOF
7580                 chmod +x mk_shared_lib.sh
7581                 ;;
7582         (msys*)
7583                 CC_SHARED_OPTS=
7584                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7585                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7586                 cf_cv_shlib_version=msysdll
7587                 cf_cv_shlib_version_infix=msysdll
7588                 shlibdir=$bindir
7589                 MAKE_DLLS=
7590                 cat >mk_shared_lib.sh <<-CF_EOF
7591                 #!/bin/sh
7592                 SHARED_LIB=\$1
7593                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7594                 shift
7595                 cat <<-EOF
7596                 Linking shared library
7597                 ** SHARED_LIB \$SHARED_LIB
7598                 ** IMPORT_LIB \$IMPORT_LIB
7599 EOF
7600                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7601 CF_EOF
7602                 chmod +x mk_shared_lib.sh
7603                 ;;
7604         (darwin*)
7605                 cf_try_cflags="no-cpp-precomp"
7606                 CC_SHARED_OPTS="-dynamic"
7607                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7608                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7609                 cf_cv_shlib_version_infix=yes
7610                 echo "$as_me:7610: checking if ld -search_paths_first works" >&5
7611 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7612 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7613   echo $ECHO_N "(cached) $ECHO_C" >&6
7614 else
7615
7616                         cf_save_LDFLAGS=$LDFLAGS
7617                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7618                         cat >conftest.$ac_ext <<_ACEOF
7619 #line 7619 "configure"
7620 #include "confdefs.h"
7621
7622 int
7623 main ()
7624 {
7625 int i;
7626   ;
7627   return 0;
7628 }
7629 _ACEOF
7630 rm -f conftest.$ac_objext conftest$ac_exeext
7631 if { (eval echo "$as_me:7631: \"$ac_link\"") >&5
7632   (eval $ac_link) 2>&5
7633   ac_status=$?
7634   echo "$as_me:7634: \$? = $ac_status" >&5
7635   (exit $ac_status); } &&
7636          { ac_try='test -s conftest$ac_exeext'
7637   { (eval echo "$as_me:7637: \"$ac_try\"") >&5
7638   (eval $ac_try) 2>&5
7639   ac_status=$?
7640   echo "$as_me:7640: \$? = $ac_status" >&5
7641   (exit $ac_status); }; }; then
7642   cf_cv_ldflags_search_paths_first=yes
7643 else
7644   echo "$as_me: failed program was:" >&5
7645 cat conftest.$ac_ext >&5
7646 cf_cv_ldflags_search_paths_first=no
7647 fi
7648 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7649                                 LDFLAGS=$cf_save_LDFLAGS
7650 fi
7651 echo "$as_me:7651: result: $cf_cv_ldflags_search_paths_first" >&5
7652 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7653                 if test $cf_cv_ldflags_search_paths_first = yes; then
7654                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7655                 fi
7656                 ;;
7657         (hpux[7-8]*)
7658                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
7659                 if test "$GCC" != yes; then
7660                         CC_SHARED_OPTS='+Z'
7661                 fi
7662                 MK_SHARED_LIB='${LD} -b -o $@'
7663                 INSTALL_LIB="-m 555"
7664                 ;;
7665         (hpux*)
7666                 # (tested with gcc 2.7.2 -- I don't have c89)
7667                 if test "$GCC" = yes; then
7668                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7669                 else
7670                         CC_SHARED_OPTS='+Z'
7671                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7672                 fi
7673                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7674                 # HP-UX shared libraries must be executable, and should be
7675                 # readonly to exploit a quirk in the memory manager.
7676                 INSTALL_LIB="-m 555"
7677                 ;;
7678         (interix*)
7679                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7680                 if test "$cf_cv_shlib_version" = rel; then
7681                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
7682                 else
7683                         cf_shared_soname='`basename `'
7684                 fi
7685                 CC_SHARED_OPTS=
7686                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
7687                 ;;
7688         (irix*)
7689                 if test "$cf_cv_enable_rpath" = yes ; then
7690                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7691                 fi
7692                 # tested with IRIX 5.2 and 'cc'.
7693                 if test "$GCC" != yes; then
7694                         CC_SHARED_OPTS='-KPIC'
7695                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7696                 else
7697                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7698                 fi
7699                 cf_cv_rm_so_locs=yes
7700                 ;;
7701         (linux*|gnu*|k*bsd*-gnu)
7702                 if test "$DFT_LWR_MODEL" = "shared" ; then
7703                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7704                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7705                 fi
7706                 if test "$cf_cv_enable_rpath" = yes ; then
7707                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7708                 fi
7709
7710         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7711         if test "$cf_cv_shlib_version" = rel; then
7712                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7713         else
7714                 cf_cv_shared_soname='`basename $@`'
7715         fi
7716
7717                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7718                 ;;
7719         (mingw*)
7720                 cf_cv_shlib_version=mingw
7721                 cf_cv_shlib_version_infix=mingw
7722                 shlibdir=$bindir
7723                 MAKE_DLLS=
7724                 if test "$DFT_LWR_MODEL" = "shared" ; then
7725                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
7726                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7727                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
7728                 fi
7729                 CC_SHARED_OPTS=
7730                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7731                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7732                 cat >mk_shared_lib.sh <<-CF_EOF
7733                 #!/bin/sh
7734                 SHARED_LIB=\$1
7735                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
7736                 shift
7737                 cat <<-EOF
7738                 Linking shared library
7739                 ** SHARED_LIB \$SHARED_LIB
7740                 ** IMPORT_LIB \$IMPORT_LIB
7741 EOF
7742                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7743 CF_EOF
7744                 chmod +x mk_shared_lib.sh
7745                 ;;
7746         (openbsd[2-9].*|mirbsd*)
7747                 if test "$DFT_LWR_MODEL" = "shared" ; then
7748                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7749                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7750                 fi
7751                 if test "$cf_cv_enable_rpath" = yes ; then
7752                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7753                 fi
7754                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7755
7756         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7757         if test "$cf_cv_shlib_version" = rel; then
7758                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7759         else
7760                 cf_cv_shared_soname='`basename $@`'
7761         fi
7762
7763                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7764                 ;;
7765         (nto-qnx*|openbsd*|freebsd[12].*)
7766                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7767                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7768                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7769                 ;;
7770         (dragonfly*|freebsd*)
7771                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7772                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7773                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7774                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
7775                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7776                 fi
7777
7778         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7779         if test "$cf_cv_shlib_version" = rel; then
7780                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7781         else
7782                 cf_cv_shared_soname='`basename $@`'
7783         fi
7784
7785                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7786                 ;;
7787         (netbsd*)
7788                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7789                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7790                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7791                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7792                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7793                         if test "$cf_cv_shlib_version" = auto; then
7794                         if test -f /usr/libexec/ld.elf_so; then
7795                                 cf_cv_shlib_version=abi
7796                         else
7797                                 cf_cv_shlib_version=rel
7798                         fi
7799                         fi
7800
7801         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7802         if test "$cf_cv_shlib_version" = rel; then
7803                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7804         else
7805                 cf_cv_shared_soname='`basename $@`'
7806         fi
7807
7808                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7809                 else
7810                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
7811                 fi
7812                 ;;
7813         (osf*|mls+*)
7814                 # tested with OSF/1 V3.2 and 'cc'
7815                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7816                 # link with shared libs).
7817                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7818                 case $host_os in
7819                 (osf4*)
7820                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7821                         ;;
7822                 esac
7823                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7824                 if test "$DFT_LWR_MODEL" = "shared" ; then
7825                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7826                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7827                 fi
7828                 cf_cv_rm_so_locs=yes
7829                 ;;
7830         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
7831                 # tested with osr5.0.5
7832                 if test "$GCC" != yes; then
7833                         CC_SHARED_OPTS='-belf -KPIC'
7834                 fi
7835                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7836                 if test "$cf_cv_enable_rpath" = yes ; then
7837                         # only way is to set LD_RUN_PATH but no switch for it
7838                         RUN_PATH=$libdir
7839                 fi
7840                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7841                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7842                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7843                 ;;
7844         (sunos4*)
7845                 # tested with SunOS 4.1.1 and gcc 2.7.0
7846                 if test "$GCC" != yes; then
7847                         CC_SHARED_OPTS='-KPIC'
7848                 fi
7849                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7850                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7851                 ;;
7852         (solaris2*)
7853                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7854                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7855                 if test "$DFT_LWR_MODEL" = "shared" ; then
7856                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7857                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7858                 fi
7859                 if test "$cf_cv_enable_rpath" = yes ; then
7860                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7861                 fi
7862
7863         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7864         if test "$cf_cv_shlib_version" = rel; then
7865                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7866         else
7867                 cf_cv_shared_soname='`basename $@`'
7868         fi
7869
7870                 if test "$GCC" != yes; then
7871                         cf_save_CFLAGS="$CFLAGS"
7872                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7873                         do
7874                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7875                                 cat >conftest.$ac_ext <<_ACEOF
7876 #line 7876 "configure"
7877 #include "confdefs.h"
7878 #include <stdio.h>
7879 int
7880 main ()
7881 {
7882 printf("Hello\n");
7883   ;
7884   return 0;
7885 }
7886 _ACEOF
7887 rm -f conftest.$ac_objext
7888 if { (eval echo "$as_me:7888: \"$ac_compile\"") >&5
7889   (eval $ac_compile) 2>&5
7890   ac_status=$?
7891   echo "$as_me:7891: \$? = $ac_status" >&5
7892   (exit $ac_status); } &&
7893          { ac_try='test -s conftest.$ac_objext'
7894   { (eval echo "$as_me:7894: \"$ac_try\"") >&5
7895   (eval $ac_try) 2>&5
7896   ac_status=$?
7897   echo "$as_me:7897: \$? = $ac_status" >&5
7898   (exit $ac_status); }; }; then
7899   break
7900 else
7901   echo "$as_me: failed program was:" >&5
7902 cat conftest.$ac_ext >&5
7903 fi
7904 rm -f conftest.$ac_objext conftest.$ac_ext
7905                         done
7906                         CFLAGS="$cf_save_CFLAGS"
7907                         CC_SHARED_OPTS=$cf_shared_opts
7908                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7909                 else
7910                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7911                 fi
7912                 ;;
7913         (sysv5uw7*|unix_sv*)
7914                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7915                 if test "$GCC" != yes; then
7916                         CC_SHARED_OPTS='-KPIC'
7917                 fi
7918                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7919                 ;;
7920         (*)
7921                 CC_SHARED_OPTS='unknown'
7922                 MK_SHARED_LIB='echo unknown'
7923                 ;;
7924         esac
7925
7926         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7927         case "$cf_cv_shlib_version" in
7928         (rel|abi)
7929                 case "$MK_SHARED_LIB" in
7930                 (*'-o $@')
7931                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7932                         ;;
7933                 (*)
7934                         { echo "$as_me:7934: WARNING: ignored --with-shlib-version" >&5
7935 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7936                         ;;
7937                 esac
7938                 ;;
7939         esac
7940
7941         if test -n "$cf_try_cflags"
7942         then
7943 cat > conftest.$ac_ext <<EOF
7944 #line 7944 "${as_me:-configure}"
7945 #include <stdio.h>
7946 int main(int argc, char *argv[])
7947 {
7948         printf("hello\n");
7949         return (argv[argc-1] == 0) ;
7950 }
7951 EOF
7952                 cf_save_CFLAGS="$CFLAGS"
7953                 for cf_opt in $cf_try_cflags
7954                 do
7955                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
7956                         echo "$as_me:7956: checking if CFLAGS option -$cf_opt works" >&5
7957 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
7958                         if { (eval echo "$as_me:7958: \"$ac_compile\"") >&5
7959   (eval $ac_compile) 2>&5
7960   ac_status=$?
7961   echo "$as_me:7961: \$? = $ac_status" >&5
7962   (exit $ac_status); }; then
7963                                 echo "$as_me:7963: result: yes" >&5
7964 echo "${ECHO_T}yes" >&6
7965                                 cf_save_CFLAGS="$CFLAGS"
7966                         else
7967                                 echo "$as_me:7967: result: no" >&5
7968 echo "${ECHO_T}no" >&6
7969                         fi
7970                 done
7971                 CFLAGS="$cf_save_CFLAGS"
7972         fi
7973
7974         # RPATH_LIST is a colon-separated list of directories
7975         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
7976         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
7977
7978         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
7979
7980         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
7981
7982 echo "${as_me:-configure}:7982: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
7983
7984         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
7985
7986 echo "${as_me:-configure}:7986: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
7987
7988 # The test/sample programs in the original tree link using rpath option.
7989 # Make it optional for packagers.
7990 if test -n "$LOCAL_LDFLAGS"
7991 then
7992         echo "$as_me:7992: checking if you want to link sample programs with rpath option" >&5
7993 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
7994
7995 # Check whether --enable-rpath-link or --disable-rpath-link was given.
7996 if test "${enable_rpath_link+set}" = set; then
7997   enableval="$enable_rpath_link"
7998   with_rpath_link=$enableval
7999 else
8000   with_rpath_link=yes
8001 fi;
8002         echo "$as_me:8002: result: $with_rpath_link" >&5
8003 echo "${ECHO_T}$with_rpath_link" >&6
8004         if test "$with_rpath_link" = no
8005         then
8006                 LOCAL_LDFLAGS=
8007                 LOCAL_LDFLAGS2=
8008         fi
8009 fi
8010
8011 ###############################################################################
8012
8013 ###   use option --enable-broken-linker to force on use of broken-linker support
8014 echo "$as_me:8014: checking if you want broken-linker support code" >&5
8015 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
8016
8017 # Check whether --enable-broken_linker or --disable-broken_linker was given.
8018 if test "${enable_broken_linker+set}" = set; then
8019   enableval="$enable_broken_linker"
8020   with_broken_linker=$enableval
8021 else
8022   with_broken_linker=${BROKEN_LINKER:-no}
8023 fi;
8024 echo "$as_me:8024: result: $with_broken_linker" >&5
8025 echo "${ECHO_T}$with_broken_linker" >&6
8026
8027 BROKEN_LINKER=0
8028 if test "$with_broken_linker" = yes ; then
8029         cat >>confdefs.h <<\EOF
8030 #define BROKEN_LINKER 1
8031 EOF
8032
8033         BROKEN_LINKER=1
8034 elif test "$DFT_LWR_MODEL" = shared ; then
8035         case $cf_cv_system_name in
8036         (cygwin*)
8037                 cat >>confdefs.h <<\EOF
8038 #define BROKEN_LINKER 1
8039 EOF
8040
8041                 BROKEN_LINKER=1
8042                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
8043
8044 echo "${as_me:-configure}:8044: testing cygwin linker is broken anyway ..." 1>&5
8045
8046                 ;;
8047         esac
8048 fi
8049
8050 # Check to define _XOPEN_SOURCE "automatically"
8051
8052 cf_XOPEN_SOURCE=500
8053 cf_POSIX_C_SOURCE=199506L
8054 cf_xopen_source=
8055
8056 case $host_os in
8057 (aix[4-7]*)
8058         cf_xopen_source="-D_ALL_SOURCE"
8059         ;;
8060 (cygwin|msys)
8061         cf_XOPEN_SOURCE=600
8062         ;;
8063 (darwin[0-8].*)
8064         cf_xopen_source="-D_APPLE_C_SOURCE"
8065         ;;
8066 (darwin*)
8067         cf_xopen_source="-D_DARWIN_C_SOURCE"
8068         cf_XOPEN_SOURCE=
8069         ;;
8070 (freebsd*|dragonfly*)
8071         # 5.x headers associate
8072         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
8073         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
8074         cf_POSIX_C_SOURCE=200112L
8075         cf_XOPEN_SOURCE=600
8076         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8077         ;;
8078 (hpux11*)
8079         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
8080         ;;
8081 (hpux*)
8082         cf_xopen_source="-D_HPUX_SOURCE"
8083         ;;
8084 (irix[56].*)
8085         cf_xopen_source="-D_SGI_SOURCE"
8086         cf_XOPEN_SOURCE=
8087         ;;
8088 (linux*|gnu*|mint*|k*bsd*-gnu)
8089
8090 echo "$as_me:8090: checking if we must define _GNU_SOURCE" >&5
8091 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
8092 if test "${cf_cv_gnu_source+set}" = set; then
8093   echo $ECHO_N "(cached) $ECHO_C" >&6
8094 else
8095
8096 cat >conftest.$ac_ext <<_ACEOF
8097 #line 8097 "configure"
8098 #include "confdefs.h"
8099 #include <sys/types.h>
8100 int
8101 main ()
8102 {
8103
8104 #ifndef _XOPEN_SOURCE
8105 make an error
8106 #endif
8107   ;
8108   return 0;
8109 }
8110 _ACEOF
8111 rm -f conftest.$ac_objext
8112 if { (eval echo "$as_me:8112: \"$ac_compile\"") >&5
8113   (eval $ac_compile) 2>&5
8114   ac_status=$?
8115   echo "$as_me:8115: \$? = $ac_status" >&5
8116   (exit $ac_status); } &&
8117          { ac_try='test -s conftest.$ac_objext'
8118   { (eval echo "$as_me:8118: \"$ac_try\"") >&5
8119   (eval $ac_try) 2>&5
8120   ac_status=$?
8121   echo "$as_me:8121: \$? = $ac_status" >&5
8122   (exit $ac_status); }; }; then
8123   cf_cv_gnu_source=no
8124 else
8125   echo "$as_me: failed program was:" >&5
8126 cat conftest.$ac_ext >&5
8127 cf_save="$CPPFLAGS"
8128          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
8129          cat >conftest.$ac_ext <<_ACEOF
8130 #line 8130 "configure"
8131 #include "confdefs.h"
8132 #include <sys/types.h>
8133 int
8134 main ()
8135 {
8136
8137 #ifdef _XOPEN_SOURCE
8138 make an error
8139 #endif
8140   ;
8141   return 0;
8142 }
8143 _ACEOF
8144 rm -f conftest.$ac_objext
8145 if { (eval echo "$as_me:8145: \"$ac_compile\"") >&5
8146   (eval $ac_compile) 2>&5
8147   ac_status=$?
8148   echo "$as_me:8148: \$? = $ac_status" >&5
8149   (exit $ac_status); } &&
8150          { ac_try='test -s conftest.$ac_objext'
8151   { (eval echo "$as_me:8151: \"$ac_try\"") >&5
8152   (eval $ac_try) 2>&5
8153   ac_status=$?
8154   echo "$as_me:8154: \$? = $ac_status" >&5
8155   (exit $ac_status); }; }; then
8156   cf_cv_gnu_source=no
8157 else
8158   echo "$as_me: failed program was:" >&5
8159 cat conftest.$ac_ext >&5
8160 cf_cv_gnu_source=yes
8161 fi
8162 rm -f conftest.$ac_objext conftest.$ac_ext
8163         CPPFLAGS="$cf_save"
8164
8165 fi
8166 rm -f conftest.$ac_objext conftest.$ac_ext
8167
8168 fi
8169 echo "$as_me:8169: result: $cf_cv_gnu_source" >&5
8170 echo "${ECHO_T}$cf_cv_gnu_source" >&6
8171 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
8172
8173         ;;
8174 (minix*)
8175         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
8176         ;;
8177 (mirbsd*)
8178         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
8179         cf_XOPEN_SOURCE=
8180
8181 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8182
8183 cf_save_CFLAGS="$CFLAGS"
8184 cf_save_CPPFLAGS="$CPPFLAGS"
8185
8186 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8187         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8188                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8189
8190 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8191         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8192                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8193
8194 echo "$as_me:8194: checking if we should define _POSIX_C_SOURCE" >&5
8195 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8196 if test "${cf_cv_posix_c_source+set}" = set; then
8197   echo $ECHO_N "(cached) $ECHO_C" >&6
8198 else
8199
8200 echo "${as_me:-configure}:8200: testing if the symbol is already defined go no further ..." 1>&5
8201
8202         cat >conftest.$ac_ext <<_ACEOF
8203 #line 8203 "configure"
8204 #include "confdefs.h"
8205 #include <sys/types.h>
8206 int
8207 main ()
8208 {
8209
8210 #ifndef _POSIX_C_SOURCE
8211 make an error
8212 #endif
8213   ;
8214   return 0;
8215 }
8216 _ACEOF
8217 rm -f conftest.$ac_objext
8218 if { (eval echo "$as_me:8218: \"$ac_compile\"") >&5
8219   (eval $ac_compile) 2>&5
8220   ac_status=$?
8221   echo "$as_me:8221: \$? = $ac_status" >&5
8222   (exit $ac_status); } &&
8223          { ac_try='test -s conftest.$ac_objext'
8224   { (eval echo "$as_me:8224: \"$ac_try\"") >&5
8225   (eval $ac_try) 2>&5
8226   ac_status=$?
8227   echo "$as_me:8227: \$? = $ac_status" >&5
8228   (exit $ac_status); }; }; then
8229   cf_cv_posix_c_source=no
8230 else
8231   echo "$as_me: failed program was:" >&5
8232 cat conftest.$ac_ext >&5
8233 cf_want_posix_source=no
8234          case .$cf_POSIX_C_SOURCE in
8235          (.[12]??*)
8236                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8237                 ;;
8238          (.2)
8239                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8240                 cf_want_posix_source=yes
8241                 ;;
8242          (.*)
8243                 cf_want_posix_source=yes
8244                 ;;
8245          esac
8246          if test "$cf_want_posix_source" = yes ; then
8247                 cat >conftest.$ac_ext <<_ACEOF
8248 #line 8248 "configure"
8249 #include "confdefs.h"
8250 #include <sys/types.h>
8251 int
8252 main ()
8253 {
8254
8255 #ifdef _POSIX_SOURCE
8256 make an error
8257 #endif
8258   ;
8259   return 0;
8260 }
8261 _ACEOF
8262 rm -f conftest.$ac_objext
8263 if { (eval echo "$as_me:8263: \"$ac_compile\"") >&5
8264   (eval $ac_compile) 2>&5
8265   ac_status=$?
8266   echo "$as_me:8266: \$? = $ac_status" >&5
8267   (exit $ac_status); } &&
8268          { ac_try='test -s conftest.$ac_objext'
8269   { (eval echo "$as_me:8269: \"$ac_try\"") >&5
8270   (eval $ac_try) 2>&5
8271   ac_status=$?
8272   echo "$as_me:8272: \$? = $ac_status" >&5
8273   (exit $ac_status); }; }; then
8274   :
8275 else
8276   echo "$as_me: failed program was:" >&5
8277 cat conftest.$ac_ext >&5
8278 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8279 fi
8280 rm -f conftest.$ac_objext conftest.$ac_ext
8281          fi
8282
8283 echo "${as_me:-configure}:8283: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8284
8285          CFLAGS="$cf_trim_CFLAGS"
8286          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8287
8288 echo "${as_me:-configure}:8288: testing if the second compile does not leave our definition intact error ..." 1>&5
8289
8290          cat >conftest.$ac_ext <<_ACEOF
8291 #line 8291 "configure"
8292 #include "confdefs.h"
8293 #include <sys/types.h>
8294 int
8295 main ()
8296 {
8297
8298 #ifndef _POSIX_C_SOURCE
8299 make an error
8300 #endif
8301   ;
8302   return 0;
8303 }
8304 _ACEOF
8305 rm -f conftest.$ac_objext
8306 if { (eval echo "$as_me:8306: \"$ac_compile\"") >&5
8307   (eval $ac_compile) 2>&5
8308   ac_status=$?
8309   echo "$as_me:8309: \$? = $ac_status" >&5
8310   (exit $ac_status); } &&
8311          { ac_try='test -s conftest.$ac_objext'
8312   { (eval echo "$as_me:8312: \"$ac_try\"") >&5
8313   (eval $ac_try) 2>&5
8314   ac_status=$?
8315   echo "$as_me:8315: \$? = $ac_status" >&5
8316   (exit $ac_status); }; }; then
8317   :
8318 else
8319   echo "$as_me: failed program was:" >&5
8320 cat conftest.$ac_ext >&5
8321 cf_cv_posix_c_source=no
8322 fi
8323 rm -f conftest.$ac_objext conftest.$ac_ext
8324          CFLAGS="$cf_save_CFLAGS"
8325          CPPFLAGS="$cf_save_CPPFLAGS"
8326
8327 fi
8328 rm -f conftest.$ac_objext conftest.$ac_ext
8329
8330 fi
8331 echo "$as_me:8331: result: $cf_cv_posix_c_source" >&5
8332 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8333
8334 if test "$cf_cv_posix_c_source" != no ; then
8335         CFLAGS="$cf_trim_CFLAGS"
8336         CPPFLAGS="$cf_trim_CPPFLAGS"
8337
8338 cf_fix_cppflags=no
8339 cf_new_cflags=
8340 cf_new_cppflags=
8341 cf_new_extra_cppflags=
8342
8343 for cf_add_cflags in $cf_cv_posix_c_source
8344 do
8345 case $cf_fix_cppflags in
8346 (no)
8347         case $cf_add_cflags in
8348         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8349                 case $cf_add_cflags in
8350                 (-D*)
8351                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8352
8353                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8354                                 && test -z "${cf_tst_cflags}" \
8355                                 && cf_fix_cppflags=yes
8356
8357                         if test $cf_fix_cppflags = yes ; then
8358                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8359                                 continue
8360                         elif test "${cf_tst_cflags}" = "\"'" ; then
8361                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8362                                 continue
8363                         fi
8364                         ;;
8365                 esac
8366                 case "$CPPFLAGS" in
8367                 (*$cf_add_cflags)
8368                         ;;
8369                 (*)
8370                         case $cf_add_cflags in
8371                         (-D*)
8372                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8373
8374 CPPFLAGS=`echo "$CPPFLAGS" | \
8375         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8376                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8377
8378                                 ;;
8379                         esac
8380                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8381                         ;;
8382                 esac
8383                 ;;
8384         (*)
8385                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8386                 ;;
8387         esac
8388         ;;
8389 (yes)
8390         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8391
8392         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8393
8394         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8395                 && test -z "${cf_tst_cflags}" \
8396                 && cf_fix_cppflags=no
8397         ;;
8398 esac
8399 done
8400
8401 if test -n "$cf_new_cflags" ; then
8402
8403         CFLAGS="$CFLAGS $cf_new_cflags"
8404 fi
8405
8406 if test -n "$cf_new_cppflags" ; then
8407
8408         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8409 fi
8410
8411 if test -n "$cf_new_extra_cppflags" ; then
8412
8413         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8414 fi
8415
8416 fi
8417
8418         ;;
8419 (netbsd*)
8420         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
8421         ;;
8422 (openbsd[4-9]*)
8423         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
8424         cf_xopen_source="-D_BSD_SOURCE"
8425         cf_XOPEN_SOURCE=600
8426         ;;
8427 (openbsd*)
8428         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
8429         ;;
8430 (osf[45]*)
8431         cf_xopen_source="-D_OSF_SOURCE"
8432         ;;
8433 (nto-qnx*)
8434         cf_xopen_source="-D_QNX_SOURCE"
8435         ;;
8436 (sco*)
8437         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
8438         ;;
8439 (solaris2.*)
8440         cf_xopen_source="-D__EXTENSIONS__"
8441         cf_cv_xopen_source=broken
8442         ;;
8443 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
8444         cf_XOPEN_SOURCE=
8445         cf_POSIX_C_SOURCE=
8446         ;;
8447 (*)
8448
8449 echo "$as_me:8449: checking if we should define _XOPEN_SOURCE" >&5
8450 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8451 if test "${cf_cv_xopen_source+set}" = set; then
8452   echo $ECHO_N "(cached) $ECHO_C" >&6
8453 else
8454
8455         cat >conftest.$ac_ext <<_ACEOF
8456 #line 8456 "configure"
8457 #include "confdefs.h"
8458
8459 #include <stdlib.h>
8460 #include <string.h>
8461 #include <sys/types.h>
8462
8463 int
8464 main ()
8465 {
8466
8467 #ifndef _XOPEN_SOURCE
8468 make an error
8469 #endif
8470   ;
8471   return 0;
8472 }
8473 _ACEOF
8474 rm -f conftest.$ac_objext
8475 if { (eval echo "$as_me:8475: \"$ac_compile\"") >&5
8476   (eval $ac_compile) 2>&5
8477   ac_status=$?
8478   echo "$as_me:8478: \$? = $ac_status" >&5
8479   (exit $ac_status); } &&
8480          { ac_try='test -s conftest.$ac_objext'
8481   { (eval echo "$as_me:8481: \"$ac_try\"") >&5
8482   (eval $ac_try) 2>&5
8483   ac_status=$?
8484   echo "$as_me:8484: \$? = $ac_status" >&5
8485   (exit $ac_status); }; }; then
8486   cf_cv_xopen_source=no
8487 else
8488   echo "$as_me: failed program was:" >&5
8489 cat conftest.$ac_ext >&5
8490 cf_save="$CPPFLAGS"
8491          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8492          cat >conftest.$ac_ext <<_ACEOF
8493 #line 8493 "configure"
8494 #include "confdefs.h"
8495
8496 #include <stdlib.h>
8497 #include <string.h>
8498 #include <sys/types.h>
8499
8500 int
8501 main ()
8502 {
8503
8504 #ifdef _XOPEN_SOURCE
8505 make an error
8506 #endif
8507   ;
8508   return 0;
8509 }
8510 _ACEOF
8511 rm -f conftest.$ac_objext
8512 if { (eval echo "$as_me:8512: \"$ac_compile\"") >&5
8513   (eval $ac_compile) 2>&5
8514   ac_status=$?
8515   echo "$as_me:8515: \$? = $ac_status" >&5
8516   (exit $ac_status); } &&
8517          { ac_try='test -s conftest.$ac_objext'
8518   { (eval echo "$as_me:8518: \"$ac_try\"") >&5
8519   (eval $ac_try) 2>&5
8520   ac_status=$?
8521   echo "$as_me:8521: \$? = $ac_status" >&5
8522   (exit $ac_status); }; }; then
8523   cf_cv_xopen_source=no
8524 else
8525   echo "$as_me: failed program was:" >&5
8526 cat conftest.$ac_ext >&5
8527 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8528 fi
8529 rm -f conftest.$ac_objext conftest.$ac_ext
8530         CPPFLAGS="$cf_save"
8531
8532 fi
8533 rm -f conftest.$ac_objext conftest.$ac_ext
8534
8535 fi
8536 echo "$as_me:8536: result: $cf_cv_xopen_source" >&5
8537 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8538
8539 if test "$cf_cv_xopen_source" != no ; then
8540
8541 CFLAGS=`echo "$CFLAGS" | \
8542         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8543                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8544
8545 CPPFLAGS=`echo "$CPPFLAGS" | \
8546         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8547                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8548
8549         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8550
8551 cf_fix_cppflags=no
8552 cf_new_cflags=
8553 cf_new_cppflags=
8554 cf_new_extra_cppflags=
8555
8556 for cf_add_cflags in $cf_temp_xopen_source
8557 do
8558 case $cf_fix_cppflags in
8559 (no)
8560         case $cf_add_cflags in
8561         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8562                 case $cf_add_cflags in
8563                 (-D*)
8564                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8565
8566                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8567                                 && test -z "${cf_tst_cflags}" \
8568                                 && cf_fix_cppflags=yes
8569
8570                         if test $cf_fix_cppflags = yes ; then
8571                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8572                                 continue
8573                         elif test "${cf_tst_cflags}" = "\"'" ; then
8574                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8575                                 continue
8576                         fi
8577                         ;;
8578                 esac
8579                 case "$CPPFLAGS" in
8580                 (*$cf_add_cflags)
8581                         ;;
8582                 (*)
8583                         case $cf_add_cflags in
8584                         (-D*)
8585                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8586
8587 CPPFLAGS=`echo "$CPPFLAGS" | \
8588         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8589                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8590
8591                                 ;;
8592                         esac
8593                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8594                         ;;
8595                 esac
8596                 ;;
8597         (*)
8598                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8599                 ;;
8600         esac
8601         ;;
8602 (yes)
8603         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8604
8605         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8606
8607         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8608                 && test -z "${cf_tst_cflags}" \
8609                 && cf_fix_cppflags=no
8610         ;;
8611 esac
8612 done
8613
8614 if test -n "$cf_new_cflags" ; then
8615
8616         CFLAGS="$CFLAGS $cf_new_cflags"
8617 fi
8618
8619 if test -n "$cf_new_cppflags" ; then
8620
8621         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8622 fi
8623
8624 if test -n "$cf_new_extra_cppflags" ; then
8625
8626         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8627 fi
8628
8629 fi
8630
8631 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8632
8633 cf_save_CFLAGS="$CFLAGS"
8634 cf_save_CPPFLAGS="$CPPFLAGS"
8635
8636 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8637         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8638                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8639
8640 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8641         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8642                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8643
8644 echo "$as_me:8644: checking if we should define _POSIX_C_SOURCE" >&5
8645 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8646 if test "${cf_cv_posix_c_source+set}" = set; then
8647   echo $ECHO_N "(cached) $ECHO_C" >&6
8648 else
8649
8650 echo "${as_me:-configure}:8650: testing if the symbol is already defined go no further ..." 1>&5
8651
8652         cat >conftest.$ac_ext <<_ACEOF
8653 #line 8653 "configure"
8654 #include "confdefs.h"
8655 #include <sys/types.h>
8656 int
8657 main ()
8658 {
8659
8660 #ifndef _POSIX_C_SOURCE
8661 make an error
8662 #endif
8663   ;
8664   return 0;
8665 }
8666 _ACEOF
8667 rm -f conftest.$ac_objext
8668 if { (eval echo "$as_me:8668: \"$ac_compile\"") >&5
8669   (eval $ac_compile) 2>&5
8670   ac_status=$?
8671   echo "$as_me:8671: \$? = $ac_status" >&5
8672   (exit $ac_status); } &&
8673          { ac_try='test -s conftest.$ac_objext'
8674   { (eval echo "$as_me:8674: \"$ac_try\"") >&5
8675   (eval $ac_try) 2>&5
8676   ac_status=$?
8677   echo "$as_me:8677: \$? = $ac_status" >&5
8678   (exit $ac_status); }; }; then
8679   cf_cv_posix_c_source=no
8680 else
8681   echo "$as_me: failed program was:" >&5
8682 cat conftest.$ac_ext >&5
8683 cf_want_posix_source=no
8684          case .$cf_POSIX_C_SOURCE in
8685          (.[12]??*)
8686                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8687                 ;;
8688          (.2)
8689                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8690                 cf_want_posix_source=yes
8691                 ;;
8692          (.*)
8693                 cf_want_posix_source=yes
8694                 ;;
8695          esac
8696          if test "$cf_want_posix_source" = yes ; then
8697                 cat >conftest.$ac_ext <<_ACEOF
8698 #line 8698 "configure"
8699 #include "confdefs.h"
8700 #include <sys/types.h>
8701 int
8702 main ()
8703 {
8704
8705 #ifdef _POSIX_SOURCE
8706 make an error
8707 #endif
8708   ;
8709   return 0;
8710 }
8711 _ACEOF
8712 rm -f conftest.$ac_objext
8713 if { (eval echo "$as_me:8713: \"$ac_compile\"") >&5
8714   (eval $ac_compile) 2>&5
8715   ac_status=$?
8716   echo "$as_me:8716: \$? = $ac_status" >&5
8717   (exit $ac_status); } &&
8718          { ac_try='test -s conftest.$ac_objext'
8719   { (eval echo "$as_me:8719: \"$ac_try\"") >&5
8720   (eval $ac_try) 2>&5
8721   ac_status=$?
8722   echo "$as_me:8722: \$? = $ac_status" >&5
8723   (exit $ac_status); }; }; then
8724   :
8725 else
8726   echo "$as_me: failed program was:" >&5
8727 cat conftest.$ac_ext >&5
8728 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8729 fi
8730 rm -f conftest.$ac_objext conftest.$ac_ext
8731          fi
8732
8733 echo "${as_me:-configure}:8733: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8734
8735          CFLAGS="$cf_trim_CFLAGS"
8736          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8737
8738 echo "${as_me:-configure}:8738: testing if the second compile does not leave our definition intact error ..." 1>&5
8739
8740          cat >conftest.$ac_ext <<_ACEOF
8741 #line 8741 "configure"
8742 #include "confdefs.h"
8743 #include <sys/types.h>
8744 int
8745 main ()
8746 {
8747
8748 #ifndef _POSIX_C_SOURCE
8749 make an error
8750 #endif
8751   ;
8752   return 0;
8753 }
8754 _ACEOF
8755 rm -f conftest.$ac_objext
8756 if { (eval echo "$as_me:8756: \"$ac_compile\"") >&5
8757   (eval $ac_compile) 2>&5
8758   ac_status=$?
8759   echo "$as_me:8759: \$? = $ac_status" >&5
8760   (exit $ac_status); } &&
8761          { ac_try='test -s conftest.$ac_objext'
8762   { (eval echo "$as_me:8762: \"$ac_try\"") >&5
8763   (eval $ac_try) 2>&5
8764   ac_status=$?
8765   echo "$as_me:8765: \$? = $ac_status" >&5
8766   (exit $ac_status); }; }; then
8767   :
8768 else
8769   echo "$as_me: failed program was:" >&5
8770 cat conftest.$ac_ext >&5
8771 cf_cv_posix_c_source=no
8772 fi
8773 rm -f conftest.$ac_objext conftest.$ac_ext
8774          CFLAGS="$cf_save_CFLAGS"
8775          CPPFLAGS="$cf_save_CPPFLAGS"
8776
8777 fi
8778 rm -f conftest.$ac_objext conftest.$ac_ext
8779
8780 fi
8781 echo "$as_me:8781: result: $cf_cv_posix_c_source" >&5
8782 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8783
8784 if test "$cf_cv_posix_c_source" != no ; then
8785         CFLAGS="$cf_trim_CFLAGS"
8786         CPPFLAGS="$cf_trim_CPPFLAGS"
8787
8788 cf_fix_cppflags=no
8789 cf_new_cflags=
8790 cf_new_cppflags=
8791 cf_new_extra_cppflags=
8792
8793 for cf_add_cflags in $cf_cv_posix_c_source
8794 do
8795 case $cf_fix_cppflags in
8796 (no)
8797         case $cf_add_cflags in
8798         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8799                 case $cf_add_cflags in
8800                 (-D*)
8801                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8802
8803                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8804                                 && test -z "${cf_tst_cflags}" \
8805                                 && cf_fix_cppflags=yes
8806
8807                         if test $cf_fix_cppflags = yes ; then
8808                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8809                                 continue
8810                         elif test "${cf_tst_cflags}" = "\"'" ; then
8811                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8812                                 continue
8813                         fi
8814                         ;;
8815                 esac
8816                 case "$CPPFLAGS" in
8817                 (*$cf_add_cflags)
8818                         ;;
8819                 (*)
8820                         case $cf_add_cflags in
8821                         (-D*)
8822                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8823
8824 CPPFLAGS=`echo "$CPPFLAGS" | \
8825         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8826                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8827
8828                                 ;;
8829                         esac
8830                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8831                         ;;
8832                 esac
8833                 ;;
8834         (*)
8835                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8836                 ;;
8837         esac
8838         ;;
8839 (yes)
8840         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8841
8842         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8843
8844         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8845                 && test -z "${cf_tst_cflags}" \
8846                 && cf_fix_cppflags=no
8847         ;;
8848 esac
8849 done
8850
8851 if test -n "$cf_new_cflags" ; then
8852
8853         CFLAGS="$CFLAGS $cf_new_cflags"
8854 fi
8855
8856 if test -n "$cf_new_cppflags" ; then
8857
8858         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8859 fi
8860
8861 if test -n "$cf_new_extra_cppflags" ; then
8862
8863         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8864 fi
8865
8866 fi
8867
8868         ;;
8869 esac
8870
8871 if test -n "$cf_xopen_source" ; then
8872
8873 cf_fix_cppflags=no
8874 cf_new_cflags=
8875 cf_new_cppflags=
8876 cf_new_extra_cppflags=
8877
8878 for cf_add_cflags in $cf_xopen_source
8879 do
8880 case $cf_fix_cppflags in
8881 (no)
8882         case $cf_add_cflags in
8883         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8884                 case $cf_add_cflags in
8885                 (-D*)
8886                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8887
8888                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8889                                 && test -z "${cf_tst_cflags}" \
8890                                 && cf_fix_cppflags=yes
8891
8892                         if test $cf_fix_cppflags = yes ; then
8893                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8894                                 continue
8895                         elif test "${cf_tst_cflags}" = "\"'" ; then
8896                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8897                                 continue
8898                         fi
8899                         ;;
8900                 esac
8901                 case "$CPPFLAGS" in
8902                 (*$cf_add_cflags)
8903                         ;;
8904                 (*)
8905                         case $cf_add_cflags in
8906                         (-D*)
8907                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8908
8909 CPPFLAGS=`echo "$CPPFLAGS" | \
8910         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8911                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8912
8913                                 ;;
8914                         esac
8915                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8916                         ;;
8917                 esac
8918                 ;;
8919         (*)
8920                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8921                 ;;
8922         esac
8923         ;;
8924 (yes)
8925         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8926
8927         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8928
8929         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8930                 && test -z "${cf_tst_cflags}" \
8931                 && cf_fix_cppflags=no
8932         ;;
8933 esac
8934 done
8935
8936 if test -n "$cf_new_cflags" ; then
8937         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
8938
8939 echo "${as_me:-configure}:8939: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
8940
8941         CFLAGS="$CFLAGS $cf_new_cflags"
8942 fi
8943
8944 if test -n "$cf_new_cppflags" ; then
8945         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
8946
8947 echo "${as_me:-configure}:8947: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
8948
8949         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8950 fi
8951
8952 if test -n "$cf_new_extra_cppflags" ; then
8953         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
8954
8955 echo "${as_me:-configure}:8955: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
8956
8957         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8958 fi
8959
8960 fi
8961
8962 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
8963         echo "$as_me:8963: checking if _XOPEN_SOURCE really is set" >&5
8964 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
8965         cat >conftest.$ac_ext <<_ACEOF
8966 #line 8966 "configure"
8967 #include "confdefs.h"
8968 #include <stdlib.h>
8969 int
8970 main ()
8971 {
8972
8973 #ifndef _XOPEN_SOURCE
8974 make an error
8975 #endif
8976   ;
8977   return 0;
8978 }
8979 _ACEOF
8980 rm -f conftest.$ac_objext
8981 if { (eval echo "$as_me:8981: \"$ac_compile\"") >&5
8982   (eval $ac_compile) 2>&5
8983   ac_status=$?
8984   echo "$as_me:8984: \$? = $ac_status" >&5
8985   (exit $ac_status); } &&
8986          { ac_try='test -s conftest.$ac_objext'
8987   { (eval echo "$as_me:8987: \"$ac_try\"") >&5
8988   (eval $ac_try) 2>&5
8989   ac_status=$?
8990   echo "$as_me:8990: \$? = $ac_status" >&5
8991   (exit $ac_status); }; }; then
8992   cf_XOPEN_SOURCE_set=yes
8993 else
8994   echo "$as_me: failed program was:" >&5
8995 cat conftest.$ac_ext >&5
8996 cf_XOPEN_SOURCE_set=no
8997 fi
8998 rm -f conftest.$ac_objext conftest.$ac_ext
8999         echo "$as_me:8999: result: $cf_XOPEN_SOURCE_set" >&5
9000 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
9001         if test $cf_XOPEN_SOURCE_set = yes
9002         then
9003                 cat >conftest.$ac_ext <<_ACEOF
9004 #line 9004 "configure"
9005 #include "confdefs.h"
9006 #include <stdlib.h>
9007 int
9008 main ()
9009 {
9010
9011 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
9012 make an error
9013 #endif
9014   ;
9015   return 0;
9016 }
9017 _ACEOF
9018 rm -f conftest.$ac_objext
9019 if { (eval echo "$as_me:9019: \"$ac_compile\"") >&5
9020   (eval $ac_compile) 2>&5
9021   ac_status=$?
9022   echo "$as_me:9022: \$? = $ac_status" >&5
9023   (exit $ac_status); } &&
9024          { ac_try='test -s conftest.$ac_objext'
9025   { (eval echo "$as_me:9025: \"$ac_try\"") >&5
9026   (eval $ac_try) 2>&5
9027   ac_status=$?
9028   echo "$as_me:9028: \$? = $ac_status" >&5
9029   (exit $ac_status); }; }; then
9030   cf_XOPEN_SOURCE_set_ok=yes
9031 else
9032   echo "$as_me: failed program was:" >&5
9033 cat conftest.$ac_ext >&5
9034 cf_XOPEN_SOURCE_set_ok=no
9035 fi
9036 rm -f conftest.$ac_objext conftest.$ac_ext
9037                 if test $cf_XOPEN_SOURCE_set_ok = no
9038                 then
9039                         { echo "$as_me:9039: WARNING: _XOPEN_SOURCE is lower than requested" >&5
9040 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
9041                 fi
9042         else
9043
9044 echo "$as_me:9044: checking if we should define _XOPEN_SOURCE" >&5
9045 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
9046 if test "${cf_cv_xopen_source+set}" = set; then
9047   echo $ECHO_N "(cached) $ECHO_C" >&6
9048 else
9049
9050         cat >conftest.$ac_ext <<_ACEOF
9051 #line 9051 "configure"
9052 #include "confdefs.h"
9053
9054 #include <stdlib.h>
9055 #include <string.h>
9056 #include <sys/types.h>
9057
9058 int
9059 main ()
9060 {
9061
9062 #ifndef _XOPEN_SOURCE
9063 make an error
9064 #endif
9065   ;
9066   return 0;
9067 }
9068 _ACEOF
9069 rm -f conftest.$ac_objext
9070 if { (eval echo "$as_me:9070: \"$ac_compile\"") >&5
9071   (eval $ac_compile) 2>&5
9072   ac_status=$?
9073   echo "$as_me:9073: \$? = $ac_status" >&5
9074   (exit $ac_status); } &&
9075          { ac_try='test -s conftest.$ac_objext'
9076   { (eval echo "$as_me:9076: \"$ac_try\"") >&5
9077   (eval $ac_try) 2>&5
9078   ac_status=$?
9079   echo "$as_me:9079: \$? = $ac_status" >&5
9080   (exit $ac_status); }; }; then
9081   cf_cv_xopen_source=no
9082 else
9083   echo "$as_me: failed program was:" >&5
9084 cat conftest.$ac_ext >&5
9085 cf_save="$CPPFLAGS"
9086          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
9087          cat >conftest.$ac_ext <<_ACEOF
9088 #line 9088 "configure"
9089 #include "confdefs.h"
9090
9091 #include <stdlib.h>
9092 #include <string.h>
9093 #include <sys/types.h>
9094
9095 int
9096 main ()
9097 {
9098
9099 #ifdef _XOPEN_SOURCE
9100 make an error
9101 #endif
9102   ;
9103   return 0;
9104 }
9105 _ACEOF
9106 rm -f conftest.$ac_objext
9107 if { (eval echo "$as_me:9107: \"$ac_compile\"") >&5
9108   (eval $ac_compile) 2>&5
9109   ac_status=$?
9110   echo "$as_me:9110: \$? = $ac_status" >&5
9111   (exit $ac_status); } &&
9112          { ac_try='test -s conftest.$ac_objext'
9113   { (eval echo "$as_me:9113: \"$ac_try\"") >&5
9114   (eval $ac_try) 2>&5
9115   ac_status=$?
9116   echo "$as_me:9116: \$? = $ac_status" >&5
9117   (exit $ac_status); }; }; then
9118   cf_cv_xopen_source=no
9119 else
9120   echo "$as_me: failed program was:" >&5
9121 cat conftest.$ac_ext >&5
9122 cf_cv_xopen_source=$cf_XOPEN_SOURCE
9123 fi
9124 rm -f conftest.$ac_objext conftest.$ac_ext
9125         CPPFLAGS="$cf_save"
9126
9127 fi
9128 rm -f conftest.$ac_objext conftest.$ac_ext
9129
9130 fi
9131 echo "$as_me:9131: result: $cf_cv_xopen_source" >&5
9132 echo "${ECHO_T}$cf_cv_xopen_source" >&6
9133
9134 if test "$cf_cv_xopen_source" != no ; then
9135
9136 CFLAGS=`echo "$CFLAGS" | \
9137         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
9138                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
9139
9140 CPPFLAGS=`echo "$CPPFLAGS" | \
9141         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
9142                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
9143
9144         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
9145
9146 cf_fix_cppflags=no
9147 cf_new_cflags=
9148 cf_new_cppflags=
9149 cf_new_extra_cppflags=
9150
9151 for cf_add_cflags in $cf_temp_xopen_source
9152 do
9153 case $cf_fix_cppflags in
9154 (no)
9155         case $cf_add_cflags in
9156         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9157                 case $cf_add_cflags in
9158                 (-D*)
9159                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9160
9161                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9162                                 && test -z "${cf_tst_cflags}" \
9163                                 && cf_fix_cppflags=yes
9164
9165                         if test $cf_fix_cppflags = yes ; then
9166                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9167                                 continue
9168                         elif test "${cf_tst_cflags}" = "\"'" ; then
9169                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9170                                 continue
9171                         fi
9172                         ;;
9173                 esac
9174                 case "$CPPFLAGS" in
9175                 (*$cf_add_cflags)
9176                         ;;
9177                 (*)
9178                         case $cf_add_cflags in
9179                         (-D*)
9180                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9181
9182 CPPFLAGS=`echo "$CPPFLAGS" | \
9183         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9184                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9185
9186                                 ;;
9187                         esac
9188                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9189                         ;;
9190                 esac
9191                 ;;
9192         (*)
9193                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9194                 ;;
9195         esac
9196         ;;
9197 (yes)
9198         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9199
9200         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9201
9202         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9203                 && test -z "${cf_tst_cflags}" \
9204                 && cf_fix_cppflags=no
9205         ;;
9206 esac
9207 done
9208
9209 if test -n "$cf_new_cflags" ; then
9210
9211         CFLAGS="$CFLAGS $cf_new_cflags"
9212 fi
9213
9214 if test -n "$cf_new_cppflags" ; then
9215
9216         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9217 fi
9218
9219 if test -n "$cf_new_extra_cppflags" ; then
9220
9221         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9222 fi
9223
9224 fi
9225
9226         fi
9227 fi
9228
9229 # Check whether --enable-largefile or --disable-largefile was given.
9230 if test "${enable_largefile+set}" = set; then
9231   enableval="$enable_largefile"
9232
9233 fi;
9234 if test "$enable_largefile" != no; then
9235
9236   echo "$as_me:9236: checking for special C compiler options needed for large files" >&5
9237 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
9238 if test "${ac_cv_sys_largefile_CC+set}" = set; then
9239   echo $ECHO_N "(cached) $ECHO_C" >&6
9240 else
9241   ac_cv_sys_largefile_CC=no
9242      if test "$GCC" != yes; then
9243        ac_save_CC=$CC
9244        while :; do
9245          # IRIX 6.2 and later do not support large files by default,
9246          # so use the C compiler's -n32 option if that helps.
9247          cat >conftest.$ac_ext <<_ACEOF
9248 #line 9248 "configure"
9249 #include "confdefs.h"
9250 #include <sys/types.h>
9251  /* Check that off_t can represent 2**63 - 1 correctly.
9252     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9253     since some C++ compilers masquerading as C compilers
9254     incorrectly reject 9223372036854775807.  */
9255 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9256   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9257                        && LARGE_OFF_T % 2147483647 == 1)
9258                       ? 1 : -1];
9259 int
9260 main ()
9261 {
9262
9263   ;
9264   return 0;
9265 }
9266 _ACEOF
9267          rm -f conftest.$ac_objext
9268 if { (eval echo "$as_me:9268: \"$ac_compile\"") >&5
9269   (eval $ac_compile) 2>&5
9270   ac_status=$?
9271   echo "$as_me:9271: \$? = $ac_status" >&5
9272   (exit $ac_status); } &&
9273          { ac_try='test -s conftest.$ac_objext'
9274   { (eval echo "$as_me:9274: \"$ac_try\"") >&5
9275   (eval $ac_try) 2>&5
9276   ac_status=$?
9277   echo "$as_me:9277: \$? = $ac_status" >&5
9278   (exit $ac_status); }; }; then
9279   break
9280 else
9281   echo "$as_me: failed program was:" >&5
9282 cat conftest.$ac_ext >&5
9283 fi
9284 rm -f conftest.$ac_objext
9285          CC="$CC -n32"
9286          rm -f conftest.$ac_objext
9287 if { (eval echo "$as_me:9287: \"$ac_compile\"") >&5
9288   (eval $ac_compile) 2>&5
9289   ac_status=$?
9290   echo "$as_me:9290: \$? = $ac_status" >&5
9291   (exit $ac_status); } &&
9292          { ac_try='test -s conftest.$ac_objext'
9293   { (eval echo "$as_me:9293: \"$ac_try\"") >&5
9294   (eval $ac_try) 2>&5
9295   ac_status=$?
9296   echo "$as_me:9296: \$? = $ac_status" >&5
9297   (exit $ac_status); }; }; then
9298   ac_cv_sys_largefile_CC=' -n32'; break
9299 else
9300   echo "$as_me: failed program was:" >&5
9301 cat conftest.$ac_ext >&5
9302 fi
9303 rm -f conftest.$ac_objext
9304          break
9305        done
9306        CC=$ac_save_CC
9307        rm -f conftest.$ac_ext
9308     fi
9309 fi
9310 echo "$as_me:9310: result: $ac_cv_sys_largefile_CC" >&5
9311 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
9312   if test "$ac_cv_sys_largefile_CC" != no; then
9313     CC=$CC$ac_cv_sys_largefile_CC
9314   fi
9315
9316   echo "$as_me:9316: checking for _FILE_OFFSET_BITS value needed for large files" >&5
9317 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
9318 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
9319   echo $ECHO_N "(cached) $ECHO_C" >&6
9320 else
9321   while :; do
9322   ac_cv_sys_file_offset_bits=no
9323   cat >conftest.$ac_ext <<_ACEOF
9324 #line 9324 "configure"
9325 #include "confdefs.h"
9326 #include <sys/types.h>
9327  /* Check that off_t can represent 2**63 - 1 correctly.
9328     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9329     since some C++ compilers masquerading as C compilers
9330     incorrectly reject 9223372036854775807.  */
9331 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9332   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9333                        && LARGE_OFF_T % 2147483647 == 1)
9334                       ? 1 : -1];
9335 int
9336 main ()
9337 {
9338
9339   ;
9340   return 0;
9341 }
9342 _ACEOF
9343 rm -f conftest.$ac_objext
9344 if { (eval echo "$as_me:9344: \"$ac_compile\"") >&5
9345   (eval $ac_compile) 2>&5
9346   ac_status=$?
9347   echo "$as_me:9347: \$? = $ac_status" >&5
9348   (exit $ac_status); } &&
9349          { ac_try='test -s conftest.$ac_objext'
9350   { (eval echo "$as_me:9350: \"$ac_try\"") >&5
9351   (eval $ac_try) 2>&5
9352   ac_status=$?
9353   echo "$as_me:9353: \$? = $ac_status" >&5
9354   (exit $ac_status); }; }; then
9355   break
9356 else
9357   echo "$as_me: failed program was:" >&5
9358 cat conftest.$ac_ext >&5
9359 fi
9360 rm -f conftest.$ac_objext conftest.$ac_ext
9361   cat >conftest.$ac_ext <<_ACEOF
9362 #line 9362 "configure"
9363 #include "confdefs.h"
9364 #define _FILE_OFFSET_BITS 64
9365 #include <sys/types.h>
9366  /* Check that off_t can represent 2**63 - 1 correctly.
9367     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9368     since some C++ compilers masquerading as C compilers
9369     incorrectly reject 9223372036854775807.  */
9370 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9371   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9372                        && LARGE_OFF_T % 2147483647 == 1)
9373                       ? 1 : -1];
9374 int
9375 main ()
9376 {
9377
9378   ;
9379   return 0;
9380 }
9381 _ACEOF
9382 rm -f conftest.$ac_objext
9383 if { (eval echo "$as_me:9383: \"$ac_compile\"") >&5
9384   (eval $ac_compile) 2>&5
9385   ac_status=$?
9386   echo "$as_me:9386: \$? = $ac_status" >&5
9387   (exit $ac_status); } &&
9388          { ac_try='test -s conftest.$ac_objext'
9389   { (eval echo "$as_me:9389: \"$ac_try\"") >&5
9390   (eval $ac_try) 2>&5
9391   ac_status=$?
9392   echo "$as_me:9392: \$? = $ac_status" >&5
9393   (exit $ac_status); }; }; then
9394   ac_cv_sys_file_offset_bits=64; break
9395 else
9396   echo "$as_me: failed program was:" >&5
9397 cat conftest.$ac_ext >&5
9398 fi
9399 rm -f conftest.$ac_objext conftest.$ac_ext
9400   break
9401 done
9402 fi
9403 echo "$as_me:9403: result: $ac_cv_sys_file_offset_bits" >&5
9404 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
9405 if test "$ac_cv_sys_file_offset_bits" != no; then
9406
9407 cat >>confdefs.h <<EOF
9408 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
9409 EOF
9410
9411 fi
9412 rm -rf conftest*
9413   echo "$as_me:9413: checking for _LARGE_FILES value needed for large files" >&5
9414 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
9415 if test "${ac_cv_sys_large_files+set}" = set; then
9416   echo $ECHO_N "(cached) $ECHO_C" >&6
9417 else
9418   while :; do
9419   ac_cv_sys_large_files=no
9420   cat >conftest.$ac_ext <<_ACEOF
9421 #line 9421 "configure"
9422 #include "confdefs.h"
9423 #include <sys/types.h>
9424  /* Check that off_t can represent 2**63 - 1 correctly.
9425     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9426     since some C++ compilers masquerading as C compilers
9427     incorrectly reject 9223372036854775807.  */
9428 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9429   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9430                        && LARGE_OFF_T % 2147483647 == 1)
9431                       ? 1 : -1];
9432 int
9433 main ()
9434 {
9435
9436   ;
9437   return 0;
9438 }
9439 _ACEOF
9440 rm -f conftest.$ac_objext
9441 if { (eval echo "$as_me:9441: \"$ac_compile\"") >&5
9442   (eval $ac_compile) 2>&5
9443   ac_status=$?
9444   echo "$as_me:9444: \$? = $ac_status" >&5
9445   (exit $ac_status); } &&
9446          { ac_try='test -s conftest.$ac_objext'
9447   { (eval echo "$as_me:9447: \"$ac_try\"") >&5
9448   (eval $ac_try) 2>&5
9449   ac_status=$?
9450   echo "$as_me:9450: \$? = $ac_status" >&5
9451   (exit $ac_status); }; }; then
9452   break
9453 else
9454   echo "$as_me: failed program was:" >&5
9455 cat conftest.$ac_ext >&5
9456 fi
9457 rm -f conftest.$ac_objext conftest.$ac_ext
9458   cat >conftest.$ac_ext <<_ACEOF
9459 #line 9459 "configure"
9460 #include "confdefs.h"
9461 #define _LARGE_FILES 1
9462 #include <sys/types.h>
9463  /* Check that off_t can represent 2**63 - 1 correctly.
9464     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9465     since some C++ compilers masquerading as C compilers
9466     incorrectly reject 9223372036854775807.  */
9467 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9468   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9469                        && LARGE_OFF_T % 2147483647 == 1)
9470                       ? 1 : -1];
9471 int
9472 main ()
9473 {
9474
9475   ;
9476   return 0;
9477 }
9478 _ACEOF
9479 rm -f conftest.$ac_objext
9480 if { (eval echo "$as_me:9480: \"$ac_compile\"") >&5
9481   (eval $ac_compile) 2>&5
9482   ac_status=$?
9483   echo "$as_me:9483: \$? = $ac_status" >&5
9484   (exit $ac_status); } &&
9485          { ac_try='test -s conftest.$ac_objext'
9486   { (eval echo "$as_me:9486: \"$ac_try\"") >&5
9487   (eval $ac_try) 2>&5
9488   ac_status=$?
9489   echo "$as_me:9489: \$? = $ac_status" >&5
9490   (exit $ac_status); }; }; then
9491   ac_cv_sys_large_files=1; break
9492 else
9493   echo "$as_me: failed program was:" >&5
9494 cat conftest.$ac_ext >&5
9495 fi
9496 rm -f conftest.$ac_objext conftest.$ac_ext
9497   break
9498 done
9499 fi
9500 echo "$as_me:9500: result: $ac_cv_sys_large_files" >&5
9501 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
9502 if test "$ac_cv_sys_large_files" != no; then
9503
9504 cat >>confdefs.h <<EOF
9505 #define _LARGE_FILES $ac_cv_sys_large_files
9506 EOF
9507
9508 fi
9509 rm -rf conftest*
9510 fi
9511
9512         if test "$enable_largefile" != no ; then
9513         echo "$as_me:9513: checking for _LARGEFILE_SOURCE value needed for large files" >&5
9514 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
9515 if test "${ac_cv_sys_largefile_source+set}" = set; then
9516   echo $ECHO_N "(cached) $ECHO_C" >&6
9517 else
9518   while :; do
9519   ac_cv_sys_largefile_source=no
9520   cat >conftest.$ac_ext <<_ACEOF
9521 #line 9521 "configure"
9522 #include "confdefs.h"
9523 #include <stdio.h>
9524 int
9525 main ()
9526 {
9527 return !fseeko;
9528   ;
9529   return 0;
9530 }
9531 _ACEOF
9532 rm -f conftest.$ac_objext
9533 if { (eval echo "$as_me:9533: \"$ac_compile\"") >&5
9534   (eval $ac_compile) 2>&5
9535   ac_status=$?
9536   echo "$as_me:9536: \$? = $ac_status" >&5
9537   (exit $ac_status); } &&
9538          { ac_try='test -s conftest.$ac_objext'
9539   { (eval echo "$as_me:9539: \"$ac_try\"") >&5
9540   (eval $ac_try) 2>&5
9541   ac_status=$?
9542   echo "$as_me:9542: \$? = $ac_status" >&5
9543   (exit $ac_status); }; }; then
9544   break
9545 else
9546   echo "$as_me: failed program was:" >&5
9547 cat conftest.$ac_ext >&5
9548 fi
9549 rm -f conftest.$ac_objext conftest.$ac_ext
9550   cat >conftest.$ac_ext <<_ACEOF
9551 #line 9551 "configure"
9552 #include "confdefs.h"
9553 #define _LARGEFILE_SOURCE 1
9554 #include <stdio.h>
9555 int
9556 main ()
9557 {
9558 return !fseeko;
9559   ;
9560   return 0;
9561 }
9562 _ACEOF
9563 rm -f conftest.$ac_objext
9564 if { (eval echo "$as_me:9564: \"$ac_compile\"") >&5
9565   (eval $ac_compile) 2>&5
9566   ac_status=$?
9567   echo "$as_me:9567: \$? = $ac_status" >&5
9568   (exit $ac_status); } &&
9569          { ac_try='test -s conftest.$ac_objext'
9570   { (eval echo "$as_me:9570: \"$ac_try\"") >&5
9571   (eval $ac_try) 2>&5
9572   ac_status=$?
9573   echo "$as_me:9573: \$? = $ac_status" >&5
9574   (exit $ac_status); }; }; then
9575   ac_cv_sys_largefile_source=1; break
9576 else
9577   echo "$as_me: failed program was:" >&5
9578 cat conftest.$ac_ext >&5
9579 fi
9580 rm -f conftest.$ac_objext conftest.$ac_ext
9581   break
9582 done
9583 fi
9584 echo "$as_me:9584: result: $ac_cv_sys_largefile_source" >&5
9585 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
9586 if test "$ac_cv_sys_largefile_source" != no; then
9587
9588 cat >>confdefs.h <<EOF
9589 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
9590 EOF
9591
9592 fi
9593 rm -rf conftest*
9594
9595 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
9596 # in glibc 2.1.3, but that breaks too many other things.
9597 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
9598 echo "$as_me:9598: checking for fseeko" >&5
9599 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
9600 if test "${ac_cv_func_fseeko+set}" = set; then
9601   echo $ECHO_N "(cached) $ECHO_C" >&6
9602 else
9603   cat >conftest.$ac_ext <<_ACEOF
9604 #line 9604 "configure"
9605 #include "confdefs.h"
9606 #include <stdio.h>
9607 int
9608 main ()
9609 {
9610 return fseeko && fseeko (stdin, 0, 0);
9611   ;
9612   return 0;
9613 }
9614 _ACEOF
9615 rm -f conftest.$ac_objext conftest$ac_exeext
9616 if { (eval echo "$as_me:9616: \"$ac_link\"") >&5
9617   (eval $ac_link) 2>&5
9618   ac_status=$?
9619   echo "$as_me:9619: \$? = $ac_status" >&5
9620   (exit $ac_status); } &&
9621          { ac_try='test -s conftest$ac_exeext'
9622   { (eval echo "$as_me:9622: \"$ac_try\"") >&5
9623   (eval $ac_try) 2>&5
9624   ac_status=$?
9625   echo "$as_me:9625: \$? = $ac_status" >&5
9626   (exit $ac_status); }; }; then
9627   ac_cv_func_fseeko=yes
9628 else
9629   echo "$as_me: failed program was:" >&5
9630 cat conftest.$ac_ext >&5
9631 ac_cv_func_fseeko=no
9632 fi
9633 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9634 fi
9635 echo "$as_me:9635: result: $ac_cv_func_fseeko" >&5
9636 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
9637 if test $ac_cv_func_fseeko = yes; then
9638
9639 cat >>confdefs.h <<\EOF
9640 #define HAVE_FSEEKO 1
9641 EOF
9642
9643 fi
9644
9645         # Normally we would collect these definitions in the config.h,
9646         # but (like _XOPEN_SOURCE), some environments rely on having these
9647         # defined before any of the system headers are included.  Another
9648         # case comes up with C++, e.g., on AIX the compiler compiles the
9649         # header files by themselves before looking at the body files it is
9650         # told to compile.  For ncurses, those header files do not include
9651         # the config.h
9652         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
9653         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
9654         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
9655
9656         echo "$as_me:9656: checking whether to use struct dirent64" >&5
9657 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
9658 if test "${cf_cv_struct_dirent64+set}" = set; then
9659   echo $ECHO_N "(cached) $ECHO_C" >&6
9660 else
9661
9662                 cat >conftest.$ac_ext <<_ACEOF
9663 #line 9663 "configure"
9664 #include "confdefs.h"
9665
9666 #include <sys/types.h>
9667 #include <dirent.h>
9668
9669 int
9670 main ()
9671 {
9672
9673                 /* if transitional largefile support is setup, this is true */
9674                 extern struct dirent64 * readdir(DIR *);
9675                 struct dirent64 *x = readdir((DIR *)0);
9676                 struct dirent *y = readdir((DIR *)0);
9677                 int z = x - y;
9678
9679   ;
9680   return 0;
9681 }
9682 _ACEOF
9683 rm -f conftest.$ac_objext
9684 if { (eval echo "$as_me:9684: \"$ac_compile\"") >&5
9685   (eval $ac_compile) 2>&5
9686   ac_status=$?
9687   echo "$as_me:9687: \$? = $ac_status" >&5
9688   (exit $ac_status); } &&
9689          { ac_try='test -s conftest.$ac_objext'
9690   { (eval echo "$as_me:9690: \"$ac_try\"") >&5
9691   (eval $ac_try) 2>&5
9692   ac_status=$?
9693   echo "$as_me:9693: \$? = $ac_status" >&5
9694   (exit $ac_status); }; }; then
9695   cf_cv_struct_dirent64=yes
9696 else
9697   echo "$as_me: failed program was:" >&5
9698 cat conftest.$ac_ext >&5
9699 cf_cv_struct_dirent64=no
9700 fi
9701 rm -f conftest.$ac_objext conftest.$ac_ext
9702
9703 fi
9704 echo "$as_me:9704: result: $cf_cv_struct_dirent64" >&5
9705 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
9706         test "$cf_cv_struct_dirent64" = yes &&
9707 cat >>confdefs.h <<\EOF
9708 #define HAVE_STRUCT_DIRENT64 1
9709 EOF
9710
9711         fi
9712
9713 ### Enable compiling-in rcs id's
9714 echo "$as_me:9714: checking if RCS identifiers should be compiled-in" >&5
9715 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
9716
9717 # Check whether --with-rcs-ids or --without-rcs-ids was given.
9718 if test "${with_rcs_ids+set}" = set; then
9719   withval="$with_rcs_ids"
9720   with_rcs_ids=$withval
9721 else
9722   with_rcs_ids=no
9723 fi;
9724 echo "$as_me:9724: result: $with_rcs_ids" >&5
9725 echo "${ECHO_T}$with_rcs_ids" >&6
9726 test "$with_rcs_ids" = yes &&
9727 cat >>confdefs.h <<\EOF
9728 #define USE_RCS_IDS 1
9729 EOF
9730
9731 ###############################################################################
9732
9733 ### Note that some functions (such as const) are normally disabled anyway.
9734 echo "$as_me:9734: checking if you want to build with function extensions" >&5
9735 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
9736
9737 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
9738 if test "${enable_ext_funcs+set}" = set; then
9739   enableval="$enable_ext_funcs"
9740   with_ext_funcs=$enableval
9741 else
9742   with_ext_funcs=yes
9743 fi;
9744 echo "$as_me:9744: result: $with_ext_funcs" >&5
9745 echo "${ECHO_T}$with_ext_funcs" >&6
9746 if test "$with_ext_funcs" = yes ; then
9747         NCURSES_EXT_FUNCS=1
9748
9749 cat >>confdefs.h <<\EOF
9750 #define HAVE_USE_DEFAULT_COLORS 1
9751 EOF
9752
9753 cat >>confdefs.h <<\EOF
9754 #define NCURSES_EXT_FUNCS 1
9755 EOF
9756
9757 else
9758         NCURSES_EXT_FUNCS=0
9759 fi
9760
9761 ###   use option --enable-const to turn on use of const beyond that in XSI.
9762 echo "$as_me:9762: checking for extended use of const keyword" >&5
9763 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
9764
9765 # Check whether --enable-const or --disable-const was given.
9766 if test "${enable_const+set}" = set; then
9767   enableval="$enable_const"
9768   with_ext_const=$enableval
9769 else
9770   with_ext_const=no
9771 fi;
9772 echo "$as_me:9772: result: $with_ext_const" >&5
9773 echo "${ECHO_T}$with_ext_const" >&6
9774 NCURSES_CONST='/*nothing*/'
9775 if test "$with_ext_const" = yes ; then
9776         NCURSES_CONST=const
9777 fi
9778
9779 ###############################################################################
9780 # These options are relatively safe to experiment with.
9781
9782 echo "$as_me:9782: checking if you want all development code" >&5
9783 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
9784
9785 # Check whether --with-develop or --without-develop was given.
9786 if test "${with_develop+set}" = set; then
9787   withval="$with_develop"
9788   with_develop=$withval
9789 else
9790   with_develop=no
9791 fi;
9792 echo "$as_me:9792: result: $with_develop" >&5
9793 echo "${ECHO_T}$with_develop" >&6
9794
9795 ###############################################################################
9796 # These are just experimental, probably should not be in a package:
9797
9798 # This is still experimental (20080329), but should ultimately be moved to
9799 # the script-block --with-normal, etc.
9800
9801 echo "$as_me:9801: checking if you want to link with the pthread library" >&5
9802 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
9803
9804 # Check whether --with-pthread or --without-pthread was given.
9805 if test "${with_pthread+set}" = set; then
9806   withval="$with_pthread"
9807   with_pthread=$withval
9808 else
9809   with_pthread=no
9810 fi;
9811 echo "$as_me:9811: result: $with_pthread" >&5
9812 echo "${ECHO_T}$with_pthread" >&6
9813
9814 if test "$with_pthread" != no ; then
9815         echo "$as_me:9815: checking for pthread.h" >&5
9816 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
9817 if test "${ac_cv_header_pthread_h+set}" = set; then
9818   echo $ECHO_N "(cached) $ECHO_C" >&6
9819 else
9820   cat >conftest.$ac_ext <<_ACEOF
9821 #line 9821 "configure"
9822 #include "confdefs.h"
9823 #include <pthread.h>
9824 _ACEOF
9825 if { (eval echo "$as_me:9825: \"$ac_cpp conftest.$ac_ext\"") >&5
9826   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9827   ac_status=$?
9828   egrep -v '^ *\+' conftest.er1 >conftest.err
9829   rm -f conftest.er1
9830   cat conftest.err >&5
9831   echo "$as_me:9831: \$? = $ac_status" >&5
9832   (exit $ac_status); } >/dev/null; then
9833   if test -s conftest.err; then
9834     ac_cpp_err=$ac_c_preproc_warn_flag
9835   else
9836     ac_cpp_err=
9837   fi
9838 else
9839   ac_cpp_err=yes
9840 fi
9841 if test -z "$ac_cpp_err"; then
9842   ac_cv_header_pthread_h=yes
9843 else
9844   echo "$as_me: failed program was:" >&5
9845   cat conftest.$ac_ext >&5
9846   ac_cv_header_pthread_h=no
9847 fi
9848 rm -f conftest.err conftest.$ac_ext
9849 fi
9850 echo "$as_me:9850: result: $ac_cv_header_pthread_h" >&5
9851 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
9852 if test $ac_cv_header_pthread_h = yes; then
9853
9854 cat >>confdefs.h <<\EOF
9855 #define HAVE_PTHREADS_H 1
9856 EOF
9857
9858         for cf_lib_pthread in pthread c_r
9859         do
9860             echo "$as_me:9860: checking if we can link with the $cf_lib_pthread library" >&5
9861 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
9862             cf_save_LIBS="$LIBS"
9863
9864 cf_add_libs="-l$cf_lib_pthread"
9865 # Filter out duplicates - this happens with badly-designed ".pc" files...
9866 for cf_add_1lib in $LIBS
9867 do
9868         for cf_add_2lib in $cf_add_libs
9869         do
9870                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9871                 then
9872                         cf_add_1lib=
9873                         break
9874                 fi
9875         done
9876         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9877 done
9878 LIBS="$cf_add_libs"
9879
9880             cat >conftest.$ac_ext <<_ACEOF
9881 #line 9881 "configure"
9882 #include "confdefs.h"
9883
9884 #include <pthread.h>
9885
9886 int
9887 main ()
9888 {
9889
9890                 int rc = pthread_create(0,0,0,0);
9891                 int r2 = pthread_mutexattr_settype(0, 0);
9892
9893   ;
9894   return 0;
9895 }
9896 _ACEOF
9897 rm -f conftest.$ac_objext conftest$ac_exeext
9898 if { (eval echo "$as_me:9898: \"$ac_link\"") >&5
9899   (eval $ac_link) 2>&5
9900   ac_status=$?
9901   echo "$as_me:9901: \$? = $ac_status" >&5
9902   (exit $ac_status); } &&
9903          { ac_try='test -s conftest$ac_exeext'
9904   { (eval echo "$as_me:9904: \"$ac_try\"") >&5
9905   (eval $ac_try) 2>&5
9906   ac_status=$?
9907   echo "$as_me:9907: \$? = $ac_status" >&5
9908   (exit $ac_status); }; }; then
9909   with_pthread=yes
9910 else
9911   echo "$as_me: failed program was:" >&5
9912 cat conftest.$ac_ext >&5
9913 with_pthread=no
9914 fi
9915 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9916             LIBS="$cf_save_LIBS"
9917             echo "$as_me:9917: result: $with_pthread" >&5
9918 echo "${ECHO_T}$with_pthread" >&6
9919             test "$with_pthread" = yes && break
9920         done
9921
9922         if test "$with_pthread" = yes ; then
9923
9924 cf_add_libs="-l$cf_lib_pthread"
9925 # Filter out duplicates - this happens with badly-designed ".pc" files...
9926 for cf_add_1lib in $LIBS
9927 do
9928         for cf_add_2lib in $cf_add_libs
9929         do
9930                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9931                 then
9932                         cf_add_1lib=
9933                         break
9934                 fi
9935         done
9936         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9937 done
9938 LIBS="$cf_add_libs"
9939
9940 cat >>confdefs.h <<\EOF
9941 #define HAVE_LIBPTHREADS 1
9942 EOF
9943
9944         else
9945             { { echo "$as_me:9945: error: Cannot link with pthread library" >&5
9946 echo "$as_me: error: Cannot link with pthread library" >&2;}
9947    { (exit 1); exit 1; }; }
9948         fi
9949
9950 fi
9951
9952 fi
9953
9954 echo "$as_me:9954: checking if you want to use weak-symbols for pthreads" >&5
9955 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
9956
9957 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
9958 if test "${enable_weak_symbols+set}" = set; then
9959   enableval="$enable_weak_symbols"
9960   use_weak_symbols=$withval
9961 else
9962   use_weak_symbols=no
9963 fi;
9964 echo "$as_me:9964: result: $use_weak_symbols" >&5
9965 echo "${ECHO_T}$use_weak_symbols" >&6
9966 if test "$use_weak_symbols" = yes ; then
9967
9968 echo "$as_me:9968: checking if $CC supports weak symbols" >&5
9969 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9970 if test "${cf_cv_weak_symbols+set}" = set; then
9971   echo $ECHO_N "(cached) $ECHO_C" >&6
9972 else
9973
9974 cat >conftest.$ac_ext <<_ACEOF
9975 #line 9975 "configure"
9976 #include "confdefs.h"
9977
9978 #include <stdio.h>
9979 int
9980 main ()
9981 {
9982
9983 #if defined(__GNUC__)
9984 #  if defined __USE_ISOC99
9985 #    define _cat_pragma(exp)    _Pragma(#exp)
9986 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9987 #  else
9988 #    define _weak_pragma(exp)
9989 #  endif
9990 #  define _declare(name)        __extension__ extern __typeof__(name) name
9991 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9992 #endif
9993
9994 weak_symbol(fopen);
9995
9996   ;
9997   return 0;
9998 }
9999 _ACEOF
10000 rm -f conftest.$ac_objext
10001 if { (eval echo "$as_me:10001: \"$ac_compile\"") >&5
10002   (eval $ac_compile) 2>&5
10003   ac_status=$?
10004   echo "$as_me:10004: \$? = $ac_status" >&5
10005   (exit $ac_status); } &&
10006          { ac_try='test -s conftest.$ac_objext'
10007   { (eval echo "$as_me:10007: \"$ac_try\"") >&5
10008   (eval $ac_try) 2>&5
10009   ac_status=$?
10010   echo "$as_me:10010: \$? = $ac_status" >&5
10011   (exit $ac_status); }; }; then
10012   cf_cv_weak_symbols=yes
10013 else
10014   echo "$as_me: failed program was:" >&5
10015 cat conftest.$ac_ext >&5
10016 cf_cv_weak_symbols=no
10017 fi
10018 rm -f conftest.$ac_objext conftest.$ac_ext
10019
10020 fi
10021 echo "$as_me:10021: result: $cf_cv_weak_symbols" >&5
10022 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
10023
10024 else
10025         cf_cv_weak_symbols=no
10026 fi
10027
10028 if test $cf_cv_weak_symbols = yes ; then
10029
10030 cat >>confdefs.h <<\EOF
10031 #define USE_WEAK_SYMBOLS 1
10032 EOF
10033
10034 fi
10035
10036 PTHREAD=
10037 if test "$with_pthread" = "yes" ; then
10038
10039 cat >>confdefs.h <<\EOF
10040 #define USE_PTHREADS 1
10041 EOF
10042
10043         enable_reentrant=yes
10044         if test $cf_cv_weak_symbols = yes ; then
10045                 PTHREAD=-lpthread
10046         fi
10047 fi
10048
10049 # OpenSUSE is installing ncurses6, using reentrant option.
10050 echo "$as_me:10050: checking for _nc_TABSIZE" >&5
10051 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
10052 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
10053   echo $ECHO_N "(cached) $ECHO_C" >&6
10054 else
10055   cat >conftest.$ac_ext <<_ACEOF
10056 #line 10056 "configure"
10057 #include "confdefs.h"
10058 /* System header to define __stub macros and hopefully few prototypes,
10059     which can conflict with char _nc_TABSIZE (); below.  */
10060 #include <assert.h>
10061 /* Override any gcc2 internal prototype to avoid an error.  */
10062 #ifdef __cplusplus
10063 extern "C"
10064 #endif
10065 /* We use char because int might match the return type of a gcc2
10066    builtin and then its argument prototype would still apply.  */
10067 char _nc_TABSIZE ();
10068 char (*f) ();
10069
10070 int
10071 main ()
10072 {
10073 /* The GNU C library defines this for functions which it implements
10074     to always fail with ENOSYS.  Some functions are actually named
10075     something starting with __ and the normal name is an alias.  */
10076 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
10077 choke me
10078 #else
10079 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10080 #endif
10081
10082   ;
10083   return 0;
10084 }
10085 _ACEOF
10086 rm -f conftest.$ac_objext conftest$ac_exeext
10087 if { (eval echo "$as_me:10087: \"$ac_link\"") >&5
10088   (eval $ac_link) 2>&5
10089   ac_status=$?
10090   echo "$as_me:10090: \$? = $ac_status" >&5
10091   (exit $ac_status); } &&
10092          { ac_try='test -s conftest$ac_exeext'
10093   { (eval echo "$as_me:10093: \"$ac_try\"") >&5
10094   (eval $ac_try) 2>&5
10095   ac_status=$?
10096   echo "$as_me:10096: \$? = $ac_status" >&5
10097   (exit $ac_status); }; }; then
10098   ac_cv_func__nc_TABSIZE=yes
10099 else
10100   echo "$as_me: failed program was:" >&5
10101 cat conftest.$ac_ext >&5
10102 ac_cv_func__nc_TABSIZE=no
10103 fi
10104 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10105 fi
10106 echo "$as_me:10106: result: $ac_cv_func__nc_TABSIZE" >&5
10107 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
10108 if test $ac_cv_func__nc_TABSIZE = yes; then
10109   assume_reentrant=yes
10110 else
10111   assume_reentrant=no
10112 fi
10113
10114 # Reentrant code has to be opaque; there's little advantage to making ncurses
10115 # opaque outside of that, so there is no --enable-opaque option.  We can use
10116 # this option without --with-pthreads, but this will be always set for
10117 # pthreads.
10118 echo "$as_me:10118: checking if you want experimental reentrant code" >&5
10119 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
10120
10121 # Check whether --enable-reentrant or --disable-reentrant was given.
10122 if test "${enable_reentrant+set}" = set; then
10123   enableval="$enable_reentrant"
10124   with_reentrant=$enableval
10125 else
10126   with_reentrant=$assume_reentrant
10127 fi;
10128 echo "$as_me:10128: result: $with_reentrant" >&5
10129 echo "${ECHO_T}$with_reentrant" >&6
10130 if test "$with_reentrant" = yes ; then
10131         cf_cv_enable_reentrant=1
10132         if test $cf_cv_weak_symbols = yes ; then
10133
10134 # remove pthread library from $LIBS
10135 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
10136
10137         elif test "$assume_reentrant" = no ; then
10138                 LIB_SUFFIX="t${LIB_SUFFIX}"
10139         fi
10140
10141 cat >>confdefs.h <<\EOF
10142 #define USE_REENTRANT 1
10143 EOF
10144
10145 else
10146         cf_cv_enable_reentrant=0
10147 fi
10148
10149 ### Allow using a different wrap-prefix
10150 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
10151         echo "$as_me:10151: checking for prefix used to wrap public variables" >&5
10152 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
10153
10154 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
10155 if test "${with_wrap_prefix+set}" = set; then
10156   withval="$with_wrap_prefix"
10157   NCURSES_WRAP_PREFIX=$withval
10158 else
10159   NCURSES_WRAP_PREFIX=_nc_
10160 fi;
10161         echo "$as_me:10161: result: $NCURSES_WRAP_PREFIX" >&5
10162 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
10163 else
10164         NCURSES_WRAP_PREFIX=_nc_
10165 fi
10166
10167 cat >>confdefs.h <<EOF
10168 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
10169 EOF
10170
10171 ###############################################################################
10172
10173 ###     use option --disable-echo to suppress full display compiling commands
10174
10175 echo "$as_me:10175: checking if you want to see long compiling messages" >&5
10176 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
10177
10178 # Check whether --enable-echo or --disable-echo was given.
10179 if test "${enable_echo+set}" = set; then
10180   enableval="$enable_echo"
10181   test "$enableval" != no && enableval=yes
10182   if test "$enableval" != "yes" ; then
10183
10184         ECHO_LT='--silent'
10185         ECHO_LD='@echo linking $@;'
10186         RULE_CC='@echo compiling $<'
10187         SHOW_CC='@echo compiling $@'
10188         ECHO_CC='@'
10189
10190   else
10191
10192         ECHO_LT=''
10193         ECHO_LD=''
10194         RULE_CC=''
10195         SHOW_CC=''
10196         ECHO_CC=''
10197
10198   fi
10199 else
10200   enableval=yes
10201
10202         ECHO_LT=''
10203         ECHO_LD=''
10204         RULE_CC=''
10205         SHOW_CC=''
10206         ECHO_CC=''
10207
10208 fi;
10209 echo "$as_me:10209: result: $enableval" >&5
10210 echo "${ECHO_T}$enableval" >&6
10211
10212 ###     use option --enable-warnings to turn on all gcc warnings
10213 echo "$as_me:10213: checking if you want to see compiler warnings" >&5
10214 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
10215
10216 # Check whether --enable-warnings or --disable-warnings was given.
10217 if test "${enable_warnings+set}" = set; then
10218   enableval="$enable_warnings"
10219   with_warnings=$enableval
10220 fi;
10221 echo "$as_me:10221: result: $with_warnings" >&5
10222 echo "${ECHO_T}$with_warnings" >&6
10223
10224 if test "x$with_warnings" = "xyes"; then
10225
10226         ADAFLAGS="$ADAFLAGS -gnatg"
10227
10228 INTEL_COMPILER=no
10229
10230 if test "$GCC" = yes ; then
10231         case $host_os in
10232         (linux*|gnu*)
10233                 echo "$as_me:10233: checking if this is really Intel C compiler" >&5
10234 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
10235                 cf_save_CFLAGS="$CFLAGS"
10236                 CFLAGS="$CFLAGS -no-gcc"
10237                 cat >conftest.$ac_ext <<_ACEOF
10238 #line 10238 "configure"
10239 #include "confdefs.h"
10240
10241 int
10242 main ()
10243 {
10244
10245 #ifdef __INTEL_COMPILER
10246 #else
10247 make an error
10248 #endif
10249
10250   ;
10251   return 0;
10252 }
10253 _ACEOF
10254 rm -f conftest.$ac_objext
10255 if { (eval echo "$as_me:10255: \"$ac_compile\"") >&5
10256   (eval $ac_compile) 2>&5
10257   ac_status=$?
10258   echo "$as_me:10258: \$? = $ac_status" >&5
10259   (exit $ac_status); } &&
10260          { ac_try='test -s conftest.$ac_objext'
10261   { (eval echo "$as_me:10261: \"$ac_try\"") >&5
10262   (eval $ac_try) 2>&5
10263   ac_status=$?
10264   echo "$as_me:10264: \$? = $ac_status" >&5
10265   (exit $ac_status); }; }; then
10266   INTEL_COMPILER=yes
10267 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
10268
10269 else
10270   echo "$as_me: failed program was:" >&5
10271 cat conftest.$ac_ext >&5
10272 fi
10273 rm -f conftest.$ac_objext conftest.$ac_ext
10274                 CFLAGS="$cf_save_CFLAGS"
10275                 echo "$as_me:10275: result: $INTEL_COMPILER" >&5
10276 echo "${ECHO_T}$INTEL_COMPILER" >&6
10277                 ;;
10278         esac
10279 fi
10280
10281 CLANG_COMPILER=no
10282
10283 if test "$GCC" = yes ; then
10284         echo "$as_me:10284: checking if this is really Clang C compiler" >&5
10285 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
10286         cf_save_CFLAGS="$CFLAGS"
10287         CFLAGS="$CFLAGS -Qunused-arguments"
10288         cat >conftest.$ac_ext <<_ACEOF
10289 #line 10289 "configure"
10290 #include "confdefs.h"
10291
10292 int
10293 main ()
10294 {
10295
10296 #ifdef __clang__
10297 #else
10298 make an error
10299 #endif
10300
10301   ;
10302   return 0;
10303 }
10304 _ACEOF
10305 rm -f conftest.$ac_objext
10306 if { (eval echo "$as_me:10306: \"$ac_compile\"") >&5
10307   (eval $ac_compile) 2>&5
10308   ac_status=$?
10309   echo "$as_me:10309: \$? = $ac_status" >&5
10310   (exit $ac_status); } &&
10311          { ac_try='test -s conftest.$ac_objext'
10312   { (eval echo "$as_me:10312: \"$ac_try\"") >&5
10313   (eval $ac_try) 2>&5
10314   ac_status=$?
10315   echo "$as_me:10315: \$? = $ac_status" >&5
10316   (exit $ac_status); }; }; then
10317   CLANG_COMPILER=yes
10318 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
10319
10320 else
10321   echo "$as_me: failed program was:" >&5
10322 cat conftest.$ac_ext >&5
10323 fi
10324 rm -f conftest.$ac_objext conftest.$ac_ext
10325         CFLAGS="$cf_save_CFLAGS"
10326         echo "$as_me:10326: result: $CLANG_COMPILER" >&5
10327 echo "${ECHO_T}$CLANG_COMPILER" >&6
10328 fi
10329
10330 cat > conftest.$ac_ext <<EOF
10331 #line 10331 "${as_me:-configure}"
10332 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
10333 EOF
10334
10335 if test "$INTEL_COMPILER" = yes
10336 then
10337 # The "-wdXXX" options suppress warnings:
10338 # remark #1419: external declaration in primary source file
10339 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
10340 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
10341 # remark #193: zero used for undefined preprocessing identifier
10342 # remark #593: variable "curs_sb_left_arrow" was set but never used
10343 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
10344 # remark #869: parameter "tw" was never referenced
10345 # remark #981: operands are evaluated in unspecified order
10346 # warning #279: controlling expression is constant
10347
10348         { echo "$as_me:10348: checking for $CC warning options..." >&5
10349 echo "$as_me: checking for $CC warning options..." >&6;}
10350         cf_save_CFLAGS="$CFLAGS"
10351         EXTRA_CFLAGS="-Wall"
10352         for cf_opt in \
10353                 wd1419 \
10354                 wd1683 \
10355                 wd1684 \
10356                 wd193 \
10357                 wd593 \
10358                 wd279 \
10359                 wd810 \
10360                 wd869 \
10361                 wd981
10362         do
10363                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10364                 if { (eval echo "$as_me:10364: \"$ac_compile\"") >&5
10365   (eval $ac_compile) 2>&5
10366   ac_status=$?
10367   echo "$as_me:10367: \$? = $ac_status" >&5
10368   (exit $ac_status); }; then
10369                         test -n "$verbose" && echo "$as_me:10369: result: ... -$cf_opt" >&5
10370 echo "${ECHO_T}... -$cf_opt" >&6
10371                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10372                 fi
10373         done
10374         CFLAGS="$cf_save_CFLAGS"
10375
10376 elif test "$GCC" = yes
10377 then
10378         { echo "$as_me:10378: checking for $CC warning options..." >&5
10379 echo "$as_me: checking for $CC warning options..." >&6;}
10380         cf_save_CFLAGS="$CFLAGS"
10381         EXTRA_CFLAGS=
10382         cf_warn_CONST=""
10383         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
10384         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
10385         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
10386         for cf_opt in W Wall \
10387                 Wbad-function-cast \
10388                 Wcast-align \
10389                 Wcast-qual \
10390                 Wdeclaration-after-statement \
10391                 Wextra \
10392                 Winline \
10393                 Wmissing-declarations \
10394                 Wmissing-prototypes \
10395                 Wnested-externs \
10396                 Wpointer-arith \
10397                 Wshadow \
10398                 Wstrict-prototypes \
10399                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
10400         do
10401                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10402                 if { (eval echo "$as_me:10402: \"$ac_compile\"") >&5
10403   (eval $ac_compile) 2>&5
10404   ac_status=$?
10405   echo "$as_me:10405: \$? = $ac_status" >&5
10406   (exit $ac_status); }; then
10407                         test -n "$verbose" && echo "$as_me:10407: result: ... -$cf_opt" >&5
10408 echo "${ECHO_T}... -$cf_opt" >&6
10409                         case $cf_opt in
10410                         (Wcast-qual)
10411                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
10412                                 ;;
10413                         (Winline)
10414                                 case $GCC_VERSION in
10415                                 ([34].*)
10416                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10417
10418 echo "${as_me:-configure}:10418: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10419
10420                                         continue;;
10421                                 esac
10422                                 ;;
10423                         (Wpointer-arith)
10424                                 case $GCC_VERSION in
10425                                 ([12].*)
10426                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10427
10428 echo "${as_me:-configure}:10428: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10429
10430                                         continue;;
10431                                 esac
10432                                 ;;
10433                         esac
10434                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10435                 fi
10436         done
10437         CFLAGS="$cf_save_CFLAGS"
10438 fi
10439 rm -rf conftest*
10440
10441 fi
10442
10443 if test "$GCC" = yes
10444 then
10445 cat > conftest.i <<EOF
10446 #ifndef GCC_PRINTF
10447 #define GCC_PRINTF 0
10448 #endif
10449 #ifndef GCC_SCANF
10450 #define GCC_SCANF 0
10451 #endif
10452 #ifndef GCC_NORETURN
10453 #define GCC_NORETURN /* nothing */
10454 #endif
10455 #ifndef GCC_UNUSED
10456 #define GCC_UNUSED /* nothing */
10457 #endif
10458 EOF
10459 if test "$GCC" = yes
10460 then
10461         { echo "$as_me:10461: checking for $CC __attribute__ directives..." >&5
10462 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
10463 cat > conftest.$ac_ext <<EOF
10464 #line 10464 "${as_me:-configure}"
10465 #include "confdefs.h"
10466 #include "conftest.h"
10467 #include "conftest.i"
10468 #if     GCC_PRINTF
10469 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
10470 #else
10471 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
10472 #endif
10473 #if     GCC_SCANF
10474 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
10475 #else
10476 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
10477 #endif
10478 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
10479 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
10480 extern void foo(void) GCC_NORETURN;
10481 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
10482 EOF
10483         cf_printf_attribute=no
10484         cf_scanf_attribute=no
10485         for cf_attribute in scanf printf unused noreturn
10486         do
10487
10488 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10489
10490                 cf_directive="__attribute__(($cf_attribute))"
10491                 echo "checking for $CC $cf_directive" 1>&5
10492
10493                 case $cf_attribute in
10494                 (printf)
10495                         cf_printf_attribute=yes
10496                         cat >conftest.h <<EOF
10497 #define GCC_$cf_ATTRIBUTE 1
10498 EOF
10499                         ;;
10500                 (scanf)
10501                         cf_scanf_attribute=yes
10502                         cat >conftest.h <<EOF
10503 #define GCC_$cf_ATTRIBUTE 1
10504 EOF
10505                         ;;
10506                 (*)
10507                         cat >conftest.h <<EOF
10508 #define GCC_$cf_ATTRIBUTE $cf_directive
10509 EOF
10510                         ;;
10511                 esac
10512
10513                 if { (eval echo "$as_me:10513: \"$ac_compile\"") >&5
10514   (eval $ac_compile) 2>&5
10515   ac_status=$?
10516   echo "$as_me:10516: \$? = $ac_status" >&5
10517   (exit $ac_status); }; then
10518                         test -n "$verbose" && echo "$as_me:10518: result: ... $cf_attribute" >&5
10519 echo "${ECHO_T}... $cf_attribute" >&6
10520                         cat conftest.h >>confdefs.h
10521                         case $cf_attribute in
10522                         (noreturn)
10523
10524 cat >>confdefs.h <<EOF
10525 #define GCC_NORETURN $cf_directive
10526 EOF
10527
10528                                 ;;
10529                         (printf)
10530                                 cf_value='/* nothing */'
10531                                 if test "$cf_printf_attribute" != no ; then
10532                                         cf_value='__attribute__((format(printf,fmt,var)))'
10533
10534 cat >>confdefs.h <<\EOF
10535 #define GCC_PRINTF 1
10536 EOF
10537
10538                                 fi
10539
10540 cat >>confdefs.h <<EOF
10541 #define GCC_PRINTFLIKE(fmt,var) $cf_value
10542 EOF
10543
10544                                 ;;
10545                         (scanf)
10546                                 cf_value='/* nothing */'
10547                                 if test "$cf_scanf_attribute" != no ; then
10548                                         cf_value='__attribute__((format(scanf,fmt,var)))'
10549
10550 cat >>confdefs.h <<\EOF
10551 #define GCC_SCANF 1
10552 EOF
10553
10554                                 fi
10555
10556 cat >>confdefs.h <<EOF
10557 #define GCC_SCANFLIKE(fmt,var) $cf_value
10558 EOF
10559
10560                                 ;;
10561                         (unused)
10562
10563 cat >>confdefs.h <<EOF
10564 #define GCC_UNUSED $cf_directive
10565 EOF
10566
10567                                 ;;
10568                         esac
10569                 fi
10570         done
10571 else
10572         fgrep define conftest.i >>confdefs.h
10573 fi
10574 rm -rf conftest*
10575 fi
10576
10577 ###     use option --enable-assertions to turn on generation of assertion code
10578 echo "$as_me:10578: checking if you want to enable runtime assertions" >&5
10579 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
10580
10581 # Check whether --enable-assertions or --disable-assertions was given.
10582 if test "${enable_assertions+set}" = set; then
10583   enableval="$enable_assertions"
10584   with_assertions=$enableval
10585 else
10586   with_assertions=no
10587 fi;
10588 echo "$as_me:10588: result: $with_assertions" >&5
10589 echo "${ECHO_T}$with_assertions" >&6
10590 if test -n "$GCC"
10591 then
10592         if test "$with_assertions" = no
10593         then
10594                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
10595         else
10596
10597         ADAFLAGS="$ADAFLAGS -gnata"
10598
10599         fi
10600 fi
10601
10602 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
10603
10604 cat >>confdefs.h <<\EOF
10605 #define HAVE_NC_ALLOC_H 1
10606 EOF
10607
10608 ###     use option --enable-expanded to generate certain macros as functions
10609
10610 # Check whether --enable-expanded or --disable-expanded was given.
10611 if test "${enable_expanded+set}" = set; then
10612   enableval="$enable_expanded"
10613   test "$enableval" = yes &&
10614 cat >>confdefs.h <<\EOF
10615 #define NCURSES_EXPANDED 1
10616 EOF
10617
10618 fi;
10619
10620 ###     use option --disable-macros to suppress macros in favor of functions
10621
10622 # Check whether --enable-macros or --disable-macros was given.
10623 if test "${enable_macros+set}" = set; then
10624   enableval="$enable_macros"
10625   test "$enableval" = no &&
10626 cat >>confdefs.h <<\EOF
10627 #define NCURSES_NOMACROS 1
10628 EOF
10629
10630 fi;
10631
10632 # Normally we only add trace() to the debug-library.  Allow this to be
10633 # extended to all models of the ncurses library:
10634 cf_all_traces=no
10635 case "$CFLAGS $CPPFLAGS" in
10636 (*-DTRACE*)
10637         cf_all_traces=yes
10638         ;;
10639 esac
10640
10641 echo "$as_me:10641: checking whether to add trace feature to all models" >&5
10642 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
10643
10644 # Check whether --with-trace or --without-trace was given.
10645 if test "${with_trace+set}" = set; then
10646   withval="$with_trace"
10647   cf_with_trace=$withval
10648 else
10649   cf_with_trace=$cf_all_traces
10650 fi;
10651 echo "$as_me:10651: result: $cf_with_trace" >&5
10652 echo "${ECHO_T}$cf_with_trace" >&6
10653
10654 if test "$cf_with_trace" = yes ; then
10655         ADA_TRACE=TRUE
10656
10657 cf_fix_cppflags=no
10658 cf_new_cflags=
10659 cf_new_cppflags=
10660 cf_new_extra_cppflags=
10661
10662 for cf_add_cflags in -DTRACE
10663 do
10664 case $cf_fix_cppflags in
10665 (no)
10666         case $cf_add_cflags in
10667         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10668                 case $cf_add_cflags in
10669                 (-D*)
10670                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10671
10672                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10673                                 && test -z "${cf_tst_cflags}" \
10674                                 && cf_fix_cppflags=yes
10675
10676                         if test $cf_fix_cppflags = yes ; then
10677                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10678                                 continue
10679                         elif test "${cf_tst_cflags}" = "\"'" ; then
10680                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10681                                 continue
10682                         fi
10683                         ;;
10684                 esac
10685                 case "$CPPFLAGS" in
10686                 (*$cf_add_cflags)
10687                         ;;
10688                 (*)
10689                         case $cf_add_cflags in
10690                         (-D*)
10691                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10692
10693 CPPFLAGS=`echo "$CPPFLAGS" | \
10694         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10695                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10696
10697                                 ;;
10698                         esac
10699                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10700                         ;;
10701                 esac
10702                 ;;
10703         (*)
10704                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10705                 ;;
10706         esac
10707         ;;
10708 (yes)
10709         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10710
10711         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10712
10713         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10714                 && test -z "${cf_tst_cflags}" \
10715                 && cf_fix_cppflags=no
10716         ;;
10717 esac
10718 done
10719
10720 if test -n "$cf_new_cflags" ; then
10721
10722         CFLAGS="$CFLAGS $cf_new_cflags"
10723 fi
10724
10725 if test -n "$cf_new_cppflags" ; then
10726
10727         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10728 fi
10729
10730 if test -n "$cf_new_extra_cppflags" ; then
10731
10732         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10733 fi
10734
10735 else
10736         ADA_TRACE=FALSE
10737 fi
10738
10739 echo "$as_me:10739: checking if we want to use GNAT projects" >&5
10740 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
10741
10742 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
10743 if test "${enable_gnat_projects+set}" = set; then
10744   enableval="$enable_gnat_projects"
10745   test "$enableval" != no && enableval=yes
10746   if test "$enableval" != "yes" ; then
10747     enable_gnat_projects=no
10748   else
10749     enable_gnat_projects=yes
10750   fi
10751 else
10752   enableval=yes
10753   enable_gnat_projects=yes
10754
10755 fi;
10756 echo "$as_me:10756: result: $enable_gnat_projects" >&5
10757 echo "${ECHO_T}$enable_gnat_projects" >&6
10758
10759 ###     Checks for libraries.
10760 case $cf_cv_system_name in
10761 (*mingw32*)
10762         ;;
10763 (*)
10764 echo "$as_me:10764: checking for gettimeofday" >&5
10765 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
10766 if test "${ac_cv_func_gettimeofday+set}" = set; then
10767   echo $ECHO_N "(cached) $ECHO_C" >&6
10768 else
10769   cat >conftest.$ac_ext <<_ACEOF
10770 #line 10770 "configure"
10771 #include "confdefs.h"
10772 /* System header to define __stub macros and hopefully few prototypes,
10773     which can conflict with char gettimeofday (); below.  */
10774 #include <assert.h>
10775 /* Override any gcc2 internal prototype to avoid an error.  */
10776 #ifdef __cplusplus
10777 extern "C"
10778 #endif
10779 /* We use char because int might match the return type of a gcc2
10780    builtin and then its argument prototype would still apply.  */
10781 char gettimeofday ();
10782 char (*f) ();
10783
10784 int
10785 main ()
10786 {
10787 /* The GNU C library defines this for functions which it implements
10788     to always fail with ENOSYS.  Some functions are actually named
10789     something starting with __ and the normal name is an alias.  */
10790 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
10791 choke me
10792 #else
10793 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10794 #endif
10795
10796   ;
10797   return 0;
10798 }
10799 _ACEOF
10800 rm -f conftest.$ac_objext conftest$ac_exeext
10801 if { (eval echo "$as_me:10801: \"$ac_link\"") >&5
10802   (eval $ac_link) 2>&5
10803   ac_status=$?
10804   echo "$as_me:10804: \$? = $ac_status" >&5
10805   (exit $ac_status); } &&
10806          { ac_try='test -s conftest$ac_exeext'
10807   { (eval echo "$as_me:10807: \"$ac_try\"") >&5
10808   (eval $ac_try) 2>&5
10809   ac_status=$?
10810   echo "$as_me:10810: \$? = $ac_status" >&5
10811   (exit $ac_status); }; }; then
10812   ac_cv_func_gettimeofday=yes
10813 else
10814   echo "$as_me: failed program was:" >&5
10815 cat conftest.$ac_ext >&5
10816 ac_cv_func_gettimeofday=no
10817 fi
10818 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10819 fi
10820 echo "$as_me:10820: result: $ac_cv_func_gettimeofday" >&5
10821 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
10822 if test $ac_cv_func_gettimeofday = yes; then
10823   cat >>confdefs.h <<\EOF
10824 #define HAVE_GETTIMEOFDAY 1
10825 EOF
10826
10827 else
10828
10829 echo "$as_me:10829: checking for gettimeofday in -lbsd" >&5
10830 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
10831 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
10832   echo $ECHO_N "(cached) $ECHO_C" >&6
10833 else
10834   ac_check_lib_save_LIBS=$LIBS
10835 LIBS="-lbsd  $LIBS"
10836 cat >conftest.$ac_ext <<_ACEOF
10837 #line 10837 "configure"
10838 #include "confdefs.h"
10839
10840 /* Override any gcc2 internal prototype to avoid an error.  */
10841 #ifdef __cplusplus
10842 extern "C"
10843 #endif
10844 /* We use char because int might match the return type of a gcc2
10845    builtin and then its argument prototype would still apply.  */
10846 char gettimeofday ();
10847 int
10848 main ()
10849 {
10850 gettimeofday ();
10851   ;
10852   return 0;
10853 }
10854 _ACEOF
10855 rm -f conftest.$ac_objext conftest$ac_exeext
10856 if { (eval echo "$as_me:10856: \"$ac_link\"") >&5
10857   (eval $ac_link) 2>&5
10858   ac_status=$?
10859   echo "$as_me:10859: \$? = $ac_status" >&5
10860   (exit $ac_status); } &&
10861          { ac_try='test -s conftest$ac_exeext'
10862   { (eval echo "$as_me:10862: \"$ac_try\"") >&5
10863   (eval $ac_try) 2>&5
10864   ac_status=$?
10865   echo "$as_me:10865: \$? = $ac_status" >&5
10866   (exit $ac_status); }; }; then
10867   ac_cv_lib_bsd_gettimeofday=yes
10868 else
10869   echo "$as_me: failed program was:" >&5
10870 cat conftest.$ac_ext >&5
10871 ac_cv_lib_bsd_gettimeofday=no
10872 fi
10873 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10874 LIBS=$ac_check_lib_save_LIBS
10875 fi
10876 echo "$as_me:10876: result: $ac_cv_lib_bsd_gettimeofday" >&5
10877 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
10878 if test $ac_cv_lib_bsd_gettimeofday = yes; then
10879
10880 cat >>confdefs.h <<\EOF
10881 #define HAVE_GETTIMEOFDAY 1
10882 EOF
10883
10884         LIBS="$LIBS -lbsd"
10885 fi
10886
10887 fi
10888         ;;
10889 esac
10890
10891 ###     Checks for header files.
10892 echo "$as_me:10892: checking for ANSI C header files" >&5
10893 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10894 if test "${ac_cv_header_stdc+set}" = set; then
10895   echo $ECHO_N "(cached) $ECHO_C" >&6
10896 else
10897   cat >conftest.$ac_ext <<_ACEOF
10898 #line 10898 "configure"
10899 #include "confdefs.h"
10900 #include <stdlib.h>
10901 #include <stdarg.h>
10902 #include <string.h>
10903 #include <float.h>
10904
10905 _ACEOF
10906 if { (eval echo "$as_me:10906: \"$ac_cpp conftest.$ac_ext\"") >&5
10907   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10908   ac_status=$?
10909   egrep -v '^ *\+' conftest.er1 >conftest.err
10910   rm -f conftest.er1
10911   cat conftest.err >&5
10912   echo "$as_me:10912: \$? = $ac_status" >&5
10913   (exit $ac_status); } >/dev/null; then
10914   if test -s conftest.err; then
10915     ac_cpp_err=$ac_c_preproc_warn_flag
10916   else
10917     ac_cpp_err=
10918   fi
10919 else
10920   ac_cpp_err=yes
10921 fi
10922 if test -z "$ac_cpp_err"; then
10923   ac_cv_header_stdc=yes
10924 else
10925   echo "$as_me: failed program was:" >&5
10926   cat conftest.$ac_ext >&5
10927   ac_cv_header_stdc=no
10928 fi
10929 rm -f conftest.err conftest.$ac_ext
10930
10931 if test $ac_cv_header_stdc = yes; then
10932   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10933   cat >conftest.$ac_ext <<_ACEOF
10934 #line 10934 "configure"
10935 #include "confdefs.h"
10936 #include <string.h>
10937
10938 _ACEOF
10939 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10940   egrep "memchr" >/dev/null 2>&1; then
10941   :
10942 else
10943   ac_cv_header_stdc=no
10944 fi
10945 rm -rf conftest*
10946
10947 fi
10948
10949 if test $ac_cv_header_stdc = yes; then
10950   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10951   cat >conftest.$ac_ext <<_ACEOF
10952 #line 10952 "configure"
10953 #include "confdefs.h"
10954 #include <stdlib.h>
10955
10956 _ACEOF
10957 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10958   egrep "free" >/dev/null 2>&1; then
10959   :
10960 else
10961   ac_cv_header_stdc=no
10962 fi
10963 rm -rf conftest*
10964
10965 fi
10966
10967 if test $ac_cv_header_stdc = yes; then
10968   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10969   if test "$cross_compiling" = yes; then
10970   :
10971 else
10972   cat >conftest.$ac_ext <<_ACEOF
10973 #line 10973 "configure"
10974 #include "confdefs.h"
10975 #include <ctype.h>
10976 #if ((' ' & 0x0FF) == 0x020)
10977 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10978 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10979 #else
10980 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
10981                      || ('j' <= (c) && (c) <= 'r') \
10982                      || ('s' <= (c) && (c) <= 'z'))
10983 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10984 #endif
10985
10986 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10987 int
10988 main ()
10989 {
10990   int i;
10991   for (i = 0; i < 256; i++)
10992     if (XOR (islower (i), ISLOWER (i))
10993         || toupper (i) != TOUPPER (i))
10994       $ac_main_return(2);
10995   $ac_main_return (0);
10996 }
10997 _ACEOF
10998 rm -f conftest$ac_exeext
10999 if { (eval echo "$as_me:10999: \"$ac_link\"") >&5
11000   (eval $ac_link) 2>&5
11001   ac_status=$?
11002   echo "$as_me:11002: \$? = $ac_status" >&5
11003   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11004   { (eval echo "$as_me:11004: \"$ac_try\"") >&5
11005   (eval $ac_try) 2>&5
11006   ac_status=$?
11007   echo "$as_me:11007: \$? = $ac_status" >&5
11008   (exit $ac_status); }; }; then
11009   :
11010 else
11011   echo "$as_me: program exited with status $ac_status" >&5
11012 echo "$as_me: failed program was:" >&5
11013 cat conftest.$ac_ext >&5
11014 ac_cv_header_stdc=no
11015 fi
11016 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11017 fi
11018 fi
11019 fi
11020 echo "$as_me:11020: result: $ac_cv_header_stdc" >&5
11021 echo "${ECHO_T}$ac_cv_header_stdc" >&6
11022 if test $ac_cv_header_stdc = yes; then
11023
11024 cat >>confdefs.h <<\EOF
11025 #define STDC_HEADERS 1
11026 EOF
11027
11028 fi
11029
11030 ac_header_dirent=no
11031 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
11032   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
11033 echo "$as_me:11033: checking for $ac_hdr that defines DIR" >&5
11034 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
11035 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11036   echo $ECHO_N "(cached) $ECHO_C" >&6
11037 else
11038   cat >conftest.$ac_ext <<_ACEOF
11039 #line 11039 "configure"
11040 #include "confdefs.h"
11041 #include <sys/types.h>
11042 #include <$ac_hdr>
11043
11044 int
11045 main ()
11046 {
11047 if ((DIR *) 0)
11048 return 0;
11049   ;
11050   return 0;
11051 }
11052 _ACEOF
11053 rm -f conftest.$ac_objext
11054 if { (eval echo "$as_me:11054: \"$ac_compile\"") >&5
11055   (eval $ac_compile) 2>&5
11056   ac_status=$?
11057   echo "$as_me:11057: \$? = $ac_status" >&5
11058   (exit $ac_status); } &&
11059          { ac_try='test -s conftest.$ac_objext'
11060   { (eval echo "$as_me:11060: \"$ac_try\"") >&5
11061   (eval $ac_try) 2>&5
11062   ac_status=$?
11063   echo "$as_me:11063: \$? = $ac_status" >&5
11064   (exit $ac_status); }; }; then
11065   eval "$as_ac_Header=yes"
11066 else
11067   echo "$as_me: failed program was:" >&5
11068 cat conftest.$ac_ext >&5
11069 eval "$as_ac_Header=no"
11070 fi
11071 rm -f conftest.$ac_objext conftest.$ac_ext
11072 fi
11073 echo "$as_me:11073: result: `eval echo '${'$as_ac_Header'}'`" >&5
11074 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
11075 if test `eval echo '${'$as_ac_Header'}'` = yes; then
11076   cat >>confdefs.h <<EOF
11077 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
11078 EOF
11079
11080 ac_header_dirent=$ac_hdr; break
11081 fi
11082
11083 done
11084 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
11085 if test $ac_header_dirent = dirent.h; then
11086   echo "$as_me:11086: checking for opendir in -ldir" >&5
11087 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
11088 if test "${ac_cv_lib_dir_opendir+set}" = set; then
11089   echo $ECHO_N "(cached) $ECHO_C" >&6
11090 else
11091   ac_check_lib_save_LIBS=$LIBS
11092 LIBS="-ldir  $LIBS"
11093 cat >conftest.$ac_ext <<_ACEOF
11094 #line 11094 "configure"
11095 #include "confdefs.h"
11096
11097 /* Override any gcc2 internal prototype to avoid an error.  */
11098 #ifdef __cplusplus
11099 extern "C"
11100 #endif
11101 /* We use char because int might match the return type of a gcc2
11102    builtin and then its argument prototype would still apply.  */
11103 char opendir ();
11104 int
11105 main ()
11106 {
11107 opendir ();
11108   ;
11109   return 0;
11110 }
11111 _ACEOF
11112 rm -f conftest.$ac_objext conftest$ac_exeext
11113 if { (eval echo "$as_me:11113: \"$ac_link\"") >&5
11114   (eval $ac_link) 2>&5
11115   ac_status=$?
11116   echo "$as_me:11116: \$? = $ac_status" >&5
11117   (exit $ac_status); } &&
11118          { ac_try='test -s conftest$ac_exeext'
11119   { (eval echo "$as_me:11119: \"$ac_try\"") >&5
11120   (eval $ac_try) 2>&5
11121   ac_status=$?
11122   echo "$as_me:11122: \$? = $ac_status" >&5
11123   (exit $ac_status); }; }; then
11124   ac_cv_lib_dir_opendir=yes
11125 else
11126   echo "$as_me: failed program was:" >&5
11127 cat conftest.$ac_ext >&5
11128 ac_cv_lib_dir_opendir=no
11129 fi
11130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11131 LIBS=$ac_check_lib_save_LIBS
11132 fi
11133 echo "$as_me:11133: result: $ac_cv_lib_dir_opendir" >&5
11134 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
11135 if test $ac_cv_lib_dir_opendir = yes; then
11136   LIBS="$LIBS -ldir"
11137 fi
11138
11139 else
11140   echo "$as_me:11140: checking for opendir in -lx" >&5
11141 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
11142 if test "${ac_cv_lib_x_opendir+set}" = set; then
11143   echo $ECHO_N "(cached) $ECHO_C" >&6
11144 else
11145   ac_check_lib_save_LIBS=$LIBS
11146 LIBS="-lx  $LIBS"
11147 cat >conftest.$ac_ext <<_ACEOF
11148 #line 11148 "configure"
11149 #include "confdefs.h"
11150
11151 /* Override any gcc2 internal prototype to avoid an error.  */
11152 #ifdef __cplusplus
11153 extern "C"
11154 #endif
11155 /* We use char because int might match the return type of a gcc2
11156    builtin and then its argument prototype would still apply.  */
11157 char opendir ();
11158 int
11159 main ()
11160 {
11161 opendir ();
11162   ;
11163   return 0;
11164 }
11165 _ACEOF
11166 rm -f conftest.$ac_objext conftest$ac_exeext
11167 if { (eval echo "$as_me:11167: \"$ac_link\"") >&5
11168   (eval $ac_link) 2>&5
11169   ac_status=$?
11170   echo "$as_me:11170: \$? = $ac_status" >&5
11171   (exit $ac_status); } &&
11172          { ac_try='test -s conftest$ac_exeext'
11173   { (eval echo "$as_me:11173: \"$ac_try\"") >&5
11174   (eval $ac_try) 2>&5
11175   ac_status=$?
11176   echo "$as_me:11176: \$? = $ac_status" >&5
11177   (exit $ac_status); }; }; then
11178   ac_cv_lib_x_opendir=yes
11179 else
11180   echo "$as_me: failed program was:" >&5
11181 cat conftest.$ac_ext >&5
11182 ac_cv_lib_x_opendir=no
11183 fi
11184 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11185 LIBS=$ac_check_lib_save_LIBS
11186 fi
11187 echo "$as_me:11187: result: $ac_cv_lib_x_opendir" >&5
11188 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
11189 if test $ac_cv_lib_x_opendir = yes; then
11190   LIBS="$LIBS -lx"
11191 fi
11192
11193 fi
11194
11195 echo "$as_me:11195: checking whether time.h and sys/time.h may both be included" >&5
11196 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
11197 if test "${ac_cv_header_time+set}" = set; then
11198   echo $ECHO_N "(cached) $ECHO_C" >&6
11199 else
11200   cat >conftest.$ac_ext <<_ACEOF
11201 #line 11201 "configure"
11202 #include "confdefs.h"
11203 #include <sys/types.h>
11204 #include <sys/time.h>
11205 #include <time.h>
11206
11207 int
11208 main ()
11209 {
11210 if ((struct tm *) 0)
11211 return 0;
11212   ;
11213   return 0;
11214 }
11215 _ACEOF
11216 rm -f conftest.$ac_objext
11217 if { (eval echo "$as_me:11217: \"$ac_compile\"") >&5
11218   (eval $ac_compile) 2>&5
11219   ac_status=$?
11220   echo "$as_me:11220: \$? = $ac_status" >&5
11221   (exit $ac_status); } &&
11222          { ac_try='test -s conftest.$ac_objext'
11223   { (eval echo "$as_me:11223: \"$ac_try\"") >&5
11224   (eval $ac_try) 2>&5
11225   ac_status=$?
11226   echo "$as_me:11226: \$? = $ac_status" >&5
11227   (exit $ac_status); }; }; then
11228   ac_cv_header_time=yes
11229 else
11230   echo "$as_me: failed program was:" >&5
11231 cat conftest.$ac_ext >&5
11232 ac_cv_header_time=no
11233 fi
11234 rm -f conftest.$ac_objext conftest.$ac_ext
11235 fi
11236 echo "$as_me:11236: result: $ac_cv_header_time" >&5
11237 echo "${ECHO_T}$ac_cv_header_time" >&6
11238 if test $ac_cv_header_time = yes; then
11239
11240 cat >>confdefs.h <<\EOF
11241 #define TIME_WITH_SYS_TIME 1
11242 EOF
11243
11244 fi
11245
11246 ###     checks for compiler characteristics
11247 ac_ext=c
11248 ac_cpp='$CPP $CPPFLAGS'
11249 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11250 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11251 ac_compiler_gnu=$ac_cv_c_compiler_gnu
11252 ac_main_return=return
11253
11254 echo "$as_me:11254: checking for an ANSI C-conforming const" >&5
11255 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
11256 if test "${ac_cv_c_const+set}" = set; then
11257   echo $ECHO_N "(cached) $ECHO_C" >&6
11258 else
11259   cat >conftest.$ac_ext <<_ACEOF
11260 #line 11260 "configure"
11261 #include "confdefs.h"
11262
11263 int
11264 main ()
11265 {
11266 /* FIXME: Include the comments suggested by Paul. */
11267 #ifndef __cplusplus
11268   /* Ultrix mips cc rejects this.  */
11269   typedef int charset[2];
11270   const charset x;
11271   /* SunOS 4.1.1 cc rejects this.  */
11272   char const *const *ccp;
11273   char **p;
11274   /* NEC SVR4.0.2 mips cc rejects this.  */
11275   struct point {int x, y;};
11276   static struct point const zero = {0,0};
11277   /* AIX XL C 1.02.0.0 rejects this.
11278      It does not let you subtract one const X* pointer from another in
11279      an arm of an if-expression whose if-part is not a constant
11280      expression */
11281   const char *g = "string";
11282   ccp = &g + (g ? g-g : 0);
11283   /* HPUX 7.0 cc rejects these. */
11284   ++ccp;
11285   p = (char**) ccp;
11286   ccp = (char const *const *) p;
11287   { /* SCO 3.2v4 cc rejects this.  */
11288     char *t;
11289     char const *s = 0 ? (char *) 0 : (char const *) 0;
11290
11291     *t++ = 0;
11292   }
11293   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
11294     int x[] = {25, 17};
11295     const int *foo = &x[0];
11296     ++foo;
11297   }
11298   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
11299     typedef const int *iptr;
11300     iptr p = 0;
11301     ++p;
11302   }
11303   { /* AIX XL C 1.02.0.0 rejects this saying
11304        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
11305     struct s { int j; const int *ap[3]; };
11306     struct s *b; b->j = 5;
11307   }
11308   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
11309     const int foo = 10;
11310   }
11311 #endif
11312
11313   ;
11314   return 0;
11315 }
11316 _ACEOF
11317 rm -f conftest.$ac_objext
11318 if { (eval echo "$as_me:11318: \"$ac_compile\"") >&5
11319   (eval $ac_compile) 2>&5
11320   ac_status=$?
11321   echo "$as_me:11321: \$? = $ac_status" >&5
11322   (exit $ac_status); } &&
11323          { ac_try='test -s conftest.$ac_objext'
11324   { (eval echo "$as_me:11324: \"$ac_try\"") >&5
11325   (eval $ac_try) 2>&5
11326   ac_status=$?
11327   echo "$as_me:11327: \$? = $ac_status" >&5
11328   (exit $ac_status); }; }; then
11329   ac_cv_c_const=yes
11330 else
11331   echo "$as_me: failed program was:" >&5
11332 cat conftest.$ac_ext >&5
11333 ac_cv_c_const=no
11334 fi
11335 rm -f conftest.$ac_objext conftest.$ac_ext
11336 fi
11337 echo "$as_me:11337: result: $ac_cv_c_const" >&5
11338 echo "${ECHO_T}$ac_cv_c_const" >&6
11339 if test $ac_cv_c_const = no; then
11340
11341 cat >>confdefs.h <<\EOF
11342 #define const
11343 EOF
11344
11345 fi
11346
11347 ###     Checks for external-data
11348
11349 echo "$as_me:11349: checking if data-only library module links" >&5
11350 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
11351 if test "${cf_cv_link_dataonly+set}" = set; then
11352   echo $ECHO_N "(cached) $ECHO_C" >&6
11353 else
11354
11355         rm -f conftest.a
11356         cat >conftest.$ac_ext <<EOF
11357 #line 11357 "configure"
11358 int     testdata[3] = { 123, 456, 789 };
11359 EOF
11360         if { (eval echo "$as_me:11360: \"$ac_compile\"") >&5
11361   (eval $ac_compile) 2>&5
11362   ac_status=$?
11363   echo "$as_me:11363: \$? = $ac_status" >&5
11364   (exit $ac_status); } ; then
11365                 mv conftest.o data.o && \
11366                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
11367         fi
11368         rm -f conftest.$ac_ext data.o
11369         cat >conftest.$ac_ext <<EOF
11370 #line 11370 "configure"
11371 int     testfunc()
11372 {
11373 #if defined(NeXT)
11374         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
11375 #else
11376         extern int testdata[3];
11377         return testdata[0] == 123
11378            &&  testdata[1] == 456
11379            &&  testdata[2] == 789;
11380 #endif
11381 }
11382 EOF
11383         if { (eval echo "$as_me:11383: \"$ac_compile\"") >&5
11384   (eval $ac_compile) 2>&5
11385   ac_status=$?
11386   echo "$as_me:11386: \$? = $ac_status" >&5
11387   (exit $ac_status); }; then
11388                 mv conftest.o func.o && \
11389                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
11390         fi
11391         rm -f conftest.$ac_ext func.o
11392         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
11393         cf_saveLIBS="$LIBS"
11394         LIBS="conftest.a $LIBS"
11395         if test "$cross_compiling" = yes; then
11396   cf_cv_link_dataonly=unknown
11397 else
11398   cat >conftest.$ac_ext <<_ACEOF
11399 #line 11399 "configure"
11400 #include "confdefs.h"
11401
11402         int main()
11403         {
11404                 extern int testfunc();
11405                 ${cf_cv_main_return:-return} (!testfunc());
11406         }
11407
11408 _ACEOF
11409 rm -f conftest$ac_exeext
11410 if { (eval echo "$as_me:11410: \"$ac_link\"") >&5
11411   (eval $ac_link) 2>&5
11412   ac_status=$?
11413   echo "$as_me:11413: \$? = $ac_status" >&5
11414   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11415   { (eval echo "$as_me:11415: \"$ac_try\"") >&5
11416   (eval $ac_try) 2>&5
11417   ac_status=$?
11418   echo "$as_me:11418: \$? = $ac_status" >&5
11419   (exit $ac_status); }; }; then
11420   cf_cv_link_dataonly=yes
11421 else
11422   echo "$as_me: program exited with status $ac_status" >&5
11423 echo "$as_me: failed program was:" >&5
11424 cat conftest.$ac_ext >&5
11425 cf_cv_link_dataonly=no
11426 fi
11427 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11428 fi
11429         LIBS="$cf_saveLIBS"
11430
11431 fi
11432
11433 echo "$as_me:11433: result: $cf_cv_link_dataonly" >&5
11434 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
11435
11436 if test "$cf_cv_link_dataonly" = no ; then
11437
11438 cat >>confdefs.h <<\EOF
11439 #define BROKEN_LINKER 1
11440 EOF
11441
11442         BROKEN_LINKER=1
11443 fi
11444
11445 ###     Checks for library functions.
11446
11447 echo "$as_me:11447: checking for working mkstemp" >&5
11448 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
11449 if test "${cf_cv_func_mkstemp+set}" = set; then
11450   echo $ECHO_N "(cached) $ECHO_C" >&6
11451 else
11452
11453 rm -rf conftest*
11454 if test "$cross_compiling" = yes; then
11455   cf_cv_func_mkstemp=maybe
11456 else
11457   cat >conftest.$ac_ext <<_ACEOF
11458 #line 11458 "configure"
11459 #include "confdefs.h"
11460
11461 #include <sys/types.h>
11462 #include <stdlib.h>
11463 #include <stdio.h>
11464 #include <string.h>
11465 #include <sys/stat.h>
11466 int main()
11467 {
11468         char *tmpl = "conftestXXXXXX";
11469         char name[2][80];
11470         int n;
11471         int result = 0;
11472         int fd;
11473         struct stat sb;
11474
11475         umask(077);
11476         for (n = 0; n < 2; ++n) {
11477                 strcpy(name[n], tmpl);
11478                 if ((fd = mkstemp(name[n])) >= 0) {
11479                         if (!strcmp(name[n], tmpl)
11480                          || stat(name[n], &sb) != 0
11481                          || (sb.st_mode & S_IFMT) != S_IFREG
11482                          || (sb.st_mode & 077) != 0) {
11483                                 result = 1;
11484                         }
11485                         close(fd);
11486                 }
11487         }
11488         if (result == 0
11489          && !strcmp(name[0], name[1]))
11490                 result = 1;
11491         ${cf_cv_main_return:-return}(result);
11492 }
11493
11494 _ACEOF
11495 rm -f conftest$ac_exeext
11496 if { (eval echo "$as_me:11496: \"$ac_link\"") >&5
11497   (eval $ac_link) 2>&5
11498   ac_status=$?
11499   echo "$as_me:11499: \$? = $ac_status" >&5
11500   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11501   { (eval echo "$as_me:11501: \"$ac_try\"") >&5
11502   (eval $ac_try) 2>&5
11503   ac_status=$?
11504   echo "$as_me:11504: \$? = $ac_status" >&5
11505   (exit $ac_status); }; }; then
11506   cf_cv_func_mkstemp=yes
11507
11508 else
11509   echo "$as_me: program exited with status $ac_status" >&5
11510 echo "$as_me: failed program was:" >&5
11511 cat conftest.$ac_ext >&5
11512 cf_cv_func_mkstemp=no
11513
11514 fi
11515 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11516 fi
11517
11518 fi
11519 echo "$as_me:11519: result: $cf_cv_func_mkstemp" >&5
11520 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
11521 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
11522         echo "$as_me:11522: checking for mkstemp" >&5
11523 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
11524 if test "${ac_cv_func_mkstemp+set}" = set; then
11525   echo $ECHO_N "(cached) $ECHO_C" >&6
11526 else
11527   cat >conftest.$ac_ext <<_ACEOF
11528 #line 11528 "configure"
11529 #include "confdefs.h"
11530 /* System header to define __stub macros and hopefully few prototypes,
11531     which can conflict with char mkstemp (); below.  */
11532 #include <assert.h>
11533 /* Override any gcc2 internal prototype to avoid an error.  */
11534 #ifdef __cplusplus
11535 extern "C"
11536 #endif
11537 /* We use char because int might match the return type of a gcc2
11538    builtin and then its argument prototype would still apply.  */
11539 char mkstemp ();
11540 char (*f) ();
11541
11542 int
11543 main ()
11544 {
11545 /* The GNU C library defines this for functions which it implements
11546     to always fail with ENOSYS.  Some functions are actually named
11547     something starting with __ and the normal name is an alias.  */
11548 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
11549 choke me
11550 #else
11551 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11552 #endif
11553
11554   ;
11555   return 0;
11556 }
11557 _ACEOF
11558 rm -f conftest.$ac_objext conftest$ac_exeext
11559 if { (eval echo "$as_me:11559: \"$ac_link\"") >&5
11560   (eval $ac_link) 2>&5
11561   ac_status=$?
11562   echo "$as_me:11562: \$? = $ac_status" >&5
11563   (exit $ac_status); } &&
11564          { ac_try='test -s conftest$ac_exeext'
11565   { (eval echo "$as_me:11565: \"$ac_try\"") >&5
11566   (eval $ac_try) 2>&5
11567   ac_status=$?
11568   echo "$as_me:11568: \$? = $ac_status" >&5
11569   (exit $ac_status); }; }; then
11570   ac_cv_func_mkstemp=yes
11571 else
11572   echo "$as_me: failed program was:" >&5
11573 cat conftest.$ac_ext >&5
11574 ac_cv_func_mkstemp=no
11575 fi
11576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11577 fi
11578 echo "$as_me:11578: result: $ac_cv_func_mkstemp" >&5
11579 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
11580
11581 fi
11582 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
11583
11584 cat >>confdefs.h <<\EOF
11585 #define HAVE_MKSTEMP 1
11586 EOF
11587
11588 fi
11589
11590 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
11591         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11592         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11593 fi
11594
11595 cf_with_ada=yes
11596 if test "$cf_with_ada" != "no" ; then
11597
11598 cf_ada_make=gnatmake
11599 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
11600 set dummy $cf_ada_make; ac_word=$2
11601 echo "$as_me:11601: checking for $ac_word" >&5
11602 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11603 if test "${ac_cv_prog_gnat_exists+set}" = set; then
11604   echo $ECHO_N "(cached) $ECHO_C" >&6
11605 else
11606   if test -n "$gnat_exists"; then
11607   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
11608 else
11609   ac_save_IFS=$IFS; IFS=$ac_path_separator
11610 ac_dummy="$PATH"
11611 for ac_dir in $ac_dummy; do
11612   IFS=$ac_save_IFS
11613   test -z "$ac_dir" && ac_dir=.
11614   $as_executable_p "$ac_dir/$ac_word" || continue
11615 ac_cv_prog_gnat_exists="yes"
11616 echo "$as_me:11616: found $ac_dir/$ac_word" >&5
11617 break
11618 done
11619
11620   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
11621 fi
11622 fi
11623 gnat_exists=$ac_cv_prog_gnat_exists
11624 if test -n "$gnat_exists"; then
11625   echo "$as_me:11625: result: $gnat_exists" >&5
11626 echo "${ECHO_T}$gnat_exists" >&6
11627 else
11628   echo "$as_me:11628: result: no" >&5
11629 echo "${ECHO_T}no" >&6
11630 fi
11631
11632 if test "$ac_cv_prog_gnat_exists" = no; then
11633         cf_ada_make=
11634         cf_cv_prog_gnat_correct=no
11635 else
11636
11637 echo "$as_me:11637: checking for gnat version" >&5
11638 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
11639 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
11640         grep '[0-9].[0-9][0-9]*' |\
11641         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
11642 echo "$as_me:11642: result: $cf_gnat_version" >&5
11643 echo "${ECHO_T}$cf_gnat_version" >&6
11644
11645 case $cf_gnat_version in
11646 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
11647         cf_cv_prog_gnat_correct=yes
11648         ;;
11649 (*)
11650         { echo "$as_me:11650: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
11651 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
11652         cf_cv_prog_gnat_correct=no
11653         ;;
11654 esac
11655
11656         # Extract the first word of "m4", so it can be a program name with args.
11657 set dummy m4; ac_word=$2
11658 echo "$as_me:11658: checking for $ac_word" >&5
11659 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11660 if test "${ac_cv_prog_M4_exists+set}" = set; then
11661   echo $ECHO_N "(cached) $ECHO_C" >&6
11662 else
11663   if test -n "$M4_exists"; then
11664   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
11665 else
11666   ac_save_IFS=$IFS; IFS=$ac_path_separator
11667 ac_dummy="$PATH"
11668 for ac_dir in $ac_dummy; do
11669   IFS=$ac_save_IFS
11670   test -z "$ac_dir" && ac_dir=.
11671   $as_executable_p "$ac_dir/$ac_word" || continue
11672 ac_cv_prog_M4_exists="yes"
11673 echo "$as_me:11673: found $ac_dir/$ac_word" >&5
11674 break
11675 done
11676
11677   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
11678 fi
11679 fi
11680 M4_exists=$ac_cv_prog_M4_exists
11681 if test -n "$M4_exists"; then
11682   echo "$as_me:11682: result: $M4_exists" >&5
11683 echo "${ECHO_T}$M4_exists" >&6
11684 else
11685   echo "$as_me:11685: result: no" >&5
11686 echo "${ECHO_T}no" >&6
11687 fi
11688
11689         if test "$ac_cv_prog_M4_exists" = no; then
11690                 cf_cv_prog_gnat_correct=no
11691                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
11692         fi
11693         if test "$cf_cv_prog_gnat_correct" = yes; then
11694                 echo "$as_me:11694: checking if GNAT works" >&5
11695 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
11696
11697 rm -rf conftest* *~conftest*
11698 cat >>conftest.ads <<CF_EOF
11699 procedure conftest;
11700 CF_EOF
11701 cat >>conftest.adb <<CF_EOF
11702 with Text_IO;
11703 with GNAT.OS_Lib;
11704 procedure conftest is
11705 begin
11706    Text_IO.Put ("Hello World");
11707    Text_IO.New_Line;
11708    GNAT.OS_Lib.OS_Exit (0);
11709 end conftest;
11710 CF_EOF
11711 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11712    if ( ./conftest 1>&5 2>&1 ) ; then
11713       cf_cv_prog_gnat_correct=yes
11714    else
11715       cf_cv_prog_gnat_correct=no
11716    fi
11717 else
11718    cf_cv_prog_gnat_correct=no
11719 fi
11720 rm -rf conftest* *~conftest*
11721
11722                 echo "$as_me:11722: result: $cf_cv_prog_gnat_correct" >&5
11723 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
11724         fi
11725 fi
11726
11727         if test "$cf_cv_prog_gnat_correct" = yes; then
11728
11729         echo "$as_me:11729: checking optimization options for ADAFLAGS" >&5
11730 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
11731         case "$CFLAGS" in
11732         (*-g*)
11733
11734         ADAFLAGS="$ADAFLAGS -g"
11735
11736                 ;;
11737         esac
11738         case "$CFLAGS" in
11739         (*-O*)
11740                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
11741
11742         ADAFLAGS="$ADAFLAGS $cf_O_flag"
11743
11744                 ;;
11745         esac
11746         echo "$as_me:11746: result: $ADAFLAGS" >&5
11747 echo "${ECHO_T}$ADAFLAGS" >&6
11748
11749 echo "$as_me:11749: checking if GNATPREP supports -T option" >&5
11750 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
11751 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
11752   echo $ECHO_N "(cached) $ECHO_C" >&6
11753 else
11754
11755 cf_cv_gnatprep_opt_t=no
11756 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
11757
11758 fi
11759 echo "$as_me:11759: result: $cf_cv_gnatprep_opt_t" >&5
11760 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
11761 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
11762
11763 echo "$as_me:11763: checking if GNAT supports generics" >&5
11764 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
11765 case $cf_gnat_version in
11766 (3.[1-9]*|[4-9].*)
11767         cf_gnat_generics=yes
11768         ;;
11769 (*)
11770         cf_gnat_generics=no
11771         ;;
11772 esac
11773 echo "$as_me:11773: result: $cf_gnat_generics" >&5
11774 echo "${ECHO_T}$cf_gnat_generics" >&6
11775
11776 if test "$cf_gnat_generics" = yes
11777 then
11778         cf_compile_generics=generics
11779         cf_generic_objects="\${GENOBJS}"
11780 else
11781         cf_compile_generics=
11782         cf_generic_objects=
11783 fi
11784
11785 echo "$as_me:11785: checking if GNAT supports SIGINT" >&5
11786 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
11787 if test "${cf_cv_gnat_sigint+set}" = set; then
11788   echo $ECHO_N "(cached) $ECHO_C" >&6
11789 else
11790
11791 rm -rf conftest* *~conftest*
11792 cat >>conftest.ads <<CF_EOF
11793 with Ada.Interrupts.Names;
11794
11795 package ConfTest is
11796
11797    pragma Warnings (Off);  --  the next pragma exists since 3.11p
11798    pragma Unreserve_All_Interrupts;
11799    pragma Warnings (On);
11800
11801    protected Process is
11802       procedure Stop;
11803       function Continue return Boolean;
11804       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
11805    private
11806       Done : Boolean := False;
11807    end Process;
11808
11809 end ConfTest;
11810 CF_EOF
11811 cat >>conftest.adb <<CF_EOF
11812 package body ConfTest is
11813    protected body Process is
11814       procedure Stop is
11815       begin
11816          Done := True;
11817       end Stop;
11818       function Continue return Boolean is
11819       begin
11820          return not Done;
11821       end Continue;
11822    end Process;
11823 end ConfTest;
11824 CF_EOF
11825 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11826       cf_cv_gnat_sigint=yes
11827 else
11828    cf_cv_gnat_sigint=no
11829 fi
11830 rm -rf conftest* *~conftest*
11831
11832 fi
11833 echo "$as_me:11833: result: $cf_cv_gnat_sigint" >&5
11834 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
11835
11836 if test $cf_cv_gnat_sigint = yes ; then
11837         USE_GNAT_SIGINT=""
11838 else
11839         USE_GNAT_SIGINT="#"
11840 fi
11841
11842 cf_gnat_libraries=no
11843 cf_gnat_projects=no
11844
11845 if test "$enable_gnat_projects" != no ; then
11846 echo "$as_me:11846: checking if GNAT supports project files" >&5
11847 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
11848 case $cf_gnat_version in
11849 (3.[0-9]*)
11850         ;;
11851 (*)
11852         case $cf_cv_system_name in
11853         (cygwin*|msys*)
11854                 ;;
11855         (*)
11856                 mkdir conftest.src conftest.bin conftest.lib
11857                 cd conftest.src
11858                 rm -rf conftest* *~conftest*
11859                 cat >>library.gpr <<CF_EOF
11860 project Library is
11861   Kind := External ("LIB_KIND");
11862   for Library_Name use "ConfTest";
11863   for Object_Dir use ".";
11864   for Library_ALI_Dir use External("LIBRARY_DIR");
11865   for Library_Version use External ("SONAME");
11866   for Library_Kind use Kind;
11867   for Library_Dir use External("BUILD_DIR");
11868   Source_Dir := External ("SOURCE_DIR");
11869   for Source_Dirs use (Source_Dir);
11870 end Library;
11871 CF_EOF
11872                 cat >>confpackage.ads <<CF_EOF
11873 package ConfPackage is
11874    procedure conftest;
11875 end ConfPackage;
11876 CF_EOF
11877                 cat >>confpackage.adb <<CF_EOF
11878 with Text_IO;
11879 package body ConfPackage is
11880    procedure conftest is
11881    begin
11882       Text_IO.Put ("Hello World");
11883       Text_IO.New_Line;
11884    end conftest;
11885 end ConfPackage;
11886 CF_EOF
11887                 if ( $cf_ada_make $ADAFLAGS \
11888                                 -Plibrary.gpr \
11889                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
11890                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
11891                                 -XSOURCE_DIR=`pwd` \
11892                                 -XSONAME=libConfTest.so.1 \
11893                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
11894                         cf_gnat_projects=yes
11895                 fi
11896                 cd ..
11897                 if test -f conftest.lib/confpackage.ali
11898                 then
11899                         cf_gnat_libraries=yes
11900                 fi
11901                 rm -rf conftest* *~conftest*
11902                 ;;
11903         esac
11904         ;;
11905 esac
11906 echo "$as_me:11906: result: $cf_gnat_projects" >&5
11907 echo "${ECHO_T}$cf_gnat_projects" >&6
11908 fi # enable_gnat_projects
11909
11910 if test $cf_gnat_projects = yes
11911 then
11912         echo "$as_me:11912: checking if GNAT supports libraries" >&5
11913 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
11914         echo "$as_me:11914: result: $cf_gnat_libraries" >&5
11915 echo "${ECHO_T}$cf_gnat_libraries" >&6
11916 fi
11917
11918 if test "$cf_gnat_projects" = yes
11919 then
11920         USE_OLD_MAKERULES="#"
11921         USE_GNAT_PROJECTS=""
11922 else
11923         USE_OLD_MAKERULES=""
11924         USE_GNAT_PROJECTS="#"
11925 fi
11926
11927 if test "$cf_gnat_libraries" = yes
11928 then
11929         USE_GNAT_LIBRARIES=""
11930 else
11931         USE_GNAT_LIBRARIES="#"
11932 fi
11933
11934 echo "$as_me:11934: checking for ada-compiler" >&5
11935 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
11936
11937 # Check whether --with-ada-compiler or --without-ada-compiler was given.
11938 if test "${with_ada_compiler+set}" = set; then
11939   withval="$with_ada_compiler"
11940   cf_ada_compiler=$withval
11941 else
11942   cf_ada_compiler=gnatmake
11943 fi;
11944
11945 echo "$as_me:11945: result: $cf_ada_compiler" >&5
11946 echo "${ECHO_T}$cf_ada_compiler" >&6
11947
11948                 cf_ada_package=terminal_interface
11949
11950 echo "$as_me:11950: checking for ada-include" >&5
11951 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
11952
11953 # Check whether --with-ada-include or --without-ada-include was given.
11954 if test "${with_ada_include+set}" = set; then
11955   withval="$with_ada_include"
11956
11957 else
11958   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
11959 fi; if test -n "$prefix/share/ada/adainclude" ; then
11960
11961 if test "x$prefix" != xNONE; then
11962         cf_path_syntax="$prefix"
11963 else
11964         cf_path_syntax="$ac_default_prefix"
11965 fi
11966
11967 case ".$withval" in
11968 (.\$\(*\)*|.\'*\'*)
11969         ;;
11970 (..|./*|.\\*)
11971         ;;
11972 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
11973         ;;
11974 (.\${*prefix}*|.\${*dir}*)
11975         eval withval="$withval"
11976         case ".$withval" in
11977         (.NONE/*)
11978                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11979                 ;;
11980         esac
11981         ;;
11982 (.no|.NONE/*)
11983         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11984         ;;
11985 (*)
11986         { { echo "$as_me:11986: error: expected a pathname, not \"$withval\"" >&5
11987 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11988    { (exit 1); exit 1; }; }
11989         ;;
11990 esac
11991
11992 fi
11993 eval ADA_INCLUDE="$withval"
11994
11995 echo "$as_me:11995: result: $ADA_INCLUDE" >&5
11996 echo "${ECHO_T}$ADA_INCLUDE" >&6
11997
11998 echo "$as_me:11998: checking for ada-objects" >&5
11999 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
12000
12001 # Check whether --with-ada-objects or --without-ada-objects was given.
12002 if test "${with_ada_objects+set}" = set; then
12003   withval="$with_ada_objects"
12004
12005 else
12006   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
12007 fi; if test -n "$prefix/lib/ada/adalib" ; then
12008
12009 if test "x$prefix" != xNONE; then
12010         cf_path_syntax="$prefix"
12011 else
12012         cf_path_syntax="$ac_default_prefix"
12013 fi
12014
12015 case ".$withval" in
12016 (.\$\(*\)*|.\'*\'*)
12017         ;;
12018 (..|./*|.\\*)
12019         ;;
12020 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
12021         ;;
12022 (.\${*prefix}*|.\${*dir}*)
12023         eval withval="$withval"
12024         case ".$withval" in
12025         (.NONE/*)
12026                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
12027                 ;;
12028         esac
12029         ;;
12030 (.no|.NONE/*)
12031         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
12032         ;;
12033 (*)
12034         { { echo "$as_me:12034: error: expected a pathname, not \"$withval\"" >&5
12035 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
12036    { (exit 1); exit 1; }; }
12037         ;;
12038 esac
12039
12040 fi
12041 eval ADA_OBJECTS="$withval"
12042
12043 echo "$as_me:12043: result: $ADA_OBJECTS" >&5
12044 echo "${ECHO_T}$ADA_OBJECTS" >&6
12045
12046 echo "$as_me:12046: checking if an Ada95 shared-library should be built" >&5
12047 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
12048
12049 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
12050 if test "${with_ada_sharedlib+set}" = set; then
12051   withval="$with_ada_sharedlib"
12052   with_ada_sharedlib=$withval
12053 else
12054   with_ada_sharedlib=no
12055 fi;
12056 echo "$as_me:12056: result: $with_ada_sharedlib" >&5
12057 echo "${ECHO_T}$with_ada_sharedlib" >&6
12058
12059 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
12060 MAKE_ADA_SHAREDLIB="#"
12061
12062 if test "x$with_ada_sharedlib" != xno
12063 then
12064         MAKE_ADA_SHAREDLIB=
12065         if test "x$with_ada_sharedlib" != xyes
12066         then
12067                 ADA_SHAREDLIB="$with_ada_sharedlib"
12068         fi
12069 fi
12070
12071         else
12072                 { { echo "$as_me:12072: error: No usable Ada compiler found" >&5
12073 echo "$as_me: error: No usable Ada compiler found" >&2;}
12074    { (exit 1); exit 1; }; }
12075         fi
12076 else
12077         { { echo "$as_me:12077: error: The Ada compiler is needed for this package" >&5
12078 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
12079    { (exit 1); exit 1; }; }
12080 fi
12081
12082 ################################################################################
12083
12084 # not needed
12085 TINFO_LDFLAGS2=
12086
12087 TINFO_LIBS=
12088
12089 ### Construct the list of include-directories to be generated
12090
12091 if test "$srcdir" != "."; then
12092         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
12093 fi
12094 CPPFLAGS="-I../include $CPPFLAGS"
12095 if test "$srcdir" != "."; then
12096         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
12097 fi
12098 CPPFLAGS="-I. $CPPFLAGS"
12099
12100 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
12101 if test "$srcdir" != "."; then
12102         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
12103 fi
12104 if test "$GCC" != yes; then
12105         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
12106 elif test "$includedir" != "/usr/include"; then
12107         if test "$includedir" = '${prefix}/include' ; then
12108                 if test x$prefix != x/usr ; then
12109                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
12110                 fi
12111         else
12112                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
12113         fi
12114 fi
12115
12116 ### Build up pieces for makefile rules
12117 echo "$as_me:12117: checking default library suffix" >&5
12118 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
12119
12120         case $DFT_LWR_MODEL in
12121         (libtool) DFT_ARG_SUFFIX=''   ;;
12122         (normal)  DFT_ARG_SUFFIX=''   ;;
12123         (debug)   DFT_ARG_SUFFIX='_g' ;;
12124         (profile) DFT_ARG_SUFFIX='_p' ;;
12125         (shared)  DFT_ARG_SUFFIX=''   ;;
12126         esac
12127         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
12128 echo "$as_me:12128: result: $DFT_ARG_SUFFIX" >&5
12129 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
12130
12131 echo "$as_me:12131: checking default library-dependency suffix" >&5
12132 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
12133
12134         case X$DFT_LWR_MODEL in
12135         (Xlibtool)
12136                 DFT_LIB_SUFFIX='.la'
12137                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12138                 ;;
12139         (Xdebug)
12140                 DFT_LIB_SUFFIX='_g.a'
12141                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12142                 ;;
12143         (Xprofile)
12144                 DFT_LIB_SUFFIX='_p.a'
12145                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12146                 ;;
12147         (Xshared)
12148                 case $cf_cv_system_name in
12149                 (aix[5-7]*)
12150                         DFT_LIB_SUFFIX='.so'
12151                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12152                         ;;
12153                 (cygwin*|msys*|mingw*)
12154                         DFT_LIB_SUFFIX='.dll'
12155                         DFT_DEP_SUFFIX='.dll.a'
12156                         ;;
12157                 (darwin*)
12158                         DFT_LIB_SUFFIX='.dylib'
12159                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12160                         ;;
12161                 (hpux*)
12162                         case $target in
12163                         (ia64*)
12164                                 DFT_LIB_SUFFIX='.so'
12165                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12166                                 ;;
12167                         (*)
12168                                 DFT_LIB_SUFFIX='.sl'
12169                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12170                                 ;;
12171                         esac
12172                         ;;
12173                 (*)
12174                         DFT_LIB_SUFFIX='.so'
12175                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12176                         ;;
12177                 esac
12178                 ;;
12179         (*)
12180                 DFT_LIB_SUFFIX='.a'
12181                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12182                 ;;
12183         esac
12184         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
12185         then
12186                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
12187                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
12188         fi
12189 echo "$as_me:12189: result: $DFT_DEP_SUFFIX" >&5
12190 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
12191
12192 echo "$as_me:12192: checking default object directory" >&5
12193 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
12194
12195         case $DFT_LWR_MODEL in
12196         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
12197         (normal)  DFT_OBJ_SUBDIR='objects' ;;
12198         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
12199         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
12200         (shared)
12201                 case $cf_cv_system_name in
12202                 (cygwin|msys)
12203                         DFT_OBJ_SUBDIR='objects' ;;
12204                 (*)
12205                         DFT_OBJ_SUBDIR='obj_s' ;;
12206                 esac
12207         esac
12208 echo "$as_me:12208: result: $DFT_OBJ_SUBDIR" >&5
12209 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
12210
12211 ### Set up low-level terminfo dependencies for makefiles.
12212
12213 if test "$DFT_LWR_MODEL" = shared ; then
12214         case $cf_cv_system_name in
12215         (cygwin*)
12216                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
12217                 ;;
12218         (msys*)
12219                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
12220                 ;;
12221         esac
12222 fi
12223
12224 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
12225
12226 ### Construct the list of subdirectories for which we'll customize makefiles
12227 ### with the appropriate compile-rules.
12228
12229 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
12230
12231 cat >>confdefs.h <<EOF
12232 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
12233 EOF
12234
12235 ### Now that we're done running tests, add the compiler-warnings, if any
12236
12237 cf_fix_cppflags=no
12238 cf_new_cflags=
12239 cf_new_cppflags=
12240 cf_new_extra_cppflags=
12241
12242 for cf_add_cflags in $EXTRA_CFLAGS
12243 do
12244 case $cf_fix_cppflags in
12245 (no)
12246         case $cf_add_cflags in
12247         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12248                 case $cf_add_cflags in
12249                 (-D*)
12250                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12251
12252                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12253                                 && test -z "${cf_tst_cflags}" \
12254                                 && cf_fix_cppflags=yes
12255
12256                         if test $cf_fix_cppflags = yes ; then
12257                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12258                                 continue
12259                         elif test "${cf_tst_cflags}" = "\"'" ; then
12260                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12261                                 continue
12262                         fi
12263                         ;;
12264                 esac
12265                 case "$CPPFLAGS" in
12266                 (*$cf_add_cflags)
12267                         ;;
12268                 (*)
12269                         case $cf_add_cflags in
12270                         (-D*)
12271                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12272
12273 CPPFLAGS=`echo "$CPPFLAGS" | \
12274         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12275                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12276
12277                                 ;;
12278                         esac
12279                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12280                         ;;
12281                 esac
12282                 ;;
12283         (*)
12284                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12285                 ;;
12286         esac
12287         ;;
12288 (yes)
12289         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12290
12291         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12292
12293         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12294                 && test -z "${cf_tst_cflags}" \
12295                 && cf_fix_cppflags=no
12296         ;;
12297 esac
12298 done
12299
12300 if test -n "$cf_new_cflags" ; then
12301
12302         CFLAGS="$CFLAGS $cf_new_cflags"
12303 fi
12304
12305 if test -n "$cf_new_cppflags" ; then
12306
12307         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12308 fi
12309
12310 if test -n "$cf_new_extra_cppflags" ; then
12311
12312         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12313 fi
12314
12315 ################################################################################
12316
12317 TEST_ARG2=
12318
12319 TEST_LIBS2=
12320
12321 NCURSES_SHLIB2="sh -c"
12322
12323 ADA_SUBDIRS="include gen src doc"
12324 if test "x$cf_with_tests" != "xno" ; then
12325         ADA_SUBDIRS="$ADA_SUBDIRS samples"
12326 fi
12327 for cf_dir in $ADA_SUBDIRS
12328 do
12329         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
12330 done
12331
12332 NCURSES_TREE="#"
12333
12334 EXTERNAL_TREE=
12335
12336 # match layout used by make-tar.sh
12337 ADAHTML_DIR=../doc/ada
12338
12339 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
12340 ac_config_commands="$ac_config_commands default"
12341 cat >confcache <<\_ACEOF
12342 # This file is a shell script that caches the results of configure
12343 # tests run on this system so they can be shared between configure
12344 # scripts and configure runs, see configure's option --config-cache.
12345 # It is not useful on other systems.  If it contains results you don't
12346 # want to keep, you may remove or edit it.
12347 #
12348 # config.status only pays attention to the cache file if you give it
12349 # the --recheck option to rerun configure.
12350 #
12351 # `ac_cv_env_foo' variables (set or unset) will be overriden when
12352 # loading this file, other *unset* `ac_cv_foo' will be assigned the
12353 # following values.
12354
12355 _ACEOF
12356
12357 # The following way of writing the cache mishandles newlines in values,
12358 # but we know of no workaround that is simple, portable, and efficient.
12359 # So, don't put newlines in cache variables' values.
12360 # Ultrix sh set writes to stderr and can't be redirected directly,
12361 # and sets the high bit in the cache file unless we assign to the vars.
12362 {
12363   (set) 2>&1 |
12364     case `(ac_space=' '; set | grep ac_space) 2>&1` in
12365     *ac_space=\ *)
12366       # `set' does not quote correctly, so add quotes (double-quote
12367       # substitution turns \\\\ into \\, and sed turns \\ into \).
12368       sed -n \
12369         "s/'/'\\\\''/g;
12370           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
12371       ;;
12372     *)
12373       # `set' quotes correctly as required by POSIX, so do not add quotes.
12374       sed -n \
12375         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
12376       ;;
12377     esac;
12378 } |
12379   sed '
12380      t clear
12381      : clear
12382      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
12383      t end
12384      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
12385      : end' >>confcache
12386 if cmp -s $cache_file confcache; then :; else
12387   if test -w $cache_file; then
12388     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
12389     cat confcache >$cache_file
12390   else
12391     echo "not updating unwritable cache $cache_file"
12392   fi
12393 fi
12394 rm -f confcache
12395
12396 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12397 # Let make expand exec_prefix.
12398 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12399
12400 # VPATH may cause trouble with some makes, so we remove $(srcdir),
12401 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
12402 # trailing colons and then remove the whole line if VPATH becomes empty
12403 # (actually we leave an empty line to preserve line numbers).
12404 if test "x$srcdir" = x.; then
12405   ac_vpsub='/^[         ]*VPATH[        ]*=/{
12406 s/:*\$(srcdir):*/:/;
12407 s/:*\${srcdir}:*/:/;
12408 s/:*@srcdir@:*/:/;
12409 s/^\([^=]*=[    ]*\):*/\1/;
12410 s/:*$//;
12411 s/^[^=]*=[      ]*$//;
12412 }'
12413 fi
12414
12415 DEFS=-DHAVE_CONFIG_H
12416
12417 : ${CONFIG_STATUS=./config.status}
12418 ac_clean_files_save=$ac_clean_files
12419 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
12420 { echo "$as_me:12420: creating $CONFIG_STATUS" >&5
12421 echo "$as_me: creating $CONFIG_STATUS" >&6;}
12422 cat >$CONFIG_STATUS <<_ACEOF
12423 #! $SHELL
12424 # Generated automatically by configure.
12425 # Run this file to recreate the current configuration.
12426 # Compiler output produced by configure, useful for debugging
12427 # configure, is in config.log if it exists.
12428
12429 debug=false
12430 SHELL=\${CONFIG_SHELL-$SHELL}
12431 ac_cs_invocation="\$0 \$@"
12432
12433 _ACEOF
12434
12435 cat >>$CONFIG_STATUS <<\_ACEOF
12436 # Be Bourne compatible
12437 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
12438   emulate sh
12439   NULLCMD=:
12440 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
12441   set -o posix
12442 fi
12443
12444 # Name of the executable.
12445 as_me=`echo "$0" |sed 's,.*[\\/],,'`
12446
12447 if expr a : '\(a\)' >/dev/null 2>&1; then
12448   as_expr=expr
12449 else
12450   as_expr=false
12451 fi
12452
12453 rm -f conf$$ conf$$.exe conf$$.file
12454 echo >conf$$.file
12455 if ln -s conf$$.file conf$$ 2>/dev/null; then
12456   # We could just check for DJGPP; but this test a) works b) is more generic
12457   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
12458   if test -f conf$$.exe; then
12459     # Don't use ln at all; we don't have any links
12460     as_ln_s='cp -p'
12461   else
12462     as_ln_s='ln -s'
12463   fi
12464 elif ln conf$$.file conf$$ 2>/dev/null; then
12465   as_ln_s=ln
12466 else
12467   as_ln_s='cp -p'
12468 fi
12469 rm -f conf$$ conf$$.exe conf$$.file
12470
12471 as_executable_p="test -f"
12472
12473 # Support unset when possible.
12474 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
12475   as_unset=unset
12476 else
12477   as_unset=false
12478 fi
12479
12480 # NLS nuisances.
12481 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
12482 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
12483 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
12484 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
12485 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
12486 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
12487 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
12488 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
12489
12490 # IFS
12491 # We need space, tab and new line, in precisely that order.
12492 as_nl='
12493 '
12494 IFS="   $as_nl"
12495
12496 # CDPATH.
12497 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
12498
12499 exec 6>&1
12500
12501 _ACEOF
12502
12503 # Files that config.status was made for.
12504 if test -n "$ac_config_files"; then
12505   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
12506 fi
12507
12508 if test -n "$ac_config_headers"; then
12509   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
12510 fi
12511
12512 if test -n "$ac_config_links"; then
12513   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
12514 fi
12515
12516 if test -n "$ac_config_commands"; then
12517   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
12518 fi
12519
12520 cat >>$CONFIG_STATUS <<\EOF
12521
12522 ac_cs_usage="\
12523 \`$as_me' instantiates files from templates according to the
12524 current configuration.
12525
12526 Usage: $0 [OPTIONS] [FILE]...
12527
12528   -h, --help       print this help, then exit
12529   -V, --version    print version number, then exit
12530   -d, --debug      don't remove temporary files
12531       --recheck    update $as_me by reconfiguring in the same conditions
12532   --file=FILE[:TEMPLATE]
12533                    instantiate the configuration file FILE
12534   --header=FILE[:TEMPLATE]
12535                    instantiate the configuration header FILE
12536
12537 Configuration files:
12538 $config_files
12539
12540 Configuration headers:
12541 $config_headers
12542
12543 Configuration commands:
12544 $config_commands
12545
12546 Report bugs to <dickey@invisible-island.net>."
12547 EOF
12548
12549 cat >>$CONFIG_STATUS <<EOF
12550 ac_cs_version="\\
12551 config.status
12552 configured by $0, generated by GNU Autoconf 2.52.20141204,
12553   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
12554
12555 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
12556 Free Software Foundation, Inc.
12557 This config.status script is free software; the Free Software Foundation
12558 gives unlimited permission to copy, distribute and modify it."
12559 srcdir=$srcdir
12560 INSTALL="$INSTALL"
12561 EOF
12562
12563 cat >>$CONFIG_STATUS <<\EOF
12564 # If no file are specified by the user, then we need to provide default
12565 # value.  By we need to know if files were specified by the user.
12566 ac_need_defaults=:
12567 while test $# != 0
12568 do
12569   case $1 in
12570   --*=*)
12571     ac_option=`expr "x$1" : 'x\([^=]*\)='`
12572     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
12573     shift
12574     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
12575     shift
12576     ;;
12577   -*);;
12578   *) # This is not an option, so the user has probably given explicit
12579      # arguments.
12580      ac_need_defaults=false;;
12581   esac
12582
12583   case $1 in
12584   # Handling of the options.
12585 EOF
12586 cat >>$CONFIG_STATUS <<EOF
12587   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12588     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
12589     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
12590 EOF
12591 cat >>$CONFIG_STATUS <<\EOF
12592   --version | --vers* | -V )
12593     echo "$ac_cs_version"; exit 0 ;;
12594   --he | --h)
12595     # Conflict between --help and --header
12596     { { echo "$as_me:12596: error: ambiguous option: $1
12597 Try \`$0 --help' for more information." >&5
12598 echo "$as_me: error: ambiguous option: $1
12599 Try \`$0 --help' for more information." >&2;}
12600    { (exit 1); exit 1; }; };;
12601   --help | --hel | -h )
12602     echo "$ac_cs_usage"; exit 0 ;;
12603   --debug | --d* | -d )
12604     debug=: ;;
12605   --file | --fil | --fi | --f )
12606     shift
12607     CONFIG_FILES="$CONFIG_FILES $1"
12608     ac_need_defaults=false;;
12609   --header | --heade | --head | --hea )
12610     shift
12611     CONFIG_HEADERS="$CONFIG_HEADERS $1"
12612     ac_need_defaults=false;;
12613
12614   # This is an error.
12615   -*) { { echo "$as_me:12615: error: unrecognized option: $1
12616 Try \`$0 --help' for more information." >&5
12617 echo "$as_me: error: unrecognized option: $1
12618 Try \`$0 --help' for more information." >&2;}
12619    { (exit 1); exit 1; }; } ;;
12620
12621   *) ac_config_targets="$ac_config_targets $1" ;;
12622
12623   esac
12624   shift
12625 done
12626
12627 exec 5>>config.log
12628 cat >&5 << _ACEOF
12629
12630 ## ----------------------- ##
12631 ## Running config.status.  ##
12632 ## ----------------------- ##
12633
12634 This file was extended by $as_me 2.52.20141204, executed with
12635   CONFIG_FILES    = $CONFIG_FILES
12636   CONFIG_HEADERS  = $CONFIG_HEADERS
12637   CONFIG_LINKS    = $CONFIG_LINKS
12638   CONFIG_COMMANDS = $CONFIG_COMMANDS
12639   > $ac_cs_invocation
12640 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12641
12642 _ACEOF
12643 EOF
12644
12645 cat >>$CONFIG_STATUS <<EOF
12646 #
12647 # INIT-COMMANDS section.
12648 #
12649
12650 ### Special initialization commands, used to pass information from the
12651 ### configuration-run into config.status
12652
12653 AWK="$AWK"
12654 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
12655 DFT_LWR_MODEL="$DFT_LWR_MODEL"
12656 LIB_NAME="$LIB_NAME"
12657 LIB_PREFIX="$LIB_PREFIX"
12658 LIB_SUFFIX="$LIB_SUFFIX"
12659 LN_S="$LN_S"
12660 NCURSES_MAJOR="$NCURSES_MAJOR"
12661 NCURSES_MINOR="$NCURSES_MINOR"
12662 NCURSES_PATCH="$NCURSES_PATCH"
12663 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
12664 cf_cv_abi_version="$cf_cv_abi_version"
12665 cf_cv_rel_version="$cf_cv_rel_version"
12666 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
12667 cf_cv_shared_soname='$cf_cv_shared_soname'
12668 cf_cv_shlib_version="$cf_cv_shlib_version"
12669 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
12670 cf_cv_system_name="$cf_cv_system_name"
12671 host="$host"
12672 target="$target"
12673
12674 EOF
12675
12676 cat >>$CONFIG_STATUS <<\EOF
12677 for ac_config_target in $ac_config_targets
12678 do
12679   case "$ac_config_target" in
12680   # Handling of arguments.
12681   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
12682   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
12683   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
12684   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
12685   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
12686   *) { { echo "$as_me:12686: error: invalid argument: $ac_config_target" >&5
12687 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
12688    { (exit 1); exit 1; }; };;
12689   esac
12690 done
12691
12692 # If the user did not use the arguments to specify the items to instantiate,
12693 # then the envvar interface is used.  Set only those that are not.
12694 # We use the long form for the default assignment because of an extremely
12695 # bizarre bug on SunOS 4.1.3.
12696 if $ac_need_defaults; then
12697   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
12698   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
12699   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
12700 fi
12701
12702 # Create a temporary directory, and hook for its removal unless debugging.
12703 $debug ||
12704 {
12705   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
12706   trap '{ (exit 1); exit 1; }' 1 2 13 15
12707 }
12708
12709 # Create a (secure) tmp directory for tmp files.
12710 : ${TMPDIR=/tmp}
12711 {
12712   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
12713   test -n "$tmp" && test -d "$tmp"
12714 }  ||
12715 {
12716   tmp=$TMPDIR/cs$$-$RANDOM
12717   (umask 077 && mkdir $tmp)
12718 } ||
12719 {
12720    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
12721    { (exit 1); exit 1; }
12722 }
12723
12724 EOF
12725
12726 cat >>$CONFIG_STATUS <<EOF
12727
12728 #
12729 # CONFIG_FILES section.
12730 #
12731
12732 # No need to generate the scripts if there are no CONFIG_FILES.
12733 # This happens for instance when ./config.status config.h
12734 if test -n "\$CONFIG_FILES"; then
12735   # Protect against being on the right side of a sed subst in config.status.
12736   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
12737    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
12738 s,@SHELL@,$SHELL,;t t
12739 s,@exec_prefix@,$exec_prefix,;t t
12740 s,@prefix@,$prefix,;t t
12741 s,@program_transform_name@,$program_transform_name,;t t
12742 s,@bindir@,$bindir,;t t
12743 s,@sbindir@,$sbindir,;t t
12744 s,@libexecdir@,$libexecdir,;t t
12745 s,@datarootdir@,$datarootdir,;t t
12746 s,@datadir@,$datadir,;t t
12747 s,@sysconfdir@,$sysconfdir,;t t
12748 s,@sharedstatedir@,$sharedstatedir,;t t
12749 s,@localstatedir@,$localstatedir,;t t
12750 s,@libdir@,$libdir,;t t
12751 s,@includedir@,$includedir,;t t
12752 s,@oldincludedir@,$oldincludedir,;t t
12753 s,@infodir@,$infodir,;t t
12754 s,@mandir@,$mandir,;t t
12755 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
12756 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
12757 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
12758 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
12759 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
12760 s,@build_alias@,$build_alias,;t t
12761 s,@host_alias@,$host_alias,;t t
12762 s,@target_alias@,$target_alias,;t t
12763 s,@ECHO_C@,$ECHO_C,;t t
12764 s,@ECHO_N@,$ECHO_N,;t t
12765 s,@ECHO_T@,$ECHO_T,;t t
12766 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
12767 s,@DEFS@,$DEFS,;t t
12768 s,@LIBS@,$LIBS,;t t
12769 s,@top_builddir@,$top_builddir,;t t
12770 s,@build@,$build,;t t
12771 s,@build_cpu@,$build_cpu,;t t
12772 s,@build_vendor@,$build_vendor,;t t
12773 s,@build_os@,$build_os,;t t
12774 s,@host@,$host,;t t
12775 s,@host_cpu@,$host_cpu,;t t
12776 s,@host_vendor@,$host_vendor,;t t
12777 s,@host_os@,$host_os,;t t
12778 s,@target@,$target,;t t
12779 s,@target_cpu@,$target_cpu,;t t
12780 s,@target_vendor@,$target_vendor,;t t
12781 s,@target_os@,$target_os,;t t
12782 s,@CC@,$CC,;t t
12783 s,@CFLAGS@,$CFLAGS,;t t
12784 s,@LDFLAGS@,$LDFLAGS,;t t
12785 s,@CPPFLAGS@,$CPPFLAGS,;t t
12786 s,@ac_ct_CC@,$ac_ct_CC,;t t
12787 s,@EXEEXT@,$EXEEXT,;t t
12788 s,@OBJEXT@,$OBJEXT,;t t
12789 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
12790 s,@CPP@,$CPP,;t t
12791 s,@AWK@,$AWK,;t t
12792 s,@EGREP@,$EGREP,;t t
12793 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
12794 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
12795 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
12796 s,@LN_S@,$LN_S,;t t
12797 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
12798 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
12799 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
12800 s,@SET_MAKE@,$SET_MAKE,;t t
12801 s,@CTAGS@,$CTAGS,;t t
12802 s,@ETAGS@,$ETAGS,;t t
12803 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
12804 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
12805 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
12806 s,@RANLIB@,$RANLIB,;t t
12807 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
12808 s,@LD@,$LD,;t t
12809 s,@ac_ct_LD@,$ac_ct_LD,;t t
12810 s,@AR@,$AR,;t t
12811 s,@ac_ct_AR@,$ac_ct_AR,;t t
12812 s,@ARFLAGS@,$ARFLAGS,;t t
12813 s,@DESTDIR@,$DESTDIR,;t t
12814 s,@BUILD_CC@,$BUILD_CC,;t t
12815 s,@BUILD_CPP@,$BUILD_CPP,;t t
12816 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
12817 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
12818 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
12819 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
12820 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
12821 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
12822 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
12823 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
12824 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
12825 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
12826 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
12827 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
12828 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
12829 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
12830 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
12831 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
12832 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
12833 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
12834 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
12835 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
12836 s,@CC_G_OPT@,$CC_G_OPT,;t t
12837 s,@LD_MODEL@,$LD_MODEL,;t t
12838 s,@shlibdir@,$shlibdir,;t t
12839 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
12840 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
12841 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
12842 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
12843 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
12844 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
12845 s,@LINK_PROGS@,$LINK_PROGS,;t t
12846 s,@LINK_TESTS@,$LINK_TESTS,;t t
12847 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
12848 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
12849 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
12850 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
12851 s,@RPATH_LIST@,$RPATH_LIST,;t t
12852 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
12853 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
12854 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
12855 s,@PTHREAD@,$PTHREAD,;t t
12856 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
12857 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
12858 s,@ECHO_LT@,$ECHO_LT,;t t
12859 s,@ECHO_LD@,$ECHO_LD,;t t
12860 s,@RULE_CC@,$RULE_CC,;t t
12861 s,@SHOW_CC@,$SHOW_CC,;t t
12862 s,@ECHO_CC@,$ECHO_CC,;t t
12863 s,@ADAFLAGS@,$ADAFLAGS,;t t
12864 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
12865 s,@ADA_TRACE@,$ADA_TRACE,;t t
12866 s,@gnat_exists@,$gnat_exists,;t t
12867 s,@M4_exists@,$M4_exists,;t t
12868 s,@cf_ada_make@,$cf_ada_make,;t t
12869 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
12870 s,@cf_compile_generics@,$cf_compile_generics,;t t
12871 s,@cf_generic_objects@,$cf_generic_objects,;t t
12872 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
12873 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
12874 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
12875 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
12876 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
12877 s,@cf_ada_package@,$cf_ada_package,;t t
12878 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
12879 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
12880 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
12881 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
12882 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
12883 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
12884 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
12885 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
12886 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
12887 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
12888 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
12889 s,@TEST_ARG2@,$TEST_ARG2,;t t
12890 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
12891 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
12892 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
12893 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
12894 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
12895 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
12896 CEOF
12897
12898 EOF
12899
12900   cat >>$CONFIG_STATUS <<\EOF
12901   # Split the substitutions into bite-sized pieces for seds with
12902   # small command number limits, like on Digital OSF/1 and HP-UX.
12903   ac_max_sed_lines=48
12904   ac_sed_frag=1 # Number of current file.
12905   ac_beg=1 # First line for current file.
12906   ac_end=$ac_max_sed_lines # Line after last line for current file.
12907   ac_more_lines=:
12908   ac_sed_cmds=
12909   while $ac_more_lines; do
12910     if test $ac_beg -gt 1; then
12911       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12912     else
12913       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12914     fi
12915     if test ! -s $tmp/subs.frag; then
12916       ac_more_lines=false
12917     else
12918       # The purpose of the label and of the branching condition is to
12919       # speed up the sed processing (if there are no `@' at all, there
12920       # is no need to browse any of the substitutions).
12921       # These are the two extra sed commands mentioned above.
12922       (echo ':t
12923   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
12924       if test -z "$ac_sed_cmds"; then
12925         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
12926       else
12927         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
12928       fi
12929       ac_sed_frag=`expr $ac_sed_frag + 1`
12930       ac_beg=$ac_end
12931       ac_end=`expr $ac_end + $ac_max_sed_lines`
12932     fi
12933   done
12934   if test -z "$ac_sed_cmds"; then
12935     ac_sed_cmds=cat
12936   fi
12937 fi # test -n "$CONFIG_FILES"
12938
12939 EOF
12940 cat >>$CONFIG_STATUS <<\EOF
12941 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12942   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12943   case $ac_file in
12944   - | *:- | *:-:* ) # input from stdin
12945         cat >$tmp/stdin
12946         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12947         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12948   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12949         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12950   * )   ac_file_in=$ac_file.in ;;
12951   esac
12952
12953   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12954   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12955          X"$ac_file" : 'X\(//\)[^/]' \| \
12956          X"$ac_file" : 'X\(//\)$' \| \
12957          X"$ac_file" : 'X\(/\)' \| \
12958          .     : '\(.\)' 2>/dev/null ||
12959 echo X"$ac_file" |
12960     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12961           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12962           /^X\(\/\/\)$/{ s//\1/; q; }
12963           /^X\(\/\).*/{ s//\1/; q; }
12964           s/.*/./; q'`
12965   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12966     { case "$ac_dir" in
12967   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12968   *)                      as_incr_dir=.;;
12969 esac
12970 as_dummy="$ac_dir"
12971 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12972   case $as_mkdir_dir in
12973     # Skip DOS drivespec
12974     ?:) as_incr_dir=$as_mkdir_dir ;;
12975     *)
12976       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12977       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12978     ;;
12979   esac
12980 done; }
12981
12982     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
12983     # A "../" for each directory in $ac_dir_suffix.
12984     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
12985   else
12986     ac_dir_suffix= ac_dots=
12987   fi
12988
12989   case $srcdir in
12990   .)  ac_srcdir=.
12991       if test -z "$ac_dots"; then
12992          ac_top_srcdir=.
12993       else
12994          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
12995       fi ;;
12996   [\\/]* | ?:[\\/]* )
12997       ac_srcdir=$srcdir$ac_dir_suffix;
12998       ac_top_srcdir=$srcdir ;;
12999   *) # Relative path.
13000     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
13001     ac_top_srcdir=$ac_dots$srcdir ;;
13002   esac
13003
13004   case $INSTALL in
13005   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
13006   *) ac_INSTALL=$ac_dots$INSTALL ;;
13007   esac
13008
13009   if test x"$ac_file" != x-; then
13010     { echo "$as_me:13010: creating $ac_file" >&5
13011 echo "$as_me: creating $ac_file" >&6;}
13012     rm -f "$ac_file"
13013   fi
13014   # Let's still pretend it is `configure' which instantiates (i.e., don't
13015   # use $as_me), people would be surprised to read:
13016   #    /* config.h.  Generated automatically by config.status.  */
13017   configure_input="Generated automatically from `echo $ac_file_in |
13018                                                  sed 's,.*/,,'` by configure."
13019
13020   # First look for the input files in the build tree, otherwise in the
13021   # src tree.
13022   ac_file_inputs=`IFS=:
13023     for f in $ac_file_in; do
13024       case $f in
13025       -) echo $tmp/stdin ;;
13026       [\\/$]*)
13027          # Absolute (can't be DOS-style, as IFS=:)
13028          test -f "$f" || { { echo "$as_me:13028: error: cannot find input file: $f" >&5
13029 echo "$as_me: error: cannot find input file: $f" >&2;}
13030    { (exit 1); exit 1; }; }
13031          echo $f;;
13032       *) # Relative
13033          if test -f "$f"; then
13034            # Build tree
13035            echo $f
13036          elif test -f "$srcdir/$f"; then
13037            # Source tree
13038            echo $srcdir/$f
13039          else
13040            # /dev/null tree
13041            { { echo "$as_me:13041: error: cannot find input file: $f" >&5
13042 echo "$as_me: error: cannot find input file: $f" >&2;}
13043    { (exit 1); exit 1; }; }
13044          fi;;
13045       esac
13046     done` || { (exit 1); exit 1; }
13047 EOF
13048 cat >>$CONFIG_STATUS <<\EOF
13049   ac_warn_datarootdir=no
13050   if test x"$ac_file" != x-; then
13051     for ac_item in $ac_file_inputs
13052     do
13053       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
13054       if test -n "$ac_seen"; then
13055         ac_used=`grep '@datarootdir@' $ac_item`
13056         if test -z "$ac_used"; then
13057           { echo "$as_me:13057: WARNING: datarootdir was used implicitly but not set:
13058 $ac_seen" >&5
13059 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
13060 $ac_seen" >&2;}
13061           ac_warn_datarootdir=yes
13062         fi
13063       fi
13064       ac_seen=`grep '${datarootdir}' $ac_item`
13065       if test -n "$ac_seen"; then
13066         { echo "$as_me:13066: WARNING: datarootdir was used explicitly but not set:
13067 $ac_seen" >&5
13068 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
13069 $ac_seen" >&2;}
13070         ac_warn_datarootdir=yes
13071       fi
13072     done
13073   fi
13074
13075 if test "x$ac_warn_datarootdir" = xyes; then
13076   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
13077 fi
13078
13079 EOF
13080 cat >>$CONFIG_STATUS <<EOF
13081   sed "$ac_vpsub
13082 $extrasub
13083 EOF
13084 cat >>$CONFIG_STATUS <<\EOF
13085 :t
13086 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
13087 s,@configure_input@,$configure_input,;t t
13088 s,@srcdir@,$ac_srcdir,;t t
13089 s,@top_srcdir@,$ac_top_srcdir,;t t
13090 s,@INSTALL@,$ac_INSTALL,;t t
13091 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
13092   rm -f $tmp/stdin
13093   if test x"$ac_file" != x-; then
13094     cp $tmp/out $ac_file
13095
13096     for ac_name in prefix exec_prefix datarootdir
13097     do
13098         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
13099         if test -n "$ac_seen"; then
13100             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
13101             if test -z "$ac_init"; then
13102               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
13103               { echo "$as_me:13103: WARNING: Variable $ac_name is used but was not set:
13104 $ac_seen" >&5
13105 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
13106 $ac_seen" >&2;}
13107             fi
13108         fi
13109     done
13110     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
13111     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
13112     if test -s $tmp/out; then
13113       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
13114       { echo "$as_me:13114: WARNING: Some variables may not be substituted:
13115 $ac_seen" >&5
13116 echo "$as_me: WARNING: Some variables may not be substituted:
13117 $ac_seen" >&2;}
13118     fi
13119   else
13120     cat $tmp/out
13121   fi
13122   rm -f $tmp/out
13123
13124 done
13125 EOF
13126 cat >>$CONFIG_STATUS <<\EOF
13127
13128 #
13129 # CONFIG_HEADER section.
13130 #
13131
13132 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13133 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13134 #
13135 # ac_d sets the value in "#define NAME VALUE" lines.
13136 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13137 ac_dB='[        ].*$,\1#\2'
13138 ac_dC=' '
13139 ac_dD=',;t'
13140 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13141 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13142 ac_iB='\([      ]\),\1#\2define\3'
13143 ac_iC=' '
13144 ac_iD='\4,;t'
13145 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13146 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13147 ac_uB='$,\1#\2define\3'
13148 ac_uC=' '
13149 ac_uD=',;t'
13150
13151 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
13152   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13153   case $ac_file in
13154   - | *:- | *:-:* ) # input from stdin
13155         cat >$tmp/stdin
13156         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
13157         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
13158   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
13159         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
13160   * )   ac_file_in=$ac_file.in ;;
13161   esac
13162
13163   test x"$ac_file" != x- && { echo "$as_me:13163: creating $ac_file" >&5
13164 echo "$as_me: creating $ac_file" >&6;}
13165
13166   # First look for the input files in the build tree, otherwise in the
13167   # src tree.
13168   ac_file_inputs=`IFS=:
13169     for f in $ac_file_in; do
13170       case $f in
13171       -) echo $tmp/stdin ;;
13172       [\\/$]*)
13173          # Absolute (can't be DOS-style, as IFS=:)
13174          test -f "$f" || { { echo "$as_me:13174: error: cannot find input file: $f" >&5
13175 echo "$as_me: error: cannot find input file: $f" >&2;}
13176    { (exit 1); exit 1; }; }
13177          echo $f;;
13178       *) # Relative
13179          if test -f "$f"; then
13180            # Build tree
13181            echo $f
13182          elif test -f "$srcdir/$f"; then
13183            # Source tree
13184            echo $srcdir/$f
13185          else
13186            # /dev/null tree
13187            { { echo "$as_me:13187: error: cannot find input file: $f" >&5
13188 echo "$as_me: error: cannot find input file: $f" >&2;}
13189    { (exit 1); exit 1; }; }
13190          fi;;
13191       esac
13192     done` || { (exit 1); exit 1; }
13193   # Remove the trailing spaces.
13194   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
13195
13196 EOF
13197
13198 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
13199 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
13200 # be either 'cat' or 'sort'.
13201 cat confdefs.h | uniq >conftest.vals
13202
13203 # Break up conftest.vals because some shells have a limit on
13204 # the size of here documents, and old seds have small limits too.
13205
13206 rm -f conftest.tail
13207 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
13208 while grep . conftest.vals >/dev/null
13209 do
13210   # Write chunks of a limited-size here document to conftest.frag.
13211   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
13212   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
13213   echo 'CEOF' >> $CONFIG_STATUS
13214   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13215   rm -f conftest.vals
13216   mv conftest.tail conftest.vals
13217 done
13218 rm -f conftest.vals
13219
13220 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
13221 # marker @DEFS@.
13222 echo '  cat >> conftest.edit <<CEOF
13223 /@DEFS@/r conftest.frag
13224 /@DEFS@/d
13225 CEOF
13226 sed -f conftest.edit $tmp/in > $tmp/out
13227 rm -f $tmp/in
13228 mv $tmp/out $tmp/in
13229 rm -f conftest.edit conftest.frag
13230 ' >> $CONFIG_STATUS
13231
13232 cat >>$CONFIG_STATUS <<\EOF
13233   # Let's still pretend it is `configure' which instantiates (i.e., don't
13234   # use $as_me), people would be surprised to read:
13235   #    /* config.h.  Generated automatically by config.status.  */
13236   if test x"$ac_file" = x-; then
13237     echo "/* Generated automatically by configure.  */" >$tmp/config.h
13238   else
13239     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
13240   fi
13241   cat $tmp/in >>$tmp/config.h
13242   rm -f $tmp/in
13243   if test x"$ac_file" != x-; then
13244     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
13245       { echo "$as_me:13245: $ac_file is unchanged" >&5
13246 echo "$as_me: $ac_file is unchanged" >&6;}
13247     else
13248       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13249          X"$ac_file" : 'X\(//\)[^/]' \| \
13250          X"$ac_file" : 'X\(//\)$' \| \
13251          X"$ac_file" : 'X\(/\)' \| \
13252          .     : '\(.\)' 2>/dev/null ||
13253 echo X"$ac_file" |
13254     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13255           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13256           /^X\(\/\/\)$/{ s//\1/; q; }
13257           /^X\(\/\).*/{ s//\1/; q; }
13258           s/.*/./; q'`
13259       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13260         { case "$ac_dir" in
13261   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
13262   *)                      as_incr_dir=.;;
13263 esac
13264 as_dummy="$ac_dir"
13265 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
13266   case $as_mkdir_dir in
13267     # Skip DOS drivespec
13268     ?:) as_incr_dir=$as_mkdir_dir ;;
13269     *)
13270       as_incr_dir=$as_incr_dir/$as_mkdir_dir
13271       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
13272     ;;
13273   esac
13274 done; }
13275
13276       fi
13277       rm -f $ac_file
13278       mv $tmp/config.h $ac_file
13279     fi
13280   else
13281     cat $tmp/config.h
13282     rm -f $tmp/config.h
13283   fi
13284 done
13285 EOF
13286 cat >>$CONFIG_STATUS <<\EOF
13287 #
13288 # CONFIG_COMMANDS section.
13289 #
13290 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
13291   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
13292   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
13293
13294   case $ac_dest in
13295     default )
13296 if test -z "$USE_OLD_MAKERULES" ; then
13297         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
13298 fi
13299  ;;
13300   esac
13301 done
13302 EOF
13303
13304 cat >>$CONFIG_STATUS <<\EOF
13305
13306 { (exit 0); exit 0; }
13307 EOF
13308 chmod +x $CONFIG_STATUS
13309 ac_clean_files=$ac_clean_files_save
13310
13311 # configure is writing to config.log, and then calls config.status.
13312 # config.status does its own redirection, appending to config.log.
13313 # Unfortunately, on DOS this fails, as config.log is still kept open
13314 # by configure, so config.status won't be able to write to it; its
13315 # output is simply discarded.  So we exec the FD to /dev/null,
13316 # effectively closing config.log, so it can be properly (re)opened and
13317 # appended to by config.status.  When coming back to configure, we
13318 # need to make the FD available again.
13319 if test "$no_create" != yes; then
13320   ac_cs_success=:
13321   exec 5>/dev/null
13322   $SHELL $CONFIG_STATUS || ac_cs_success=false
13323   exec 5>>config.log
13324   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
13325   # would make configure fail if this is the last instruction.
13326   $ac_cs_success || { (exit 1); exit 1; }
13327 fi
13328 ${MAKE:-make} preinstall