]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 5.9 - patch 20140712
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.55 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20121002.
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.20121002.  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"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
978   *c*,-n*) ECHO_N= ECHO_C='
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 #(vi
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 #(vi
1817         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1818                 case $cf_add_cflags in
1819                 -D*)
1820                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1821
1822                         test "${cf_add_cflags}" != "${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) #(vi
1837                         ;;
1838                 *) #(vi
1839                         case $cf_add_cflags in #(vi
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 "${cf_add_cflags}" != "${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 #(vi
2416 no) #(vi
2417         PKG_CONFIG=none
2418         ;;
2419 yes) #(vi
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 #(vi
2521 .\$\(*\)*|.\'*\'*) #(vi
2522   ;;
2523 ..|./*|.\\*) #(vi
2524   ;;
2525 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2526   ;;
2527 .\${*prefix}*|.\${*dir}*) #(vi
2528   eval PKG_CONFIG="$PKG_CONFIG"
2529   case ".$PKG_CONFIG" in #(vi
2530   .NONE/*)
2531     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2532     ;;
2533   esac
2534   ;; #(vi
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 fi
2546
2547 if test "$PKG_CONFIG" != none ; then
2548         echo "$as_me:2548: checking for $PKG_CONFIG library directory" >&5
2549 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2550
2551 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2552 if test "${with_pkg_config_libdir+set}" = set; then
2553   withval="$with_pkg_config_libdir"
2554   PKG_CONFIG_LIBDIR=$withval
2555 else
2556   PKG_CONFIG_LIBDIR=yes
2557 fi;
2558
2559         case x$PKG_CONFIG_LIBDIR in #(vi
2560         x/*) #(vi
2561                 ;;
2562         xyes) #(vi
2563                 # look for the library directory using the same prefix as the executable
2564                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2565                 case x`(arch) 2>/dev/null` in #(vi
2566                 *64) #(vi
2567                         for cf_config in $cf_path/share $cf_path/lib64 $cf_path/lib32 $cf_path/lib
2568                         do
2569                                 if test -d $cf_config/pkgconfig
2570                                 then
2571                                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2572                                         break
2573                                 fi
2574                         done
2575                         ;;
2576                 *)
2577                         PKG_CONFIG_LIBDIR=$cf_path/lib/pkgconfig
2578                         ;;
2579                 esac
2580                 ;;
2581         *)
2582                 ;;
2583         esac
2584
2585         echo "$as_me:2585: result: $PKG_CONFIG_LIBDIR" >&5
2586 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2587 fi
2588
2589 echo "$as_me:2589: checking if you want to build test-programs" >&5
2590 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2591
2592 # Check whether --with-tests or --without-tests was given.
2593 if test "${with_tests+set}" = set; then
2594   withval="$with_tests"
2595   cf_with_tests=$withval
2596 else
2597   cf_with_tests=yes
2598 fi;
2599 echo "$as_me:2599: result: $cf_with_tests" >&5
2600 echo "${ECHO_T}$cf_with_tests" >&6
2601
2602 echo "$as_me:2602: checking if we should assume mixed-case filenames" >&5
2603 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2604
2605 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2606 if test "${enable_mixed_case+set}" = set; then
2607   enableval="$enable_mixed_case"
2608   enable_mixedcase=$enableval
2609 else
2610   enable_mixedcase=auto
2611 fi;
2612 echo "$as_me:2612: result: $enable_mixedcase" >&5
2613 echo "${ECHO_T}$enable_mixedcase" >&6
2614 if test "$enable_mixedcase" = "auto" ; then
2615
2616 echo "$as_me:2616: checking if filesystem supports mixed-case filenames" >&5
2617 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2618 if test "${cf_cv_mixedcase+set}" = set; then
2619   echo $ECHO_N "(cached) $ECHO_C" >&6
2620 else
2621
2622 if test "$cross_compiling" = yes ; then
2623         case $target_alias in #(vi
2624         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
2625                 cf_cv_mixedcase=no
2626                 ;;
2627         *)
2628                 cf_cv_mixedcase=yes
2629                 ;;
2630         esac
2631 else
2632         rm -f conftest CONFTEST
2633         echo test >conftest
2634         if test -f CONFTEST ; then
2635                 cf_cv_mixedcase=no
2636         else
2637                 cf_cv_mixedcase=yes
2638         fi
2639         rm -f conftest CONFTEST
2640 fi
2641
2642 fi
2643 echo "$as_me:2643: result: $cf_cv_mixedcase" >&5
2644 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2645 test "$cf_cv_mixedcase" = yes &&
2646 cat >>confdefs.h <<\EOF
2647 #define MIXEDCASE_FILENAMES 1
2648 EOF
2649
2650 else
2651     cf_cv_mixedcase=$enable_mixedcase
2652     if test "$enable_mixedcase" = "yes" ; then
2653         cat >>confdefs.h <<\EOF
2654 #define MIXEDCASE_FILENAMES 1
2655 EOF
2656
2657     fi
2658 fi
2659
2660 # do this after mixed-case option (tags/TAGS is not as important as tic).
2661 echo "$as_me:2661: checking whether ${MAKE-make} sets \${MAKE}" >&5
2662 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2663 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2664 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2665   echo $ECHO_N "(cached) $ECHO_C" >&6
2666 else
2667   cat >conftest.make <<\EOF
2668 all:
2669         @echo 'ac_maketemp="${MAKE}"'
2670 EOF
2671 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2672 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2673 if test -n "$ac_maketemp"; then
2674   eval ac_cv_prog_make_${ac_make}_set=yes
2675 else
2676   eval ac_cv_prog_make_${ac_make}_set=no
2677 fi
2678 rm -f conftest.make
2679 fi
2680 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2681   echo "$as_me:2681: result: yes" >&5
2682 echo "${ECHO_T}yes" >&6
2683   SET_MAKE=
2684 else
2685   echo "$as_me:2685: result: no" >&5
2686 echo "${ECHO_T}no" >&6
2687   SET_MAKE="MAKE=${MAKE-make}"
2688 fi
2689
2690 for ac_prog in exctags ctags
2691 do
2692   # Extract the first word of "$ac_prog", so it can be a program name with args.
2693 set dummy $ac_prog; ac_word=$2
2694 echo "$as_me:2694: checking for $ac_word" >&5
2695 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2696 if test "${ac_cv_prog_CTAGS+set}" = set; then
2697   echo $ECHO_N "(cached) $ECHO_C" >&6
2698 else
2699   if test -n "$CTAGS"; then
2700   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2701 else
2702   ac_save_IFS=$IFS; IFS=$ac_path_separator
2703 ac_dummy="$PATH"
2704 for ac_dir in $ac_dummy; do
2705   IFS=$ac_save_IFS
2706   test -z "$ac_dir" && ac_dir=.
2707   $as_executable_p "$ac_dir/$ac_word" || continue
2708 ac_cv_prog_CTAGS="$ac_prog"
2709 echo "$as_me:2709: found $ac_dir/$ac_word" >&5
2710 break
2711 done
2712
2713 fi
2714 fi
2715 CTAGS=$ac_cv_prog_CTAGS
2716 if test -n "$CTAGS"; then
2717   echo "$as_me:2717: result: $CTAGS" >&5
2718 echo "${ECHO_T}$CTAGS" >&6
2719 else
2720   echo "$as_me:2720: result: no" >&5
2721 echo "${ECHO_T}no" >&6
2722 fi
2723
2724   test -n "$CTAGS" && break
2725 done
2726
2727 for ac_prog in exetags etags
2728 do
2729   # Extract the first word of "$ac_prog", so it can be a program name with args.
2730 set dummy $ac_prog; ac_word=$2
2731 echo "$as_me:2731: checking for $ac_word" >&5
2732 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2733 if test "${ac_cv_prog_ETAGS+set}" = set; then
2734   echo $ECHO_N "(cached) $ECHO_C" >&6
2735 else
2736   if test -n "$ETAGS"; then
2737   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2738 else
2739   ac_save_IFS=$IFS; IFS=$ac_path_separator
2740 ac_dummy="$PATH"
2741 for ac_dir in $ac_dummy; do
2742   IFS=$ac_save_IFS
2743   test -z "$ac_dir" && ac_dir=.
2744   $as_executable_p "$ac_dir/$ac_word" || continue
2745 ac_cv_prog_ETAGS="$ac_prog"
2746 echo "$as_me:2746: found $ac_dir/$ac_word" >&5
2747 break
2748 done
2749
2750 fi
2751 fi
2752 ETAGS=$ac_cv_prog_ETAGS
2753 if test -n "$ETAGS"; then
2754   echo "$as_me:2754: result: $ETAGS" >&5
2755 echo "${ECHO_T}$ETAGS" >&6
2756 else
2757   echo "$as_me:2757: result: no" >&5
2758 echo "${ECHO_T}no" >&6
2759 fi
2760
2761   test -n "$ETAGS" && break
2762 done
2763
2764 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2765 set dummy ${CTAGS:-ctags}; ac_word=$2
2766 echo "$as_me:2766: checking for $ac_word" >&5
2767 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2768 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2769   echo $ECHO_N "(cached) $ECHO_C" >&6
2770 else
2771   if test -n "$MAKE_LOWER_TAGS"; then
2772   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2773 else
2774   ac_save_IFS=$IFS; IFS=$ac_path_separator
2775 ac_dummy="$PATH"
2776 for ac_dir in $ac_dummy; do
2777   IFS=$ac_save_IFS
2778   test -z "$ac_dir" && ac_dir=.
2779   $as_executable_p "$ac_dir/$ac_word" || continue
2780 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2781 echo "$as_me:2781: found $ac_dir/$ac_word" >&5
2782 break
2783 done
2784
2785   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2786 fi
2787 fi
2788 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2789 if test -n "$MAKE_LOWER_TAGS"; then
2790   echo "$as_me:2790: result: $MAKE_LOWER_TAGS" >&5
2791 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2792 else
2793   echo "$as_me:2793: result: no" >&5
2794 echo "${ECHO_T}no" >&6
2795 fi
2796
2797 if test "$cf_cv_mixedcase" = yes ; then
2798         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2799 set dummy ${ETAGS:-etags}; ac_word=$2
2800 echo "$as_me:2800: checking for $ac_word" >&5
2801 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2802 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2803   echo $ECHO_N "(cached) $ECHO_C" >&6
2804 else
2805   if test -n "$MAKE_UPPER_TAGS"; then
2806   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2807 else
2808   ac_save_IFS=$IFS; IFS=$ac_path_separator
2809 ac_dummy="$PATH"
2810 for ac_dir in $ac_dummy; do
2811   IFS=$ac_save_IFS
2812   test -z "$ac_dir" && ac_dir=.
2813   $as_executable_p "$ac_dir/$ac_word" || continue
2814 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2815 echo "$as_me:2815: found $ac_dir/$ac_word" >&5
2816 break
2817 done
2818
2819   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2820 fi
2821 fi
2822 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2823 if test -n "$MAKE_UPPER_TAGS"; then
2824   echo "$as_me:2824: result: $MAKE_UPPER_TAGS" >&5
2825 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2826 else
2827   echo "$as_me:2827: result: no" >&5
2828 echo "${ECHO_T}no" >&6
2829 fi
2830
2831 else
2832         MAKE_UPPER_TAGS=no
2833 fi
2834
2835 if test "$MAKE_UPPER_TAGS" = yes ; then
2836         MAKE_UPPER_TAGS=
2837 else
2838         MAKE_UPPER_TAGS="#"
2839 fi
2840
2841 if test "$MAKE_LOWER_TAGS" = yes ; then
2842         MAKE_LOWER_TAGS=
2843 else
2844         MAKE_LOWER_TAGS="#"
2845 fi
2846
2847 echo "$as_me:2847: checking for makeflags variable" >&5
2848 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2849 if test "${cf_cv_makeflags+set}" = set; then
2850   echo $ECHO_N "(cached) $ECHO_C" >&6
2851 else
2852
2853         cf_cv_makeflags=''
2854         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2855         do
2856                 cat >cf_makeflags.tmp <<CF_EOF
2857 SHELL = /bin/sh
2858 all :
2859         @ echo '.$cf_option'
2860 CF_EOF
2861                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2862                 case "$cf_result" in
2863                 .*k|.*kw)
2864                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2865                         case "$cf_result" in
2866                         .*CC=*) cf_cv_makeflags=
2867                                 ;;
2868                         *)      cf_cv_makeflags=$cf_option
2869                                 ;;
2870                         esac
2871                         break
2872                         ;;
2873                 .-)     ;;
2874                 *)      echo "given option \"$cf_option\", no match \"$cf_result\""
2875                         ;;
2876                 esac
2877         done
2878         rm -f cf_makeflags.tmp
2879
2880 fi
2881 echo "$as_me:2881: result: $cf_cv_makeflags" >&5
2882 echo "${ECHO_T}$cf_cv_makeflags" >&6
2883
2884 if test -n "$ac_tool_prefix"; then
2885   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2886 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2887 echo "$as_me:2887: checking for $ac_word" >&5
2888 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2889 if test "${ac_cv_prog_RANLIB+set}" = set; then
2890   echo $ECHO_N "(cached) $ECHO_C" >&6
2891 else
2892   if test -n "$RANLIB"; then
2893   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2894 else
2895   ac_save_IFS=$IFS; IFS=$ac_path_separator
2896 ac_dummy="$PATH"
2897 for ac_dir in $ac_dummy; do
2898   IFS=$ac_save_IFS
2899   test -z "$ac_dir" && ac_dir=.
2900   $as_executable_p "$ac_dir/$ac_word" || continue
2901 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2902 echo "$as_me:2902: found $ac_dir/$ac_word" >&5
2903 break
2904 done
2905
2906 fi
2907 fi
2908 RANLIB=$ac_cv_prog_RANLIB
2909 if test -n "$RANLIB"; then
2910   echo "$as_me:2910: result: $RANLIB" >&5
2911 echo "${ECHO_T}$RANLIB" >&6
2912 else
2913   echo "$as_me:2913: result: no" >&5
2914 echo "${ECHO_T}no" >&6
2915 fi
2916
2917 fi
2918 if test -z "$ac_cv_prog_RANLIB"; then
2919   ac_ct_RANLIB=$RANLIB
2920   # Extract the first word of "ranlib", so it can be a program name with args.
2921 set dummy ranlib; ac_word=$2
2922 echo "$as_me:2922: checking for $ac_word" >&5
2923 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2924 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2925   echo $ECHO_N "(cached) $ECHO_C" >&6
2926 else
2927   if test -n "$ac_ct_RANLIB"; then
2928   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2929 else
2930   ac_save_IFS=$IFS; IFS=$ac_path_separator
2931 ac_dummy="$PATH"
2932 for ac_dir in $ac_dummy; do
2933   IFS=$ac_save_IFS
2934   test -z "$ac_dir" && ac_dir=.
2935   $as_executable_p "$ac_dir/$ac_word" || continue
2936 ac_cv_prog_ac_ct_RANLIB="ranlib"
2937 echo "$as_me:2937: found $ac_dir/$ac_word" >&5
2938 break
2939 done
2940
2941   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
2942 fi
2943 fi
2944 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2945 if test -n "$ac_ct_RANLIB"; then
2946   echo "$as_me:2946: result: $ac_ct_RANLIB" >&5
2947 echo "${ECHO_T}$ac_ct_RANLIB" >&6
2948 else
2949   echo "$as_me:2949: result: no" >&5
2950 echo "${ECHO_T}no" >&6
2951 fi
2952
2953   RANLIB=$ac_ct_RANLIB
2954 else
2955   RANLIB="$ac_cv_prog_RANLIB"
2956 fi
2957
2958 if test -n "$ac_tool_prefix"; then
2959   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
2960 set dummy ${ac_tool_prefix}ld; ac_word=$2
2961 echo "$as_me:2961: checking for $ac_word" >&5
2962 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2963 if test "${ac_cv_prog_LD+set}" = set; then
2964   echo $ECHO_N "(cached) $ECHO_C" >&6
2965 else
2966   if test -n "$LD"; then
2967   ac_cv_prog_LD="$LD" # Let the user override the test.
2968 else
2969   ac_save_IFS=$IFS; IFS=$ac_path_separator
2970 ac_dummy="$PATH"
2971 for ac_dir in $ac_dummy; do
2972   IFS=$ac_save_IFS
2973   test -z "$ac_dir" && ac_dir=.
2974   $as_executable_p "$ac_dir/$ac_word" || continue
2975 ac_cv_prog_LD="${ac_tool_prefix}ld"
2976 echo "$as_me:2976: found $ac_dir/$ac_word" >&5
2977 break
2978 done
2979
2980 fi
2981 fi
2982 LD=$ac_cv_prog_LD
2983 if test -n "$LD"; then
2984   echo "$as_me:2984: result: $LD" >&5
2985 echo "${ECHO_T}$LD" >&6
2986 else
2987   echo "$as_me:2987: result: no" >&5
2988 echo "${ECHO_T}no" >&6
2989 fi
2990
2991 fi
2992 if test -z "$ac_cv_prog_LD"; then
2993   ac_ct_LD=$LD
2994   # Extract the first word of "ld", so it can be a program name with args.
2995 set dummy ld; ac_word=$2
2996 echo "$as_me:2996: checking for $ac_word" >&5
2997 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2998 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
2999   echo $ECHO_N "(cached) $ECHO_C" >&6
3000 else
3001   if test -n "$ac_ct_LD"; then
3002   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3003 else
3004   ac_save_IFS=$IFS; IFS=$ac_path_separator
3005 ac_dummy="$PATH"
3006 for ac_dir in $ac_dummy; do
3007   IFS=$ac_save_IFS
3008   test -z "$ac_dir" && ac_dir=.
3009   $as_executable_p "$ac_dir/$ac_word" || continue
3010 ac_cv_prog_ac_ct_LD="ld"
3011 echo "$as_me:3011: found $ac_dir/$ac_word" >&5
3012 break
3013 done
3014
3015   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3016 fi
3017 fi
3018 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3019 if test -n "$ac_ct_LD"; then
3020   echo "$as_me:3020: result: $ac_ct_LD" >&5
3021 echo "${ECHO_T}$ac_ct_LD" >&6
3022 else
3023   echo "$as_me:3023: result: no" >&5
3024 echo "${ECHO_T}no" >&6
3025 fi
3026
3027   LD=$ac_ct_LD
3028 else
3029   LD="$ac_cv_prog_LD"
3030 fi
3031
3032 if test -n "$ac_tool_prefix"; then
3033   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3034 set dummy ${ac_tool_prefix}ar; ac_word=$2
3035 echo "$as_me:3035: checking for $ac_word" >&5
3036 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3037 if test "${ac_cv_prog_AR+set}" = set; then
3038   echo $ECHO_N "(cached) $ECHO_C" >&6
3039 else
3040   if test -n "$AR"; then
3041   ac_cv_prog_AR="$AR" # Let the user override the test.
3042 else
3043   ac_save_IFS=$IFS; IFS=$ac_path_separator
3044 ac_dummy="$PATH"
3045 for ac_dir in $ac_dummy; do
3046   IFS=$ac_save_IFS
3047   test -z "$ac_dir" && ac_dir=.
3048   $as_executable_p "$ac_dir/$ac_word" || continue
3049 ac_cv_prog_AR="${ac_tool_prefix}ar"
3050 echo "$as_me:3050: found $ac_dir/$ac_word" >&5
3051 break
3052 done
3053
3054 fi
3055 fi
3056 AR=$ac_cv_prog_AR
3057 if test -n "$AR"; then
3058   echo "$as_me:3058: result: $AR" >&5
3059 echo "${ECHO_T}$AR" >&6
3060 else
3061   echo "$as_me:3061: result: no" >&5
3062 echo "${ECHO_T}no" >&6
3063 fi
3064
3065 fi
3066 if test -z "$ac_cv_prog_AR"; then
3067   ac_ct_AR=$AR
3068   # Extract the first word of "ar", so it can be a program name with args.
3069 set dummy ar; ac_word=$2
3070 echo "$as_me:3070: checking for $ac_word" >&5
3071 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3072 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3073   echo $ECHO_N "(cached) $ECHO_C" >&6
3074 else
3075   if test -n "$ac_ct_AR"; then
3076   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3077 else
3078   ac_save_IFS=$IFS; IFS=$ac_path_separator
3079 ac_dummy="$PATH"
3080 for ac_dir in $ac_dummy; do
3081   IFS=$ac_save_IFS
3082   test -z "$ac_dir" && ac_dir=.
3083   $as_executable_p "$ac_dir/$ac_word" || continue
3084 ac_cv_prog_ac_ct_AR="ar"
3085 echo "$as_me:3085: found $ac_dir/$ac_word" >&5
3086 break
3087 done
3088
3089   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3090 fi
3091 fi
3092 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3093 if test -n "$ac_ct_AR"; then
3094   echo "$as_me:3094: result: $ac_ct_AR" >&5
3095 echo "${ECHO_T}$ac_ct_AR" >&6
3096 else
3097   echo "$as_me:3097: result: no" >&5
3098 echo "${ECHO_T}no" >&6
3099 fi
3100
3101   AR=$ac_ct_AR
3102 else
3103   AR="$ac_cv_prog_AR"
3104 fi
3105
3106 if test -n "$ac_tool_prefix"; then
3107   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3108 set dummy ${ac_tool_prefix}ar; ac_word=$2
3109 echo "$as_me:3109: checking for $ac_word" >&5
3110 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3111 if test "${ac_cv_prog_AR+set}" = set; then
3112   echo $ECHO_N "(cached) $ECHO_C" >&6
3113 else
3114   if test -n "$AR"; then
3115   ac_cv_prog_AR="$AR" # Let the user override the test.
3116 else
3117   ac_save_IFS=$IFS; IFS=$ac_path_separator
3118 ac_dummy="$PATH"
3119 for ac_dir in $ac_dummy; do
3120   IFS=$ac_save_IFS
3121   test -z "$ac_dir" && ac_dir=.
3122   $as_executable_p "$ac_dir/$ac_word" || continue
3123 ac_cv_prog_AR="${ac_tool_prefix}ar"
3124 echo "$as_me:3124: found $ac_dir/$ac_word" >&5
3125 break
3126 done
3127
3128 fi
3129 fi
3130 AR=$ac_cv_prog_AR
3131 if test -n "$AR"; then
3132   echo "$as_me:3132: result: $AR" >&5
3133 echo "${ECHO_T}$AR" >&6
3134 else
3135   echo "$as_me:3135: result: no" >&5
3136 echo "${ECHO_T}no" >&6
3137 fi
3138
3139 fi
3140 if test -z "$ac_cv_prog_AR"; then
3141   ac_ct_AR=$AR
3142   # Extract the first word of "ar", so it can be a program name with args.
3143 set dummy ar; ac_word=$2
3144 echo "$as_me:3144: checking for $ac_word" >&5
3145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3146 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3147   echo $ECHO_N "(cached) $ECHO_C" >&6
3148 else
3149   if test -n "$ac_ct_AR"; then
3150   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3151 else
3152   ac_save_IFS=$IFS; IFS=$ac_path_separator
3153 ac_dummy="$PATH"
3154 for ac_dir in $ac_dummy; do
3155   IFS=$ac_save_IFS
3156   test -z "$ac_dir" && ac_dir=.
3157   $as_executable_p "$ac_dir/$ac_word" || continue
3158 ac_cv_prog_ac_ct_AR="ar"
3159 echo "$as_me:3159: found $ac_dir/$ac_word" >&5
3160 break
3161 done
3162
3163   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3164 fi
3165 fi
3166 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3167 if test -n "$ac_ct_AR"; then
3168   echo "$as_me:3168: result: $ac_ct_AR" >&5
3169 echo "${ECHO_T}$ac_ct_AR" >&6
3170 else
3171   echo "$as_me:3171: result: no" >&5
3172 echo "${ECHO_T}no" >&6
3173 fi
3174
3175   AR=$ac_ct_AR
3176 else
3177   AR="$ac_cv_prog_AR"
3178 fi
3179
3180 echo "$as_me:3180: checking for options to update archives" >&5
3181 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3182 if test "${cf_cv_ar_flags+set}" = set; then
3183   echo $ECHO_N "(cached) $ECHO_C" >&6
3184 else
3185
3186         cf_cv_ar_flags=unknown
3187         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3188         do
3189
3190                 # check if $ARFLAGS already contains this choice
3191                 if test "x$ARFLAGS" != "x" ; then
3192                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3193                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3194                                 cf_cv_ar_flags=
3195                                 break
3196                         fi
3197                 fi
3198
3199                 rm -f conftest.$ac_cv_objext
3200                 rm -f conftest.a
3201
3202                 cat >conftest.$ac_ext <<EOF
3203 #line 3203 "configure"
3204 int     testdata[3] = { 123, 456, 789 };
3205 EOF
3206                 if { (eval echo "$as_me:3206: \"$ac_compile\"") >&5
3207   (eval $ac_compile) 2>&5
3208   ac_status=$?
3209   echo "$as_me:3209: \$? = $ac_status" >&5
3210   (exit $ac_status); } ; then
3211                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3212                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3213                         if test -f conftest.a ; then
3214                                 cf_cv_ar_flags=$cf_ar_flags
3215                                 break
3216                         fi
3217                 else
3218                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3219
3220 echo "${as_me:-configure}:3220: testing cannot compile test-program ..." 1>&5
3221
3222                         break
3223                 fi
3224         done
3225         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3226
3227 fi
3228 echo "$as_me:3228: result: $cf_cv_ar_flags" >&5
3229 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3230
3231 if test -n "$ARFLAGS" ; then
3232         if test -n "$cf_cv_ar_flags" ; then
3233                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3234         fi
3235 else
3236         ARFLAGS=$cf_cv_ar_flags
3237 fi
3238
3239         echo "$as_me:3239: checking for PATH separator" >&5
3240 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3241         case $cf_cv_system_name in
3242         os2*)   PATH_SEPARATOR=';'  ;;
3243         *)      ${PATH_SEPARATOR:=':'}  ;;
3244         esac
3245
3246         echo "$as_me:3246: result: $PATH_SEPARATOR" >&5
3247 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3248
3249 echo "$as_me:3249: checking if you have specified an install-prefix" >&5
3250 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3251
3252 # Check whether --with-install-prefix or --without-install-prefix was given.
3253 if test "${with_install_prefix+set}" = set; then
3254   withval="$with_install_prefix"
3255   case "$withval" in #(vi
3256         yes|no) #(vi
3257                 ;;
3258         *)      DESTDIR="$withval"
3259                 ;;
3260         esac
3261 fi;
3262 echo "$as_me:3262: result: $DESTDIR" >&5
3263 echo "${ECHO_T}$DESTDIR" >&6
3264
3265 ###############################################################################
3266
3267 # If we're cross-compiling, allow the user to override the tools and their
3268 # options.  The configure script is oriented toward identifying the host
3269 # compiler, etc., but we need a build compiler to generate parts of the source.
3270
3271 if test "$cross_compiling" = yes ; then
3272
3273         # defaults that we might want to override
3274         : ${BUILD_CFLAGS:=''}
3275         : ${BUILD_CPPFLAGS:=''}
3276         : ${BUILD_LDFLAGS:=''}
3277         : ${BUILD_LIBS:=''}
3278         : ${BUILD_EXEEXT:='$x'}
3279         : ${BUILD_OBJEXT:='o'}
3280
3281 # Check whether --with-build-cc or --without-build-cc was given.
3282 if test "${with_build_cc+set}" = set; then
3283   withval="$with_build_cc"
3284   BUILD_CC="$withval"
3285 else
3286   for ac_prog in gcc cc cl
3287 do
3288   # Extract the first word of "$ac_prog", so it can be a program name with args.
3289 set dummy $ac_prog; ac_word=$2
3290 echo "$as_me:3290: checking for $ac_word" >&5
3291 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3292 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3293   echo $ECHO_N "(cached) $ECHO_C" >&6
3294 else
3295   if test -n "$BUILD_CC"; then
3296   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3297 else
3298   ac_save_IFS=$IFS; IFS=$ac_path_separator
3299 ac_dummy="$PATH"
3300 for ac_dir in $ac_dummy; do
3301   IFS=$ac_save_IFS
3302   test -z "$ac_dir" && ac_dir=.
3303   $as_executable_p "$ac_dir/$ac_word" || continue
3304 ac_cv_prog_BUILD_CC="$ac_prog"
3305 echo "$as_me:3305: found $ac_dir/$ac_word" >&5
3306 break
3307 done
3308
3309 fi
3310 fi
3311 BUILD_CC=$ac_cv_prog_BUILD_CC
3312 if test -n "$BUILD_CC"; then
3313   echo "$as_me:3313: result: $BUILD_CC" >&5
3314 echo "${ECHO_T}$BUILD_CC" >&6
3315 else
3316   echo "$as_me:3316: result: no" >&5
3317 echo "${ECHO_T}no" >&6
3318 fi
3319
3320   test -n "$BUILD_CC" && break
3321 done
3322
3323 fi;
3324         echo "$as_me:3324: checking for native build C compiler" >&5
3325 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3326         echo "$as_me:3326: result: $BUILD_CC" >&5
3327 echo "${ECHO_T}$BUILD_CC" >&6
3328
3329         echo "$as_me:3329: checking for native build C preprocessor" >&5
3330 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3331
3332 # Check whether --with-build-cpp or --without-build-cpp was given.
3333 if test "${with_build_cpp+set}" = set; then
3334   withval="$with_build_cpp"
3335   BUILD_CPP="$withval"
3336 else
3337   BUILD_CPP='${BUILD_CC} -E'
3338 fi;
3339         echo "$as_me:3339: result: $BUILD_CPP" >&5
3340 echo "${ECHO_T}$BUILD_CPP" >&6
3341
3342         echo "$as_me:3342: checking for native build C flags" >&5
3343 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3344
3345 # Check whether --with-build-cflags or --without-build-cflags was given.
3346 if test "${with_build_cflags+set}" = set; then
3347   withval="$with_build_cflags"
3348   BUILD_CFLAGS="$withval"
3349 fi;
3350         echo "$as_me:3350: result: $BUILD_CFLAGS" >&5
3351 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3352
3353         echo "$as_me:3353: checking for native build C preprocessor-flags" >&5
3354 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3355
3356 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3357 if test "${with_build_cppflags+set}" = set; then
3358   withval="$with_build_cppflags"
3359   BUILD_CPPFLAGS="$withval"
3360 fi;
3361         echo "$as_me:3361: result: $BUILD_CPPFLAGS" >&5
3362 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3363
3364         echo "$as_me:3364: checking for native build linker-flags" >&5
3365 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3366
3367 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3368 if test "${with_build_ldflags+set}" = set; then
3369   withval="$with_build_ldflags"
3370   BUILD_LDFLAGS="$withval"
3371 fi;
3372         echo "$as_me:3372: result: $BUILD_LDFLAGS" >&5
3373 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3374
3375         echo "$as_me:3375: checking for native build linker-libraries" >&5
3376 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3377
3378 # Check whether --with-build-libs or --without-build-libs was given.
3379 if test "${with_build_libs+set}" = set; then
3380   withval="$with_build_libs"
3381   BUILD_LIBS="$withval"
3382 fi;
3383         echo "$as_me:3383: result: $BUILD_LIBS" >&5
3384 echo "${ECHO_T}$BUILD_LIBS" >&6
3385
3386         # this assumes we're on Unix.
3387         BUILD_EXEEXT=
3388         BUILD_OBJEXT=o
3389
3390         : ${BUILD_CC:='${CC}'}
3391
3392         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3393                 { { echo "$as_me:3393: error: Cross-build requires two compilers.
3394 Use --with-build-cc to specify the native compiler." >&5
3395 echo "$as_me: error: Cross-build requires two compilers.
3396 Use --with-build-cc to specify the native compiler." >&2;}
3397    { (exit 1); exit 1; }; }
3398         fi
3399
3400 else
3401         : ${BUILD_CC:='${CC}'}
3402         : ${BUILD_CPP:='${CPP}'}
3403         : ${BUILD_CFLAGS:='${CFLAGS}'}
3404         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3405         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3406         : ${BUILD_LIBS:='${LIBS}'}
3407         : ${BUILD_EXEEXT:='$x'}
3408         : ${BUILD_OBJEXT:='o'}
3409 fi
3410
3411 ###############################################################################
3412
3413 ### Options to allow the user to specify the set of libraries which are used.
3414 ### Use "--without-normal --with-shared" to allow the default model to be
3415 ### shared, for example.
3416 cf_list_models=""
3417
3418 echo "$as_me:3418: checking if you want to build shared C-objects" >&5
3419 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3420
3421 # Check whether --with-shared or --without-shared was given.
3422 if test "${with_shared+set}" = set; then
3423   withval="$with_shared"
3424   with_shared=$withval
3425 else
3426   with_shared=no
3427 fi;
3428 echo "$as_me:3428: result: $with_shared" >&5
3429 echo "${ECHO_T}$with_shared" >&6
3430 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3431
3432 echo "$as_me:3432: checking for specified models" >&5
3433 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3434 test -z "$cf_list_models" && cf_list_models=normal
3435 echo "$as_me:3435: result: $cf_list_models" >&5
3436 echo "${ECHO_T}$cf_list_models" >&6
3437
3438 ### Use the first model as the default, and save its suffix for use in building
3439 ### up test-applications.
3440 echo "$as_me:3440: checking for default model" >&5
3441 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3442 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3443 echo "$as_me:3443: result: $DFT_LWR_MODEL" >&5
3444 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3445
3446 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3447
3448 echo "$as_me:3448: checking for specific curses-directory" >&5
3449 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3450
3451 # Check whether --with-curses-dir or --without-curses-dir was given.
3452 if test "${with_curses_dir+set}" = set; then
3453   withval="$with_curses_dir"
3454   cf_cv_curses_dir=$withval
3455 else
3456   cf_cv_curses_dir=no
3457 fi;
3458 echo "$as_me:3458: result: $cf_cv_curses_dir" >&5
3459 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3460
3461 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3462 then
3463
3464 if test "x$prefix" != xNONE; then
3465   cf_path_syntax="$prefix"
3466 else
3467   cf_path_syntax="$ac_default_prefix"
3468 fi
3469
3470 case ".$withval" in #(vi
3471 .\$\(*\)*|.\'*\'*) #(vi
3472   ;;
3473 ..|./*|.\\*) #(vi
3474   ;;
3475 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
3476   ;;
3477 .\${*prefix}*|.\${*dir}*) #(vi
3478   eval withval="$withval"
3479   case ".$withval" in #(vi
3480   .NONE/*)
3481     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3482     ;;
3483   esac
3484   ;; #(vi
3485 .no|.NONE/*)
3486   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3487   ;;
3488 *)
3489   { { echo "$as_me:3489: error: expected a pathname, not \"$withval\"" >&5
3490 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3491    { (exit 1); exit 1; }; }
3492   ;;
3493 esac
3494
3495         if test -d "$cf_cv_curses_dir"
3496         then
3497
3498 if test -n "$cf_cv_curses_dir/include" ; then
3499   for cf_add_incdir in $cf_cv_curses_dir/include
3500   do
3501         while test $cf_add_incdir != /usr/include
3502         do
3503           if test -d $cf_add_incdir
3504           then
3505                 cf_have_incdir=no
3506                 if test -n "$CFLAGS$CPPFLAGS" ; then
3507                   # a loop is needed to ensure we can add subdirs of existing dirs
3508                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3509                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3510                           cf_have_incdir=yes; break
3511                         fi
3512                   done
3513                 fi
3514
3515                 if test "$cf_have_incdir" = no ; then
3516                   if test "$cf_add_incdir" = /usr/local/include ; then
3517                         if test "$GCC" = yes
3518                         then
3519                           cf_save_CPPFLAGS=$CPPFLAGS
3520                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3521                           cat >conftest.$ac_ext <<_ACEOF
3522 #line 3522 "configure"
3523 #include "confdefs.h"
3524 #include <stdio.h>
3525 int
3526 main ()
3527 {
3528 printf("Hello")
3529   ;
3530   return 0;
3531 }
3532 _ACEOF
3533 rm -f conftest.$ac_objext
3534 if { (eval echo "$as_me:3534: \"$ac_compile\"") >&5
3535   (eval $ac_compile) 2>&5
3536   ac_status=$?
3537   echo "$as_me:3537: \$? = $ac_status" >&5
3538   (exit $ac_status); } &&
3539          { ac_try='test -s conftest.$ac_objext'
3540   { (eval echo "$as_me:3540: \"$ac_try\"") >&5
3541   (eval $ac_try) 2>&5
3542   ac_status=$?
3543   echo "$as_me:3543: \$? = $ac_status" >&5
3544   (exit $ac_status); }; }; then
3545   :
3546 else
3547   echo "$as_me: failed program was:" >&5
3548 cat conftest.$ac_ext >&5
3549 cf_have_incdir=yes
3550 fi
3551 rm -f conftest.$ac_objext conftest.$ac_ext
3552                           CPPFLAGS=$cf_save_CPPFLAGS
3553                         fi
3554                   fi
3555                 fi
3556
3557                 if test "$cf_have_incdir" = no ; then
3558                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3559
3560 echo "${as_me:-configure}:3560: testing adding $cf_add_incdir to include-path ..." 1>&5
3561
3562                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3563
3564                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3565                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3566                   cf_add_incdir="$cf_top_incdir"
3567                 else
3568                   break
3569                 fi
3570           fi
3571         done
3572   done
3573 fi
3574
3575 if test -n "$cf_cv_curses_dir/lib" ; then
3576   for cf_add_libdir in $cf_cv_curses_dir/lib
3577   do
3578     if test $cf_add_libdir = /usr/lib ; then
3579       :
3580     elif test -d $cf_add_libdir
3581     then
3582       cf_have_libdir=no
3583       if test -n "$LDFLAGS$LIBS" ; then
3584         # a loop is needed to ensure we can add subdirs of existing dirs
3585         for cf_test_libdir in $LDFLAGS $LIBS ; do
3586           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3587             cf_have_libdir=yes; break
3588           fi
3589         done
3590       fi
3591       if test "$cf_have_libdir" = no ; then
3592         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3593
3594 echo "${as_me:-configure}:3594: testing adding $cf_add_libdir to library-path ..." 1>&5
3595
3596         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3597       fi
3598     fi
3599   done
3600 fi
3601
3602         fi
3603 fi
3604
3605 echo "$as_me:3605: checking if you want wide-character code" >&5
3606 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3607
3608 # Check whether --enable-widec or --disable-widec was given.
3609 if test "${enable_widec+set}" = set; then
3610   enableval="$enable_widec"
3611   with_widec=$enableval
3612 else
3613   with_widec=no
3614 fi;
3615 echo "$as_me:3615: result: $with_widec" >&5
3616 echo "${ECHO_T}$with_widec" >&6
3617 if test "$with_widec" = yes ; then
3618
3619 echo "$as_me:3619: checking for multibyte character support" >&5
3620 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3621 if test "${cf_cv_utf8_lib+set}" = set; then
3622   echo $ECHO_N "(cached) $ECHO_C" >&6
3623 else
3624
3625         cf_save_LIBS="$LIBS"
3626         cat >conftest.$ac_ext <<_ACEOF
3627 #line 3627 "configure"
3628 #include "confdefs.h"
3629
3630 #include <stdlib.h>
3631 int
3632 main ()
3633 {
3634 putwc(0,0);
3635   ;
3636   return 0;
3637 }
3638 _ACEOF
3639 rm -f conftest.$ac_objext conftest$ac_exeext
3640 if { (eval echo "$as_me:3640: \"$ac_link\"") >&5
3641   (eval $ac_link) 2>&5
3642   ac_status=$?
3643   echo "$as_me:3643: \$? = $ac_status" >&5
3644   (exit $ac_status); } &&
3645          { ac_try='test -s conftest$ac_exeext'
3646   { (eval echo "$as_me:3646: \"$ac_try\"") >&5
3647   (eval $ac_try) 2>&5
3648   ac_status=$?
3649   echo "$as_me:3649: \$? = $ac_status" >&5
3650   (exit $ac_status); }; }; then
3651   cf_cv_utf8_lib=yes
3652 else
3653   echo "$as_me: failed program was:" >&5
3654 cat conftest.$ac_ext >&5
3655
3656 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3657 # will be set on completion of the AC_TRY_LINK below.
3658 cf_cv_header_path_utf8=
3659 cf_cv_library_path_utf8=
3660
3661 echo "${as_me:-configure}:3661: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3662
3663 cf_save_LIBS="$LIBS"
3664
3665 cat >conftest.$ac_ext <<_ACEOF
3666 #line 3666 "configure"
3667 #include "confdefs.h"
3668
3669 #include <libutf8.h>
3670 int
3671 main ()
3672 {
3673 putwc(0,0);
3674   ;
3675   return 0;
3676 }
3677 _ACEOF
3678 rm -f conftest.$ac_objext conftest$ac_exeext
3679 if { (eval echo "$as_me:3679: \"$ac_link\"") >&5
3680   (eval $ac_link) 2>&5
3681   ac_status=$?
3682   echo "$as_me:3682: \$? = $ac_status" >&5
3683   (exit $ac_status); } &&
3684          { ac_try='test -s conftest$ac_exeext'
3685   { (eval echo "$as_me:3685: \"$ac_try\"") >&5
3686   (eval $ac_try) 2>&5
3687   ac_status=$?
3688   echo "$as_me:3688: \$? = $ac_status" >&5
3689   (exit $ac_status); }; }; then
3690
3691         cf_cv_find_linkage_utf8=yes
3692         cf_cv_header_path_utf8=/usr/include
3693         cf_cv_library_path_utf8=/usr/lib
3694
3695 else
3696   echo "$as_me: failed program was:" >&5
3697 cat conftest.$ac_ext >&5
3698
3699 LIBS="-lutf8  $cf_save_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         cf_cv_library_file_utf8="-lutf8"
3731
3732 else
3733   echo "$as_me: failed program was:" >&5
3734 cat conftest.$ac_ext >&5
3735
3736         cf_cv_find_linkage_utf8=no
3737         LIBS="$cf_save_LIBS"
3738
3739     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
3740
3741 echo "${as_me:-configure}:3741: testing find linkage for utf8 library ..." 1>&5
3742
3743 echo "${as_me:-configure}:3743: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3744
3745     cf_save_CPPFLAGS="$CPPFLAGS"
3746     cf_test_CPPFLAGS="$CPPFLAGS"
3747
3748 cf_search=
3749
3750 # collect the current set of include-directories from compiler flags
3751 cf_header_path_list=""
3752 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3753         for cf_header_path in $CPPFLAGS $CFLAGS
3754         do
3755                 case $cf_header_path in #(vi
3756                 -I*)
3757                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3758
3759 test "x$cf_header_path" != "xNONE" && \
3760 test -d "$cf_header_path" && \
3761  {
3762         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3763         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3764         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
3765         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
3766         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
3767         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
3768 }
3769
3770                         cf_header_path_list="$cf_header_path_list $cf_search"
3771                         ;;
3772                 esac
3773         done
3774 fi
3775
3776 # add the variations for the package we are looking for
3777
3778 cf_search=
3779
3780 test "x/usr" != "x$prefix" && \
3781 test -d "/usr" && \
3782 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
3783         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
3784         test -d /usr/include &&          cf_search="$cf_search /usr/include"
3785         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
3786         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
3787         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
3788         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
3789 }
3790
3791 test "x$prefix" != "xNONE" && \
3792 test -d "$prefix" && \
3793  {
3794         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3795         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3796         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
3797         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
3798         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
3799         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
3800 }
3801
3802 test "x/usr/local" != "x$prefix" && \
3803 test -d "/usr/local" && \
3804 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
3805         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
3806         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
3807         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
3808         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
3809         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
3810         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
3811 }
3812
3813 test "x/opt" != "x$prefix" && \
3814 test -d "/opt" && \
3815 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
3816         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
3817         test -d /opt/include &&          cf_search="$cf_search /opt/include"
3818         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
3819         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
3820         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
3821         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
3822 }
3823
3824 test "x$HOME" != "x$prefix" && \
3825 test -d "$HOME" && \
3826 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
3827         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
3828         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
3829         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
3830         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
3831         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
3832         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
3833 }
3834
3835 test "$includedir" != NONE && \
3836 test "$includedir" != "/usr/include" && \
3837 test -d "$includedir" && {
3838         test -d $includedir &&    cf_search="$cf_search $includedir"
3839         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
3840 }
3841
3842 test "$oldincludedir" != NONE && \
3843 test "$oldincludedir" != "/usr/include" && \
3844 test -d "$oldincludedir" && {
3845         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3846         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
3847 }
3848
3849 cf_search="$cf_search $cf_header_path_list"
3850
3851     for cf_cv_header_path_utf8 in $cf_search
3852     do
3853       if test -d $cf_cv_header_path_utf8 ; then
3854         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
3855
3856 echo "${as_me:-configure}:3856: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
3857
3858         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
3859         cat >conftest.$ac_ext <<_ACEOF
3860 #line 3860 "configure"
3861 #include "confdefs.h"
3862
3863 #include <libutf8.h>
3864 int
3865 main ()
3866 {
3867 putwc(0,0);
3868   ;
3869   return 0;
3870 }
3871 _ACEOF
3872 rm -f conftest.$ac_objext
3873 if { (eval echo "$as_me:3873: \"$ac_compile\"") >&5
3874   (eval $ac_compile) 2>&5
3875   ac_status=$?
3876   echo "$as_me:3876: \$? = $ac_status" >&5
3877   (exit $ac_status); } &&
3878          { ac_try='test -s conftest.$ac_objext'
3879   { (eval echo "$as_me:3879: \"$ac_try\"") >&5
3880   (eval $ac_try) 2>&5
3881   ac_status=$?
3882   echo "$as_me:3882: \$? = $ac_status" >&5
3883   (exit $ac_status); }; }; then
3884
3885             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
3886
3887 echo "${as_me:-configure}:3887: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
3888
3889             cf_cv_find_linkage_utf8=maybe
3890             cf_test_CPPFLAGS="$CPPFLAGS"
3891             break
3892 else
3893   echo "$as_me: failed program was:" >&5
3894 cat conftest.$ac_ext >&5
3895
3896             CPPFLAGS="$cf_save_CPPFLAGS"
3897
3898 fi
3899 rm -f conftest.$ac_objext conftest.$ac_ext
3900       fi
3901     done
3902
3903     if test "$cf_cv_find_linkage_utf8" = maybe ; then
3904
3905 echo "${as_me:-configure}:3905: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
3906
3907       cf_save_LIBS="$LIBS"
3908       cf_save_LDFLAGS="$LDFLAGS"
3909
3910       if test "$cf_cv_find_linkage_utf8" != yes ; then
3911
3912 cf_search=
3913 cf_library_path_list=""
3914 if test -n "${LDFLAGS}${LIBS}" ; then
3915         for cf_library_path in $LDFLAGS $LIBS
3916         do
3917                 case $cf_library_path in #(vi
3918                 -L*)
3919                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
3920
3921 test "x$cf_library_path" != "xNONE" && \
3922 test -d "$cf_library_path" && \
3923  {
3924         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
3925         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
3926         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
3927         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
3928         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
3929         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
3930 }
3931
3932                         cf_library_path_list="$cf_library_path_list $cf_search"
3933                         ;;
3934                 esac
3935         done
3936 fi
3937
3938 cf_search=
3939
3940 test "x/usr" != "x$prefix" && \
3941 test -d "/usr" && \
3942 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
3943         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
3944         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
3945         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
3946         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
3947         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
3948         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
3949 }
3950
3951 test "x$prefix" != "xNONE" && \
3952 test -d "$prefix" && \
3953  {
3954         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
3955         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
3956         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
3957         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
3958         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
3959         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
3960 }
3961
3962 test "x/usr/local" != "x$prefix" && \
3963 test -d "/usr/local" && \
3964 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
3965         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
3966         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
3967         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
3968         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
3969         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
3970         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
3971 }
3972
3973 test "x/opt" != "x$prefix" && \
3974 test -d "/opt" && \
3975 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
3976         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
3977         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
3978         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
3979         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
3980         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
3981         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
3982 }
3983
3984 test "x$HOME" != "x$prefix" && \
3985 test -d "$HOME" && \
3986 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
3987         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
3988         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
3989         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
3990         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
3991         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
3992         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
3993 }
3994
3995 cf_search="$cf_library_path_list $cf_search"
3996
3997         for cf_cv_library_path_utf8 in $cf_search
3998         do
3999           if test -d $cf_cv_library_path_utf8 ; then
4000             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
4001
4002 echo "${as_me:-configure}:4002: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
4003
4004             CPPFLAGS="$cf_test_CPPFLAGS"
4005             LIBS="-lutf8  $cf_save_LIBS"
4006             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
4007             cat >conftest.$ac_ext <<_ACEOF
4008 #line 4008 "configure"
4009 #include "confdefs.h"
4010
4011 #include <libutf8.h>
4012 int
4013 main ()
4014 {
4015 putwc(0,0);
4016   ;
4017   return 0;
4018 }
4019 _ACEOF
4020 rm -f conftest.$ac_objext conftest$ac_exeext
4021 if { (eval echo "$as_me:4021: \"$ac_link\"") >&5
4022   (eval $ac_link) 2>&5
4023   ac_status=$?
4024   echo "$as_me:4024: \$? = $ac_status" >&5
4025   (exit $ac_status); } &&
4026          { ac_try='test -s conftest$ac_exeext'
4027   { (eval echo "$as_me:4027: \"$ac_try\"") >&5
4028   (eval $ac_try) 2>&5
4029   ac_status=$?
4030   echo "$as_me:4030: \$? = $ac_status" >&5
4031   (exit $ac_status); }; }; then
4032
4033                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4034
4035 echo "${as_me:-configure}:4035: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4036
4037                 cf_cv_find_linkage_utf8=yes
4038                 cf_cv_library_file_utf8="-lutf8"
4039                 break
4040 else
4041   echo "$as_me: failed program was:" >&5
4042 cat conftest.$ac_ext >&5
4043
4044                 CPPFLAGS="$cf_save_CPPFLAGS"
4045                 LIBS="$cf_save_LIBS"
4046                 LDFLAGS="$cf_save_LDFLAGS"
4047
4048 fi
4049 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4050           fi
4051         done
4052         CPPFLAGS="$cf_save_CPPFLAGS"
4053         LDFLAGS="$cf_save_LDFLAGS"
4054       fi
4055
4056     else
4057       cf_cv_find_linkage_utf8=no
4058     fi
4059
4060 fi
4061 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4062
4063 fi
4064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4065
4066 LIBS="$cf_save_LIBS"
4067
4068 if test "$cf_cv_find_linkage_utf8" = yes ; then
4069 cf_cv_utf8_lib=add-on
4070 else
4071 cf_cv_utf8_lib=no
4072 fi
4073
4074 fi
4075 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4076 fi
4077 echo "$as_me:4077: result: $cf_cv_utf8_lib" >&5
4078 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4079
4080 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4081 # ncurses/ncursesw:
4082 if test "$cf_cv_utf8_lib" = "add-on" ; then
4083
4084 cat >>confdefs.h <<\EOF
4085 #define HAVE_LIBUTF8_H 1
4086 EOF
4087
4088 if test -n "$cf_cv_header_path_utf8" ; then
4089   for cf_add_incdir in $cf_cv_header_path_utf8
4090   do
4091         while test $cf_add_incdir != /usr/include
4092         do
4093           if test -d $cf_add_incdir
4094           then
4095                 cf_have_incdir=no
4096                 if test -n "$CFLAGS$CPPFLAGS" ; then
4097                   # a loop is needed to ensure we can add subdirs of existing dirs
4098                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4099                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4100                           cf_have_incdir=yes; break
4101                         fi
4102                   done
4103                 fi
4104
4105                 if test "$cf_have_incdir" = no ; then
4106                   if test "$cf_add_incdir" = /usr/local/include ; then
4107                         if test "$GCC" = yes
4108                         then
4109                           cf_save_CPPFLAGS=$CPPFLAGS
4110                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4111                           cat >conftest.$ac_ext <<_ACEOF
4112 #line 4112 "configure"
4113 #include "confdefs.h"
4114 #include <stdio.h>
4115 int
4116 main ()
4117 {
4118 printf("Hello")
4119   ;
4120   return 0;
4121 }
4122 _ACEOF
4123 rm -f conftest.$ac_objext
4124 if { (eval echo "$as_me:4124: \"$ac_compile\"") >&5
4125   (eval $ac_compile) 2>&5
4126   ac_status=$?
4127   echo "$as_me:4127: \$? = $ac_status" >&5
4128   (exit $ac_status); } &&
4129          { ac_try='test -s conftest.$ac_objext'
4130   { (eval echo "$as_me:4130: \"$ac_try\"") >&5
4131   (eval $ac_try) 2>&5
4132   ac_status=$?
4133   echo "$as_me:4133: \$? = $ac_status" >&5
4134   (exit $ac_status); }; }; then
4135   :
4136 else
4137   echo "$as_me: failed program was:" >&5
4138 cat conftest.$ac_ext >&5
4139 cf_have_incdir=yes
4140 fi
4141 rm -f conftest.$ac_objext conftest.$ac_ext
4142                           CPPFLAGS=$cf_save_CPPFLAGS
4143                         fi
4144                   fi
4145                 fi
4146
4147                 if test "$cf_have_incdir" = no ; then
4148                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4149
4150 echo "${as_me:-configure}:4150: testing adding $cf_add_incdir to include-path ..." 1>&5
4151
4152                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4153
4154                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4155                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4156                   cf_add_incdir="$cf_top_incdir"
4157                 else
4158                   break
4159                 fi
4160           fi
4161         done
4162   done
4163 fi
4164
4165 if test -n "$cf_cv_library_path_utf8" ; then
4166   for cf_add_libdir in $cf_cv_library_path_utf8
4167   do
4168     if test $cf_add_libdir = /usr/lib ; then
4169       :
4170     elif test -d $cf_add_libdir
4171     then
4172       cf_have_libdir=no
4173       if test -n "$LDFLAGS$LIBS" ; then
4174         # a loop is needed to ensure we can add subdirs of existing dirs
4175         for cf_test_libdir in $LDFLAGS $LIBS ; do
4176           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4177             cf_have_libdir=yes; break
4178           fi
4179         done
4180       fi
4181       if test "$cf_have_libdir" = no ; then
4182         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4183
4184 echo "${as_me:-configure}:4184: testing adding $cf_add_libdir to library-path ..." 1>&5
4185
4186         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4187       fi
4188     fi
4189   done
4190 fi
4191
4192         LIBS="$cf_cv_library_file_utf8 $LIBS"
4193 fi
4194
4195 cf_ncuconfig_root=ncursesw
4196
4197 echo "Looking for ${cf_ncuconfig_root}-config"
4198
4199 if test -n "$ac_tool_prefix"; then
4200   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4201   do
4202     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4203 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4204 echo "$as_me:4204: checking for $ac_word" >&5
4205 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4206 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4207   echo $ECHO_N "(cached) $ECHO_C" >&6
4208 else
4209   if test -n "$NCURSES_CONFIG"; then
4210   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4211 else
4212   ac_save_IFS=$IFS; IFS=$ac_path_separator
4213 ac_dummy="$PATH"
4214 for ac_dir in $ac_dummy; do
4215   IFS=$ac_save_IFS
4216   test -z "$ac_dir" && ac_dir=.
4217   $as_executable_p "$ac_dir/$ac_word" || continue
4218 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4219 echo "$as_me:4219: found $ac_dir/$ac_word" >&5
4220 break
4221 done
4222
4223 fi
4224 fi
4225 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4226 if test -n "$NCURSES_CONFIG"; then
4227   echo "$as_me:4227: result: $NCURSES_CONFIG" >&5
4228 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4229 else
4230   echo "$as_me:4230: result: no" >&5
4231 echo "${ECHO_T}no" >&6
4232 fi
4233
4234     test -n "$NCURSES_CONFIG" && break
4235   done
4236 fi
4237 if test -z "$NCURSES_CONFIG"; then
4238   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4239   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4240 do
4241   # Extract the first word of "$ac_prog", so it can be a program name with args.
4242 set dummy $ac_prog; ac_word=$2
4243 echo "$as_me:4243: checking for $ac_word" >&5
4244 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4245 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4246   echo $ECHO_N "(cached) $ECHO_C" >&6
4247 else
4248   if test -n "$ac_ct_NCURSES_CONFIG"; then
4249   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4250 else
4251   ac_save_IFS=$IFS; IFS=$ac_path_separator
4252 ac_dummy="$PATH"
4253 for ac_dir in $ac_dummy; do
4254   IFS=$ac_save_IFS
4255   test -z "$ac_dir" && ac_dir=.
4256   $as_executable_p "$ac_dir/$ac_word" || continue
4257 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4258 echo "$as_me:4258: found $ac_dir/$ac_word" >&5
4259 break
4260 done
4261
4262 fi
4263 fi
4264 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4265 if test -n "$ac_ct_NCURSES_CONFIG"; then
4266   echo "$as_me:4266: result: $ac_ct_NCURSES_CONFIG" >&5
4267 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4268 else
4269   echo "$as_me:4269: result: no" >&5
4270 echo "${ECHO_T}no" >&6
4271 fi
4272
4273   test -n "$ac_ct_NCURSES_CONFIG" && break
4274 done
4275 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4276
4277   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4278 fi
4279
4280 if test "$NCURSES_CONFIG" != none ; then
4281
4282 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4283 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
4284
4285 # even with config script, some packages use no-override for curses.h
4286
4287 echo "$as_me:4287: checking if we have identified curses headers" >&5
4288 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4289 if test "${cf_cv_ncurses_header+set}" = set; then
4290   echo $ECHO_N "(cached) $ECHO_C" >&6
4291 else
4292
4293 cf_cv_ncurses_header=none
4294 for cf_header in  \
4295     ncursesw/ncurses.h \
4296         ncursesw/curses.h \
4297         ncurses.h \
4298         curses.h
4299 do
4300 cat >conftest.$ac_ext <<_ACEOF
4301 #line 4301 "configure"
4302 #include "confdefs.h"
4303 #include <${cf_header}>
4304 int
4305 main ()
4306 {
4307 initscr(); tgoto("?", 0,0)
4308   ;
4309   return 0;
4310 }
4311 _ACEOF
4312 rm -f conftest.$ac_objext
4313 if { (eval echo "$as_me:4313: \"$ac_compile\"") >&5
4314   (eval $ac_compile) 2>&5
4315   ac_status=$?
4316   echo "$as_me:4316: \$? = $ac_status" >&5
4317   (exit $ac_status); } &&
4318          { ac_try='test -s conftest.$ac_objext'
4319   { (eval echo "$as_me:4319: \"$ac_try\"") >&5
4320   (eval $ac_try) 2>&5
4321   ac_status=$?
4322   echo "$as_me:4322: \$? = $ac_status" >&5
4323   (exit $ac_status); }; }; then
4324   cf_cv_ncurses_header=$cf_header; break
4325 else
4326   echo "$as_me: failed program was:" >&5
4327 cat conftest.$ac_ext >&5
4328 fi
4329 rm -f conftest.$ac_objext conftest.$ac_ext
4330 done
4331
4332 fi
4333 echo "$as_me:4333: result: $cf_cv_ncurses_header" >&5
4334 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4335
4336 if test "$cf_cv_ncurses_header" = none ; then
4337         { { echo "$as_me:4337: error: No curses header-files found" >&5
4338 echo "$as_me: error: No curses header-files found" >&2;}
4339    { (exit 1); exit 1; }; }
4340 fi
4341
4342 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4343
4344 for ac_header in $cf_cv_ncurses_header
4345 do
4346 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4347 echo "$as_me:4347: checking for $ac_header" >&5
4348 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4349 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4350   echo $ECHO_N "(cached) $ECHO_C" >&6
4351 else
4352   cat >conftest.$ac_ext <<_ACEOF
4353 #line 4353 "configure"
4354 #include "confdefs.h"
4355 #include <$ac_header>
4356 _ACEOF
4357 if { (eval echo "$as_me:4357: \"$ac_cpp conftest.$ac_ext\"") >&5
4358   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4359   ac_status=$?
4360   egrep -v '^ *\+' conftest.er1 >conftest.err
4361   rm -f conftest.er1
4362   cat conftest.err >&5
4363   echo "$as_me:4363: \$? = $ac_status" >&5
4364   (exit $ac_status); } >/dev/null; then
4365   if test -s conftest.err; then
4366     ac_cpp_err=$ac_c_preproc_warn_flag
4367   else
4368     ac_cpp_err=
4369   fi
4370 else
4371   ac_cpp_err=yes
4372 fi
4373 if test -z "$ac_cpp_err"; then
4374   eval "$as_ac_Header=yes"
4375 else
4376   echo "$as_me: failed program was:" >&5
4377   cat conftest.$ac_ext >&5
4378   eval "$as_ac_Header=no"
4379 fi
4380 rm -f conftest.err conftest.$ac_ext
4381 fi
4382 echo "$as_me:4382: result: `eval echo '${'$as_ac_Header'}'`" >&5
4383 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4384 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4385   cat >>confdefs.h <<EOF
4386 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4387 EOF
4388
4389 fi
4390 done
4391
4392 cat >>confdefs.h <<\EOF
4393 #define NCURSES 1
4394 EOF
4395
4396 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4397
4398 cat >>confdefs.h <<EOF
4399 #define $cf_nculib_ROOT 1
4400 EOF
4401
4402 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4403
4404 else
4405
4406 cf_ncuhdr_root=ncursesw
4407
4408 test -n "$cf_cv_curses_dir" && \
4409 test "$cf_cv_curses_dir" != "no" && { \
4410
4411 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4412   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4413   do
4414         while test $cf_add_incdir != /usr/include
4415         do
4416           if test -d $cf_add_incdir
4417           then
4418                 cf_have_incdir=no
4419                 if test -n "$CFLAGS$CPPFLAGS" ; then
4420                   # a loop is needed to ensure we can add subdirs of existing dirs
4421                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4422                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4423                           cf_have_incdir=yes; break
4424                         fi
4425                   done
4426                 fi
4427
4428                 if test "$cf_have_incdir" = no ; then
4429                   if test "$cf_add_incdir" = /usr/local/include ; then
4430                         if test "$GCC" = yes
4431                         then
4432                           cf_save_CPPFLAGS=$CPPFLAGS
4433                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4434                           cat >conftest.$ac_ext <<_ACEOF
4435 #line 4435 "configure"
4436 #include "confdefs.h"
4437 #include <stdio.h>
4438 int
4439 main ()
4440 {
4441 printf("Hello")
4442   ;
4443   return 0;
4444 }
4445 _ACEOF
4446 rm -f conftest.$ac_objext
4447 if { (eval echo "$as_me:4447: \"$ac_compile\"") >&5
4448   (eval $ac_compile) 2>&5
4449   ac_status=$?
4450   echo "$as_me:4450: \$? = $ac_status" >&5
4451   (exit $ac_status); } &&
4452          { ac_try='test -s conftest.$ac_objext'
4453   { (eval echo "$as_me:4453: \"$ac_try\"") >&5
4454   (eval $ac_try) 2>&5
4455   ac_status=$?
4456   echo "$as_me:4456: \$? = $ac_status" >&5
4457   (exit $ac_status); }; }; then
4458   :
4459 else
4460   echo "$as_me: failed program was:" >&5
4461 cat conftest.$ac_ext >&5
4462 cf_have_incdir=yes
4463 fi
4464 rm -f conftest.$ac_objext conftest.$ac_ext
4465                           CPPFLAGS=$cf_save_CPPFLAGS
4466                         fi
4467                   fi
4468                 fi
4469
4470                 if test "$cf_have_incdir" = no ; then
4471                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4472
4473 echo "${as_me:-configure}:4473: testing adding $cf_add_incdir to include-path ..." 1>&5
4474
4475                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4476
4477                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4478                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4479                   cf_add_incdir="$cf_top_incdir"
4480                 else
4481                   break
4482                 fi
4483           fi
4484         done
4485   done
4486 fi
4487
4488 }
4489
4490 echo "$as_me:4490: checking for $cf_ncuhdr_root header in include-path" >&5
4491 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4492 if test "${cf_cv_ncurses_h+set}" = set; then
4493   echo $ECHO_N "(cached) $ECHO_C" >&6
4494 else
4495
4496         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4497         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4498         for cf_header in $cf_header_list
4499         do
4500
4501         cat >conftest.$ac_ext <<_ACEOF
4502 #line 4502 "configure"
4503 #include "confdefs.h"
4504
4505 #define _XOPEN_SOURCE_EXTENDED
4506 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4507 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4508
4509 #include <$cf_header>
4510 int
4511 main ()
4512 {
4513
4514 #ifdef NCURSES_VERSION
4515
4516 #ifndef WACS_BSSB
4517         make an error
4518 #endif
4519
4520 printf("%s\n", NCURSES_VERSION);
4521 #else
4522 #ifdef __NCURSES_H
4523 printf("old\n");
4524 #else
4525         make an error
4526 #endif
4527 #endif
4528
4529   ;
4530   return 0;
4531 }
4532 _ACEOF
4533 rm -f conftest.$ac_objext
4534 if { (eval echo "$as_me:4534: \"$ac_compile\"") >&5
4535   (eval $ac_compile) 2>&5
4536   ac_status=$?
4537   echo "$as_me:4537: \$? = $ac_status" >&5
4538   (exit $ac_status); } &&
4539          { ac_try='test -s conftest.$ac_objext'
4540   { (eval echo "$as_me:4540: \"$ac_try\"") >&5
4541   (eval $ac_try) 2>&5
4542   ac_status=$?
4543   echo "$as_me:4543: \$? = $ac_status" >&5
4544   (exit $ac_status); }; }; then
4545   cf_cv_ncurses_h=$cf_header
4546
4547 else
4548   echo "$as_me: failed program was:" >&5
4549 cat conftest.$ac_ext >&5
4550 cf_cv_ncurses_h=no
4551 fi
4552 rm -f conftest.$ac_objext conftest.$ac_ext
4553
4554                 test "$cf_cv_ncurses_h" != no && break
4555         done
4556
4557 fi
4558 echo "$as_me:4558: result: $cf_cv_ncurses_h" >&5
4559 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4560
4561 if test "$cf_cv_ncurses_h" != no ; then
4562         cf_cv_ncurses_header=$cf_cv_ncurses_h
4563 else
4564
4565 echo "$as_me:4565: checking for $cf_ncuhdr_root include-path" >&5
4566 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4567 if test "${cf_cv_ncurses_h2+set}" = set; then
4568   echo $ECHO_N "(cached) $ECHO_C" >&6
4569 else
4570
4571         test -n "$verbose" && echo
4572
4573 cf_search=
4574
4575 # collect the current set of include-directories from compiler flags
4576 cf_header_path_list=""
4577 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4578         for cf_header_path in $CPPFLAGS $CFLAGS
4579         do
4580                 case $cf_header_path in #(vi
4581                 -I*)
4582                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4583
4584 test "x$cf_header_path" != "xNONE" && \
4585 test -d "$cf_header_path" && \
4586  {
4587         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4588         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4589         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4590         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4591         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4592         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"
4593 }
4594
4595                         cf_header_path_list="$cf_header_path_list $cf_search"
4596                         ;;
4597                 esac
4598         done
4599 fi
4600
4601 # add the variations for the package we are looking for
4602
4603 cf_search=
4604
4605 test "x/usr" != "x$prefix" && \
4606 test -d "/usr" && \
4607 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
4608         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4609         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4610         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
4611         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
4612         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
4613         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4614 }
4615
4616 test "x$prefix" != "xNONE" && \
4617 test -d "$prefix" && \
4618  {
4619         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4620         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4621         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4622         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4623         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4624         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4625 }
4626
4627 test "x/usr/local" != "x$prefix" && \
4628 test -d "/usr/local" && \
4629 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
4630         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4631         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4632         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
4633         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
4634         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
4635         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4636 }
4637
4638 test "x/opt" != "x$prefix" && \
4639 test -d "/opt" && \
4640 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
4641         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4642         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4643         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
4644         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
4645         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
4646         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4647 }
4648
4649 test "x$HOME" != "x$prefix" && \
4650 test -d "$HOME" && \
4651 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
4652         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4653         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4654         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
4655         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
4656         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
4657         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4658 }
4659
4660 test "$includedir" != NONE && \
4661 test "$includedir" != "/usr/include" && \
4662 test -d "$includedir" && {
4663         test -d $includedir &&    cf_search="$cf_search $includedir"
4664         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4665 }
4666
4667 test "$oldincludedir" != NONE && \
4668 test "$oldincludedir" != "/usr/include" && \
4669 test -d "$oldincludedir" && {
4670         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4671         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4672 }
4673
4674 cf_search="$cf_search $cf_header_path_list"
4675
4676         test -n "$verbose" && echo search path $cf_search
4677         cf_save2_CPPFLAGS="$CPPFLAGS"
4678         for cf_incdir in $cf_search
4679         do
4680
4681 if test -n "$cf_incdir" ; then
4682   for cf_add_incdir in $cf_incdir
4683   do
4684         while test $cf_add_incdir != /usr/include
4685         do
4686           if test -d $cf_add_incdir
4687           then
4688                 cf_have_incdir=no
4689                 if test -n "$CFLAGS$CPPFLAGS" ; then
4690                   # a loop is needed to ensure we can add subdirs of existing dirs
4691                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4692                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4693                           cf_have_incdir=yes; break
4694                         fi
4695                   done
4696                 fi
4697
4698                 if test "$cf_have_incdir" = no ; then
4699                   if test "$cf_add_incdir" = /usr/local/include ; then
4700                         if test "$GCC" = yes
4701                         then
4702                           cf_save_CPPFLAGS=$CPPFLAGS
4703                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4704                           cat >conftest.$ac_ext <<_ACEOF
4705 #line 4705 "configure"
4706 #include "confdefs.h"
4707 #include <stdio.h>
4708 int
4709 main ()
4710 {
4711 printf("Hello")
4712   ;
4713   return 0;
4714 }
4715 _ACEOF
4716 rm -f conftest.$ac_objext
4717 if { (eval echo "$as_me:4717: \"$ac_compile\"") >&5
4718   (eval $ac_compile) 2>&5
4719   ac_status=$?
4720   echo "$as_me:4720: \$? = $ac_status" >&5
4721   (exit $ac_status); } &&
4722          { ac_try='test -s conftest.$ac_objext'
4723   { (eval echo "$as_me:4723: \"$ac_try\"") >&5
4724   (eval $ac_try) 2>&5
4725   ac_status=$?
4726   echo "$as_me:4726: \$? = $ac_status" >&5
4727   (exit $ac_status); }; }; then
4728   :
4729 else
4730   echo "$as_me: failed program was:" >&5
4731 cat conftest.$ac_ext >&5
4732 cf_have_incdir=yes
4733 fi
4734 rm -f conftest.$ac_objext conftest.$ac_ext
4735                           CPPFLAGS=$cf_save_CPPFLAGS
4736                         fi
4737                   fi
4738                 fi
4739
4740                 if test "$cf_have_incdir" = no ; then
4741                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4742
4743 echo "${as_me:-configure}:4743: testing adding $cf_add_incdir to include-path ..." 1>&5
4744
4745                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4746
4747                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4748                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4749                   cf_add_incdir="$cf_top_incdir"
4750                 else
4751                   break
4752                 fi
4753           fi
4754         done
4755   done
4756 fi
4757
4758                 for cf_header in \
4759                         ncurses.h \
4760                         curses.h
4761                 do
4762
4763         cat >conftest.$ac_ext <<_ACEOF
4764 #line 4764 "configure"
4765 #include "confdefs.h"
4766
4767 #include <$cf_header>
4768 int
4769 main ()
4770 {
4771
4772 #ifdef NCURSES_VERSION
4773
4774 printf("%s\n", NCURSES_VERSION);
4775 #else
4776 #ifdef __NCURSES_H
4777 printf("old\n");
4778 #else
4779         make an error
4780 #endif
4781 #endif
4782
4783   ;
4784   return 0;
4785 }
4786 _ACEOF
4787 rm -f conftest.$ac_objext
4788 if { (eval echo "$as_me:4788: \"$ac_compile\"") >&5
4789   (eval $ac_compile) 2>&5
4790   ac_status=$?
4791   echo "$as_me:4791: \$? = $ac_status" >&5
4792   (exit $ac_status); } &&
4793          { ac_try='test -s conftest.$ac_objext'
4794   { (eval echo "$as_me:4794: \"$ac_try\"") >&5
4795   (eval $ac_try) 2>&5
4796   ac_status=$?
4797   echo "$as_me:4797: \$? = $ac_status" >&5
4798   (exit $ac_status); }; }; then
4799   cf_cv_ncurses_h2=$cf_header
4800
4801 else
4802   echo "$as_me: failed program was:" >&5
4803 cat conftest.$ac_ext >&5
4804 cf_cv_ncurses_h2=no
4805 fi
4806 rm -f conftest.$ac_objext conftest.$ac_ext
4807
4808                         if test "$cf_cv_ncurses_h2" != no ; then
4809                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4810                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4811                                 break
4812                         fi
4813                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4814                 done
4815                 CPPFLAGS="$cf_save2_CPPFLAGS"
4816                 test "$cf_cv_ncurses_h2" != no && break
4817         done
4818         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4818: error: not found" >&5
4819 echo "$as_me: error: not found" >&2;}
4820    { (exit 1); exit 1; }; }
4821
4822 fi
4823 echo "$as_me:4823: result: $cf_cv_ncurses_h2" >&5
4824 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4825
4826         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4827         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4828         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4829                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4830         fi
4831
4832 if test -n "$cf_1st_incdir" ; then
4833   for cf_add_incdir in $cf_1st_incdir
4834   do
4835         while test $cf_add_incdir != /usr/include
4836         do
4837           if test -d $cf_add_incdir
4838           then
4839                 cf_have_incdir=no
4840                 if test -n "$CFLAGS$CPPFLAGS" ; then
4841                   # a loop is needed to ensure we can add subdirs of existing dirs
4842                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4843                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4844                           cf_have_incdir=yes; break
4845                         fi
4846                   done
4847                 fi
4848
4849                 if test "$cf_have_incdir" = no ; then
4850                   if test "$cf_add_incdir" = /usr/local/include ; then
4851                         if test "$GCC" = yes
4852                         then
4853                           cf_save_CPPFLAGS=$CPPFLAGS
4854                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4855                           cat >conftest.$ac_ext <<_ACEOF
4856 #line 4856 "configure"
4857 #include "confdefs.h"
4858 #include <stdio.h>
4859 int
4860 main ()
4861 {
4862 printf("Hello")
4863   ;
4864   return 0;
4865 }
4866 _ACEOF
4867 rm -f conftest.$ac_objext
4868 if { (eval echo "$as_me:4868: \"$ac_compile\"") >&5
4869   (eval $ac_compile) 2>&5
4870   ac_status=$?
4871   echo "$as_me:4871: \$? = $ac_status" >&5
4872   (exit $ac_status); } &&
4873          { ac_try='test -s conftest.$ac_objext'
4874   { (eval echo "$as_me:4874: \"$ac_try\"") >&5
4875   (eval $ac_try) 2>&5
4876   ac_status=$?
4877   echo "$as_me:4877: \$? = $ac_status" >&5
4878   (exit $ac_status); }; }; then
4879   :
4880 else
4881   echo "$as_me: failed program was:" >&5
4882 cat conftest.$ac_ext >&5
4883 cf_have_incdir=yes
4884 fi
4885 rm -f conftest.$ac_objext conftest.$ac_ext
4886                           CPPFLAGS=$cf_save_CPPFLAGS
4887                         fi
4888                   fi
4889                 fi
4890
4891                 if test "$cf_have_incdir" = no ; then
4892                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4893
4894 echo "${as_me:-configure}:4894: testing adding $cf_add_incdir to include-path ..." 1>&5
4895
4896                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4897
4898                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4899                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4900                   cf_add_incdir="$cf_top_incdir"
4901                 else
4902                   break
4903                 fi
4904           fi
4905         done
4906   done
4907 fi
4908
4909 fi
4910
4911 # Set definitions to allow ifdef'ing for ncurses.h
4912
4913 case $cf_cv_ncurses_header in # (vi
4914 *ncurses.h)
4915
4916 cat >>confdefs.h <<\EOF
4917 #define HAVE_NCURSES_H 1
4918 EOF
4919
4920         ;;
4921 esac
4922
4923 case $cf_cv_ncurses_header in # (vi
4924 ncurses/curses.h|ncurses/ncurses.h)
4925
4926 cat >>confdefs.h <<\EOF
4927 #define HAVE_NCURSES_NCURSES_H 1
4928 EOF
4929
4930         ;;
4931 ncursesw/curses.h|ncursesw/ncurses.h)
4932
4933 cat >>confdefs.h <<\EOF
4934 #define HAVE_NCURSESW_NCURSES_H 1
4935 EOF
4936
4937         ;;
4938 esac
4939
4940 echo "$as_me:4940: checking for terminfo header" >&5
4941 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4942 if test "${cf_cv_term_header+set}" = set; then
4943   echo $ECHO_N "(cached) $ECHO_C" >&6
4944 else
4945
4946 case ${cf_cv_ncurses_header} in #(vi
4947 */ncurses.h|*/ncursesw.h) #(vi
4948         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4949         ;;
4950 *)
4951         cf_term_header=term.h
4952         ;;
4953 esac
4954
4955 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4956 do
4957 cat >conftest.$ac_ext <<_ACEOF
4958 #line 4958 "configure"
4959 #include "confdefs.h"
4960 #include <stdio.h>
4961 #include <${cf_cv_ncurses_header:-curses.h}>
4962 #include <$cf_test>
4963
4964 int
4965 main ()
4966 {
4967 int x = auto_left_margin
4968   ;
4969   return 0;
4970 }
4971 _ACEOF
4972 rm -f conftest.$ac_objext
4973 if { (eval echo "$as_me:4973: \"$ac_compile\"") >&5
4974   (eval $ac_compile) 2>&5
4975   ac_status=$?
4976   echo "$as_me:4976: \$? = $ac_status" >&5
4977   (exit $ac_status); } &&
4978          { ac_try='test -s conftest.$ac_objext'
4979   { (eval echo "$as_me:4979: \"$ac_try\"") >&5
4980   (eval $ac_try) 2>&5
4981   ac_status=$?
4982   echo "$as_me:4982: \$? = $ac_status" >&5
4983   (exit $ac_status); }; }; then
4984
4985         cf_cv_term_header="$cf_test"
4986 else
4987   echo "$as_me: failed program was:" >&5
4988 cat conftest.$ac_ext >&5
4989
4990         cf_cv_term_header=unknown
4991
4992 fi
4993 rm -f conftest.$ac_objext conftest.$ac_ext
4994         test "$cf_cv_term_header" != unknown && break
4995 done
4996
4997 fi
4998 echo "$as_me:4998: result: $cf_cv_term_header" >&5
4999 echo "${ECHO_T}$cf_cv_term_header" >&6
5000
5001 # Set definitions to allow ifdef'ing to accommodate subdirectories
5002
5003 case $cf_cv_term_header in # (vi
5004 *term.h)
5005
5006 cat >>confdefs.h <<\EOF
5007 #define HAVE_TERM_H 1
5008 EOF
5009
5010         ;;
5011 esac
5012
5013 case $cf_cv_term_header in # (vi
5014 ncurses/term.h) #(vi
5015
5016 cat >>confdefs.h <<\EOF
5017 #define HAVE_NCURSES_TERM_H 1
5018 EOF
5019
5020         ;;
5021 ncursesw/term.h)
5022
5023 cat >>confdefs.h <<\EOF
5024 #define HAVE_NCURSESW_TERM_H 1
5025 EOF
5026
5027         ;;
5028 esac
5029
5030 # some applications need this, but should check for NCURSES_VERSION
5031
5032 cat >>confdefs.h <<\EOF
5033 #define NCURSES 1
5034 EOF
5035
5036 echo "$as_me:5036: checking for ncurses version" >&5
5037 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5038 if test "${cf_cv_ncurses_version+set}" = set; then
5039   echo $ECHO_N "(cached) $ECHO_C" >&6
5040 else
5041
5042         cf_cv_ncurses_version=no
5043         cf_tempfile=out$$
5044         rm -f $cf_tempfile
5045         if test "$cross_compiling" = yes; then
5046
5047         # This will not work if the preprocessor splits the line after the
5048         # Autoconf token.  The 'unproto' program does that.
5049         cat > conftest.$ac_ext <<EOF
5050 #include <${cf_cv_ncurses_header:-curses.h}>
5051 #undef Autoconf
5052 #ifdef NCURSES_VERSION
5053 Autoconf NCURSES_VERSION
5054 #else
5055 #ifdef __NCURSES_H
5056 Autoconf "old"
5057 #endif
5058 ;
5059 #endif
5060 EOF
5061         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5062         { (eval echo "$as_me:5062: \"$cf_try\"") >&5
5063   (eval $cf_try) 2>&5
5064   ac_status=$?
5065   echo "$as_me:5065: \$? = $ac_status" >&5
5066   (exit $ac_status); }
5067         if test -f conftest.out ; then
5068                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5069                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5070                 rm -f conftest.out
5071         fi
5072
5073 else
5074   cat >conftest.$ac_ext <<_ACEOF
5075 #line 5075 "configure"
5076 #include "confdefs.h"
5077
5078 #include <${cf_cv_ncurses_header:-curses.h}>
5079 #include <stdio.h>
5080 int main()
5081 {
5082         FILE *fp = fopen("$cf_tempfile", "w");
5083 #ifdef NCURSES_VERSION
5084 # ifdef NCURSES_VERSION_PATCH
5085         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5086 # else
5087         fprintf(fp, "%s\n", NCURSES_VERSION);
5088 # endif
5089 #else
5090 # ifdef __NCURSES_H
5091         fprintf(fp, "old\n");
5092 # else
5093         make an error
5094 # endif
5095 #endif
5096         ${cf_cv_main_return:-return}(0);
5097 }
5098 _ACEOF
5099 rm -f conftest$ac_exeext
5100 if { (eval echo "$as_me:5100: \"$ac_link\"") >&5
5101   (eval $ac_link) 2>&5
5102   ac_status=$?
5103   echo "$as_me:5103: \$? = $ac_status" >&5
5104   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5105   { (eval echo "$as_me:5105: \"$ac_try\"") >&5
5106   (eval $ac_try) 2>&5
5107   ac_status=$?
5108   echo "$as_me:5108: \$? = $ac_status" >&5
5109   (exit $ac_status); }; }; then
5110
5111         cf_cv_ncurses_version=`cat $cf_tempfile`
5112 else
5113   echo "$as_me: program exited with status $ac_status" >&5
5114 echo "$as_me: failed program was:" >&5
5115 cat conftest.$ac_ext >&5
5116 fi
5117 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5118 fi
5119         rm -f $cf_tempfile
5120
5121 fi
5122 echo "$as_me:5122: result: $cf_cv_ncurses_version" >&5
5123 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5124 test "$cf_cv_ncurses_version" = no ||
5125 cat >>confdefs.h <<\EOF
5126 #define NCURSES 1
5127 EOF
5128
5129 cf_nculib_root=ncursesw
5130         # This works, except for the special case where we find gpm, but
5131         # ncurses is in a nonstandard location via $LIBS, and we really want
5132         # to link gpm.
5133 cf_ncurses_LIBS=""
5134 cf_ncurses_SAVE="$LIBS"
5135 echo "$as_me:5135: checking for Gpm_Open in -lgpm" >&5
5136 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5137 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5138   echo $ECHO_N "(cached) $ECHO_C" >&6
5139 else
5140   ac_check_lib_save_LIBS=$LIBS
5141 LIBS="-lgpm  $LIBS"
5142 cat >conftest.$ac_ext <<_ACEOF
5143 #line 5143 "configure"
5144 #include "confdefs.h"
5145
5146 /* Override any gcc2 internal prototype to avoid an error.  */
5147 #ifdef __cplusplus
5148 extern "C"
5149 #endif
5150 /* We use char because int might match the return type of a gcc2
5151    builtin and then its argument prototype would still apply.  */
5152 char Gpm_Open ();
5153 int
5154 main ()
5155 {
5156 Gpm_Open ();
5157   ;
5158   return 0;
5159 }
5160 _ACEOF
5161 rm -f conftest.$ac_objext conftest$ac_exeext
5162 if { (eval echo "$as_me:5162: \"$ac_link\"") >&5
5163   (eval $ac_link) 2>&5
5164   ac_status=$?
5165   echo "$as_me:5165: \$? = $ac_status" >&5
5166   (exit $ac_status); } &&
5167          { ac_try='test -s conftest$ac_exeext'
5168   { (eval echo "$as_me:5168: \"$ac_try\"") >&5
5169   (eval $ac_try) 2>&5
5170   ac_status=$?
5171   echo "$as_me:5171: \$? = $ac_status" >&5
5172   (exit $ac_status); }; }; then
5173   ac_cv_lib_gpm_Gpm_Open=yes
5174 else
5175   echo "$as_me: failed program was:" >&5
5176 cat conftest.$ac_ext >&5
5177 ac_cv_lib_gpm_Gpm_Open=no
5178 fi
5179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5180 LIBS=$ac_check_lib_save_LIBS
5181 fi
5182 echo "$as_me:5182: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5183 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5184 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5185   echo "$as_me:5185: checking for initscr in -lgpm" >&5
5186 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5187 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5188   echo $ECHO_N "(cached) $ECHO_C" >&6
5189 else
5190   ac_check_lib_save_LIBS=$LIBS
5191 LIBS="-lgpm  $LIBS"
5192 cat >conftest.$ac_ext <<_ACEOF
5193 #line 5193 "configure"
5194 #include "confdefs.h"
5195
5196 /* Override any gcc2 internal prototype to avoid an error.  */
5197 #ifdef __cplusplus
5198 extern "C"
5199 #endif
5200 /* We use char because int might match the return type of a gcc2
5201    builtin and then its argument prototype would still apply.  */
5202 char initscr ();
5203 int
5204 main ()
5205 {
5206 initscr ();
5207   ;
5208   return 0;
5209 }
5210 _ACEOF
5211 rm -f conftest.$ac_objext conftest$ac_exeext
5212 if { (eval echo "$as_me:5212: \"$ac_link\"") >&5
5213   (eval $ac_link) 2>&5
5214   ac_status=$?
5215   echo "$as_me:5215: \$? = $ac_status" >&5
5216   (exit $ac_status); } &&
5217          { ac_try='test -s conftest$ac_exeext'
5218   { (eval echo "$as_me:5218: \"$ac_try\"") >&5
5219   (eval $ac_try) 2>&5
5220   ac_status=$?
5221   echo "$as_me:5221: \$? = $ac_status" >&5
5222   (exit $ac_status); }; }; then
5223   ac_cv_lib_gpm_initscr=yes
5224 else
5225   echo "$as_me: failed program was:" >&5
5226 cat conftest.$ac_ext >&5
5227 ac_cv_lib_gpm_initscr=no
5228 fi
5229 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5230 LIBS=$ac_check_lib_save_LIBS
5231 fi
5232 echo "$as_me:5232: result: $ac_cv_lib_gpm_initscr" >&5
5233 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5234 if test $ac_cv_lib_gpm_initscr = yes; then
5235   LIBS="$cf_ncurses_SAVE"
5236 else
5237   cf_ncurses_LIBS="-lgpm"
5238 fi
5239
5240 fi
5241
5242 case $host_os in #(vi
5243 freebsd*)
5244         # This is only necessary if you are linking against an obsolete
5245         # version of ncurses (but it should do no harm, since it's static).
5246         if test "$cf_nculib_root" = ncurses ; then
5247                 echo "$as_me:5247: checking for tgoto in -lmytinfo" >&5
5248 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5249 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5250   echo $ECHO_N "(cached) $ECHO_C" >&6
5251 else
5252   ac_check_lib_save_LIBS=$LIBS
5253 LIBS="-lmytinfo  $LIBS"
5254 cat >conftest.$ac_ext <<_ACEOF
5255 #line 5255 "configure"
5256 #include "confdefs.h"
5257
5258 /* Override any gcc2 internal prototype to avoid an error.  */
5259 #ifdef __cplusplus
5260 extern "C"
5261 #endif
5262 /* We use char because int might match the return type of a gcc2
5263    builtin and then its argument prototype would still apply.  */
5264 char tgoto ();
5265 int
5266 main ()
5267 {
5268 tgoto ();
5269   ;
5270   return 0;
5271 }
5272 _ACEOF
5273 rm -f conftest.$ac_objext conftest$ac_exeext
5274 if { (eval echo "$as_me:5274: \"$ac_link\"") >&5
5275   (eval $ac_link) 2>&5
5276   ac_status=$?
5277   echo "$as_me:5277: \$? = $ac_status" >&5
5278   (exit $ac_status); } &&
5279          { ac_try='test -s conftest$ac_exeext'
5280   { (eval echo "$as_me:5280: \"$ac_try\"") >&5
5281   (eval $ac_try) 2>&5
5282   ac_status=$?
5283   echo "$as_me:5283: \$? = $ac_status" >&5
5284   (exit $ac_status); }; }; then
5285   ac_cv_lib_mytinfo_tgoto=yes
5286 else
5287   echo "$as_me: failed program was:" >&5
5288 cat conftest.$ac_ext >&5
5289 ac_cv_lib_mytinfo_tgoto=no
5290 fi
5291 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5292 LIBS=$ac_check_lib_save_LIBS
5293 fi
5294 echo "$as_me:5294: result: $ac_cv_lib_mytinfo_tgoto" >&5
5295 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5296 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5297   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5298 fi
5299
5300         fi
5301         ;;
5302 esac
5303
5304 LIBS="$cf_ncurses_LIBS $LIBS"
5305
5306 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5307 then
5308         LIBS="-l$cf_nculib_root $LIBS"
5309 else
5310
5311         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5312         cf_libdir=""
5313         echo "$as_me:5313: checking for initscr" >&5
5314 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5315 if test "${ac_cv_func_initscr+set}" = set; then
5316   echo $ECHO_N "(cached) $ECHO_C" >&6
5317 else
5318   cat >conftest.$ac_ext <<_ACEOF
5319 #line 5319 "configure"
5320 #include "confdefs.h"
5321 /* System header to define __stub macros and hopefully few prototypes,
5322     which can conflict with char initscr (); below.  */
5323 #include <assert.h>
5324 /* Override any gcc2 internal prototype to avoid an error.  */
5325 #ifdef __cplusplus
5326 extern "C"
5327 #endif
5328 /* We use char because int might match the return type of a gcc2
5329    builtin and then its argument prototype would still apply.  */
5330 char initscr ();
5331 char (*f) ();
5332
5333 int
5334 main ()
5335 {
5336 /* The GNU C library defines this for functions which it implements
5337     to always fail with ENOSYS.  Some functions are actually named
5338     something starting with __ and the normal name is an alias.  */
5339 #if defined (__stub_initscr) || defined (__stub___initscr)
5340 choke me
5341 #else
5342 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5343 #endif
5344
5345   ;
5346   return 0;
5347 }
5348 _ACEOF
5349 rm -f conftest.$ac_objext conftest$ac_exeext
5350 if { (eval echo "$as_me:5350: \"$ac_link\"") >&5
5351   (eval $ac_link) 2>&5
5352   ac_status=$?
5353   echo "$as_me:5353: \$? = $ac_status" >&5
5354   (exit $ac_status); } &&
5355          { ac_try='test -s conftest$ac_exeext'
5356   { (eval echo "$as_me:5356: \"$ac_try\"") >&5
5357   (eval $ac_try) 2>&5
5358   ac_status=$?
5359   echo "$as_me:5359: \$? = $ac_status" >&5
5360   (exit $ac_status); }; }; then
5361   ac_cv_func_initscr=yes
5362 else
5363   echo "$as_me: failed program was:" >&5
5364 cat conftest.$ac_ext >&5
5365 ac_cv_func_initscr=no
5366 fi
5367 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5368 fi
5369 echo "$as_me:5369: result: $ac_cv_func_initscr" >&5
5370 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5371 if test $ac_cv_func_initscr = yes; then
5372   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5373 else
5374
5375                 cf_save_LIBS="$LIBS"
5376                 echo "$as_me:5376: checking for initscr in -l$cf_nculib_root" >&5
5377 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5378                 LIBS="-l$cf_nculib_root $LIBS"
5379                 cat >conftest.$ac_ext <<_ACEOF
5380 #line 5380 "configure"
5381 #include "confdefs.h"
5382 #include <${cf_cv_ncurses_header:-curses.h}>
5383 int
5384 main ()
5385 {
5386 initscr()
5387   ;
5388   return 0;
5389 }
5390 _ACEOF
5391 rm -f conftest.$ac_objext conftest$ac_exeext
5392 if { (eval echo "$as_me:5392: \"$ac_link\"") >&5
5393   (eval $ac_link) 2>&5
5394   ac_status=$?
5395   echo "$as_me:5395: \$? = $ac_status" >&5
5396   (exit $ac_status); } &&
5397          { ac_try='test -s conftest$ac_exeext'
5398   { (eval echo "$as_me:5398: \"$ac_try\"") >&5
5399   (eval $ac_try) 2>&5
5400   ac_status=$?
5401   echo "$as_me:5401: \$? = $ac_status" >&5
5402   (exit $ac_status); }; }; then
5403   echo "$as_me:5403: result: yes" >&5
5404 echo "${ECHO_T}yes" >&6
5405                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5406
5407 else
5408   echo "$as_me: failed program was:" >&5
5409 cat conftest.$ac_ext >&5
5410 echo "$as_me:5410: result: no" >&5
5411 echo "${ECHO_T}no" >&6
5412
5413 cf_search=
5414 cf_library_path_list=""
5415 if test -n "${LDFLAGS}${LIBS}" ; then
5416         for cf_library_path in $LDFLAGS $LIBS
5417         do
5418                 case $cf_library_path in #(vi
5419                 -L*)
5420                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5421
5422 test "x$cf_library_path" != "xNONE" && \
5423 test -d "$cf_library_path" && \
5424  {
5425         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5426         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5427         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5428         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5429         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5430         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"
5431 }
5432
5433                         cf_library_path_list="$cf_library_path_list $cf_search"
5434                         ;;
5435                 esac
5436         done
5437 fi
5438
5439 cf_search=
5440
5441 test "x/usr" != "x$prefix" && \
5442 test -d "/usr" && \
5443 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
5444         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
5445         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
5446         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
5447         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
5448         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
5449         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
5450 }
5451
5452 test "x$prefix" != "xNONE" && \
5453 test -d "$prefix" && \
5454  {
5455         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5456         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5457         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5458         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5459         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5460         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5461 }
5462
5463 test "x/usr/local" != "x$prefix" && \
5464 test -d "/usr/local" && \
5465 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
5466         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
5467         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
5468         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
5469         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
5470         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
5471         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
5472 }
5473
5474 test "x/opt" != "x$prefix" && \
5475 test -d "/opt" && \
5476 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
5477         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
5478         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
5479         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
5480         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
5481         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
5482         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
5483 }
5484
5485 test "x$HOME" != "x$prefix" && \
5486 test -d "$HOME" && \
5487 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
5488         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
5489         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
5490         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
5491         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
5492         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
5493         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
5494 }
5495
5496 cf_search="$cf_library_path_list $cf_search"
5497
5498                         for cf_libdir in $cf_search
5499                         do
5500                                 echo "$as_me:5500: checking for -l$cf_nculib_root in $cf_libdir" >&5
5501 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5502                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5503                                 cat >conftest.$ac_ext <<_ACEOF
5504 #line 5504 "configure"
5505 #include "confdefs.h"
5506 #include <${cf_cv_ncurses_header:-curses.h}>
5507 int
5508 main ()
5509 {
5510 initscr()
5511   ;
5512   return 0;
5513 }
5514 _ACEOF
5515 rm -f conftest.$ac_objext conftest$ac_exeext
5516 if { (eval echo "$as_me:5516: \"$ac_link\"") >&5
5517   (eval $ac_link) 2>&5
5518   ac_status=$?
5519   echo "$as_me:5519: \$? = $ac_status" >&5
5520   (exit $ac_status); } &&
5521          { ac_try='test -s conftest$ac_exeext'
5522   { (eval echo "$as_me:5522: \"$ac_try\"") >&5
5523   (eval $ac_try) 2>&5
5524   ac_status=$?
5525   echo "$as_me:5525: \$? = $ac_status" >&5
5526   (exit $ac_status); }; }; then
5527   echo "$as_me:5527: result: yes" >&5
5528 echo "${ECHO_T}yes" >&6
5529                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5530                                          break
5531 else
5532   echo "$as_me: failed program was:" >&5
5533 cat conftest.$ac_ext >&5
5534 echo "$as_me:5534: result: no" >&5
5535 echo "${ECHO_T}no" >&6
5536                                          LIBS="$cf_save_LIBS"
5537 fi
5538 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5539                         done
5540
5541 fi
5542 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5543
5544 fi
5545
5546 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5547
5548 if test $cf_found_library = no ; then
5549         { { echo "$as_me:5549: error: Cannot link $cf_nculib_root library" >&5
5550 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5551    { (exit 1); exit 1; }; }
5552 fi
5553
5554 fi
5555
5556 if test -n "$cf_ncurses_LIBS" ; then
5557         echo "$as_me:5557: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5558 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5559         cf_ncurses_SAVE="$LIBS"
5560         for p in $cf_ncurses_LIBS ; do
5561                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5562                 if test "$q" != "$LIBS" ; then
5563                         LIBS="$q"
5564                 fi
5565         done
5566         cat >conftest.$ac_ext <<_ACEOF
5567 #line 5567 "configure"
5568 #include "confdefs.h"
5569 #include <${cf_cv_ncurses_header:-curses.h}>
5570 int
5571 main ()
5572 {
5573 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5574   ;
5575   return 0;
5576 }
5577 _ACEOF
5578 rm -f conftest.$ac_objext conftest$ac_exeext
5579 if { (eval echo "$as_me:5579: \"$ac_link\"") >&5
5580   (eval $ac_link) 2>&5
5581   ac_status=$?
5582   echo "$as_me:5582: \$? = $ac_status" >&5
5583   (exit $ac_status); } &&
5584          { ac_try='test -s conftest$ac_exeext'
5585   { (eval echo "$as_me:5585: \"$ac_try\"") >&5
5586   (eval $ac_try) 2>&5
5587   ac_status=$?
5588   echo "$as_me:5588: \$? = $ac_status" >&5
5589   (exit $ac_status); }; }; then
5590   echo "$as_me:5590: result: yes" >&5
5591 echo "${ECHO_T}yes" >&6
5592 else
5593   echo "$as_me: failed program was:" >&5
5594 cat conftest.$ac_ext >&5
5595 echo "$as_me:5595: result: no" >&5
5596 echo "${ECHO_T}no" >&6
5597                  LIBS="$cf_ncurses_SAVE"
5598 fi
5599 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5600 fi
5601
5602 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5603
5604 cat >>confdefs.h <<EOF
5605 #define $cf_nculib_ROOT 1
5606 EOF
5607
5608 fi
5609
5610 else
5611
5612 cf_ncuconfig_root=ncurses
5613
5614 echo "Looking for ${cf_ncuconfig_root}-config"
5615
5616 if test -n "$ac_tool_prefix"; then
5617   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5618   do
5619     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5620 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5621 echo "$as_me:5621: checking for $ac_word" >&5
5622 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5623 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5624   echo $ECHO_N "(cached) $ECHO_C" >&6
5625 else
5626   if test -n "$NCURSES_CONFIG"; then
5627   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5628 else
5629   ac_save_IFS=$IFS; IFS=$ac_path_separator
5630 ac_dummy="$PATH"
5631 for ac_dir in $ac_dummy; do
5632   IFS=$ac_save_IFS
5633   test -z "$ac_dir" && ac_dir=.
5634   $as_executable_p "$ac_dir/$ac_word" || continue
5635 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5636 echo "$as_me:5636: found $ac_dir/$ac_word" >&5
5637 break
5638 done
5639
5640 fi
5641 fi
5642 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5643 if test -n "$NCURSES_CONFIG"; then
5644   echo "$as_me:5644: result: $NCURSES_CONFIG" >&5
5645 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5646 else
5647   echo "$as_me:5647: result: no" >&5
5648 echo "${ECHO_T}no" >&6
5649 fi
5650
5651     test -n "$NCURSES_CONFIG" && break
5652   done
5653 fi
5654 if test -z "$NCURSES_CONFIG"; then
5655   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5656   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5657 do
5658   # Extract the first word of "$ac_prog", so it can be a program name with args.
5659 set dummy $ac_prog; ac_word=$2
5660 echo "$as_me:5660: checking for $ac_word" >&5
5661 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5662 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5663   echo $ECHO_N "(cached) $ECHO_C" >&6
5664 else
5665   if test -n "$ac_ct_NCURSES_CONFIG"; then
5666   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5667 else
5668   ac_save_IFS=$IFS; IFS=$ac_path_separator
5669 ac_dummy="$PATH"
5670 for ac_dir in $ac_dummy; do
5671   IFS=$ac_save_IFS
5672   test -z "$ac_dir" && ac_dir=.
5673   $as_executable_p "$ac_dir/$ac_word" || continue
5674 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5675 echo "$as_me:5675: found $ac_dir/$ac_word" >&5
5676 break
5677 done
5678
5679 fi
5680 fi
5681 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5682 if test -n "$ac_ct_NCURSES_CONFIG"; then
5683   echo "$as_me:5683: result: $ac_ct_NCURSES_CONFIG" >&5
5684 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5685 else
5686   echo "$as_me:5686: result: no" >&5
5687 echo "${ECHO_T}no" >&6
5688 fi
5689
5690   test -n "$ac_ct_NCURSES_CONFIG" && break
5691 done
5692 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5693
5694   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5695 fi
5696
5697 if test "$NCURSES_CONFIG" != none ; then
5698
5699 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5700 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5701
5702 # even with config script, some packages use no-override for curses.h
5703
5704 echo "$as_me:5704: checking if we have identified curses headers" >&5
5705 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5706 if test "${cf_cv_ncurses_header+set}" = set; then
5707   echo $ECHO_N "(cached) $ECHO_C" >&6
5708 else
5709
5710 cf_cv_ncurses_header=none
5711 for cf_header in  \
5712     ncurses/ncurses.h \
5713         ncurses/curses.h \
5714         ncurses.h \
5715         curses.h
5716 do
5717 cat >conftest.$ac_ext <<_ACEOF
5718 #line 5718 "configure"
5719 #include "confdefs.h"
5720 #include <${cf_header}>
5721 int
5722 main ()
5723 {
5724 initscr(); tgoto("?", 0,0)
5725   ;
5726   return 0;
5727 }
5728 _ACEOF
5729 rm -f conftest.$ac_objext
5730 if { (eval echo "$as_me:5730: \"$ac_compile\"") >&5
5731   (eval $ac_compile) 2>&5
5732   ac_status=$?
5733   echo "$as_me:5733: \$? = $ac_status" >&5
5734   (exit $ac_status); } &&
5735          { ac_try='test -s conftest.$ac_objext'
5736   { (eval echo "$as_me:5736: \"$ac_try\"") >&5
5737   (eval $ac_try) 2>&5
5738   ac_status=$?
5739   echo "$as_me:5739: \$? = $ac_status" >&5
5740   (exit $ac_status); }; }; then
5741   cf_cv_ncurses_header=$cf_header; break
5742 else
5743   echo "$as_me: failed program was:" >&5
5744 cat conftest.$ac_ext >&5
5745 fi
5746 rm -f conftest.$ac_objext conftest.$ac_ext
5747 done
5748
5749 fi
5750 echo "$as_me:5750: result: $cf_cv_ncurses_header" >&5
5751 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5752
5753 if test "$cf_cv_ncurses_header" = none ; then
5754         { { echo "$as_me:5754: error: No curses header-files found" >&5
5755 echo "$as_me: error: No curses header-files found" >&2;}
5756    { (exit 1); exit 1; }; }
5757 fi
5758
5759 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5760
5761 for ac_header in $cf_cv_ncurses_header
5762 do
5763 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5764 echo "$as_me:5764: checking for $ac_header" >&5
5765 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5766 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5767   echo $ECHO_N "(cached) $ECHO_C" >&6
5768 else
5769   cat >conftest.$ac_ext <<_ACEOF
5770 #line 5770 "configure"
5771 #include "confdefs.h"
5772 #include <$ac_header>
5773 _ACEOF
5774 if { (eval echo "$as_me:5774: \"$ac_cpp conftest.$ac_ext\"") >&5
5775   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5776   ac_status=$?
5777   egrep -v '^ *\+' conftest.er1 >conftest.err
5778   rm -f conftest.er1
5779   cat conftest.err >&5
5780   echo "$as_me:5780: \$? = $ac_status" >&5
5781   (exit $ac_status); } >/dev/null; then
5782   if test -s conftest.err; then
5783     ac_cpp_err=$ac_c_preproc_warn_flag
5784   else
5785     ac_cpp_err=
5786   fi
5787 else
5788   ac_cpp_err=yes
5789 fi
5790 if test -z "$ac_cpp_err"; then
5791   eval "$as_ac_Header=yes"
5792 else
5793   echo "$as_me: failed program was:" >&5
5794   cat conftest.$ac_ext >&5
5795   eval "$as_ac_Header=no"
5796 fi
5797 rm -f conftest.err conftest.$ac_ext
5798 fi
5799 echo "$as_me:5799: result: `eval echo '${'$as_ac_Header'}'`" >&5
5800 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5801 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5802   cat >>confdefs.h <<EOF
5803 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5804 EOF
5805
5806 fi
5807 done
5808
5809 cat >>confdefs.h <<\EOF
5810 #define NCURSES 1
5811 EOF
5812
5813 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5814
5815 cat >>confdefs.h <<EOF
5816 #define $cf_nculib_ROOT 1
5817 EOF
5818
5819 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5820
5821 else
5822
5823 cf_ncuhdr_root=ncurses
5824
5825 test -n "$cf_cv_curses_dir" && \
5826 test "$cf_cv_curses_dir" != "no" && { \
5827
5828 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5829   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5830   do
5831         while test $cf_add_incdir != /usr/include
5832         do
5833           if test -d $cf_add_incdir
5834           then
5835                 cf_have_incdir=no
5836                 if test -n "$CFLAGS$CPPFLAGS" ; then
5837                   # a loop is needed to ensure we can add subdirs of existing dirs
5838                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5839                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5840                           cf_have_incdir=yes; break
5841                         fi
5842                   done
5843                 fi
5844
5845                 if test "$cf_have_incdir" = no ; then
5846                   if test "$cf_add_incdir" = /usr/local/include ; then
5847                         if test "$GCC" = yes
5848                         then
5849                           cf_save_CPPFLAGS=$CPPFLAGS
5850                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5851                           cat >conftest.$ac_ext <<_ACEOF
5852 #line 5852 "configure"
5853 #include "confdefs.h"
5854 #include <stdio.h>
5855 int
5856 main ()
5857 {
5858 printf("Hello")
5859   ;
5860   return 0;
5861 }
5862 _ACEOF
5863 rm -f conftest.$ac_objext
5864 if { (eval echo "$as_me:5864: \"$ac_compile\"") >&5
5865   (eval $ac_compile) 2>&5
5866   ac_status=$?
5867   echo "$as_me:5867: \$? = $ac_status" >&5
5868   (exit $ac_status); } &&
5869          { ac_try='test -s conftest.$ac_objext'
5870   { (eval echo "$as_me:5870: \"$ac_try\"") >&5
5871   (eval $ac_try) 2>&5
5872   ac_status=$?
5873   echo "$as_me:5873: \$? = $ac_status" >&5
5874   (exit $ac_status); }; }; then
5875   :
5876 else
5877   echo "$as_me: failed program was:" >&5
5878 cat conftest.$ac_ext >&5
5879 cf_have_incdir=yes
5880 fi
5881 rm -f conftest.$ac_objext conftest.$ac_ext
5882                           CPPFLAGS=$cf_save_CPPFLAGS
5883                         fi
5884                   fi
5885                 fi
5886
5887                 if test "$cf_have_incdir" = no ; then
5888                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5889
5890 echo "${as_me:-configure}:5890: testing adding $cf_add_incdir to include-path ..." 1>&5
5891
5892                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5893
5894                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5895                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5896                   cf_add_incdir="$cf_top_incdir"
5897                 else
5898                   break
5899                 fi
5900           fi
5901         done
5902   done
5903 fi
5904
5905 }
5906
5907 echo "$as_me:5907: checking for $cf_ncuhdr_root header in include-path" >&5
5908 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5909 if test "${cf_cv_ncurses_h+set}" = set; then
5910   echo $ECHO_N "(cached) $ECHO_C" >&6
5911 else
5912
5913         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5914         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5915         for cf_header in $cf_header_list
5916         do
5917
5918         cat >conftest.$ac_ext <<_ACEOF
5919 #line 5919 "configure"
5920 #include "confdefs.h"
5921
5922 #include <$cf_header>
5923 int
5924 main ()
5925 {
5926
5927 #ifdef NCURSES_VERSION
5928
5929 printf("%s\n", NCURSES_VERSION);
5930 #else
5931 #ifdef __NCURSES_H
5932 printf("old\n");
5933 #else
5934         make an error
5935 #endif
5936 #endif
5937
5938   ;
5939   return 0;
5940 }
5941 _ACEOF
5942 rm -f conftest.$ac_objext
5943 if { (eval echo "$as_me:5943: \"$ac_compile\"") >&5
5944   (eval $ac_compile) 2>&5
5945   ac_status=$?
5946   echo "$as_me:5946: \$? = $ac_status" >&5
5947   (exit $ac_status); } &&
5948          { ac_try='test -s conftest.$ac_objext'
5949   { (eval echo "$as_me:5949: \"$ac_try\"") >&5
5950   (eval $ac_try) 2>&5
5951   ac_status=$?
5952   echo "$as_me:5952: \$? = $ac_status" >&5
5953   (exit $ac_status); }; }; then
5954   cf_cv_ncurses_h=$cf_header
5955
5956 else
5957   echo "$as_me: failed program was:" >&5
5958 cat conftest.$ac_ext >&5
5959 cf_cv_ncurses_h=no
5960 fi
5961 rm -f conftest.$ac_objext conftest.$ac_ext
5962
5963                 test "$cf_cv_ncurses_h" != no && break
5964         done
5965
5966 fi
5967 echo "$as_me:5967: result: $cf_cv_ncurses_h" >&5
5968 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5969
5970 if test "$cf_cv_ncurses_h" != no ; then
5971         cf_cv_ncurses_header=$cf_cv_ncurses_h
5972 else
5973
5974 echo "$as_me:5974: checking for $cf_ncuhdr_root include-path" >&5
5975 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5976 if test "${cf_cv_ncurses_h2+set}" = set; then
5977   echo $ECHO_N "(cached) $ECHO_C" >&6
5978 else
5979
5980         test -n "$verbose" && echo
5981
5982 cf_search=
5983
5984 # collect the current set of include-directories from compiler flags
5985 cf_header_path_list=""
5986 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5987         for cf_header_path in $CPPFLAGS $CFLAGS
5988         do
5989                 case $cf_header_path in #(vi
5990                 -I*)
5991                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5992
5993 test "x$cf_header_path" != "xNONE" && \
5994 test -d "$cf_header_path" && \
5995  {
5996         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5997         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5998         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5999         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6000         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6001         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"
6002 }
6003
6004                         cf_header_path_list="$cf_header_path_list $cf_search"
6005                         ;;
6006                 esac
6007         done
6008 fi
6009
6010 # add the variations for the package we are looking for
6011
6012 cf_search=
6013
6014 test "x/usr" != "x$prefix" && \
6015 test -d "/usr" && \
6016 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
6017         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6018         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6019         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6020         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6021         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6022         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6023 }
6024
6025 test "x$prefix" != "xNONE" && \
6026 test -d "$prefix" && \
6027  {
6028         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6029         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6030         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6031         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6032         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6033         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6034 }
6035
6036 test "x/usr/local" != "x$prefix" && \
6037 test -d "/usr/local" && \
6038 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
6039         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6040         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6041         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6042         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6043         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6044         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6045 }
6046
6047 test "x/opt" != "x$prefix" && \
6048 test -d "/opt" && \
6049 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
6050         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6051         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6052         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6053         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6054         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6055         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6056 }
6057
6058 test "x$HOME" != "x$prefix" && \
6059 test -d "$HOME" && \
6060 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
6061         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6062         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6063         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6064         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6065         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6066         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6067 }
6068
6069 test "$includedir" != NONE && \
6070 test "$includedir" != "/usr/include" && \
6071 test -d "$includedir" && {
6072         test -d $includedir &&    cf_search="$cf_search $includedir"
6073         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6074 }
6075
6076 test "$oldincludedir" != NONE && \
6077 test "$oldincludedir" != "/usr/include" && \
6078 test -d "$oldincludedir" && {
6079         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6080         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6081 }
6082
6083 cf_search="$cf_search $cf_header_path_list"
6084
6085         test -n "$verbose" && echo search path $cf_search
6086         cf_save2_CPPFLAGS="$CPPFLAGS"
6087         for cf_incdir in $cf_search
6088         do
6089
6090 if test -n "$cf_incdir" ; then
6091   for cf_add_incdir in $cf_incdir
6092   do
6093         while test $cf_add_incdir != /usr/include
6094         do
6095           if test -d $cf_add_incdir
6096           then
6097                 cf_have_incdir=no
6098                 if test -n "$CFLAGS$CPPFLAGS" ; then
6099                   # a loop is needed to ensure we can add subdirs of existing dirs
6100                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6101                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6102                           cf_have_incdir=yes; break
6103                         fi
6104                   done
6105                 fi
6106
6107                 if test "$cf_have_incdir" = no ; then
6108                   if test "$cf_add_incdir" = /usr/local/include ; then
6109                         if test "$GCC" = yes
6110                         then
6111                           cf_save_CPPFLAGS=$CPPFLAGS
6112                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6113                           cat >conftest.$ac_ext <<_ACEOF
6114 #line 6114 "configure"
6115 #include "confdefs.h"
6116 #include <stdio.h>
6117 int
6118 main ()
6119 {
6120 printf("Hello")
6121   ;
6122   return 0;
6123 }
6124 _ACEOF
6125 rm -f conftest.$ac_objext
6126 if { (eval echo "$as_me:6126: \"$ac_compile\"") >&5
6127   (eval $ac_compile) 2>&5
6128   ac_status=$?
6129   echo "$as_me:6129: \$? = $ac_status" >&5
6130   (exit $ac_status); } &&
6131          { ac_try='test -s conftest.$ac_objext'
6132   { (eval echo "$as_me:6132: \"$ac_try\"") >&5
6133   (eval $ac_try) 2>&5
6134   ac_status=$?
6135   echo "$as_me:6135: \$? = $ac_status" >&5
6136   (exit $ac_status); }; }; then
6137   :
6138 else
6139   echo "$as_me: failed program was:" >&5
6140 cat conftest.$ac_ext >&5
6141 cf_have_incdir=yes
6142 fi
6143 rm -f conftest.$ac_objext conftest.$ac_ext
6144                           CPPFLAGS=$cf_save_CPPFLAGS
6145                         fi
6146                   fi
6147                 fi
6148
6149                 if test "$cf_have_incdir" = no ; then
6150                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6151
6152 echo "${as_me:-configure}:6152: testing adding $cf_add_incdir to include-path ..." 1>&5
6153
6154                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6155
6156                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6157                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6158                   cf_add_incdir="$cf_top_incdir"
6159                 else
6160                   break
6161                 fi
6162           fi
6163         done
6164   done
6165 fi
6166
6167                 for cf_header in \
6168                         ncurses.h \
6169                         curses.h
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_h2=$cf_header
6209
6210 else
6211   echo "$as_me: failed program was:" >&5
6212 cat conftest.$ac_ext >&5
6213 cf_cv_ncurses_h2=no
6214 fi
6215 rm -f conftest.$ac_objext conftest.$ac_ext
6216
6217                         if test "$cf_cv_ncurses_h2" != no ; then
6218                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6219                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6220                                 break
6221                         fi
6222                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6223                 done
6224                 CPPFLAGS="$cf_save2_CPPFLAGS"
6225                 test "$cf_cv_ncurses_h2" != no && break
6226         done
6227         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6227: error: not found" >&5
6228 echo "$as_me: error: not found" >&2;}
6229    { (exit 1); exit 1; }; }
6230
6231 fi
6232 echo "$as_me:6232: result: $cf_cv_ncurses_h2" >&5
6233 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6234
6235         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6236         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6237         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6238                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6239         fi
6240
6241 if test -n "$cf_1st_incdir" ; then
6242   for cf_add_incdir in $cf_1st_incdir
6243   do
6244         while test $cf_add_incdir != /usr/include
6245         do
6246           if test -d $cf_add_incdir
6247           then
6248                 cf_have_incdir=no
6249                 if test -n "$CFLAGS$CPPFLAGS" ; then
6250                   # a loop is needed to ensure we can add subdirs of existing dirs
6251                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6252                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6253                           cf_have_incdir=yes; break
6254                         fi
6255                   done
6256                 fi
6257
6258                 if test "$cf_have_incdir" = no ; then
6259                   if test "$cf_add_incdir" = /usr/local/include ; then
6260                         if test "$GCC" = yes
6261                         then
6262                           cf_save_CPPFLAGS=$CPPFLAGS
6263                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6264                           cat >conftest.$ac_ext <<_ACEOF
6265 #line 6265 "configure"
6266 #include "confdefs.h"
6267 #include <stdio.h>
6268 int
6269 main ()
6270 {
6271 printf("Hello")
6272   ;
6273   return 0;
6274 }
6275 _ACEOF
6276 rm -f conftest.$ac_objext
6277 if { (eval echo "$as_me:6277: \"$ac_compile\"") >&5
6278   (eval $ac_compile) 2>&5
6279   ac_status=$?
6280   echo "$as_me:6280: \$? = $ac_status" >&5
6281   (exit $ac_status); } &&
6282          { ac_try='test -s conftest.$ac_objext'
6283   { (eval echo "$as_me:6283: \"$ac_try\"") >&5
6284   (eval $ac_try) 2>&5
6285   ac_status=$?
6286   echo "$as_me:6286: \$? = $ac_status" >&5
6287   (exit $ac_status); }; }; then
6288   :
6289 else
6290   echo "$as_me: failed program was:" >&5
6291 cat conftest.$ac_ext >&5
6292 cf_have_incdir=yes
6293 fi
6294 rm -f conftest.$ac_objext conftest.$ac_ext
6295                           CPPFLAGS=$cf_save_CPPFLAGS
6296                         fi
6297                   fi
6298                 fi
6299
6300                 if test "$cf_have_incdir" = no ; then
6301                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6302
6303 echo "${as_me:-configure}:6303: testing adding $cf_add_incdir to include-path ..." 1>&5
6304
6305                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6306
6307                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6308                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6309                   cf_add_incdir="$cf_top_incdir"
6310                 else
6311                   break
6312                 fi
6313           fi
6314         done
6315   done
6316 fi
6317
6318 fi
6319
6320 # Set definitions to allow ifdef'ing for ncurses.h
6321
6322 case $cf_cv_ncurses_header in # (vi
6323 *ncurses.h)
6324
6325 cat >>confdefs.h <<\EOF
6326 #define HAVE_NCURSES_H 1
6327 EOF
6328
6329         ;;
6330 esac
6331
6332 case $cf_cv_ncurses_header in # (vi
6333 ncurses/curses.h|ncurses/ncurses.h)
6334
6335 cat >>confdefs.h <<\EOF
6336 #define HAVE_NCURSES_NCURSES_H 1
6337 EOF
6338
6339         ;;
6340 ncursesw/curses.h|ncursesw/ncurses.h)
6341
6342 cat >>confdefs.h <<\EOF
6343 #define HAVE_NCURSESW_NCURSES_H 1
6344 EOF
6345
6346         ;;
6347 esac
6348
6349 echo "$as_me:6349: checking for terminfo header" >&5
6350 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6351 if test "${cf_cv_term_header+set}" = set; then
6352   echo $ECHO_N "(cached) $ECHO_C" >&6
6353 else
6354
6355 case ${cf_cv_ncurses_header} in #(vi
6356 */ncurses.h|*/ncursesw.h) #(vi
6357         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6358         ;;
6359 *)
6360         cf_term_header=term.h
6361         ;;
6362 esac
6363
6364 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6365 do
6366 cat >conftest.$ac_ext <<_ACEOF
6367 #line 6367 "configure"
6368 #include "confdefs.h"
6369 #include <stdio.h>
6370 #include <${cf_cv_ncurses_header:-curses.h}>
6371 #include <$cf_test>
6372
6373 int
6374 main ()
6375 {
6376 int x = auto_left_margin
6377   ;
6378   return 0;
6379 }
6380 _ACEOF
6381 rm -f conftest.$ac_objext
6382 if { (eval echo "$as_me:6382: \"$ac_compile\"") >&5
6383   (eval $ac_compile) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit $ac_status); } &&
6387          { ac_try='test -s conftest.$ac_objext'
6388   { (eval echo "$as_me:6388: \"$ac_try\"") >&5
6389   (eval $ac_try) 2>&5
6390   ac_status=$?
6391   echo "$as_me:6391: \$? = $ac_status" >&5
6392   (exit $ac_status); }; }; then
6393
6394         cf_cv_term_header="$cf_test"
6395 else
6396   echo "$as_me: failed program was:" >&5
6397 cat conftest.$ac_ext >&5
6398
6399         cf_cv_term_header=unknown
6400
6401 fi
6402 rm -f conftest.$ac_objext conftest.$ac_ext
6403         test "$cf_cv_term_header" != unknown && break
6404 done
6405
6406 fi
6407 echo "$as_me:6407: result: $cf_cv_term_header" >&5
6408 echo "${ECHO_T}$cf_cv_term_header" >&6
6409
6410 # Set definitions to allow ifdef'ing to accommodate subdirectories
6411
6412 case $cf_cv_term_header in # (vi
6413 *term.h)
6414
6415 cat >>confdefs.h <<\EOF
6416 #define HAVE_TERM_H 1
6417 EOF
6418
6419         ;;
6420 esac
6421
6422 case $cf_cv_term_header in # (vi
6423 ncurses/term.h) #(vi
6424
6425 cat >>confdefs.h <<\EOF
6426 #define HAVE_NCURSES_TERM_H 1
6427 EOF
6428
6429         ;;
6430 ncursesw/term.h)
6431
6432 cat >>confdefs.h <<\EOF
6433 #define HAVE_NCURSESW_TERM_H 1
6434 EOF
6435
6436         ;;
6437 esac
6438
6439 # some applications need this, but should check for NCURSES_VERSION
6440
6441 cat >>confdefs.h <<\EOF
6442 #define NCURSES 1
6443 EOF
6444
6445 echo "$as_me:6445: checking for ncurses version" >&5
6446 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6447 if test "${cf_cv_ncurses_version+set}" = set; then
6448   echo $ECHO_N "(cached) $ECHO_C" >&6
6449 else
6450
6451         cf_cv_ncurses_version=no
6452         cf_tempfile=out$$
6453         rm -f $cf_tempfile
6454         if test "$cross_compiling" = yes; then
6455
6456         # This will not work if the preprocessor splits the line after the
6457         # Autoconf token.  The 'unproto' program does that.
6458         cat > conftest.$ac_ext <<EOF
6459 #include <${cf_cv_ncurses_header:-curses.h}>
6460 #undef Autoconf
6461 #ifdef NCURSES_VERSION
6462 Autoconf NCURSES_VERSION
6463 #else
6464 #ifdef __NCURSES_H
6465 Autoconf "old"
6466 #endif
6467 ;
6468 #endif
6469 EOF
6470         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6471         { (eval echo "$as_me:6471: \"$cf_try\"") >&5
6472   (eval $cf_try) 2>&5
6473   ac_status=$?
6474   echo "$as_me:6474: \$? = $ac_status" >&5
6475   (exit $ac_status); }
6476         if test -f conftest.out ; then
6477                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6478                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6479                 rm -f conftest.out
6480         fi
6481
6482 else
6483   cat >conftest.$ac_ext <<_ACEOF
6484 #line 6484 "configure"
6485 #include "confdefs.h"
6486
6487 #include <${cf_cv_ncurses_header:-curses.h}>
6488 #include <stdio.h>
6489 int main()
6490 {
6491         FILE *fp = fopen("$cf_tempfile", "w");
6492 #ifdef NCURSES_VERSION
6493 # ifdef NCURSES_VERSION_PATCH
6494         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6495 # else
6496         fprintf(fp, "%s\n", NCURSES_VERSION);
6497 # endif
6498 #else
6499 # ifdef __NCURSES_H
6500         fprintf(fp, "old\n");
6501 # else
6502         make an error
6503 # endif
6504 #endif
6505         ${cf_cv_main_return:-return}(0);
6506 }
6507 _ACEOF
6508 rm -f conftest$ac_exeext
6509 if { (eval echo "$as_me:6509: \"$ac_link\"") >&5
6510   (eval $ac_link) 2>&5
6511   ac_status=$?
6512   echo "$as_me:6512: \$? = $ac_status" >&5
6513   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6514   { (eval echo "$as_me:6514: \"$ac_try\"") >&5
6515   (eval $ac_try) 2>&5
6516   ac_status=$?
6517   echo "$as_me:6517: \$? = $ac_status" >&5
6518   (exit $ac_status); }; }; then
6519
6520         cf_cv_ncurses_version=`cat $cf_tempfile`
6521 else
6522   echo "$as_me: program exited with status $ac_status" >&5
6523 echo "$as_me: failed program was:" >&5
6524 cat conftest.$ac_ext >&5
6525 fi
6526 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6527 fi
6528         rm -f $cf_tempfile
6529
6530 fi
6531 echo "$as_me:6531: result: $cf_cv_ncurses_version" >&5
6532 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6533 test "$cf_cv_ncurses_version" = no ||
6534 cat >>confdefs.h <<\EOF
6535 #define NCURSES 1
6536 EOF
6537
6538 cf_nculib_root=ncurses
6539         # This works, except for the special case where we find gpm, but
6540         # ncurses is in a nonstandard location via $LIBS, and we really want
6541         # to link gpm.
6542 cf_ncurses_LIBS=""
6543 cf_ncurses_SAVE="$LIBS"
6544 echo "$as_me:6544: checking for Gpm_Open in -lgpm" >&5
6545 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6546 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6547   echo $ECHO_N "(cached) $ECHO_C" >&6
6548 else
6549   ac_check_lib_save_LIBS=$LIBS
6550 LIBS="-lgpm  $LIBS"
6551 cat >conftest.$ac_ext <<_ACEOF
6552 #line 6552 "configure"
6553 #include "confdefs.h"
6554
6555 /* Override any gcc2 internal prototype to avoid an error.  */
6556 #ifdef __cplusplus
6557 extern "C"
6558 #endif
6559 /* We use char because int might match the return type of a gcc2
6560    builtin and then its argument prototype would still apply.  */
6561 char Gpm_Open ();
6562 int
6563 main ()
6564 {
6565 Gpm_Open ();
6566   ;
6567   return 0;
6568 }
6569 _ACEOF
6570 rm -f conftest.$ac_objext conftest$ac_exeext
6571 if { (eval echo "$as_me:6571: \"$ac_link\"") >&5
6572   (eval $ac_link) 2>&5
6573   ac_status=$?
6574   echo "$as_me:6574: \$? = $ac_status" >&5
6575   (exit $ac_status); } &&
6576          { ac_try='test -s conftest$ac_exeext'
6577   { (eval echo "$as_me:6577: \"$ac_try\"") >&5
6578   (eval $ac_try) 2>&5
6579   ac_status=$?
6580   echo "$as_me:6580: \$? = $ac_status" >&5
6581   (exit $ac_status); }; }; then
6582   ac_cv_lib_gpm_Gpm_Open=yes
6583 else
6584   echo "$as_me: failed program was:" >&5
6585 cat conftest.$ac_ext >&5
6586 ac_cv_lib_gpm_Gpm_Open=no
6587 fi
6588 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6589 LIBS=$ac_check_lib_save_LIBS
6590 fi
6591 echo "$as_me:6591: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6592 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6593 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6594   echo "$as_me:6594: checking for initscr in -lgpm" >&5
6595 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6596 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6597   echo $ECHO_N "(cached) $ECHO_C" >&6
6598 else
6599   ac_check_lib_save_LIBS=$LIBS
6600 LIBS="-lgpm  $LIBS"
6601 cat >conftest.$ac_ext <<_ACEOF
6602 #line 6602 "configure"
6603 #include "confdefs.h"
6604
6605 /* Override any gcc2 internal prototype to avoid an error.  */
6606 #ifdef __cplusplus
6607 extern "C"
6608 #endif
6609 /* We use char because int might match the return type of a gcc2
6610    builtin and then its argument prototype would still apply.  */
6611 char initscr ();
6612 int
6613 main ()
6614 {
6615 initscr ();
6616   ;
6617   return 0;
6618 }
6619 _ACEOF
6620 rm -f conftest.$ac_objext conftest$ac_exeext
6621 if { (eval echo "$as_me:6621: \"$ac_link\"") >&5
6622   (eval $ac_link) 2>&5
6623   ac_status=$?
6624   echo "$as_me:6624: \$? = $ac_status" >&5
6625   (exit $ac_status); } &&
6626          { ac_try='test -s conftest$ac_exeext'
6627   { (eval echo "$as_me:6627: \"$ac_try\"") >&5
6628   (eval $ac_try) 2>&5
6629   ac_status=$?
6630   echo "$as_me:6630: \$? = $ac_status" >&5
6631   (exit $ac_status); }; }; then
6632   ac_cv_lib_gpm_initscr=yes
6633 else
6634   echo "$as_me: failed program was:" >&5
6635 cat conftest.$ac_ext >&5
6636 ac_cv_lib_gpm_initscr=no
6637 fi
6638 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6639 LIBS=$ac_check_lib_save_LIBS
6640 fi
6641 echo "$as_me:6641: result: $ac_cv_lib_gpm_initscr" >&5
6642 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6643 if test $ac_cv_lib_gpm_initscr = yes; then
6644   LIBS="$cf_ncurses_SAVE"
6645 else
6646   cf_ncurses_LIBS="-lgpm"
6647 fi
6648
6649 fi
6650
6651 case $host_os in #(vi
6652 freebsd*)
6653         # This is only necessary if you are linking against an obsolete
6654         # version of ncurses (but it should do no harm, since it's static).
6655         if test "$cf_nculib_root" = ncurses ; then
6656                 echo "$as_me:6656: checking for tgoto in -lmytinfo" >&5
6657 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6658 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6659   echo $ECHO_N "(cached) $ECHO_C" >&6
6660 else
6661   ac_check_lib_save_LIBS=$LIBS
6662 LIBS="-lmytinfo  $LIBS"
6663 cat >conftest.$ac_ext <<_ACEOF
6664 #line 6664 "configure"
6665 #include "confdefs.h"
6666
6667 /* Override any gcc2 internal prototype to avoid an error.  */
6668 #ifdef __cplusplus
6669 extern "C"
6670 #endif
6671 /* We use char because int might match the return type of a gcc2
6672    builtin and then its argument prototype would still apply.  */
6673 char tgoto ();
6674 int
6675 main ()
6676 {
6677 tgoto ();
6678   ;
6679   return 0;
6680 }
6681 _ACEOF
6682 rm -f conftest.$ac_objext conftest$ac_exeext
6683 if { (eval echo "$as_me:6683: \"$ac_link\"") >&5
6684   (eval $ac_link) 2>&5
6685   ac_status=$?
6686   echo "$as_me:6686: \$? = $ac_status" >&5
6687   (exit $ac_status); } &&
6688          { ac_try='test -s conftest$ac_exeext'
6689   { (eval echo "$as_me:6689: \"$ac_try\"") >&5
6690   (eval $ac_try) 2>&5
6691   ac_status=$?
6692   echo "$as_me:6692: \$? = $ac_status" >&5
6693   (exit $ac_status); }; }; then
6694   ac_cv_lib_mytinfo_tgoto=yes
6695 else
6696   echo "$as_me: failed program was:" >&5
6697 cat conftest.$ac_ext >&5
6698 ac_cv_lib_mytinfo_tgoto=no
6699 fi
6700 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6701 LIBS=$ac_check_lib_save_LIBS
6702 fi
6703 echo "$as_me:6703: result: $ac_cv_lib_mytinfo_tgoto" >&5
6704 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6705 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6706   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6707 fi
6708
6709         fi
6710         ;;
6711 esac
6712
6713 LIBS="$cf_ncurses_LIBS $LIBS"
6714
6715 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6716 then
6717         LIBS="-l$cf_nculib_root $LIBS"
6718 else
6719
6720         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6721         cf_libdir=""
6722         echo "$as_me:6722: checking for initscr" >&5
6723 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6724 if test "${ac_cv_func_initscr+set}" = set; then
6725   echo $ECHO_N "(cached) $ECHO_C" >&6
6726 else
6727   cat >conftest.$ac_ext <<_ACEOF
6728 #line 6728 "configure"
6729 #include "confdefs.h"
6730 /* System header to define __stub macros and hopefully few prototypes,
6731     which can conflict with char initscr (); below.  */
6732 #include <assert.h>
6733 /* Override any gcc2 internal prototype to avoid an error.  */
6734 #ifdef __cplusplus
6735 extern "C"
6736 #endif
6737 /* We use char because int might match the return type of a gcc2
6738    builtin and then its argument prototype would still apply.  */
6739 char initscr ();
6740 char (*f) ();
6741
6742 int
6743 main ()
6744 {
6745 /* The GNU C library defines this for functions which it implements
6746     to always fail with ENOSYS.  Some functions are actually named
6747     something starting with __ and the normal name is an alias.  */
6748 #if defined (__stub_initscr) || defined (__stub___initscr)
6749 choke me
6750 #else
6751 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6752 #endif
6753
6754   ;
6755   return 0;
6756 }
6757 _ACEOF
6758 rm -f conftest.$ac_objext conftest$ac_exeext
6759 if { (eval echo "$as_me:6759: \"$ac_link\"") >&5
6760   (eval $ac_link) 2>&5
6761   ac_status=$?
6762   echo "$as_me:6762: \$? = $ac_status" >&5
6763   (exit $ac_status); } &&
6764          { ac_try='test -s conftest$ac_exeext'
6765   { (eval echo "$as_me:6765: \"$ac_try\"") >&5
6766   (eval $ac_try) 2>&5
6767   ac_status=$?
6768   echo "$as_me:6768: \$? = $ac_status" >&5
6769   (exit $ac_status); }; }; then
6770   ac_cv_func_initscr=yes
6771 else
6772   echo "$as_me: failed program was:" >&5
6773 cat conftest.$ac_ext >&5
6774 ac_cv_func_initscr=no
6775 fi
6776 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6777 fi
6778 echo "$as_me:6778: result: $ac_cv_func_initscr" >&5
6779 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6780 if test $ac_cv_func_initscr = yes; then
6781   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6782 else
6783
6784                 cf_save_LIBS="$LIBS"
6785                 echo "$as_me:6785: checking for initscr in -l$cf_nculib_root" >&5
6786 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6787                 LIBS="-l$cf_nculib_root $LIBS"
6788                 cat >conftest.$ac_ext <<_ACEOF
6789 #line 6789 "configure"
6790 #include "confdefs.h"
6791 #include <${cf_cv_ncurses_header:-curses.h}>
6792 int
6793 main ()
6794 {
6795 initscr()
6796   ;
6797   return 0;
6798 }
6799 _ACEOF
6800 rm -f conftest.$ac_objext conftest$ac_exeext
6801 if { (eval echo "$as_me:6801: \"$ac_link\"") >&5
6802   (eval $ac_link) 2>&5
6803   ac_status=$?
6804   echo "$as_me:6804: \$? = $ac_status" >&5
6805   (exit $ac_status); } &&
6806          { ac_try='test -s conftest$ac_exeext'
6807   { (eval echo "$as_me:6807: \"$ac_try\"") >&5
6808   (eval $ac_try) 2>&5
6809   ac_status=$?
6810   echo "$as_me:6810: \$? = $ac_status" >&5
6811   (exit $ac_status); }; }; then
6812   echo "$as_me:6812: result: yes" >&5
6813 echo "${ECHO_T}yes" >&6
6814                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6815
6816 else
6817   echo "$as_me: failed program was:" >&5
6818 cat conftest.$ac_ext >&5
6819 echo "$as_me:6819: result: no" >&5
6820 echo "${ECHO_T}no" >&6
6821
6822 cf_search=
6823 cf_library_path_list=""
6824 if test -n "${LDFLAGS}${LIBS}" ; then
6825         for cf_library_path in $LDFLAGS $LIBS
6826         do
6827                 case $cf_library_path in #(vi
6828                 -L*)
6829                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6830
6831 test "x$cf_library_path" != "xNONE" && \
6832 test -d "$cf_library_path" && \
6833  {
6834         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6835         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6836         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6837         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6838         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6839         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"
6840 }
6841
6842                         cf_library_path_list="$cf_library_path_list $cf_search"
6843                         ;;
6844                 esac
6845         done
6846 fi
6847
6848 cf_search=
6849
6850 test "x/usr" != "x$prefix" && \
6851 test -d "/usr" && \
6852 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr" != "x$prefix") && {
6853         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6854         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6855         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6856         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6857         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6858         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6859 }
6860
6861 test "x$prefix" != "xNONE" && \
6862 test -d "$prefix" && \
6863  {
6864         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6865         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6866         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6867         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6868         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6869         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6870 }
6871
6872 test "x/usr/local" != "x$prefix" && \
6873 test -d "/usr/local" && \
6874 (test -z "$prefix" || test x$prefix = xNONE || test "x/usr/local" != "x$prefix") && {
6875         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6876         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6877         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6878         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6879         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6880         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6881 }
6882
6883 test "x/opt" != "x$prefix" && \
6884 test -d "/opt" && \
6885 (test -z "$prefix" || test x$prefix = xNONE || test "x/opt" != "x$prefix") && {
6886         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6887         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6888         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6889         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6890         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6891         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6892 }
6893
6894 test "x$HOME" != "x$prefix" && \
6895 test -d "$HOME" && \
6896 (test -z "$prefix" || test x$prefix = xNONE || test "x$HOME" != "x$prefix") && {
6897         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6898         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6899         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6900         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6901         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6902         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6903 }
6904
6905 cf_search="$cf_library_path_list $cf_search"
6906
6907                         for cf_libdir in $cf_search
6908                         do
6909                                 echo "$as_me:6909: checking for -l$cf_nculib_root in $cf_libdir" >&5
6910 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6911                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6912                                 cat >conftest.$ac_ext <<_ACEOF
6913 #line 6913 "configure"
6914 #include "confdefs.h"
6915 #include <${cf_cv_ncurses_header:-curses.h}>
6916 int
6917 main ()
6918 {
6919 initscr()
6920   ;
6921   return 0;
6922 }
6923 _ACEOF
6924 rm -f conftest.$ac_objext conftest$ac_exeext
6925 if { (eval echo "$as_me:6925: \"$ac_link\"") >&5
6926   (eval $ac_link) 2>&5
6927   ac_status=$?
6928   echo "$as_me:6928: \$? = $ac_status" >&5
6929   (exit $ac_status); } &&
6930          { ac_try='test -s conftest$ac_exeext'
6931   { (eval echo "$as_me:6931: \"$ac_try\"") >&5
6932   (eval $ac_try) 2>&5
6933   ac_status=$?
6934   echo "$as_me:6934: \$? = $ac_status" >&5
6935   (exit $ac_status); }; }; then
6936   echo "$as_me:6936: result: yes" >&5
6937 echo "${ECHO_T}yes" >&6
6938                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6939                                          break
6940 else
6941   echo "$as_me: failed program was:" >&5
6942 cat conftest.$ac_ext >&5
6943 echo "$as_me:6943: result: no" >&5
6944 echo "${ECHO_T}no" >&6
6945                                          LIBS="$cf_save_LIBS"
6946 fi
6947 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6948                         done
6949
6950 fi
6951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6952
6953 fi
6954
6955 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6956
6957 if test $cf_found_library = no ; then
6958         { { echo "$as_me:6958: error: Cannot link $cf_nculib_root library" >&5
6959 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6960    { (exit 1); exit 1; }; }
6961 fi
6962
6963 fi
6964
6965 if test -n "$cf_ncurses_LIBS" ; then
6966         echo "$as_me:6966: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6967 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6968         cf_ncurses_SAVE="$LIBS"
6969         for p in $cf_ncurses_LIBS ; do
6970                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6971                 if test "$q" != "$LIBS" ; then
6972                         LIBS="$q"
6973                 fi
6974         done
6975         cat >conftest.$ac_ext <<_ACEOF
6976 #line 6976 "configure"
6977 #include "confdefs.h"
6978 #include <${cf_cv_ncurses_header:-curses.h}>
6979 int
6980 main ()
6981 {
6982 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6983   ;
6984   return 0;
6985 }
6986 _ACEOF
6987 rm -f conftest.$ac_objext conftest$ac_exeext
6988 if { (eval echo "$as_me:6988: \"$ac_link\"") >&5
6989   (eval $ac_link) 2>&5
6990   ac_status=$?
6991   echo "$as_me:6991: \$? = $ac_status" >&5
6992   (exit $ac_status); } &&
6993          { ac_try='test -s conftest$ac_exeext'
6994   { (eval echo "$as_me:6994: \"$ac_try\"") >&5
6995   (eval $ac_try) 2>&5
6996   ac_status=$?
6997   echo "$as_me:6997: \$? = $ac_status" >&5
6998   (exit $ac_status); }; }; then
6999   echo "$as_me:6999: result: yes" >&5
7000 echo "${ECHO_T}yes" >&6
7001 else
7002   echo "$as_me: failed program was:" >&5
7003 cat conftest.$ac_ext >&5
7004 echo "$as_me:7004: result: no" >&5
7005 echo "${ECHO_T}no" >&6
7006                  LIBS="$cf_ncurses_SAVE"
7007 fi
7008 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7009 fi
7010
7011 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7012
7013 cat >>confdefs.h <<EOF
7014 #define $cf_nculib_ROOT 1
7015 EOF
7016
7017 fi
7018
7019 fi
7020
7021 if test "$NCURSES_CONFIG" != none ; then
7022
7023 cf_version=`$NCURSES_CONFIG --version`
7024
7025 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7026 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
7027 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
7028
7029 # ABI version is not available from headers
7030 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7031
7032 else
7033
7034 for cf_name in MAJOR MINOR PATCH
7035 do
7036 cat >conftest.$ac_ext <<CF_EOF
7037 #include <${cf_cv_ncurses_header:-curses.h}>
7038 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7039 CF_EOF
7040         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7041         { (eval echo "$as_me:7041: \"$cf_try\"") >&5
7042   (eval $cf_try) 2>&5
7043   ac_status=$?
7044   echo "$as_me:7044: \$? = $ac_status" >&5
7045   (exit $ac_status); }
7046         if test -f conftest.out ; then
7047                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
7048                 eval NCURSES_$cf_name=\"$cf_result\"
7049                 # cat conftest.$ac_ext
7050                 # cat conftest.out
7051         fi
7052 done
7053
7054 cf_cv_abi_version=${NCURSES_MAJOR}
7055
7056 fi
7057
7058 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7059
7060 cf_cv_timestamp=`date`
7061
7062 echo "$as_me:7062: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7063 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7064
7065 echo "$as_me:7065: checking if you want to have a library-prefix" >&5
7066 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
7067
7068 # Check whether --with-lib-prefix or --without-lib-prefix was given.
7069 if test "${with_lib_prefix+set}" = set; then
7070   withval="$with_lib_prefix"
7071   with_lib_prefix=$withval
7072 else
7073   with_lib_prefix=auto
7074 fi;
7075 echo "$as_me:7075: result: $with_lib_prefix" >&5
7076 echo "${ECHO_T}$with_lib_prefix" >&6
7077
7078 if test $with_lib_prefix = auto
7079 then
7080
7081         case $cf_cv_system_name in #(vi
7082         OS/2*|os2*) #(vi
7083         LIB_PREFIX=''
7084         ;;
7085         *)      LIB_PREFIX='lib'
7086         ;;
7087         esac
7088 cf_prefix=$LIB_PREFIX
7089
7090 elif test $with_lib_prefix = no
7091 then
7092         LIB_PREFIX=
7093 else
7094         LIB_PREFIX=$with_lib_prefix
7095 fi
7096
7097 LIB_SUFFIX=
7098
7099 ###############################################################################
7100
7101 if test X"$CC_G_OPT" = X"" ; then
7102         CC_G_OPT='-g'
7103         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7104 fi
7105
7106 echo "$as_me:7106: checking for default loader flags" >&5
7107 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7108 case $DFT_LWR_MODEL in
7109 normal)  LD_MODEL=''   ;;
7110 debug)   LD_MODEL=$CC_G_OPT ;;
7111 profile) LD_MODEL='-pg';;
7112 shared)  LD_MODEL=''   ;;
7113 esac
7114 echo "$as_me:7114: result: $LD_MODEL" >&5
7115 echo "${ECHO_T}$LD_MODEL" >&6
7116
7117 LD_RPATH_OPT=
7118 echo "$as_me:7118: checking for an rpath option" >&5
7119 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7120 case $cf_cv_system_name in #(vi
7121 irix*) #(vi
7122         if test "$GCC" = yes; then
7123                 LD_RPATH_OPT="-Wl,-rpath,"
7124         else
7125                 LD_RPATH_OPT="-rpath "
7126         fi
7127         ;;
7128 linux*|gnu*|k*bsd*-gnu) #(vi
7129         LD_RPATH_OPT="-Wl,-rpath,"
7130         ;;
7131 openbsd[2-9].*|mirbsd*) #(vi
7132         LD_RPATH_OPT="-Wl,-rpath,"
7133         ;;
7134 dragonfly*|freebsd*) #(vi
7135         LD_RPATH_OPT="-rpath "
7136         ;;
7137 netbsd*) #(vi
7138         LD_RPATH_OPT="-Wl,-rpath,"
7139         ;;
7140 osf*|mls+*) #(vi
7141         LD_RPATH_OPT="-rpath "
7142         ;;
7143 solaris2*) #(vi
7144         LD_RPATH_OPT="-R"
7145         ;;
7146 *)
7147         ;;
7148 esac
7149 echo "$as_me:7149: result: $LD_RPATH_OPT" >&5
7150 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7151
7152 case "x$LD_RPATH_OPT" in #(vi
7153 x-R*)
7154         echo "$as_me:7154: checking if we need a space after rpath option" >&5
7155 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7156         cf_save_LIBS="$LIBS"
7157         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
7158         cat >conftest.$ac_ext <<_ACEOF
7159 #line 7159 "configure"
7160 #include "confdefs.h"
7161
7162 int
7163 main ()
7164 {
7165
7166   ;
7167   return 0;
7168 }
7169 _ACEOF
7170 rm -f conftest.$ac_objext conftest$ac_exeext
7171 if { (eval echo "$as_me:7171: \"$ac_link\"") >&5
7172   (eval $ac_link) 2>&5
7173   ac_status=$?
7174   echo "$as_me:7174: \$? = $ac_status" >&5
7175   (exit $ac_status); } &&
7176          { ac_try='test -s conftest$ac_exeext'
7177   { (eval echo "$as_me:7177: \"$ac_try\"") >&5
7178   (eval $ac_try) 2>&5
7179   ac_status=$?
7180   echo "$as_me:7180: \$? = $ac_status" >&5
7181   (exit $ac_status); }; }; then
7182   cf_rpath_space=no
7183 else
7184   echo "$as_me: failed program was:" >&5
7185 cat conftest.$ac_ext >&5
7186 cf_rpath_space=yes
7187 fi
7188 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7189         LIBS="$cf_save_LIBS"
7190         echo "$as_me:7190: result: $cf_rpath_space" >&5
7191 echo "${ECHO_T}$cf_rpath_space" >&6
7192         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7193         ;;
7194 esac
7195
7196         RM_SHARED_OPTS=
7197         LOCAL_LDFLAGS=
7198         LOCAL_LDFLAGS2=
7199         LD_SHARED_OPTS=
7200         INSTALL_LIB="-m 644"
7201         : ${rel_builddir:=.}
7202
7203         shlibdir=$libdir
7204
7205         MAKE_DLLS="#"
7206
7207         cf_cv_do_symlinks=no
7208         cf_ld_rpath_opt=
7209         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7210
7211         echo "$as_me:7211: checking if release/abi version should be used for shared libs" >&5
7212 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7213
7214 # Check whether --with-shlib-version or --without-shlib-version was given.
7215 if test "${with_shlib_version+set}" = set; then
7216   withval="$with_shlib_version"
7217   test -z "$withval" && withval=auto
7218         case $withval in #(vi
7219         yes) #(vi
7220                 cf_cv_shlib_version=auto
7221                 ;;
7222         rel|abi|auto|no) #(vi
7223                 cf_cv_shlib_version=$withval
7224                 ;;
7225         *)
7226                 { { echo "$as_me:7226: error: option value must be one of: rel, abi, auto or no" >&5
7227 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7228    { (exit 1); exit 1; }; }
7229                 ;;
7230         esac
7231
7232 else
7233   cf_cv_shlib_version=auto
7234 fi;
7235         echo "$as_me:7235: result: $cf_cv_shlib_version" >&5
7236 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7237
7238         cf_cv_rm_so_locs=no
7239         cf_try_cflags=
7240
7241         # Some less-capable ports of gcc support only -fpic
7242         CC_SHARED_OPTS=
7243         if test "$GCC" = yes
7244         then
7245                 echo "$as_me:7245: checking which $CC option to use" >&5
7246 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7247                 cf_save_CFLAGS="$CFLAGS"
7248                 for CC_SHARED_OPTS in -fPIC -fpic ''
7249                 do
7250                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7251                         cat >conftest.$ac_ext <<_ACEOF
7252 #line 7252 "configure"
7253 #include "confdefs.h"
7254 #include <stdio.h>
7255 int
7256 main ()
7257 {
7258 int x = 1
7259   ;
7260   return 0;
7261 }
7262 _ACEOF
7263 rm -f conftest.$ac_objext
7264 if { (eval echo "$as_me:7264: \"$ac_compile\"") >&5
7265   (eval $ac_compile) 2>&5
7266   ac_status=$?
7267   echo "$as_me:7267: \$? = $ac_status" >&5
7268   (exit $ac_status); } &&
7269          { ac_try='test -s conftest.$ac_objext'
7270   { (eval echo "$as_me:7270: \"$ac_try\"") >&5
7271   (eval $ac_try) 2>&5
7272   ac_status=$?
7273   echo "$as_me:7273: \$? = $ac_status" >&5
7274   (exit $ac_status); }; }; then
7275   break
7276 else
7277   echo "$as_me: failed program was:" >&5
7278 cat conftest.$ac_ext >&5
7279 fi
7280 rm -f conftest.$ac_objext conftest.$ac_ext
7281                 done
7282                 echo "$as_me:7282: result: $CC_SHARED_OPTS" >&5
7283 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7284                 CFLAGS="$cf_save_CFLAGS"
7285         fi
7286
7287         cf_cv_shlib_version_infix=no
7288
7289         case $cf_cv_system_name in #(vi
7290         aix4.3-9*|aix[5-7]*) #(vi
7291                 if test "$GCC" = yes; then
7292                         CC_SHARED_OPTS=
7293                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7294                 else
7295                         # CC_SHARED_OPTS='-qpic=large -G'
7296                         # perhaps "-bM:SRE -bnoentry -bexpall"
7297                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7298                 fi
7299                 ;;
7300         beos*) #(vi
7301                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7302                 ;;
7303         cygwin*) #(vi
7304                 CC_SHARED_OPTS=
7305                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7306                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7307                 cf_cv_shlib_version=cygdll
7308                 cf_cv_shlib_version_infix=cygdll
7309                 shlibdir=$bindir
7310                 MAKE_DLLS=
7311                 cat >mk_shared_lib.sh <<-CF_EOF
7312                 #!/bin/sh
7313                 SHARED_LIB=\$1
7314                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7315                 shift
7316                 cat <<-EOF
7317                 Linking shared library
7318                 ** SHARED_LIB \$SHARED_LIB
7319                 ** IMPORT_LIB \$IMPORT_LIB
7320 EOF
7321                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7322 CF_EOF
7323                 chmod +x mk_shared_lib.sh
7324                 ;;
7325         msys*) #(vi
7326                 CC_SHARED_OPTS=
7327                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7328                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7329                 cf_cv_shlib_version=msysdll
7330                 cf_cv_shlib_version_infix=msysdll
7331                 shlibdir=$bindir
7332                 MAKE_DLLS=
7333                 cat >mk_shared_lib.sh <<-CF_EOF
7334                 #!/bin/sh
7335                 SHARED_LIB=\$1
7336                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7337                 shift
7338                 cat <<-EOF
7339                 Linking shared library
7340                 ** SHARED_LIB \$SHARED_LIB
7341                 ** IMPORT_LIB \$IMPORT_LIB
7342 EOF
7343                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7344 CF_EOF
7345                 chmod +x mk_shared_lib.sh
7346                 ;;
7347         darwin*) #(vi
7348                 cf_try_cflags="no-cpp-precomp"
7349                 CC_SHARED_OPTS="-dynamic"
7350                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7351                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7352                 cf_cv_shlib_version_infix=yes
7353                 echo "$as_me:7353: checking if ld -search_paths_first works" >&5
7354 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7355 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7356   echo $ECHO_N "(cached) $ECHO_C" >&6
7357 else
7358
7359                         cf_save_LDFLAGS=$LDFLAGS
7360                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7361                         cat >conftest.$ac_ext <<_ACEOF
7362 #line 7362 "configure"
7363 #include "confdefs.h"
7364
7365 int
7366 main ()
7367 {
7368 int i;
7369   ;
7370   return 0;
7371 }
7372 _ACEOF
7373 rm -f conftest.$ac_objext conftest$ac_exeext
7374 if { (eval echo "$as_me:7374: \"$ac_link\"") >&5
7375   (eval $ac_link) 2>&5
7376   ac_status=$?
7377   echo "$as_me:7377: \$? = $ac_status" >&5
7378   (exit $ac_status); } &&
7379          { ac_try='test -s conftest$ac_exeext'
7380   { (eval echo "$as_me:7380: \"$ac_try\"") >&5
7381   (eval $ac_try) 2>&5
7382   ac_status=$?
7383   echo "$as_me:7383: \$? = $ac_status" >&5
7384   (exit $ac_status); }; }; then
7385   cf_cv_ldflags_search_paths_first=yes
7386 else
7387   echo "$as_me: failed program was:" >&5
7388 cat conftest.$ac_ext >&5
7389 cf_cv_ldflags_search_paths_first=no
7390 fi
7391 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7392                                 LDFLAGS=$cf_save_LDFLAGS
7393 fi
7394 echo "$as_me:7394: result: $cf_cv_ldflags_search_paths_first" >&5
7395 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7396                 if test $cf_cv_ldflags_search_paths_first = yes; then
7397                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7398                 fi
7399                 ;;
7400         hpux[7-8]*) #(vi
7401                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
7402                 if test "$GCC" != yes; then
7403                         CC_SHARED_OPTS='+Z'
7404                 fi
7405                 MK_SHARED_LIB='${LD} -b -o $@'
7406                 INSTALL_LIB="-m 555"
7407                 ;;
7408         hpux*) #(vi
7409                 # (tested with gcc 2.7.2 -- I don't have c89)
7410                 if test "$GCC" = yes; then
7411                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7412                 else
7413                         CC_SHARED_OPTS='+Z'
7414                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7415                 fi
7416                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7417                 # HP-UX shared libraries must be executable, and should be
7418                 # readonly to exploit a quirk in the memory manager.
7419                 INSTALL_LIB="-m 555"
7420                 ;;
7421         interix*)
7422                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7423                 if test "$cf_cv_shlib_version" = rel; then
7424                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
7425                 else
7426                         cf_shared_soname='`basename `'
7427                 fi
7428                 CC_SHARED_OPTS=
7429                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
7430                 ;;
7431         irix*) #(vi
7432                 if test "$cf_cv_enable_rpath" = yes ; then
7433                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7434                 fi
7435                 # tested with IRIX 5.2 and 'cc'.
7436                 if test "$GCC" != yes; then
7437                         CC_SHARED_OPTS='-KPIC'
7438                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7439                 else
7440                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7441                 fi
7442                 cf_cv_rm_so_locs=yes
7443                 ;;
7444         linux*|gnu*|k*bsd*-gnu) #(vi
7445                 if test "$DFT_LWR_MODEL" = "shared" ; then
7446                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7447                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7448                 fi
7449                 if test "$cf_cv_enable_rpath" = yes ; then
7450                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7451                 fi
7452
7453         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7454         if test "$cf_cv_shlib_version" = rel; then
7455                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7456         else
7457                 cf_cv_shared_soname='`basename $@`'
7458         fi
7459
7460                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7461                 ;;
7462         mingw*) #(vi
7463                 cf_cv_shlib_version=mingw
7464                 cf_cv_shlib_version_infix=mingw
7465                 shlibdir=$bindir
7466                 MAKE_DLLS=
7467                 if test "$DFT_LWR_MODEL" = "shared" ; then
7468                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
7469                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7470                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
7471                 fi
7472                 CC_SHARED_OPTS=
7473                 MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7474                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
7475                 cat >mk_shared_lib.sh <<-CF_EOF
7476                 #!/bin/sh
7477                 SHARED_LIB=\$1
7478                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
7479                 shift
7480                 cat <<-EOF
7481                 Linking shared library
7482                 ** SHARED_LIB \$SHARED_LIB
7483                 ** IMPORT_LIB \$IMPORT_LIB
7484 EOF
7485                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
7486 CF_EOF
7487                 chmod +x mk_shared_lib.sh
7488                 ;;
7489         openbsd[2-9].*|mirbsd*) #(vi
7490                 if test "$DFT_LWR_MODEL" = "shared" ; then
7491                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7492                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7493                 fi
7494                 if test "$cf_cv_enable_rpath" = yes ; then
7495                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7496                 fi
7497                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7498
7499         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7500         if test "$cf_cv_shlib_version" = rel; then
7501                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7502         else
7503                 cf_cv_shared_soname='`basename $@`'
7504         fi
7505
7506                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7507                 ;;
7508         nto-qnx*|openbsd*|freebsd[12].*) #(vi
7509                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7510                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7511                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7512                 ;;
7513         dragonfly*|freebsd*) #(vi
7514                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7515                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7516                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7517                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
7518                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7519                 fi
7520
7521         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7522         if test "$cf_cv_shlib_version" = rel; then
7523                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7524         else
7525                 cf_cv_shared_soname='`basename $@`'
7526         fi
7527
7528                 MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
7529                 ;;
7530         netbsd*) #(vi
7531                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7532                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7533                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7534                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7535                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7536                         if test "$cf_cv_shlib_version" = auto; then
7537                         if test -f /usr/libexec/ld.elf_so; then
7538                                 cf_cv_shlib_version=abi
7539                         else
7540                                 cf_cv_shlib_version=rel
7541                         fi
7542                         fi
7543
7544         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7545         if test "$cf_cv_shlib_version" = rel; then
7546                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7547         else
7548                 cf_cv_shared_soname='`basename $@`'
7549         fi
7550
7551                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7552                 else
7553                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
7554                 fi
7555                 ;;
7556         osf*|mls+*) #(vi
7557                 # tested with OSF/1 V3.2 and 'cc'
7558                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7559                 # link with shared libs).
7560                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7561                 case $host_os in #(vi
7562                 osf4*)
7563                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7564                         ;;
7565                 esac
7566                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7567                 if test "$DFT_LWR_MODEL" = "shared" ; then
7568                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7569                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7570                 fi
7571                 cf_cv_rm_so_locs=yes
7572                 ;;
7573         sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
7574                 # tested with osr5.0.5
7575                 if test "$GCC" != yes; then
7576                         CC_SHARED_OPTS='-belf -KPIC'
7577                 fi
7578                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7579                 if test "$cf_cv_enable_rpath" = yes ; then
7580                         # only way is to set LD_RUN_PATH but no switch for it
7581                         RUN_PATH=$libdir
7582                 fi
7583                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7584                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7585                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7586                 ;;
7587         sunos4*) #(vi
7588                 # tested with SunOS 4.1.1 and gcc 2.7.0
7589                 if test "$GCC" != yes; then
7590                         CC_SHARED_OPTS='-KPIC'
7591                 fi
7592                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7593                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7594                 ;;
7595         solaris2*) #(vi
7596                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7597                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7598                 if test "$DFT_LWR_MODEL" = "shared" ; then
7599                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7600                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7601                 fi
7602                 if test "$cf_cv_enable_rpath" = yes ; then
7603                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7604                 fi
7605
7606         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7607         if test "$cf_cv_shlib_version" = rel; then
7608                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7609         else
7610                 cf_cv_shared_soname='`basename $@`'
7611         fi
7612
7613                 if test "$GCC" != yes; then
7614                         cf_save_CFLAGS="$CFLAGS"
7615                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7616                         do
7617                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7618                                 cat >conftest.$ac_ext <<_ACEOF
7619 #line 7619 "configure"
7620 #include "confdefs.h"
7621 #include <stdio.h>
7622 int
7623 main ()
7624 {
7625 printf("Hello\n");
7626   ;
7627   return 0;
7628 }
7629 _ACEOF
7630 rm -f conftest.$ac_objext
7631 if { (eval echo "$as_me:7631: \"$ac_compile\"") >&5
7632   (eval $ac_compile) 2>&5
7633   ac_status=$?
7634   echo "$as_me:7634: \$? = $ac_status" >&5
7635   (exit $ac_status); } &&
7636          { ac_try='test -s conftest.$ac_objext'
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   break
7643 else
7644   echo "$as_me: failed program was:" >&5
7645 cat conftest.$ac_ext >&5
7646 fi
7647 rm -f conftest.$ac_objext conftest.$ac_ext
7648                         done
7649                         CFLAGS="$cf_save_CFLAGS"
7650                         CC_SHARED_OPTS=$cf_shared_opts
7651                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7652                 else
7653                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7654                 fi
7655                 ;;
7656         sysv5uw7*|unix_sv*) #(vi
7657                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7658                 if test "$GCC" != yes; then
7659                         CC_SHARED_OPTS='-KPIC'
7660                 fi
7661                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7662                 ;;
7663         *)
7664                 CC_SHARED_OPTS='unknown'
7665                 MK_SHARED_LIB='echo unknown'
7666                 ;;
7667         esac
7668
7669         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7670         case "$cf_cv_shlib_version" in #(vi
7671         rel|abi)
7672                 case "$MK_SHARED_LIB" in #(vi
7673                 *'-o $@') #(vi
7674                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7675                         ;;
7676                 *)
7677                         { echo "$as_me:7677: WARNING: ignored --with-shlib-version" >&5
7678 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7679                         ;;
7680                 esac
7681                 ;;
7682         esac
7683
7684         if test -n "$cf_try_cflags"
7685         then
7686 cat > conftest.$ac_ext <<EOF
7687 #line 7687 "${as_me:-configure}"
7688 #include <stdio.h>
7689 int main(int argc, char *argv[])
7690 {
7691         printf("hello\n");
7692         return (argv[argc-1] == 0) ;
7693 }
7694 EOF
7695                 cf_save_CFLAGS="$CFLAGS"
7696                 for cf_opt in $cf_try_cflags
7697                 do
7698                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
7699                         echo "$as_me:7699: checking if CFLAGS option -$cf_opt works" >&5
7700 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
7701                         if { (eval echo "$as_me:7701: \"$ac_compile\"") >&5
7702   (eval $ac_compile) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit $ac_status); }; then
7706                                 echo "$as_me:7706: result: yes" >&5
7707 echo "${ECHO_T}yes" >&6
7708                                 cf_save_CFLAGS="$CFLAGS"
7709                         else
7710                                 echo "$as_me:7710: result: no" >&5
7711 echo "${ECHO_T}no" >&6
7712                         fi
7713                 done
7714                 CFLAGS="$cf_save_CFLAGS"
7715         fi
7716
7717         # RPATH_LIST is a colon-separated list of directories
7718         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
7719         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
7720
7721         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
7722
7723         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
7724
7725 echo "${as_me:-configure}:7725: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
7726
7727         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
7728
7729 echo "${as_me:-configure}:7729: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
7730
7731 # The test/sample programs in the original tree link using rpath option.
7732 # Make it optional for packagers.
7733 if test -n "$LOCAL_LDFLAGS"
7734 then
7735         echo "$as_me:7735: checking if you want to link sample programs with rpath option" >&5
7736 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
7737
7738 # Check whether --enable-rpath-link or --disable-rpath-link was given.
7739 if test "${enable_rpath_link+set}" = set; then
7740   enableval="$enable_rpath_link"
7741   with_rpath_link=$enableval
7742 else
7743   with_rpath_link=yes
7744 fi;
7745         echo "$as_me:7745: result: $with_rpath_link" >&5
7746 echo "${ECHO_T}$with_rpath_link" >&6
7747         if test "$with_rpath_link" = no
7748         then
7749                 LOCAL_LDFLAGS=
7750                 LOCAL_LDFLAGS2=
7751         fi
7752 fi
7753
7754 ###############################################################################
7755
7756 ###   use option --enable-broken-linker to force on use of broken-linker support
7757 echo "$as_me:7757: checking if you want broken-linker support code" >&5
7758 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7759
7760 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7761 if test "${enable_broken_linker+set}" = set; then
7762   enableval="$enable_broken_linker"
7763   with_broken_linker=$enableval
7764 else
7765   with_broken_linker=${BROKEN_LINKER:-no}
7766 fi;
7767 echo "$as_me:7767: result: $with_broken_linker" >&5
7768 echo "${ECHO_T}$with_broken_linker" >&6
7769
7770 BROKEN_LINKER=0
7771 if test "$with_broken_linker" = yes ; then
7772         cat >>confdefs.h <<\EOF
7773 #define BROKEN_LINKER 1
7774 EOF
7775
7776         BROKEN_LINKER=1
7777 elif test "$DFT_LWR_MODEL" = shared ; then
7778         case $cf_cv_system_name in #(vi
7779         cygwin*)
7780                 cat >>confdefs.h <<\EOF
7781 #define BROKEN_LINKER 1
7782 EOF
7783
7784                 BROKEN_LINKER=1
7785                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7786
7787 echo "${as_me:-configure}:7787: testing cygwin linker is broken anyway ..." 1>&5
7788
7789                 ;;
7790         esac
7791 fi
7792
7793 # Check to define _XOPEN_SOURCE "automatically"
7794
7795 cf_XOPEN_SOURCE=500
7796 cf_POSIX_C_SOURCE=199506L
7797 cf_xopen_source=
7798
7799 case $host_os in #(vi
7800 aix[4-7]*) #(vi
7801         cf_xopen_source="-D_ALL_SOURCE"
7802         ;;
7803 cygwin|msys) #(vi
7804         cf_XOPEN_SOURCE=600
7805         ;;
7806 darwin[0-8].*) #(vi
7807         cf_xopen_source="-D_APPLE_C_SOURCE"
7808         ;;
7809 darwin*) #(vi
7810         cf_xopen_source="-D_DARWIN_C_SOURCE"
7811         cf_XOPEN_SOURCE=
7812         ;;
7813 freebsd*|dragonfly*) #(vi
7814         # 5.x headers associate
7815         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7816         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7817         cf_POSIX_C_SOURCE=200112L
7818         cf_XOPEN_SOURCE=600
7819         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7820         ;;
7821 hpux11*) #(vi
7822         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7823         ;;
7824 hpux*) #(vi
7825         cf_xopen_source="-D_HPUX_SOURCE"
7826         ;;
7827 irix[56].*) #(vi
7828         cf_xopen_source="-D_SGI_SOURCE"
7829         cf_XOPEN_SOURCE=
7830         ;;
7831 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
7832
7833 echo "$as_me:7833: checking if we must define _GNU_SOURCE" >&5
7834 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7835 if test "${cf_cv_gnu_source+set}" = set; then
7836   echo $ECHO_N "(cached) $ECHO_C" >&6
7837 else
7838
7839 cat >conftest.$ac_ext <<_ACEOF
7840 #line 7840 "configure"
7841 #include "confdefs.h"
7842 #include <sys/types.h>
7843 int
7844 main ()
7845 {
7846
7847 #ifndef _XOPEN_SOURCE
7848 make an error
7849 #endif
7850   ;
7851   return 0;
7852 }
7853 _ACEOF
7854 rm -f conftest.$ac_objext
7855 if { (eval echo "$as_me:7855: \"$ac_compile\"") >&5
7856   (eval $ac_compile) 2>&5
7857   ac_status=$?
7858   echo "$as_me:7858: \$? = $ac_status" >&5
7859   (exit $ac_status); } &&
7860          { ac_try='test -s conftest.$ac_objext'
7861   { (eval echo "$as_me:7861: \"$ac_try\"") >&5
7862   (eval $ac_try) 2>&5
7863   ac_status=$?
7864   echo "$as_me:7864: \$? = $ac_status" >&5
7865   (exit $ac_status); }; }; then
7866   cf_cv_gnu_source=no
7867 else
7868   echo "$as_me: failed program was:" >&5
7869 cat conftest.$ac_ext >&5
7870 cf_save="$CPPFLAGS"
7871          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7872          cat >conftest.$ac_ext <<_ACEOF
7873 #line 7873 "configure"
7874 #include "confdefs.h"
7875 #include <sys/types.h>
7876 int
7877 main ()
7878 {
7879
7880 #ifdef _XOPEN_SOURCE
7881 make an error
7882 #endif
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   cf_cv_gnu_source=no
7900 else
7901   echo "$as_me: failed program was:" >&5
7902 cat conftest.$ac_ext >&5
7903 cf_cv_gnu_source=yes
7904 fi
7905 rm -f conftest.$ac_objext conftest.$ac_ext
7906         CPPFLAGS="$cf_save"
7907
7908 fi
7909 rm -f conftest.$ac_objext conftest.$ac_ext
7910
7911 fi
7912 echo "$as_me:7912: result: $cf_cv_gnu_source" >&5
7913 echo "${ECHO_T}$cf_cv_gnu_source" >&6
7914 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7915
7916         ;;
7917 mirbsd*) #(vi
7918         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
7919         cf_XOPEN_SOURCE=
7920
7921 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
7922
7923 cf_save_CFLAGS="$CFLAGS"
7924 cf_save_CPPFLAGS="$CPPFLAGS"
7925
7926 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
7927         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7928                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7929
7930 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
7931         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7932                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7933
7934 echo "$as_me:7934: checking if we should define _POSIX_C_SOURCE" >&5
7935 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
7936 if test "${cf_cv_posix_c_source+set}" = set; then
7937   echo $ECHO_N "(cached) $ECHO_C" >&6
7938 else
7939
7940 echo "${as_me:-configure}:7940: testing if the symbol is already defined go no further ..." 1>&5
7941
7942         cat >conftest.$ac_ext <<_ACEOF
7943 #line 7943 "configure"
7944 #include "confdefs.h"
7945 #include <sys/types.h>
7946 int
7947 main ()
7948 {
7949
7950 #ifndef _POSIX_C_SOURCE
7951 make an error
7952 #endif
7953   ;
7954   return 0;
7955 }
7956 _ACEOF
7957 rm -f conftest.$ac_objext
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); } &&
7963          { ac_try='test -s conftest.$ac_objext'
7964   { (eval echo "$as_me:7964: \"$ac_try\"") >&5
7965   (eval $ac_try) 2>&5
7966   ac_status=$?
7967   echo "$as_me:7967: \$? = $ac_status" >&5
7968   (exit $ac_status); }; }; then
7969   cf_cv_posix_c_source=no
7970 else
7971   echo "$as_me: failed program was:" >&5
7972 cat conftest.$ac_ext >&5
7973 cf_want_posix_source=no
7974          case .$cf_POSIX_C_SOURCE in #(vi
7975          .[12]??*) #(vi
7976                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
7977                 ;;
7978          .2) #(vi
7979                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
7980                 cf_want_posix_source=yes
7981                 ;;
7982          .*)
7983                 cf_want_posix_source=yes
7984                 ;;
7985          esac
7986          if test "$cf_want_posix_source" = yes ; then
7987                 cat >conftest.$ac_ext <<_ACEOF
7988 #line 7988 "configure"
7989 #include "confdefs.h"
7990 #include <sys/types.h>
7991 int
7992 main ()
7993 {
7994
7995 #ifdef _POSIX_SOURCE
7996 make an error
7997 #endif
7998   ;
7999   return 0;
8000 }
8001 _ACEOF
8002 rm -f conftest.$ac_objext
8003 if { (eval echo "$as_me:8003: \"$ac_compile\"") >&5
8004   (eval $ac_compile) 2>&5
8005   ac_status=$?
8006   echo "$as_me:8006: \$? = $ac_status" >&5
8007   (exit $ac_status); } &&
8008          { ac_try='test -s conftest.$ac_objext'
8009   { (eval echo "$as_me:8009: \"$ac_try\"") >&5
8010   (eval $ac_try) 2>&5
8011   ac_status=$?
8012   echo "$as_me:8012: \$? = $ac_status" >&5
8013   (exit $ac_status); }; }; then
8014   :
8015 else
8016   echo "$as_me: failed program was:" >&5
8017 cat conftest.$ac_ext >&5
8018 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8019 fi
8020 rm -f conftest.$ac_objext conftest.$ac_ext
8021          fi
8022
8023 echo "${as_me:-configure}:8023: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8024
8025          CFLAGS="$cf_trim_CFLAGS"
8026          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8027
8028 echo "${as_me:-configure}:8028: testing if the second compile does not leave our definition intact error ..." 1>&5
8029
8030          cat >conftest.$ac_ext <<_ACEOF
8031 #line 8031 "configure"
8032 #include "confdefs.h"
8033 #include <sys/types.h>
8034 int
8035 main ()
8036 {
8037
8038 #ifndef _POSIX_C_SOURCE
8039 make an error
8040 #endif
8041   ;
8042   return 0;
8043 }
8044 _ACEOF
8045 rm -f conftest.$ac_objext
8046 if { (eval echo "$as_me:8046: \"$ac_compile\"") >&5
8047   (eval $ac_compile) 2>&5
8048   ac_status=$?
8049   echo "$as_me:8049: \$? = $ac_status" >&5
8050   (exit $ac_status); } &&
8051          { ac_try='test -s conftest.$ac_objext'
8052   { (eval echo "$as_me:8052: \"$ac_try\"") >&5
8053   (eval $ac_try) 2>&5
8054   ac_status=$?
8055   echo "$as_me:8055: \$? = $ac_status" >&5
8056   (exit $ac_status); }; }; then
8057   :
8058 else
8059   echo "$as_me: failed program was:" >&5
8060 cat conftest.$ac_ext >&5
8061 cf_cv_posix_c_source=no
8062 fi
8063 rm -f conftest.$ac_objext conftest.$ac_ext
8064          CFLAGS="$cf_save_CFLAGS"
8065          CPPFLAGS="$cf_save_CPPFLAGS"
8066
8067 fi
8068 rm -f conftest.$ac_objext conftest.$ac_ext
8069
8070 fi
8071 echo "$as_me:8071: result: $cf_cv_posix_c_source" >&5
8072 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8073
8074 if test "$cf_cv_posix_c_source" != no ; then
8075         CFLAGS="$cf_trim_CFLAGS"
8076         CPPFLAGS="$cf_trim_CPPFLAGS"
8077
8078 cf_fix_cppflags=no
8079 cf_new_cflags=
8080 cf_new_cppflags=
8081 cf_new_extra_cppflags=
8082
8083 for cf_add_cflags in $cf_cv_posix_c_source
8084 do
8085 case $cf_fix_cppflags in
8086 no)
8087         case $cf_add_cflags in #(vi
8088         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8089                 case $cf_add_cflags in
8090                 -D*)
8091                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8092
8093                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8094                                 && test -z "${cf_tst_cflags}" \
8095                                 && cf_fix_cppflags=yes
8096
8097                         if test $cf_fix_cppflags = yes ; then
8098                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8099                                 continue
8100                         elif test "${cf_tst_cflags}" = "\"'" ; then
8101                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8102                                 continue
8103                         fi
8104                         ;;
8105                 esac
8106                 case "$CPPFLAGS" in
8107                 *$cf_add_cflags) #(vi
8108                         ;;
8109                 *) #(vi
8110                         case $cf_add_cflags in #(vi
8111                         -D*)
8112                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8113
8114 CPPFLAGS=`echo "$CPPFLAGS" | \
8115         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8116                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8117
8118                                 ;;
8119                         esac
8120                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8121                         ;;
8122                 esac
8123                 ;;
8124         *)
8125                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8126                 ;;
8127         esac
8128         ;;
8129 yes)
8130         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8131
8132         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8133
8134         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8135                 && test -z "${cf_tst_cflags}" \
8136                 && cf_fix_cppflags=no
8137         ;;
8138 esac
8139 done
8140
8141 if test -n "$cf_new_cflags" ; then
8142
8143         CFLAGS="$CFLAGS $cf_new_cflags"
8144 fi
8145
8146 if test -n "$cf_new_cppflags" ; then
8147
8148         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8149 fi
8150
8151 if test -n "$cf_new_extra_cppflags" ; then
8152
8153         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8154 fi
8155
8156 fi
8157
8158         ;;
8159 netbsd*) #(vi
8160         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
8161         ;;
8162 openbsd[4-9]*) #(vi
8163         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
8164         cf_xopen_source="-D_BSD_SOURCE"
8165         cf_XOPEN_SOURCE=600
8166         ;;
8167 openbsd*) #(vi
8168         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
8169         ;;
8170 osf[45]*) #(vi
8171         cf_xopen_source="-D_OSF_SOURCE"
8172         ;;
8173 nto-qnx*) #(vi
8174         cf_xopen_source="-D_QNX_SOURCE"
8175         ;;
8176 sco*) #(vi
8177         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
8178         ;;
8179 solaris2.*) #(vi
8180         cf_xopen_source="-D__EXTENSIONS__"
8181         cf_cv_xopen_source=broken
8182         ;;
8183 *)
8184
8185 echo "$as_me:8185: checking if we should define _XOPEN_SOURCE" >&5
8186 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8187 if test "${cf_cv_xopen_source+set}" = set; then
8188   echo $ECHO_N "(cached) $ECHO_C" >&6
8189 else
8190
8191         cat >conftest.$ac_ext <<_ACEOF
8192 #line 8192 "configure"
8193 #include "confdefs.h"
8194
8195 #include <stdlib.h>
8196 #include <string.h>
8197 #include <sys/types.h>
8198
8199 int
8200 main ()
8201 {
8202
8203 #ifndef _XOPEN_SOURCE
8204 make an error
8205 #endif
8206   ;
8207   return 0;
8208 }
8209 _ACEOF
8210 rm -f conftest.$ac_objext
8211 if { (eval echo "$as_me:8211: \"$ac_compile\"") >&5
8212   (eval $ac_compile) 2>&5
8213   ac_status=$?
8214   echo "$as_me:8214: \$? = $ac_status" >&5
8215   (exit $ac_status); } &&
8216          { ac_try='test -s conftest.$ac_objext'
8217   { (eval echo "$as_me:8217: \"$ac_try\"") >&5
8218   (eval $ac_try) 2>&5
8219   ac_status=$?
8220   echo "$as_me:8220: \$? = $ac_status" >&5
8221   (exit $ac_status); }; }; then
8222   cf_cv_xopen_source=no
8223 else
8224   echo "$as_me: failed program was:" >&5
8225 cat conftest.$ac_ext >&5
8226 cf_save="$CPPFLAGS"
8227          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8228          cat >conftest.$ac_ext <<_ACEOF
8229 #line 8229 "configure"
8230 #include "confdefs.h"
8231
8232 #include <stdlib.h>
8233 #include <string.h>
8234 #include <sys/types.h>
8235
8236 int
8237 main ()
8238 {
8239
8240 #ifdef _XOPEN_SOURCE
8241 make an error
8242 #endif
8243   ;
8244   return 0;
8245 }
8246 _ACEOF
8247 rm -f conftest.$ac_objext
8248 if { (eval echo "$as_me:8248: \"$ac_compile\"") >&5
8249   (eval $ac_compile) 2>&5
8250   ac_status=$?
8251   echo "$as_me:8251: \$? = $ac_status" >&5
8252   (exit $ac_status); } &&
8253          { ac_try='test -s conftest.$ac_objext'
8254   { (eval echo "$as_me:8254: \"$ac_try\"") >&5
8255   (eval $ac_try) 2>&5
8256   ac_status=$?
8257   echo "$as_me:8257: \$? = $ac_status" >&5
8258   (exit $ac_status); }; }; then
8259   cf_cv_xopen_source=no
8260 else
8261   echo "$as_me: failed program was:" >&5
8262 cat conftest.$ac_ext >&5
8263 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8264 fi
8265 rm -f conftest.$ac_objext conftest.$ac_ext
8266         CPPFLAGS="$cf_save"
8267
8268 fi
8269 rm -f conftest.$ac_objext conftest.$ac_ext
8270
8271 fi
8272 echo "$as_me:8272: result: $cf_cv_xopen_source" >&5
8273 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8274
8275 if test "$cf_cv_xopen_source" != no ; then
8276
8277 CFLAGS=`echo "$CFLAGS" | \
8278         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8279                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8280
8281 CPPFLAGS=`echo "$CPPFLAGS" | \
8282         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8283                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8284
8285         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8286
8287 cf_fix_cppflags=no
8288 cf_new_cflags=
8289 cf_new_cppflags=
8290 cf_new_extra_cppflags=
8291
8292 for cf_add_cflags in $cf_temp_xopen_source
8293 do
8294 case $cf_fix_cppflags in
8295 no)
8296         case $cf_add_cflags in #(vi
8297         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8298                 case $cf_add_cflags in
8299                 -D*)
8300                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8301
8302                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8303                                 && test -z "${cf_tst_cflags}" \
8304                                 && cf_fix_cppflags=yes
8305
8306                         if test $cf_fix_cppflags = yes ; then
8307                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8308                                 continue
8309                         elif test "${cf_tst_cflags}" = "\"'" ; then
8310                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8311                                 continue
8312                         fi
8313                         ;;
8314                 esac
8315                 case "$CPPFLAGS" in
8316                 *$cf_add_cflags) #(vi
8317                         ;;
8318                 *) #(vi
8319                         case $cf_add_cflags in #(vi
8320                         -D*)
8321                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8322
8323 CPPFLAGS=`echo "$CPPFLAGS" | \
8324         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8325                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8326
8327                                 ;;
8328                         esac
8329                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8330                         ;;
8331                 esac
8332                 ;;
8333         *)
8334                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8335                 ;;
8336         esac
8337         ;;
8338 yes)
8339         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8340
8341         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8342
8343         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8344                 && test -z "${cf_tst_cflags}" \
8345                 && cf_fix_cppflags=no
8346         ;;
8347 esac
8348 done
8349
8350 if test -n "$cf_new_cflags" ; then
8351
8352         CFLAGS="$CFLAGS $cf_new_cflags"
8353 fi
8354
8355 if test -n "$cf_new_cppflags" ; then
8356
8357         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8358 fi
8359
8360 if test -n "$cf_new_extra_cppflags" ; then
8361
8362         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8363 fi
8364
8365 fi
8366
8367 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8368
8369 cf_save_CFLAGS="$CFLAGS"
8370 cf_save_CPPFLAGS="$CPPFLAGS"
8371
8372 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8373         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8374                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8375
8376 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8377         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8378                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8379
8380 echo "$as_me:8380: checking if we should define _POSIX_C_SOURCE" >&5
8381 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8382 if test "${cf_cv_posix_c_source+set}" = set; then
8383   echo $ECHO_N "(cached) $ECHO_C" >&6
8384 else
8385
8386 echo "${as_me:-configure}:8386: testing if the symbol is already defined go no further ..." 1>&5
8387
8388         cat >conftest.$ac_ext <<_ACEOF
8389 #line 8389 "configure"
8390 #include "confdefs.h"
8391 #include <sys/types.h>
8392 int
8393 main ()
8394 {
8395
8396 #ifndef _POSIX_C_SOURCE
8397 make an error
8398 #endif
8399   ;
8400   return 0;
8401 }
8402 _ACEOF
8403 rm -f conftest.$ac_objext
8404 if { (eval echo "$as_me:8404: \"$ac_compile\"") >&5
8405   (eval $ac_compile) 2>&5
8406   ac_status=$?
8407   echo "$as_me:8407: \$? = $ac_status" >&5
8408   (exit $ac_status); } &&
8409          { ac_try='test -s conftest.$ac_objext'
8410   { (eval echo "$as_me:8410: \"$ac_try\"") >&5
8411   (eval $ac_try) 2>&5
8412   ac_status=$?
8413   echo "$as_me:8413: \$? = $ac_status" >&5
8414   (exit $ac_status); }; }; then
8415   cf_cv_posix_c_source=no
8416 else
8417   echo "$as_me: failed program was:" >&5
8418 cat conftest.$ac_ext >&5
8419 cf_want_posix_source=no
8420          case .$cf_POSIX_C_SOURCE in #(vi
8421          .[12]??*) #(vi
8422                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8423                 ;;
8424          .2) #(vi
8425                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8426                 cf_want_posix_source=yes
8427                 ;;
8428          .*)
8429                 cf_want_posix_source=yes
8430                 ;;
8431          esac
8432          if test "$cf_want_posix_source" = yes ; then
8433                 cat >conftest.$ac_ext <<_ACEOF
8434 #line 8434 "configure"
8435 #include "confdefs.h"
8436 #include <sys/types.h>
8437 int
8438 main ()
8439 {
8440
8441 #ifdef _POSIX_SOURCE
8442 make an error
8443 #endif
8444   ;
8445   return 0;
8446 }
8447 _ACEOF
8448 rm -f conftest.$ac_objext
8449 if { (eval echo "$as_me:8449: \"$ac_compile\"") >&5
8450   (eval $ac_compile) 2>&5
8451   ac_status=$?
8452   echo "$as_me:8452: \$? = $ac_status" >&5
8453   (exit $ac_status); } &&
8454          { ac_try='test -s conftest.$ac_objext'
8455   { (eval echo "$as_me:8455: \"$ac_try\"") >&5
8456   (eval $ac_try) 2>&5
8457   ac_status=$?
8458   echo "$as_me:8458: \$? = $ac_status" >&5
8459   (exit $ac_status); }; }; then
8460   :
8461 else
8462   echo "$as_me: failed program was:" >&5
8463 cat conftest.$ac_ext >&5
8464 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8465 fi
8466 rm -f conftest.$ac_objext conftest.$ac_ext
8467          fi
8468
8469 echo "${as_me:-configure}:8469: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8470
8471          CFLAGS="$cf_trim_CFLAGS"
8472          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8473
8474 echo "${as_me:-configure}:8474: testing if the second compile does not leave our definition intact error ..." 1>&5
8475
8476          cat >conftest.$ac_ext <<_ACEOF
8477 #line 8477 "configure"
8478 #include "confdefs.h"
8479 #include <sys/types.h>
8480 int
8481 main ()
8482 {
8483
8484 #ifndef _POSIX_C_SOURCE
8485 make an error
8486 #endif
8487   ;
8488   return 0;
8489 }
8490 _ACEOF
8491 rm -f conftest.$ac_objext
8492 if { (eval echo "$as_me:8492: \"$ac_compile\"") >&5
8493   (eval $ac_compile) 2>&5
8494   ac_status=$?
8495   echo "$as_me:8495: \$? = $ac_status" >&5
8496   (exit $ac_status); } &&
8497          { ac_try='test -s conftest.$ac_objext'
8498   { (eval echo "$as_me:8498: \"$ac_try\"") >&5
8499   (eval $ac_try) 2>&5
8500   ac_status=$?
8501   echo "$as_me:8501: \$? = $ac_status" >&5
8502   (exit $ac_status); }; }; then
8503   :
8504 else
8505   echo "$as_me: failed program was:" >&5
8506 cat conftest.$ac_ext >&5
8507 cf_cv_posix_c_source=no
8508 fi
8509 rm -f conftest.$ac_objext conftest.$ac_ext
8510          CFLAGS="$cf_save_CFLAGS"
8511          CPPFLAGS="$cf_save_CPPFLAGS"
8512
8513 fi
8514 rm -f conftest.$ac_objext conftest.$ac_ext
8515
8516 fi
8517 echo "$as_me:8517: result: $cf_cv_posix_c_source" >&5
8518 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8519
8520 if test "$cf_cv_posix_c_source" != no ; then
8521         CFLAGS="$cf_trim_CFLAGS"
8522         CPPFLAGS="$cf_trim_CPPFLAGS"
8523
8524 cf_fix_cppflags=no
8525 cf_new_cflags=
8526 cf_new_cppflags=
8527 cf_new_extra_cppflags=
8528
8529 for cf_add_cflags in $cf_cv_posix_c_source
8530 do
8531 case $cf_fix_cppflags in
8532 no)
8533         case $cf_add_cflags in #(vi
8534         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8535                 case $cf_add_cflags in
8536                 -D*)
8537                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8538
8539                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8540                                 && test -z "${cf_tst_cflags}" \
8541                                 && cf_fix_cppflags=yes
8542
8543                         if test $cf_fix_cppflags = yes ; then
8544                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8545                                 continue
8546                         elif test "${cf_tst_cflags}" = "\"'" ; then
8547                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8548                                 continue
8549                         fi
8550                         ;;
8551                 esac
8552                 case "$CPPFLAGS" in
8553                 *$cf_add_cflags) #(vi
8554                         ;;
8555                 *) #(vi
8556                         case $cf_add_cflags in #(vi
8557                         -D*)
8558                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8559
8560 CPPFLAGS=`echo "$CPPFLAGS" | \
8561         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8562                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8563
8564                                 ;;
8565                         esac
8566                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8567                         ;;
8568                 esac
8569                 ;;
8570         *)
8571                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8572                 ;;
8573         esac
8574         ;;
8575 yes)
8576         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8577
8578         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8579
8580         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8581                 && test -z "${cf_tst_cflags}" \
8582                 && cf_fix_cppflags=no
8583         ;;
8584 esac
8585 done
8586
8587 if test -n "$cf_new_cflags" ; then
8588
8589         CFLAGS="$CFLAGS $cf_new_cflags"
8590 fi
8591
8592 if test -n "$cf_new_cppflags" ; then
8593
8594         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8595 fi
8596
8597 if test -n "$cf_new_extra_cppflags" ; then
8598
8599         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8600 fi
8601
8602 fi
8603
8604         ;;
8605 esac
8606
8607 if test -n "$cf_xopen_source" ; then
8608
8609 cf_fix_cppflags=no
8610 cf_new_cflags=
8611 cf_new_cppflags=
8612 cf_new_extra_cppflags=
8613
8614 for cf_add_cflags in $cf_xopen_source
8615 do
8616 case $cf_fix_cppflags in
8617 no)
8618         case $cf_add_cflags in #(vi
8619         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8620                 case $cf_add_cflags in
8621                 -D*)
8622                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8623
8624                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8625                                 && test -z "${cf_tst_cflags}" \
8626                                 && cf_fix_cppflags=yes
8627
8628                         if test $cf_fix_cppflags = yes ; then
8629                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8630                                 continue
8631                         elif test "${cf_tst_cflags}" = "\"'" ; then
8632                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8633                                 continue
8634                         fi
8635                         ;;
8636                 esac
8637                 case "$CPPFLAGS" in
8638                 *$cf_add_cflags) #(vi
8639                         ;;
8640                 *) #(vi
8641                         case $cf_add_cflags in #(vi
8642                         -D*)
8643                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8644
8645 CPPFLAGS=`echo "$CPPFLAGS" | \
8646         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8647                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8648
8649                                 ;;
8650                         esac
8651                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8652                         ;;
8653                 esac
8654                 ;;
8655         *)
8656                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8657                 ;;
8658         esac
8659         ;;
8660 yes)
8661         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8662
8663         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8664
8665         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8666                 && test -z "${cf_tst_cflags}" \
8667                 && cf_fix_cppflags=no
8668         ;;
8669 esac
8670 done
8671
8672 if test -n "$cf_new_cflags" ; then
8673
8674         CFLAGS="$CFLAGS $cf_new_cflags"
8675 fi
8676
8677 if test -n "$cf_new_cppflags" ; then
8678
8679         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8680 fi
8681
8682 if test -n "$cf_new_extra_cppflags" ; then
8683
8684         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8685 fi
8686
8687 fi
8688
8689 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
8690         echo "$as_me:8690: checking if _XOPEN_SOURCE really is set" >&5
8691 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
8692         cat >conftest.$ac_ext <<_ACEOF
8693 #line 8693 "configure"
8694 #include "confdefs.h"
8695 #include <stdlib.h>
8696 int
8697 main ()
8698 {
8699
8700 #ifndef _XOPEN_SOURCE
8701 make an error
8702 #endif
8703   ;
8704   return 0;
8705 }
8706 _ACEOF
8707 rm -f conftest.$ac_objext
8708 if { (eval echo "$as_me:8708: \"$ac_compile\"") >&5
8709   (eval $ac_compile) 2>&5
8710   ac_status=$?
8711   echo "$as_me:8711: \$? = $ac_status" >&5
8712   (exit $ac_status); } &&
8713          { ac_try='test -s conftest.$ac_objext'
8714   { (eval echo "$as_me:8714: \"$ac_try\"") >&5
8715   (eval $ac_try) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); }; }; then
8719   cf_XOPEN_SOURCE_set=yes
8720 else
8721   echo "$as_me: failed program was:" >&5
8722 cat conftest.$ac_ext >&5
8723 cf_XOPEN_SOURCE_set=no
8724 fi
8725 rm -f conftest.$ac_objext conftest.$ac_ext
8726         echo "$as_me:8726: result: $cf_XOPEN_SOURCE_set" >&5
8727 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
8728         if test $cf_XOPEN_SOURCE_set = yes
8729         then
8730                 cat >conftest.$ac_ext <<_ACEOF
8731 #line 8731 "configure"
8732 #include "confdefs.h"
8733 #include <stdlib.h>
8734 int
8735 main ()
8736 {
8737
8738 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
8739 make an error
8740 #endif
8741   ;
8742   return 0;
8743 }
8744 _ACEOF
8745 rm -f conftest.$ac_objext
8746 if { (eval echo "$as_me:8746: \"$ac_compile\"") >&5
8747   (eval $ac_compile) 2>&5
8748   ac_status=$?
8749   echo "$as_me:8749: \$? = $ac_status" >&5
8750   (exit $ac_status); } &&
8751          { ac_try='test -s conftest.$ac_objext'
8752   { (eval echo "$as_me:8752: \"$ac_try\"") >&5
8753   (eval $ac_try) 2>&5
8754   ac_status=$?
8755   echo "$as_me:8755: \$? = $ac_status" >&5
8756   (exit $ac_status); }; }; then
8757   cf_XOPEN_SOURCE_set_ok=yes
8758 else
8759   echo "$as_me: failed program was:" >&5
8760 cat conftest.$ac_ext >&5
8761 cf_XOPEN_SOURCE_set_ok=no
8762 fi
8763 rm -f conftest.$ac_objext conftest.$ac_ext
8764                 if test $cf_XOPEN_SOURCE_set_ok = no
8765                 then
8766                         { echo "$as_me:8766: WARNING: _XOPEN_SOURCE is lower than requested" >&5
8767 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
8768                 fi
8769         else
8770
8771 echo "$as_me:8771: checking if we should define _XOPEN_SOURCE" >&5
8772 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8773 if test "${cf_cv_xopen_source+set}" = set; then
8774   echo $ECHO_N "(cached) $ECHO_C" >&6
8775 else
8776
8777         cat >conftest.$ac_ext <<_ACEOF
8778 #line 8778 "configure"
8779 #include "confdefs.h"
8780
8781 #include <stdlib.h>
8782 #include <string.h>
8783 #include <sys/types.h>
8784
8785 int
8786 main ()
8787 {
8788
8789 #ifndef _XOPEN_SOURCE
8790 make an error
8791 #endif
8792   ;
8793   return 0;
8794 }
8795 _ACEOF
8796 rm -f conftest.$ac_objext
8797 if { (eval echo "$as_me:8797: \"$ac_compile\"") >&5
8798   (eval $ac_compile) 2>&5
8799   ac_status=$?
8800   echo "$as_me:8800: \$? = $ac_status" >&5
8801   (exit $ac_status); } &&
8802          { ac_try='test -s conftest.$ac_objext'
8803   { (eval echo "$as_me:8803: \"$ac_try\"") >&5
8804   (eval $ac_try) 2>&5
8805   ac_status=$?
8806   echo "$as_me:8806: \$? = $ac_status" >&5
8807   (exit $ac_status); }; }; then
8808   cf_cv_xopen_source=no
8809 else
8810   echo "$as_me: failed program was:" >&5
8811 cat conftest.$ac_ext >&5
8812 cf_save="$CPPFLAGS"
8813          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8814          cat >conftest.$ac_ext <<_ACEOF
8815 #line 8815 "configure"
8816 #include "confdefs.h"
8817
8818 #include <stdlib.h>
8819 #include <string.h>
8820 #include <sys/types.h>
8821
8822 int
8823 main ()
8824 {
8825
8826 #ifdef _XOPEN_SOURCE
8827 make an error
8828 #endif
8829   ;
8830   return 0;
8831 }
8832 _ACEOF
8833 rm -f conftest.$ac_objext
8834 if { (eval echo "$as_me:8834: \"$ac_compile\"") >&5
8835   (eval $ac_compile) 2>&5
8836   ac_status=$?
8837   echo "$as_me:8837: \$? = $ac_status" >&5
8838   (exit $ac_status); } &&
8839          { ac_try='test -s conftest.$ac_objext'
8840   { (eval echo "$as_me:8840: \"$ac_try\"") >&5
8841   (eval $ac_try) 2>&5
8842   ac_status=$?
8843   echo "$as_me:8843: \$? = $ac_status" >&5
8844   (exit $ac_status); }; }; then
8845   cf_cv_xopen_source=no
8846 else
8847   echo "$as_me: failed program was:" >&5
8848 cat conftest.$ac_ext >&5
8849 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8850 fi
8851 rm -f conftest.$ac_objext conftest.$ac_ext
8852         CPPFLAGS="$cf_save"
8853
8854 fi
8855 rm -f conftest.$ac_objext conftest.$ac_ext
8856
8857 fi
8858 echo "$as_me:8858: result: $cf_cv_xopen_source" >&5
8859 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8860
8861 if test "$cf_cv_xopen_source" != no ; then
8862
8863 CFLAGS=`echo "$CFLAGS" | \
8864         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8865                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8866
8867 CPPFLAGS=`echo "$CPPFLAGS" | \
8868         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8869                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8870
8871         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
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_temp_xopen_source
8879 do
8880 case $cf_fix_cppflags in
8881 no)
8882         case $cf_add_cflags in #(vi
8883         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8884                 case $cf_add_cflags in
8885                 -D*)
8886                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8887
8888                         test "${cf_add_cflags}" != "${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) #(vi
8903                         ;;
8904                 *) #(vi
8905                         case $cf_add_cflags in #(vi
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 "${cf_add_cflags}" != "${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
8938         CFLAGS="$CFLAGS $cf_new_cflags"
8939 fi
8940
8941 if test -n "$cf_new_cppflags" ; then
8942
8943         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8944 fi
8945
8946 if test -n "$cf_new_extra_cppflags" ; then
8947
8948         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8949 fi
8950
8951 fi
8952
8953         fi
8954 fi
8955
8956 # Check whether --enable-largefile or --disable-largefile was given.
8957 if test "${enable_largefile+set}" = set; then
8958   enableval="$enable_largefile"
8959
8960 fi;
8961 if test "$enable_largefile" != no; then
8962
8963   echo "$as_me:8963: checking for special C compiler options needed for large files" >&5
8964 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
8965 if test "${ac_cv_sys_largefile_CC+set}" = set; then
8966   echo $ECHO_N "(cached) $ECHO_C" >&6
8967 else
8968   ac_cv_sys_largefile_CC=no
8969      if test "$GCC" != yes; then
8970        ac_save_CC=$CC
8971        while :; do
8972          # IRIX 6.2 and later do not support large files by default,
8973          # so use the C compiler's -n32 option if that helps.
8974          cat >conftest.$ac_ext <<_ACEOF
8975 #line 8975 "configure"
8976 #include "confdefs.h"
8977 #include <sys/types.h>
8978  /* Check that off_t can represent 2**63 - 1 correctly.
8979     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8980     since some C++ compilers masquerading as C compilers
8981     incorrectly reject 9223372036854775807.  */
8982 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8983   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8984                        && LARGE_OFF_T % 2147483647 == 1)
8985                       ? 1 : -1];
8986 int
8987 main ()
8988 {
8989
8990   ;
8991   return 0;
8992 }
8993 _ACEOF
8994          rm -f conftest.$ac_objext
8995 if { (eval echo "$as_me:8995: \"$ac_compile\"") >&5
8996   (eval $ac_compile) 2>&5
8997   ac_status=$?
8998   echo "$as_me:8998: \$? = $ac_status" >&5
8999   (exit $ac_status); } &&
9000          { ac_try='test -s conftest.$ac_objext'
9001   { (eval echo "$as_me:9001: \"$ac_try\"") >&5
9002   (eval $ac_try) 2>&5
9003   ac_status=$?
9004   echo "$as_me:9004: \$? = $ac_status" >&5
9005   (exit $ac_status); }; }; then
9006   break
9007 else
9008   echo "$as_me: failed program was:" >&5
9009 cat conftest.$ac_ext >&5
9010 fi
9011 rm -f conftest.$ac_objext
9012          CC="$CC -n32"
9013          rm -f conftest.$ac_objext
9014 if { (eval echo "$as_me:9014: \"$ac_compile\"") >&5
9015   (eval $ac_compile) 2>&5
9016   ac_status=$?
9017   echo "$as_me:9017: \$? = $ac_status" >&5
9018   (exit $ac_status); } &&
9019          { ac_try='test -s conftest.$ac_objext'
9020   { (eval echo "$as_me:9020: \"$ac_try\"") >&5
9021   (eval $ac_try) 2>&5
9022   ac_status=$?
9023   echo "$as_me:9023: \$? = $ac_status" >&5
9024   (exit $ac_status); }; }; then
9025   ac_cv_sys_largefile_CC=' -n32'; break
9026 else
9027   echo "$as_me: failed program was:" >&5
9028 cat conftest.$ac_ext >&5
9029 fi
9030 rm -f conftest.$ac_objext
9031          break
9032        done
9033        CC=$ac_save_CC
9034        rm -f conftest.$ac_ext
9035     fi
9036 fi
9037 echo "$as_me:9037: result: $ac_cv_sys_largefile_CC" >&5
9038 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
9039   if test "$ac_cv_sys_largefile_CC" != no; then
9040     CC=$CC$ac_cv_sys_largefile_CC
9041   fi
9042
9043   echo "$as_me:9043: checking for _FILE_OFFSET_BITS value needed for large files" >&5
9044 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
9045 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
9046   echo $ECHO_N "(cached) $ECHO_C" >&6
9047 else
9048   while :; do
9049   ac_cv_sys_file_offset_bits=no
9050   cat >conftest.$ac_ext <<_ACEOF
9051 #line 9051 "configure"
9052 #include "confdefs.h"
9053 #include <sys/types.h>
9054  /* Check that off_t can represent 2**63 - 1 correctly.
9055     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9056     since some C++ compilers masquerading as C compilers
9057     incorrectly reject 9223372036854775807.  */
9058 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9059   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9060                        && LARGE_OFF_T % 2147483647 == 1)
9061                       ? 1 : -1];
9062 int
9063 main ()
9064 {
9065
9066   ;
9067   return 0;
9068 }
9069 _ACEOF
9070 rm -f conftest.$ac_objext
9071 if { (eval echo "$as_me:9071: \"$ac_compile\"") >&5
9072   (eval $ac_compile) 2>&5
9073   ac_status=$?
9074   echo "$as_me:9074: \$? = $ac_status" >&5
9075   (exit $ac_status); } &&
9076          { ac_try='test -s conftest.$ac_objext'
9077   { (eval echo "$as_me:9077: \"$ac_try\"") >&5
9078   (eval $ac_try) 2>&5
9079   ac_status=$?
9080   echo "$as_me:9080: \$? = $ac_status" >&5
9081   (exit $ac_status); }; }; then
9082   break
9083 else
9084   echo "$as_me: failed program was:" >&5
9085 cat conftest.$ac_ext >&5
9086 fi
9087 rm -f conftest.$ac_objext conftest.$ac_ext
9088   cat >conftest.$ac_ext <<_ACEOF
9089 #line 9089 "configure"
9090 #include "confdefs.h"
9091 #define _FILE_OFFSET_BITS 64
9092 #include <sys/types.h>
9093  /* Check that off_t can represent 2**63 - 1 correctly.
9094     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9095     since some C++ compilers masquerading as C compilers
9096     incorrectly reject 9223372036854775807.  */
9097 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9098   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9099                        && LARGE_OFF_T % 2147483647 == 1)
9100                       ? 1 : -1];
9101 int
9102 main ()
9103 {
9104
9105   ;
9106   return 0;
9107 }
9108 _ACEOF
9109 rm -f conftest.$ac_objext
9110 if { (eval echo "$as_me:9110: \"$ac_compile\"") >&5
9111   (eval $ac_compile) 2>&5
9112   ac_status=$?
9113   echo "$as_me:9113: \$? = $ac_status" >&5
9114   (exit $ac_status); } &&
9115          { ac_try='test -s conftest.$ac_objext'
9116   { (eval echo "$as_me:9116: \"$ac_try\"") >&5
9117   (eval $ac_try) 2>&5
9118   ac_status=$?
9119   echo "$as_me:9119: \$? = $ac_status" >&5
9120   (exit $ac_status); }; }; then
9121   ac_cv_sys_file_offset_bits=64; break
9122 else
9123   echo "$as_me: failed program was:" >&5
9124 cat conftest.$ac_ext >&5
9125 fi
9126 rm -f conftest.$ac_objext conftest.$ac_ext
9127   break
9128 done
9129 fi
9130 echo "$as_me:9130: result: $ac_cv_sys_file_offset_bits" >&5
9131 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
9132 if test "$ac_cv_sys_file_offset_bits" != no; then
9133
9134 cat >>confdefs.h <<EOF
9135 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
9136 EOF
9137
9138 fi
9139 rm -rf conftest*
9140   echo "$as_me:9140: checking for _LARGE_FILES value needed for large files" >&5
9141 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
9142 if test "${ac_cv_sys_large_files+set}" = set; then
9143   echo $ECHO_N "(cached) $ECHO_C" >&6
9144 else
9145   while :; do
9146   ac_cv_sys_large_files=no
9147   cat >conftest.$ac_ext <<_ACEOF
9148 #line 9148 "configure"
9149 #include "confdefs.h"
9150 #include <sys/types.h>
9151  /* Check that off_t can represent 2**63 - 1 correctly.
9152     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9153     since some C++ compilers masquerading as C compilers
9154     incorrectly reject 9223372036854775807.  */
9155 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9156   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9157                        && LARGE_OFF_T % 2147483647 == 1)
9158                       ? 1 : -1];
9159 int
9160 main ()
9161 {
9162
9163   ;
9164   return 0;
9165 }
9166 _ACEOF
9167 rm -f conftest.$ac_objext
9168 if { (eval echo "$as_me:9168: \"$ac_compile\"") >&5
9169   (eval $ac_compile) 2>&5
9170   ac_status=$?
9171   echo "$as_me:9171: \$? = $ac_status" >&5
9172   (exit $ac_status); } &&
9173          { ac_try='test -s conftest.$ac_objext'
9174   { (eval echo "$as_me:9174: \"$ac_try\"") >&5
9175   (eval $ac_try) 2>&5
9176   ac_status=$?
9177   echo "$as_me:9177: \$? = $ac_status" >&5
9178   (exit $ac_status); }; }; then
9179   break
9180 else
9181   echo "$as_me: failed program was:" >&5
9182 cat conftest.$ac_ext >&5
9183 fi
9184 rm -f conftest.$ac_objext conftest.$ac_ext
9185   cat >conftest.$ac_ext <<_ACEOF
9186 #line 9186 "configure"
9187 #include "confdefs.h"
9188 #define _LARGE_FILES 1
9189 #include <sys/types.h>
9190  /* Check that off_t can represent 2**63 - 1 correctly.
9191     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9192     since some C++ compilers masquerading as C compilers
9193     incorrectly reject 9223372036854775807.  */
9194 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9195   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9196                        && LARGE_OFF_T % 2147483647 == 1)
9197                       ? 1 : -1];
9198 int
9199 main ()
9200 {
9201
9202   ;
9203   return 0;
9204 }
9205 _ACEOF
9206 rm -f conftest.$ac_objext
9207 if { (eval echo "$as_me:9207: \"$ac_compile\"") >&5
9208   (eval $ac_compile) 2>&5
9209   ac_status=$?
9210   echo "$as_me:9210: \$? = $ac_status" >&5
9211   (exit $ac_status); } &&
9212          { ac_try='test -s conftest.$ac_objext'
9213   { (eval echo "$as_me:9213: \"$ac_try\"") >&5
9214   (eval $ac_try) 2>&5
9215   ac_status=$?
9216   echo "$as_me:9216: \$? = $ac_status" >&5
9217   (exit $ac_status); }; }; then
9218   ac_cv_sys_large_files=1; break
9219 else
9220   echo "$as_me: failed program was:" >&5
9221 cat conftest.$ac_ext >&5
9222 fi
9223 rm -f conftest.$ac_objext conftest.$ac_ext
9224   break
9225 done
9226 fi
9227 echo "$as_me:9227: result: $ac_cv_sys_large_files" >&5
9228 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
9229 if test "$ac_cv_sys_large_files" != no; then
9230
9231 cat >>confdefs.h <<EOF
9232 #define _LARGE_FILES $ac_cv_sys_large_files
9233 EOF
9234
9235 fi
9236 rm -rf conftest*
9237 fi
9238
9239     if test "$enable_largefile" != no ; then
9240         echo "$as_me:9240: checking for _LARGEFILE_SOURCE value needed for large files" >&5
9241 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
9242 if test "${ac_cv_sys_largefile_source+set}" = set; then
9243   echo $ECHO_N "(cached) $ECHO_C" >&6
9244 else
9245   while :; do
9246   ac_cv_sys_largefile_source=no
9247   cat >conftest.$ac_ext <<_ACEOF
9248 #line 9248 "configure"
9249 #include "confdefs.h"
9250 #include <stdio.h>
9251 int
9252 main ()
9253 {
9254 return !fseeko;
9255   ;
9256   return 0;
9257 }
9258 _ACEOF
9259 rm -f conftest.$ac_objext
9260 if { (eval echo "$as_me:9260: \"$ac_compile\"") >&5
9261   (eval $ac_compile) 2>&5
9262   ac_status=$?
9263   echo "$as_me:9263: \$? = $ac_status" >&5
9264   (exit $ac_status); } &&
9265          { ac_try='test -s conftest.$ac_objext'
9266   { (eval echo "$as_me:9266: \"$ac_try\"") >&5
9267   (eval $ac_try) 2>&5
9268   ac_status=$?
9269   echo "$as_me:9269: \$? = $ac_status" >&5
9270   (exit $ac_status); }; }; then
9271   break
9272 else
9273   echo "$as_me: failed program was:" >&5
9274 cat conftest.$ac_ext >&5
9275 fi
9276 rm -f conftest.$ac_objext conftest.$ac_ext
9277   cat >conftest.$ac_ext <<_ACEOF
9278 #line 9278 "configure"
9279 #include "confdefs.h"
9280 #define _LARGEFILE_SOURCE 1
9281 #include <stdio.h>
9282 int
9283 main ()
9284 {
9285 return !fseeko;
9286   ;
9287   return 0;
9288 }
9289 _ACEOF
9290 rm -f conftest.$ac_objext
9291 if { (eval echo "$as_me:9291: \"$ac_compile\"") >&5
9292   (eval $ac_compile) 2>&5
9293   ac_status=$?
9294   echo "$as_me:9294: \$? = $ac_status" >&5
9295   (exit $ac_status); } &&
9296          { ac_try='test -s conftest.$ac_objext'
9297   { (eval echo "$as_me:9297: \"$ac_try\"") >&5
9298   (eval $ac_try) 2>&5
9299   ac_status=$?
9300   echo "$as_me:9300: \$? = $ac_status" >&5
9301   (exit $ac_status); }; }; then
9302   ac_cv_sys_largefile_source=1; break
9303 else
9304   echo "$as_me: failed program was:" >&5
9305 cat conftest.$ac_ext >&5
9306 fi
9307 rm -f conftest.$ac_objext conftest.$ac_ext
9308   break
9309 done
9310 fi
9311 echo "$as_me:9311: result: $ac_cv_sys_largefile_source" >&5
9312 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
9313 if test "$ac_cv_sys_largefile_source" != no; then
9314
9315 cat >>confdefs.h <<EOF
9316 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
9317 EOF
9318
9319 fi
9320 rm -rf conftest*
9321
9322 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
9323 # in glibc 2.1.3, but that breaks too many other things.
9324 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
9325 echo "$as_me:9325: checking for fseeko" >&5
9326 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
9327 if test "${ac_cv_func_fseeko+set}" = set; then
9328   echo $ECHO_N "(cached) $ECHO_C" >&6
9329 else
9330   cat >conftest.$ac_ext <<_ACEOF
9331 #line 9331 "configure"
9332 #include "confdefs.h"
9333 #include <stdio.h>
9334 int
9335 main ()
9336 {
9337 return fseeko && fseeko (stdin, 0, 0);
9338   ;
9339   return 0;
9340 }
9341 _ACEOF
9342 rm -f conftest.$ac_objext conftest$ac_exeext
9343 if { (eval echo "$as_me:9343: \"$ac_link\"") >&5
9344   (eval $ac_link) 2>&5
9345   ac_status=$?
9346   echo "$as_me:9346: \$? = $ac_status" >&5
9347   (exit $ac_status); } &&
9348          { ac_try='test -s conftest$ac_exeext'
9349   { (eval echo "$as_me:9349: \"$ac_try\"") >&5
9350   (eval $ac_try) 2>&5
9351   ac_status=$?
9352   echo "$as_me:9352: \$? = $ac_status" >&5
9353   (exit $ac_status); }; }; then
9354   ac_cv_func_fseeko=yes
9355 else
9356   echo "$as_me: failed program was:" >&5
9357 cat conftest.$ac_ext >&5
9358 ac_cv_func_fseeko=no
9359 fi
9360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9361 fi
9362 echo "$as_me:9362: result: $ac_cv_func_fseeko" >&5
9363 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
9364 if test $ac_cv_func_fseeko = yes; then
9365
9366 cat >>confdefs.h <<\EOF
9367 #define HAVE_FSEEKO 1
9368 EOF
9369
9370 fi
9371
9372         # Normally we would collect these definitions in the config.h,
9373         # but (like _XOPEN_SOURCE), some environments rely on having these
9374         # defined before any of the system headers are included.  Another
9375         # case comes up with C++, e.g., on AIX the compiler compiles the
9376         # header files by themselves before looking at the body files it is
9377         # told to compile.  For ncurses, those header files do not include
9378         # the config.h
9379         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
9380         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
9381         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
9382
9383         echo "$as_me:9383: checking whether to use struct dirent64" >&5
9384 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
9385 if test "${cf_cv_struct_dirent64+set}" = set; then
9386   echo $ECHO_N "(cached) $ECHO_C" >&6
9387 else
9388
9389                 cat >conftest.$ac_ext <<_ACEOF
9390 #line 9390 "configure"
9391 #include "confdefs.h"
9392
9393 #include <sys/types.h>
9394 #include <dirent.h>
9395
9396 int
9397 main ()
9398 {
9399
9400                 /* if transitional largefile support is setup, this is true */
9401                 extern struct dirent64 * readdir(DIR *);
9402                 struct dirent64 *x = readdir((DIR *)0);
9403                 struct dirent *y = readdir((DIR *)0);
9404                 int z = x - y;
9405
9406   ;
9407   return 0;
9408 }
9409 _ACEOF
9410 rm -f conftest.$ac_objext
9411 if { (eval echo "$as_me:9411: \"$ac_compile\"") >&5
9412   (eval $ac_compile) 2>&5
9413   ac_status=$?
9414   echo "$as_me:9414: \$? = $ac_status" >&5
9415   (exit $ac_status); } &&
9416          { ac_try='test -s conftest.$ac_objext'
9417   { (eval echo "$as_me:9417: \"$ac_try\"") >&5
9418   (eval $ac_try) 2>&5
9419   ac_status=$?
9420   echo "$as_me:9420: \$? = $ac_status" >&5
9421   (exit $ac_status); }; }; then
9422   cf_cv_struct_dirent64=yes
9423 else
9424   echo "$as_me: failed program was:" >&5
9425 cat conftest.$ac_ext >&5
9426 cf_cv_struct_dirent64=no
9427 fi
9428 rm -f conftest.$ac_objext conftest.$ac_ext
9429
9430 fi
9431 echo "$as_me:9431: result: $cf_cv_struct_dirent64" >&5
9432 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
9433         test "$cf_cv_struct_dirent64" = yes &&
9434 cat >>confdefs.h <<\EOF
9435 #define HAVE_STRUCT_DIRENT64 1
9436 EOF
9437
9438     fi
9439
9440 ### Enable compiling-in rcs id's
9441 echo "$as_me:9441: checking if RCS identifiers should be compiled-in" >&5
9442 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
9443
9444 # Check whether --with-rcs-ids or --without-rcs-ids was given.
9445 if test "${with_rcs_ids+set}" = set; then
9446   withval="$with_rcs_ids"
9447   with_rcs_ids=$withval
9448 else
9449   with_rcs_ids=no
9450 fi;
9451 echo "$as_me:9451: result: $with_rcs_ids" >&5
9452 echo "${ECHO_T}$with_rcs_ids" >&6
9453 test "$with_rcs_ids" = yes &&
9454 cat >>confdefs.h <<\EOF
9455 #define USE_RCS_IDS 1
9456 EOF
9457
9458 ###############################################################################
9459
9460 ### Note that some functions (such as const) are normally disabled anyway.
9461 echo "$as_me:9461: checking if you want to build with function extensions" >&5
9462 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
9463
9464 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
9465 if test "${enable_ext_funcs+set}" = set; then
9466   enableval="$enable_ext_funcs"
9467   with_ext_funcs=$enableval
9468 else
9469   with_ext_funcs=yes
9470 fi;
9471 echo "$as_me:9471: result: $with_ext_funcs" >&5
9472 echo "${ECHO_T}$with_ext_funcs" >&6
9473 if test "$with_ext_funcs" = yes ; then
9474         NCURSES_EXT_FUNCS=1
9475
9476 cat >>confdefs.h <<\EOF
9477 #define HAVE_USE_DEFAULT_COLORS 1
9478 EOF
9479
9480 cat >>confdefs.h <<\EOF
9481 #define NCURSES_EXT_FUNCS 1
9482 EOF
9483
9484 else
9485         NCURSES_EXT_FUNCS=0
9486 fi
9487
9488 ###   use option --enable-const to turn on use of const beyond that in XSI.
9489 echo "$as_me:9489: checking for extended use of const keyword" >&5
9490 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
9491
9492 # Check whether --enable-const or --disable-const was given.
9493 if test "${enable_const+set}" = set; then
9494   enableval="$enable_const"
9495   with_ext_const=$enableval
9496 else
9497   with_ext_const=no
9498 fi;
9499 echo "$as_me:9499: result: $with_ext_const" >&5
9500 echo "${ECHO_T}$with_ext_const" >&6
9501 NCURSES_CONST='/*nothing*/'
9502 if test "$with_ext_const" = yes ; then
9503         NCURSES_CONST=const
9504 fi
9505
9506 ###############################################################################
9507 # These options are relatively safe to experiment with.
9508
9509 echo "$as_me:9509: checking if you want all development code" >&5
9510 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
9511
9512 # Check whether --with-develop or --without-develop was given.
9513 if test "${with_develop+set}" = set; then
9514   withval="$with_develop"
9515   with_develop=$withval
9516 else
9517   with_develop=no
9518 fi;
9519 echo "$as_me:9519: result: $with_develop" >&5
9520 echo "${ECHO_T}$with_develop" >&6
9521
9522 ###############################################################################
9523 # These are just experimental, probably should not be in a package:
9524
9525 # This is still experimental (20080329), but should ultimately be moved to
9526 # the script-block --with-normal, etc.
9527
9528 echo "$as_me:9528: checking if you want to link with the pthread library" >&5
9529 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
9530
9531 # Check whether --with-pthread or --without-pthread was given.
9532 if test "${with_pthread+set}" = set; then
9533   withval="$with_pthread"
9534   with_pthread=$withval
9535 else
9536   with_pthread=no
9537 fi;
9538 echo "$as_me:9538: result: $with_pthread" >&5
9539 echo "${ECHO_T}$with_pthread" >&6
9540
9541 if test "$with_pthread" != no ; then
9542     echo "$as_me:9542: checking for pthread.h" >&5
9543 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
9544 if test "${ac_cv_header_pthread_h+set}" = set; then
9545   echo $ECHO_N "(cached) $ECHO_C" >&6
9546 else
9547   cat >conftest.$ac_ext <<_ACEOF
9548 #line 9548 "configure"
9549 #include "confdefs.h"
9550 #include <pthread.h>
9551 _ACEOF
9552 if { (eval echo "$as_me:9552: \"$ac_cpp conftest.$ac_ext\"") >&5
9553   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9554   ac_status=$?
9555   egrep -v '^ *\+' conftest.er1 >conftest.err
9556   rm -f conftest.er1
9557   cat conftest.err >&5
9558   echo "$as_me:9558: \$? = $ac_status" >&5
9559   (exit $ac_status); } >/dev/null; then
9560   if test -s conftest.err; then
9561     ac_cpp_err=$ac_c_preproc_warn_flag
9562   else
9563     ac_cpp_err=
9564   fi
9565 else
9566   ac_cpp_err=yes
9567 fi
9568 if test -z "$ac_cpp_err"; then
9569   ac_cv_header_pthread_h=yes
9570 else
9571   echo "$as_me: failed program was:" >&5
9572   cat conftest.$ac_ext >&5
9573   ac_cv_header_pthread_h=no
9574 fi
9575 rm -f conftest.err conftest.$ac_ext
9576 fi
9577 echo "$as_me:9577: result: $ac_cv_header_pthread_h" >&5
9578 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
9579 if test $ac_cv_header_pthread_h = yes; then
9580
9581 cat >>confdefs.h <<\EOF
9582 #define HAVE_PTHREADS_H 1
9583 EOF
9584
9585         for cf_lib_pthread in pthread c_r
9586         do
9587             echo "$as_me:9587: checking if we can link with the $cf_lib_pthread library" >&5
9588 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
9589             cf_save_LIBS="$LIBS"
9590             LIBS="-l$cf_lib_pthread $LIBS"
9591             cat >conftest.$ac_ext <<_ACEOF
9592 #line 9592 "configure"
9593 #include "confdefs.h"
9594
9595 #include <pthread.h>
9596
9597 int
9598 main ()
9599 {
9600
9601                 int rc = pthread_create(0,0,0,0);
9602                 int r2 = pthread_mutexattr_settype(0, 0);
9603
9604   ;
9605   return 0;
9606 }
9607 _ACEOF
9608 rm -f conftest.$ac_objext conftest$ac_exeext
9609 if { (eval echo "$as_me:9609: \"$ac_link\"") >&5
9610   (eval $ac_link) 2>&5
9611   ac_status=$?
9612   echo "$as_me:9612: \$? = $ac_status" >&5
9613   (exit $ac_status); } &&
9614          { ac_try='test -s conftest$ac_exeext'
9615   { (eval echo "$as_me:9615: \"$ac_try\"") >&5
9616   (eval $ac_try) 2>&5
9617   ac_status=$?
9618   echo "$as_me:9618: \$? = $ac_status" >&5
9619   (exit $ac_status); }; }; then
9620   with_pthread=yes
9621 else
9622   echo "$as_me: failed program was:" >&5
9623 cat conftest.$ac_ext >&5
9624 with_pthread=no
9625 fi
9626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9627             LIBS="$cf_save_LIBS"
9628             echo "$as_me:9628: result: $with_pthread" >&5
9629 echo "${ECHO_T}$with_pthread" >&6
9630             test "$with_pthread" = yes && break
9631         done
9632
9633         if test "$with_pthread" = yes ; then
9634             LIBS="-l$cf_lib_pthread $LIBS"
9635
9636 cat >>confdefs.h <<\EOF
9637 #define HAVE_LIBPTHREADS 1
9638 EOF
9639
9640         else
9641             { { echo "$as_me:9641: error: Cannot link with pthread library" >&5
9642 echo "$as_me: error: Cannot link with pthread library" >&2;}
9643    { (exit 1); exit 1; }; }
9644         fi
9645
9646 fi
9647
9648 fi
9649
9650 echo "$as_me:9650: checking if you want to use weak-symbols for pthreads" >&5
9651 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
9652
9653 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
9654 if test "${enable_weak_symbols+set}" = set; then
9655   enableval="$enable_weak_symbols"
9656   use_weak_symbols=$withval
9657 else
9658   use_weak_symbols=no
9659 fi;
9660 echo "$as_me:9660: result: $use_weak_symbols" >&5
9661 echo "${ECHO_T}$use_weak_symbols" >&6
9662 if test "$use_weak_symbols" = yes ; then
9663
9664 echo "$as_me:9664: checking if $CC supports weak symbols" >&5
9665 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9666 if test "${cf_cv_weak_symbols+set}" = set; then
9667   echo $ECHO_N "(cached) $ECHO_C" >&6
9668 else
9669
9670 cat >conftest.$ac_ext <<_ACEOF
9671 #line 9671 "configure"
9672 #include "confdefs.h"
9673
9674 #include <stdio.h>
9675 int
9676 main ()
9677 {
9678
9679 #if defined(__GNUC__)
9680 #  if defined __USE_ISOC99
9681 #    define _cat_pragma(exp)    _Pragma(#exp)
9682 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9683 #  else
9684 #    define _weak_pragma(exp)
9685 #  endif
9686 #  define _declare(name)        __extension__ extern __typeof__(name) name
9687 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9688 #endif
9689
9690 weak_symbol(fopen);
9691
9692   ;
9693   return 0;
9694 }
9695 _ACEOF
9696 rm -f conftest.$ac_objext
9697 if { (eval echo "$as_me:9697: \"$ac_compile\"") >&5
9698   (eval $ac_compile) 2>&5
9699   ac_status=$?
9700   echo "$as_me:9700: \$? = $ac_status" >&5
9701   (exit $ac_status); } &&
9702          { ac_try='test -s conftest.$ac_objext'
9703   { (eval echo "$as_me:9703: \"$ac_try\"") >&5
9704   (eval $ac_try) 2>&5
9705   ac_status=$?
9706   echo "$as_me:9706: \$? = $ac_status" >&5
9707   (exit $ac_status); }; }; then
9708   cf_cv_weak_symbols=yes
9709 else
9710   echo "$as_me: failed program was:" >&5
9711 cat conftest.$ac_ext >&5
9712 cf_cv_weak_symbols=no
9713 fi
9714 rm -f conftest.$ac_objext conftest.$ac_ext
9715
9716 fi
9717 echo "$as_me:9717: result: $cf_cv_weak_symbols" >&5
9718 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9719
9720 else
9721     cf_cv_weak_symbols=no
9722 fi
9723
9724 if test $cf_cv_weak_symbols = yes ; then
9725
9726 cat >>confdefs.h <<\EOF
9727 #define USE_WEAK_SYMBOLS 1
9728 EOF
9729
9730 fi
9731
9732 PTHREAD=
9733 if test "$with_pthread" = "yes" ; then
9734
9735 cat >>confdefs.h <<\EOF
9736 #define USE_PTHREADS 1
9737 EOF
9738
9739     enable_reentrant=yes
9740     if test $cf_cv_weak_symbols = yes ; then
9741         PTHREAD=-lpthread
9742     fi
9743 fi
9744
9745 # OpenSUSE is installing ncurses6, using reentrant option.
9746 echo "$as_me:9746: checking for _nc_TABSIZE" >&5
9747 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
9748 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
9749   echo $ECHO_N "(cached) $ECHO_C" >&6
9750 else
9751   cat >conftest.$ac_ext <<_ACEOF
9752 #line 9752 "configure"
9753 #include "confdefs.h"
9754 /* System header to define __stub macros and hopefully few prototypes,
9755     which can conflict with char _nc_TABSIZE (); below.  */
9756 #include <assert.h>
9757 /* Override any gcc2 internal prototype to avoid an error.  */
9758 #ifdef __cplusplus
9759 extern "C"
9760 #endif
9761 /* We use char because int might match the return type of a gcc2
9762    builtin and then its argument prototype would still apply.  */
9763 char _nc_TABSIZE ();
9764 char (*f) ();
9765
9766 int
9767 main ()
9768 {
9769 /* The GNU C library defines this for functions which it implements
9770     to always fail with ENOSYS.  Some functions are actually named
9771     something starting with __ and the normal name is an alias.  */
9772 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
9773 choke me
9774 #else
9775 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9776 #endif
9777
9778   ;
9779   return 0;
9780 }
9781 _ACEOF
9782 rm -f conftest.$ac_objext conftest$ac_exeext
9783 if { (eval echo "$as_me:9783: \"$ac_link\"") >&5
9784   (eval $ac_link) 2>&5
9785   ac_status=$?
9786   echo "$as_me:9786: \$? = $ac_status" >&5
9787   (exit $ac_status); } &&
9788          { ac_try='test -s conftest$ac_exeext'
9789   { (eval echo "$as_me:9789: \"$ac_try\"") >&5
9790   (eval $ac_try) 2>&5
9791   ac_status=$?
9792   echo "$as_me:9792: \$? = $ac_status" >&5
9793   (exit $ac_status); }; }; then
9794   ac_cv_func__nc_TABSIZE=yes
9795 else
9796   echo "$as_me: failed program was:" >&5
9797 cat conftest.$ac_ext >&5
9798 ac_cv_func__nc_TABSIZE=no
9799 fi
9800 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9801 fi
9802 echo "$as_me:9802: result: $ac_cv_func__nc_TABSIZE" >&5
9803 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
9804 if test $ac_cv_func__nc_TABSIZE = yes; then
9805   assume_reentrant=yes
9806 else
9807   assume_reentrant=no
9808 fi
9809
9810 # Reentrant code has to be opaque; there's little advantage to making ncurses
9811 # opaque outside of that, so there is no --enable-opaque option.  We can use
9812 # this option without --with-pthreads, but this will be always set for
9813 # pthreads.
9814 echo "$as_me:9814: checking if you want experimental reentrant code" >&5
9815 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9816
9817 # Check whether --enable-reentrant or --disable-reentrant was given.
9818 if test "${enable_reentrant+set}" = set; then
9819   enableval="$enable_reentrant"
9820   with_reentrant=$enableval
9821 else
9822   with_reentrant=$assume_reentrant
9823 fi;
9824 echo "$as_me:9824: result: $with_reentrant" >&5
9825 echo "${ECHO_T}$with_reentrant" >&6
9826 if test "$with_reentrant" = yes ; then
9827         cf_cv_enable_reentrant=1
9828         if test $cf_cv_weak_symbols = yes ; then
9829
9830 # remove pthread library from $LIBS
9831 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9832
9833         elif test "$assume_reentrant" = no ; then
9834                 LIB_SUFFIX="t${LIB_SUFFIX}"
9835         fi
9836
9837 cat >>confdefs.h <<\EOF
9838 #define USE_REENTRANT 1
9839 EOF
9840
9841 else
9842         cf_cv_enable_reentrant=0
9843 fi
9844
9845 ### Allow using a different wrap-prefix
9846 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9847         echo "$as_me:9847: checking for prefix used to wrap public variables" >&5
9848 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9849
9850 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9851 if test "${with_wrap_prefix+set}" = set; then
9852   withval="$with_wrap_prefix"
9853   NCURSES_WRAP_PREFIX=$withval
9854 else
9855   NCURSES_WRAP_PREFIX=_nc_
9856 fi;
9857         echo "$as_me:9857: result: $NCURSES_WRAP_PREFIX" >&5
9858 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9859 else
9860         NCURSES_WRAP_PREFIX=_nc_
9861 fi
9862
9863 cat >>confdefs.h <<EOF
9864 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9865 EOF
9866
9867 ###############################################################################
9868
9869 ###     use option --disable-echo to suppress full display compiling commands
9870
9871 echo "$as_me:9871: checking if you want to see long compiling messages" >&5
9872 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
9873
9874 # Check whether --enable-echo or --disable-echo was given.
9875 if test "${enable_echo+set}" = set; then
9876   enableval="$enable_echo"
9877   test "$enableval" != no && enableval=yes
9878   if test "$enableval" != "yes" ; then
9879
9880     ECHO_LT='--silent'
9881     ECHO_LD='@echo linking $@;'
9882     RULE_CC='@echo compiling $<'
9883     SHOW_CC='@echo compiling $@'
9884     ECHO_CC='@'
9885
9886   else
9887
9888     ECHO_LT=''
9889     ECHO_LD=''
9890     RULE_CC=''
9891     SHOW_CC=''
9892     ECHO_CC=''
9893
9894   fi
9895 else
9896   enableval=yes
9897
9898     ECHO_LT=''
9899     ECHO_LD=''
9900     RULE_CC=''
9901     SHOW_CC=''
9902     ECHO_CC=''
9903
9904 fi;
9905 echo "$as_me:9905: result: $enableval" >&5
9906 echo "${ECHO_T}$enableval" >&6
9907
9908 ###     use option --enable-warnings to turn on all gcc warnings
9909 echo "$as_me:9909: checking if you want to see compiler warnings" >&5
9910 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
9911
9912 # Check whether --enable-warnings or --disable-warnings was given.
9913 if test "${enable_warnings+set}" = set; then
9914   enableval="$enable_warnings"
9915   with_warnings=$enableval
9916 fi;
9917 echo "$as_me:9917: result: $with_warnings" >&5
9918 echo "${ECHO_T}$with_warnings" >&6
9919
9920 if test "x$with_warnings" = "xyes"; then
9921
9922         ADAFLAGS="$ADAFLAGS -gnatg"
9923
9924 INTEL_COMPILER=no
9925
9926 if test "$GCC" = yes ; then
9927         case $host_os in
9928         linux*|gnu*)
9929                 echo "$as_me:9929: checking if this is really Intel C compiler" >&5
9930 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
9931                 cf_save_CFLAGS="$CFLAGS"
9932                 CFLAGS="$CFLAGS -no-gcc"
9933                 cat >conftest.$ac_ext <<_ACEOF
9934 #line 9934 "configure"
9935 #include "confdefs.h"
9936
9937 int
9938 main ()
9939 {
9940
9941 #ifdef __INTEL_COMPILER
9942 #else
9943 make an error
9944 #endif
9945
9946   ;
9947   return 0;
9948 }
9949 _ACEOF
9950 rm -f conftest.$ac_objext
9951 if { (eval echo "$as_me:9951: \"$ac_compile\"") >&5
9952   (eval $ac_compile) 2>&5
9953   ac_status=$?
9954   echo "$as_me:9954: \$? = $ac_status" >&5
9955   (exit $ac_status); } &&
9956          { ac_try='test -s conftest.$ac_objext'
9957   { (eval echo "$as_me:9957: \"$ac_try\"") >&5
9958   (eval $ac_try) 2>&5
9959   ac_status=$?
9960   echo "$as_me:9960: \$? = $ac_status" >&5
9961   (exit $ac_status); }; }; then
9962   INTEL_COMPILER=yes
9963 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
9964
9965 else
9966   echo "$as_me: failed program was:" >&5
9967 cat conftest.$ac_ext >&5
9968 fi
9969 rm -f conftest.$ac_objext conftest.$ac_ext
9970                 CFLAGS="$cf_save_CFLAGS"
9971                 echo "$as_me:9971: result: $INTEL_COMPILER" >&5
9972 echo "${ECHO_T}$INTEL_COMPILER" >&6
9973                 ;;
9974         esac
9975 fi
9976
9977 CLANG_COMPILER=no
9978
9979 if test "$GCC" = yes ; then
9980         echo "$as_me:9980: checking if this is really Clang C compiler" >&5
9981 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
9982         cf_save_CFLAGS="$CFLAGS"
9983         CFLAGS="$CFLAGS -Qunused-arguments"
9984         cat >conftest.$ac_ext <<_ACEOF
9985 #line 9985 "configure"
9986 #include "confdefs.h"
9987
9988 int
9989 main ()
9990 {
9991
9992 #ifdef __clang__
9993 #else
9994 make an error
9995 #endif
9996
9997   ;
9998   return 0;
9999 }
10000 _ACEOF
10001 rm -f conftest.$ac_objext
10002 if { (eval echo "$as_me:10002: \"$ac_compile\"") >&5
10003   (eval $ac_compile) 2>&5
10004   ac_status=$?
10005   echo "$as_me:10005: \$? = $ac_status" >&5
10006   (exit $ac_status); } &&
10007          { ac_try='test -s conftest.$ac_objext'
10008   { (eval echo "$as_me:10008: \"$ac_try\"") >&5
10009   (eval $ac_try) 2>&5
10010   ac_status=$?
10011   echo "$as_me:10011: \$? = $ac_status" >&5
10012   (exit $ac_status); }; }; then
10013   CLANG_COMPILER=yes
10014 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
10015
10016 else
10017   echo "$as_me: failed program was:" >&5
10018 cat conftest.$ac_ext >&5
10019 fi
10020 rm -f conftest.$ac_objext conftest.$ac_ext
10021         CFLAGS="$cf_save_CFLAGS"
10022         echo "$as_me:10022: result: $CLANG_COMPILER" >&5
10023 echo "${ECHO_T}$CLANG_COMPILER" >&6
10024 fi
10025
10026 cat > conftest.$ac_ext <<EOF
10027 #line 10027 "${as_me:-configure}"
10028 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
10029 EOF
10030
10031 if test "$INTEL_COMPILER" = yes
10032 then
10033 # The "-wdXXX" options suppress warnings:
10034 # remark #1419: external declaration in primary source file
10035 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
10036 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
10037 # remark #193: zero used for undefined preprocessing identifier
10038 # remark #593: variable "curs_sb_left_arrow" was set but never used
10039 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
10040 # remark #869: parameter "tw" was never referenced
10041 # remark #981: operands are evaluated in unspecified order
10042 # warning #279: controlling expression is constant
10043
10044         { echo "$as_me:10044: checking for $CC warning options..." >&5
10045 echo "$as_me: checking for $CC warning options..." >&6;}
10046         cf_save_CFLAGS="$CFLAGS"
10047         EXTRA_CFLAGS="-Wall"
10048         for cf_opt in \
10049                 wd1419 \
10050                 wd1683 \
10051                 wd1684 \
10052                 wd193 \
10053                 wd593 \
10054                 wd279 \
10055                 wd810 \
10056                 wd869 \
10057                 wd981
10058         do
10059                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10060                 if { (eval echo "$as_me:10060: \"$ac_compile\"") >&5
10061   (eval $ac_compile) 2>&5
10062   ac_status=$?
10063   echo "$as_me:10063: \$? = $ac_status" >&5
10064   (exit $ac_status); }; then
10065                         test -n "$verbose" && echo "$as_me:10065: result: ... -$cf_opt" >&5
10066 echo "${ECHO_T}... -$cf_opt" >&6
10067                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10068                 fi
10069         done
10070         CFLAGS="$cf_save_CFLAGS"
10071
10072 elif test "$GCC" = yes
10073 then
10074         { echo "$as_me:10074: checking for $CC warning options..." >&5
10075 echo "$as_me: checking for $CC warning options..." >&6;}
10076         cf_save_CFLAGS="$CFLAGS"
10077         EXTRA_CFLAGS=
10078         cf_warn_CONST=""
10079         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
10080         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
10081         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
10082         for cf_opt in W Wall \
10083                 Wbad-function-cast \
10084                 Wcast-align \
10085                 Wcast-qual \
10086                 Wdeclaration-after-statement \
10087                 Wextra \
10088                 Winline \
10089                 Wmissing-declarations \
10090                 Wmissing-prototypes \
10091                 Wnested-externs \
10092                 Wpointer-arith \
10093                 Wshadow \
10094                 Wstrict-prototypes \
10095                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
10096         do
10097                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10098                 if { (eval echo "$as_me:10098: \"$ac_compile\"") >&5
10099   (eval $ac_compile) 2>&5
10100   ac_status=$?
10101   echo "$as_me:10101: \$? = $ac_status" >&5
10102   (exit $ac_status); }; then
10103                         test -n "$verbose" && echo "$as_me:10103: result: ... -$cf_opt" >&5
10104 echo "${ECHO_T}... -$cf_opt" >&6
10105                         case $cf_opt in #(vi
10106                         Wcast-qual) #(vi
10107                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
10108                                 ;;
10109                         Winline) #(vi
10110                                 case $GCC_VERSION in
10111                                 [34].*)
10112                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10113
10114 echo "${as_me:-configure}:10114: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10115
10116                                         continue;;
10117                                 esac
10118                                 ;;
10119                         Wpointer-arith) #(vi
10120                                 case $GCC_VERSION in
10121                                 [12].*)
10122                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10123
10124 echo "${as_me:-configure}:10124: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10125
10126                                         continue;;
10127                                 esac
10128                                 ;;
10129                         esac
10130                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10131                 fi
10132         done
10133         CFLAGS="$cf_save_CFLAGS"
10134 fi
10135 rm -rf conftest*
10136
10137 fi
10138
10139 if test "$GCC" = yes
10140 then
10141 cat > conftest.i <<EOF
10142 #ifndef GCC_PRINTF
10143 #define GCC_PRINTF 0
10144 #endif
10145 #ifndef GCC_SCANF
10146 #define GCC_SCANF 0
10147 #endif
10148 #ifndef GCC_NORETURN
10149 #define GCC_NORETURN /* nothing */
10150 #endif
10151 #ifndef GCC_UNUSED
10152 #define GCC_UNUSED /* nothing */
10153 #endif
10154 EOF
10155 if test "$GCC" = yes
10156 then
10157         { echo "$as_me:10157: checking for $CC __attribute__ directives..." >&5
10158 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
10159 cat > conftest.$ac_ext <<EOF
10160 #line 10160 "${as_me:-configure}"
10161 #include "confdefs.h"
10162 #include "conftest.h"
10163 #include "conftest.i"
10164 #if     GCC_PRINTF
10165 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
10166 #else
10167 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
10168 #endif
10169 #if     GCC_SCANF
10170 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
10171 #else
10172 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
10173 #endif
10174 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
10175 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
10176 extern void foo(void) GCC_NORETURN;
10177 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
10178 EOF
10179         cf_printf_attribute=no
10180         cf_scanf_attribute=no
10181         for cf_attribute in scanf printf unused noreturn
10182         do
10183
10184 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10185
10186                 cf_directive="__attribute__(($cf_attribute))"
10187                 echo "checking for $CC $cf_directive" 1>&5
10188
10189                 case $cf_attribute in #(vi
10190                 printf) #(vi
10191                         cf_printf_attribute=yes
10192                         cat >conftest.h <<EOF
10193 #define GCC_$cf_ATTRIBUTE 1
10194 EOF
10195                         ;;
10196                 scanf) #(vi
10197                         cf_scanf_attribute=yes
10198                         cat >conftest.h <<EOF
10199 #define GCC_$cf_ATTRIBUTE 1
10200 EOF
10201                         ;;
10202                 *) #(vi
10203                         cat >conftest.h <<EOF
10204 #define GCC_$cf_ATTRIBUTE $cf_directive
10205 EOF
10206                         ;;
10207                 esac
10208
10209                 if { (eval echo "$as_me:10209: \"$ac_compile\"") >&5
10210   (eval $ac_compile) 2>&5
10211   ac_status=$?
10212   echo "$as_me:10212: \$? = $ac_status" >&5
10213   (exit $ac_status); }; then
10214                         test -n "$verbose" && echo "$as_me:10214: result: ... $cf_attribute" >&5
10215 echo "${ECHO_T}... $cf_attribute" >&6
10216                         cat conftest.h >>confdefs.h
10217                         case $cf_attribute in #(vi
10218                         noreturn) #(vi
10219
10220 cat >>confdefs.h <<EOF
10221 #define GCC_NORETURN $cf_directive
10222 EOF
10223
10224                                 ;;
10225                         printf) #(vi
10226                                 cf_value='/* nothing */'
10227                                 if test "$cf_printf_attribute" != no ; then
10228                                         cf_value='__attribute__((format(printf,fmt,var)))'
10229
10230 cat >>confdefs.h <<\EOF
10231 #define GCC_PRINTF 1
10232 EOF
10233
10234                                 fi
10235
10236 cat >>confdefs.h <<EOF
10237 #define GCC_PRINTFLIKE(fmt,var) $cf_value
10238 EOF
10239
10240                                 ;;
10241                         scanf) #(vi
10242                                 cf_value='/* nothing */'
10243                                 if test "$cf_scanf_attribute" != no ; then
10244                                         cf_value='__attribute__((format(scanf,fmt,var)))'
10245
10246 cat >>confdefs.h <<\EOF
10247 #define GCC_SCANF 1
10248 EOF
10249
10250                                 fi
10251
10252 cat >>confdefs.h <<EOF
10253 #define GCC_SCANFLIKE(fmt,var) $cf_value
10254 EOF
10255
10256                                 ;;
10257                         unused) #(vi
10258
10259 cat >>confdefs.h <<EOF
10260 #define GCC_UNUSED $cf_directive
10261 EOF
10262
10263                                 ;;
10264                         esac
10265                 fi
10266         done
10267 else
10268         fgrep define conftest.i >>confdefs.h
10269 fi
10270 rm -rf conftest*
10271 fi
10272
10273 ###     use option --enable-assertions to turn on generation of assertion code
10274 echo "$as_me:10274: checking if you want to enable runtime assertions" >&5
10275 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
10276
10277 # Check whether --enable-assertions or --disable-assertions was given.
10278 if test "${enable_assertions+set}" = set; then
10279   enableval="$enable_assertions"
10280   with_assertions=$enableval
10281 else
10282   with_assertions=no
10283 fi;
10284 echo "$as_me:10284: result: $with_assertions" >&5
10285 echo "${ECHO_T}$with_assertions" >&6
10286 if test -n "$GCC"
10287 then
10288         if test "$with_assertions" = no
10289         then
10290                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
10291         else
10292
10293         ADAFLAGS="$ADAFLAGS -gnata"
10294
10295         fi
10296 fi
10297
10298 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
10299
10300 cat >>confdefs.h <<\EOF
10301 #define HAVE_NC_ALLOC_H 1
10302 EOF
10303
10304 ###     use option --enable-expanded to generate certain macros as functions
10305
10306 # Check whether --enable-expanded or --disable-expanded was given.
10307 if test "${enable_expanded+set}" = set; then
10308   enableval="$enable_expanded"
10309   test "$enableval" = yes &&
10310 cat >>confdefs.h <<\EOF
10311 #define NCURSES_EXPANDED 1
10312 EOF
10313
10314 fi;
10315
10316 ###     use option --disable-macros to suppress macros in favor of functions
10317
10318 # Check whether --enable-macros or --disable-macros was given.
10319 if test "${enable_macros+set}" = set; then
10320   enableval="$enable_macros"
10321   test "$enableval" = no &&
10322 cat >>confdefs.h <<\EOF
10323 #define NCURSES_NOMACROS 1
10324 EOF
10325
10326 fi;
10327
10328 # Normally we only add trace() to the debug-library.  Allow this to be
10329 # extended to all models of the ncurses library:
10330 cf_all_traces=no
10331 case "$CFLAGS $CPPFLAGS" in
10332 *-DTRACE*)
10333         cf_all_traces=yes
10334         ;;
10335 esac
10336
10337 echo "$as_me:10337: checking whether to add trace feature to all models" >&5
10338 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
10339
10340 # Check whether --with-trace or --without-trace was given.
10341 if test "${with_trace+set}" = set; then
10342   withval="$with_trace"
10343   cf_with_trace=$withval
10344 else
10345   cf_with_trace=$cf_all_traces
10346 fi;
10347 echo "$as_me:10347: result: $cf_with_trace" >&5
10348 echo "${ECHO_T}$cf_with_trace" >&6
10349
10350 if test "$cf_with_trace" = yes ; then
10351         ADA_TRACE=TRUE
10352
10353 cf_fix_cppflags=no
10354 cf_new_cflags=
10355 cf_new_cppflags=
10356 cf_new_extra_cppflags=
10357
10358 for cf_add_cflags in -DTRACE
10359 do
10360 case $cf_fix_cppflags in
10361 no)
10362         case $cf_add_cflags in #(vi
10363         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10364                 case $cf_add_cflags in
10365                 -D*)
10366                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10367
10368                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10369                                 && test -z "${cf_tst_cflags}" \
10370                                 && cf_fix_cppflags=yes
10371
10372                         if test $cf_fix_cppflags = yes ; then
10373                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10374                                 continue
10375                         elif test "${cf_tst_cflags}" = "\"'" ; then
10376                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10377                                 continue
10378                         fi
10379                         ;;
10380                 esac
10381                 case "$CPPFLAGS" in
10382                 *$cf_add_cflags) #(vi
10383                         ;;
10384                 *) #(vi
10385                         case $cf_add_cflags in #(vi
10386                         -D*)
10387                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10388
10389 CPPFLAGS=`echo "$CPPFLAGS" | \
10390         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10391                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10392
10393                                 ;;
10394                         esac
10395                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10396                         ;;
10397                 esac
10398                 ;;
10399         *)
10400                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10401                 ;;
10402         esac
10403         ;;
10404 yes)
10405         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10406
10407         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10408
10409         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10410                 && test -z "${cf_tst_cflags}" \
10411                 && cf_fix_cppflags=no
10412         ;;
10413 esac
10414 done
10415
10416 if test -n "$cf_new_cflags" ; then
10417
10418         CFLAGS="$CFLAGS $cf_new_cflags"
10419 fi
10420
10421 if test -n "$cf_new_cppflags" ; then
10422
10423         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10424 fi
10425
10426 if test -n "$cf_new_extra_cppflags" ; then
10427
10428         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10429 fi
10430
10431 else
10432         ADA_TRACE=FALSE
10433 fi
10434
10435 echo "$as_me:10435: checking if we want to use GNAT projects" >&5
10436 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
10437
10438 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
10439 if test "${enable_gnat_projects+set}" = set; then
10440   enableval="$enable_gnat_projects"
10441   test "$enableval" != no && enableval=yes
10442   if test "$enableval" != "yes" ; then
10443     enable_gnat_projects=no
10444   else
10445     enable_gnat_projects=yes
10446   fi
10447 else
10448   enableval=yes
10449   enable_gnat_projects=yes
10450
10451 fi;
10452 echo "$as_me:10452: result: $enable_gnat_projects" >&5
10453 echo "${ECHO_T}$enable_gnat_projects" >&6
10454
10455 ###     Checks for libraries.
10456 case $cf_cv_system_name in #(vi
10457 *mingw32*) #(vi
10458         ;;
10459 *)
10460 echo "$as_me:10460: checking for gettimeofday" >&5
10461 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
10462 if test "${ac_cv_func_gettimeofday+set}" = set; then
10463   echo $ECHO_N "(cached) $ECHO_C" >&6
10464 else
10465   cat >conftest.$ac_ext <<_ACEOF
10466 #line 10466 "configure"
10467 #include "confdefs.h"
10468 /* System header to define __stub macros and hopefully few prototypes,
10469     which can conflict with char gettimeofday (); below.  */
10470 #include <assert.h>
10471 /* Override any gcc2 internal prototype to avoid an error.  */
10472 #ifdef __cplusplus
10473 extern "C"
10474 #endif
10475 /* We use char because int might match the return type of a gcc2
10476    builtin and then its argument prototype would still apply.  */
10477 char gettimeofday ();
10478 char (*f) ();
10479
10480 int
10481 main ()
10482 {
10483 /* The GNU C library defines this for functions which it implements
10484     to always fail with ENOSYS.  Some functions are actually named
10485     something starting with __ and the normal name is an alias.  */
10486 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
10487 choke me
10488 #else
10489 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10490 #endif
10491
10492   ;
10493   return 0;
10494 }
10495 _ACEOF
10496 rm -f conftest.$ac_objext conftest$ac_exeext
10497 if { (eval echo "$as_me:10497: \"$ac_link\"") >&5
10498   (eval $ac_link) 2>&5
10499   ac_status=$?
10500   echo "$as_me:10500: \$? = $ac_status" >&5
10501   (exit $ac_status); } &&
10502          { ac_try='test -s conftest$ac_exeext'
10503   { (eval echo "$as_me:10503: \"$ac_try\"") >&5
10504   (eval $ac_try) 2>&5
10505   ac_status=$?
10506   echo "$as_me:10506: \$? = $ac_status" >&5
10507   (exit $ac_status); }; }; then
10508   ac_cv_func_gettimeofday=yes
10509 else
10510   echo "$as_me: failed program was:" >&5
10511 cat conftest.$ac_ext >&5
10512 ac_cv_func_gettimeofday=no
10513 fi
10514 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10515 fi
10516 echo "$as_me:10516: result: $ac_cv_func_gettimeofday" >&5
10517 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
10518 if test $ac_cv_func_gettimeofday = yes; then
10519   cat >>confdefs.h <<\EOF
10520 #define HAVE_GETTIMEOFDAY 1
10521 EOF
10522
10523 else
10524
10525 echo "$as_me:10525: checking for gettimeofday in -lbsd" >&5
10526 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
10527 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
10528   echo $ECHO_N "(cached) $ECHO_C" >&6
10529 else
10530   ac_check_lib_save_LIBS=$LIBS
10531 LIBS="-lbsd  $LIBS"
10532 cat >conftest.$ac_ext <<_ACEOF
10533 #line 10533 "configure"
10534 #include "confdefs.h"
10535
10536 /* Override any gcc2 internal prototype to avoid an error.  */
10537 #ifdef __cplusplus
10538 extern "C"
10539 #endif
10540 /* We use char because int might match the return type of a gcc2
10541    builtin and then its argument prototype would still apply.  */
10542 char gettimeofday ();
10543 int
10544 main ()
10545 {
10546 gettimeofday ();
10547   ;
10548   return 0;
10549 }
10550 _ACEOF
10551 rm -f conftest.$ac_objext conftest$ac_exeext
10552 if { (eval echo "$as_me:10552: \"$ac_link\"") >&5
10553   (eval $ac_link) 2>&5
10554   ac_status=$?
10555   echo "$as_me:10555: \$? = $ac_status" >&5
10556   (exit $ac_status); } &&
10557          { ac_try='test -s conftest$ac_exeext'
10558   { (eval echo "$as_me:10558: \"$ac_try\"") >&5
10559   (eval $ac_try) 2>&5
10560   ac_status=$?
10561   echo "$as_me:10561: \$? = $ac_status" >&5
10562   (exit $ac_status); }; }; then
10563   ac_cv_lib_bsd_gettimeofday=yes
10564 else
10565   echo "$as_me: failed program was:" >&5
10566 cat conftest.$ac_ext >&5
10567 ac_cv_lib_bsd_gettimeofday=no
10568 fi
10569 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10570 LIBS=$ac_check_lib_save_LIBS
10571 fi
10572 echo "$as_me:10572: result: $ac_cv_lib_bsd_gettimeofday" >&5
10573 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
10574 if test $ac_cv_lib_bsd_gettimeofday = yes; then
10575
10576 cat >>confdefs.h <<\EOF
10577 #define HAVE_GETTIMEOFDAY 1
10578 EOF
10579
10580         LIBS="$LIBS -lbsd"
10581 fi
10582
10583 fi
10584         ;;
10585 esac
10586
10587 ###     Checks for header files.
10588 echo "$as_me:10588: checking for ANSI C header files" >&5
10589 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10590 if test "${ac_cv_header_stdc+set}" = set; then
10591   echo $ECHO_N "(cached) $ECHO_C" >&6
10592 else
10593   cat >conftest.$ac_ext <<_ACEOF
10594 #line 10594 "configure"
10595 #include "confdefs.h"
10596 #include <stdlib.h>
10597 #include <stdarg.h>
10598 #include <string.h>
10599 #include <float.h>
10600
10601 _ACEOF
10602 if { (eval echo "$as_me:10602: \"$ac_cpp conftest.$ac_ext\"") >&5
10603   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10604   ac_status=$?
10605   egrep -v '^ *\+' conftest.er1 >conftest.err
10606   rm -f conftest.er1
10607   cat conftest.err >&5
10608   echo "$as_me:10608: \$? = $ac_status" >&5
10609   (exit $ac_status); } >/dev/null; then
10610   if test -s conftest.err; then
10611     ac_cpp_err=$ac_c_preproc_warn_flag
10612   else
10613     ac_cpp_err=
10614   fi
10615 else
10616   ac_cpp_err=yes
10617 fi
10618 if test -z "$ac_cpp_err"; then
10619   ac_cv_header_stdc=yes
10620 else
10621   echo "$as_me: failed program was:" >&5
10622   cat conftest.$ac_ext >&5
10623   ac_cv_header_stdc=no
10624 fi
10625 rm -f conftest.err conftest.$ac_ext
10626
10627 if test $ac_cv_header_stdc = yes; then
10628   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10629   cat >conftest.$ac_ext <<_ACEOF
10630 #line 10630 "configure"
10631 #include "confdefs.h"
10632 #include <string.h>
10633
10634 _ACEOF
10635 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10636   egrep "memchr" >/dev/null 2>&1; then
10637   :
10638 else
10639   ac_cv_header_stdc=no
10640 fi
10641 rm -rf conftest*
10642
10643 fi
10644
10645 if test $ac_cv_header_stdc = yes; then
10646   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10647   cat >conftest.$ac_ext <<_ACEOF
10648 #line 10648 "configure"
10649 #include "confdefs.h"
10650 #include <stdlib.h>
10651
10652 _ACEOF
10653 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10654   egrep "free" >/dev/null 2>&1; then
10655   :
10656 else
10657   ac_cv_header_stdc=no
10658 fi
10659 rm -rf conftest*
10660
10661 fi
10662
10663 if test $ac_cv_header_stdc = yes; then
10664   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10665   if test "$cross_compiling" = yes; then
10666   :
10667 else
10668   cat >conftest.$ac_ext <<_ACEOF
10669 #line 10669 "configure"
10670 #include "confdefs.h"
10671 #include <ctype.h>
10672 #if ((' ' & 0x0FF) == 0x020)
10673 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10674 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10675 #else
10676 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
10677                      || ('j' <= (c) && (c) <= 'r') \
10678                      || ('s' <= (c) && (c) <= 'z'))
10679 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10680 #endif
10681
10682 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10683 int
10684 main ()
10685 {
10686   int i;
10687   for (i = 0; i < 256; i++)
10688     if (XOR (islower (i), ISLOWER (i))
10689         || toupper (i) != TOUPPER (i))
10690       $ac_main_return(2);
10691   $ac_main_return (0);
10692 }
10693 _ACEOF
10694 rm -f conftest$ac_exeext
10695 if { (eval echo "$as_me:10695: \"$ac_link\"") >&5
10696   (eval $ac_link) 2>&5
10697   ac_status=$?
10698   echo "$as_me:10698: \$? = $ac_status" >&5
10699   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10700   { (eval echo "$as_me:10700: \"$ac_try\"") >&5
10701   (eval $ac_try) 2>&5
10702   ac_status=$?
10703   echo "$as_me:10703: \$? = $ac_status" >&5
10704   (exit $ac_status); }; }; then
10705   :
10706 else
10707   echo "$as_me: program exited with status $ac_status" >&5
10708 echo "$as_me: failed program was:" >&5
10709 cat conftest.$ac_ext >&5
10710 ac_cv_header_stdc=no
10711 fi
10712 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10713 fi
10714 fi
10715 fi
10716 echo "$as_me:10716: result: $ac_cv_header_stdc" >&5
10717 echo "${ECHO_T}$ac_cv_header_stdc" >&6
10718 if test $ac_cv_header_stdc = yes; then
10719
10720 cat >>confdefs.h <<\EOF
10721 #define STDC_HEADERS 1
10722 EOF
10723
10724 fi
10725
10726 ac_header_dirent=no
10727 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
10728   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
10729 echo "$as_me:10729: checking for $ac_hdr that defines DIR" >&5
10730 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
10731 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10732   echo $ECHO_N "(cached) $ECHO_C" >&6
10733 else
10734   cat >conftest.$ac_ext <<_ACEOF
10735 #line 10735 "configure"
10736 #include "confdefs.h"
10737 #include <sys/types.h>
10738 #include <$ac_hdr>
10739
10740 int
10741 main ()
10742 {
10743 if ((DIR *) 0)
10744 return 0;
10745   ;
10746   return 0;
10747 }
10748 _ACEOF
10749 rm -f conftest.$ac_objext
10750 if { (eval echo "$as_me:10750: \"$ac_compile\"") >&5
10751   (eval $ac_compile) 2>&5
10752   ac_status=$?
10753   echo "$as_me:10753: \$? = $ac_status" >&5
10754   (exit $ac_status); } &&
10755          { ac_try='test -s conftest.$ac_objext'
10756   { (eval echo "$as_me:10756: \"$ac_try\"") >&5
10757   (eval $ac_try) 2>&5
10758   ac_status=$?
10759   echo "$as_me:10759: \$? = $ac_status" >&5
10760   (exit $ac_status); }; }; then
10761   eval "$as_ac_Header=yes"
10762 else
10763   echo "$as_me: failed program was:" >&5
10764 cat conftest.$ac_ext >&5
10765 eval "$as_ac_Header=no"
10766 fi
10767 rm -f conftest.$ac_objext conftest.$ac_ext
10768 fi
10769 echo "$as_me:10769: result: `eval echo '${'$as_ac_Header'}'`" >&5
10770 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10771 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10772   cat >>confdefs.h <<EOF
10773 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
10774 EOF
10775
10776 ac_header_dirent=$ac_hdr; break
10777 fi
10778
10779 done
10780 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
10781 if test $ac_header_dirent = dirent.h; then
10782   echo "$as_me:10782: checking for opendir in -ldir" >&5
10783 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
10784 if test "${ac_cv_lib_dir_opendir+set}" = set; then
10785   echo $ECHO_N "(cached) $ECHO_C" >&6
10786 else
10787   ac_check_lib_save_LIBS=$LIBS
10788 LIBS="-ldir  $LIBS"
10789 cat >conftest.$ac_ext <<_ACEOF
10790 #line 10790 "configure"
10791 #include "confdefs.h"
10792
10793 /* Override any gcc2 internal prototype to avoid an error.  */
10794 #ifdef __cplusplus
10795 extern "C"
10796 #endif
10797 /* We use char because int might match the return type of a gcc2
10798    builtin and then its argument prototype would still apply.  */
10799 char opendir ();
10800 int
10801 main ()
10802 {
10803 opendir ();
10804   ;
10805   return 0;
10806 }
10807 _ACEOF
10808 rm -f conftest.$ac_objext conftest$ac_exeext
10809 if { (eval echo "$as_me:10809: \"$ac_link\"") >&5
10810   (eval $ac_link) 2>&5
10811   ac_status=$?
10812   echo "$as_me:10812: \$? = $ac_status" >&5
10813   (exit $ac_status); } &&
10814          { ac_try='test -s conftest$ac_exeext'
10815   { (eval echo "$as_me:10815: \"$ac_try\"") >&5
10816   (eval $ac_try) 2>&5
10817   ac_status=$?
10818   echo "$as_me:10818: \$? = $ac_status" >&5
10819   (exit $ac_status); }; }; then
10820   ac_cv_lib_dir_opendir=yes
10821 else
10822   echo "$as_me: failed program was:" >&5
10823 cat conftest.$ac_ext >&5
10824 ac_cv_lib_dir_opendir=no
10825 fi
10826 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10827 LIBS=$ac_check_lib_save_LIBS
10828 fi
10829 echo "$as_me:10829: result: $ac_cv_lib_dir_opendir" >&5
10830 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
10831 if test $ac_cv_lib_dir_opendir = yes; then
10832   LIBS="$LIBS -ldir"
10833 fi
10834
10835 else
10836   echo "$as_me:10836: checking for opendir in -lx" >&5
10837 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
10838 if test "${ac_cv_lib_x_opendir+set}" = set; then
10839   echo $ECHO_N "(cached) $ECHO_C" >&6
10840 else
10841   ac_check_lib_save_LIBS=$LIBS
10842 LIBS="-lx  $LIBS"
10843 cat >conftest.$ac_ext <<_ACEOF
10844 #line 10844 "configure"
10845 #include "confdefs.h"
10846
10847 /* Override any gcc2 internal prototype to avoid an error.  */
10848 #ifdef __cplusplus
10849 extern "C"
10850 #endif
10851 /* We use char because int might match the return type of a gcc2
10852    builtin and then its argument prototype would still apply.  */
10853 char opendir ();
10854 int
10855 main ()
10856 {
10857 opendir ();
10858   ;
10859   return 0;
10860 }
10861 _ACEOF
10862 rm -f conftest.$ac_objext conftest$ac_exeext
10863 if { (eval echo "$as_me:10863: \"$ac_link\"") >&5
10864   (eval $ac_link) 2>&5
10865   ac_status=$?
10866   echo "$as_me:10866: \$? = $ac_status" >&5
10867   (exit $ac_status); } &&
10868          { ac_try='test -s conftest$ac_exeext'
10869   { (eval echo "$as_me:10869: \"$ac_try\"") >&5
10870   (eval $ac_try) 2>&5
10871   ac_status=$?
10872   echo "$as_me:10872: \$? = $ac_status" >&5
10873   (exit $ac_status); }; }; then
10874   ac_cv_lib_x_opendir=yes
10875 else
10876   echo "$as_me: failed program was:" >&5
10877 cat conftest.$ac_ext >&5
10878 ac_cv_lib_x_opendir=no
10879 fi
10880 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10881 LIBS=$ac_check_lib_save_LIBS
10882 fi
10883 echo "$as_me:10883: result: $ac_cv_lib_x_opendir" >&5
10884 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10885 if test $ac_cv_lib_x_opendir = yes; then
10886   LIBS="$LIBS -lx"
10887 fi
10888
10889 fi
10890
10891 echo "$as_me:10891: checking whether time.h and sys/time.h may both be included" >&5
10892 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10893 if test "${ac_cv_header_time+set}" = set; then
10894   echo $ECHO_N "(cached) $ECHO_C" >&6
10895 else
10896   cat >conftest.$ac_ext <<_ACEOF
10897 #line 10897 "configure"
10898 #include "confdefs.h"
10899 #include <sys/types.h>
10900 #include <sys/time.h>
10901 #include <time.h>
10902
10903 int
10904 main ()
10905 {
10906 if ((struct tm *) 0)
10907 return 0;
10908   ;
10909   return 0;
10910 }
10911 _ACEOF
10912 rm -f conftest.$ac_objext
10913 if { (eval echo "$as_me:10913: \"$ac_compile\"") >&5
10914   (eval $ac_compile) 2>&5
10915   ac_status=$?
10916   echo "$as_me:10916: \$? = $ac_status" >&5
10917   (exit $ac_status); } &&
10918          { ac_try='test -s conftest.$ac_objext'
10919   { (eval echo "$as_me:10919: \"$ac_try\"") >&5
10920   (eval $ac_try) 2>&5
10921   ac_status=$?
10922   echo "$as_me:10922: \$? = $ac_status" >&5
10923   (exit $ac_status); }; }; then
10924   ac_cv_header_time=yes
10925 else
10926   echo "$as_me: failed program was:" >&5
10927 cat conftest.$ac_ext >&5
10928 ac_cv_header_time=no
10929 fi
10930 rm -f conftest.$ac_objext conftest.$ac_ext
10931 fi
10932 echo "$as_me:10932: result: $ac_cv_header_time" >&5
10933 echo "${ECHO_T}$ac_cv_header_time" >&6
10934 if test $ac_cv_header_time = yes; then
10935
10936 cat >>confdefs.h <<\EOF
10937 #define TIME_WITH_SYS_TIME 1
10938 EOF
10939
10940 fi
10941
10942 ###     checks for compiler characteristics
10943 ac_ext=c
10944 ac_cpp='$CPP $CPPFLAGS'
10945 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10946 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10947 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10948 ac_main_return=return
10949
10950 echo "$as_me:10950: checking for an ANSI C-conforming const" >&5
10951 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
10952 if test "${ac_cv_c_const+set}" = set; then
10953   echo $ECHO_N "(cached) $ECHO_C" >&6
10954 else
10955   cat >conftest.$ac_ext <<_ACEOF
10956 #line 10956 "configure"
10957 #include "confdefs.h"
10958
10959 int
10960 main ()
10961 {
10962 /* FIXME: Include the comments suggested by Paul. */
10963 #ifndef __cplusplus
10964   /* Ultrix mips cc rejects this.  */
10965   typedef int charset[2];
10966   const charset x;
10967   /* SunOS 4.1.1 cc rejects this.  */
10968   char const *const *ccp;
10969   char **p;
10970   /* NEC SVR4.0.2 mips cc rejects this.  */
10971   struct point {int x, y;};
10972   static struct point const zero = {0,0};
10973   /* AIX XL C 1.02.0.0 rejects this.
10974      It does not let you subtract one const X* pointer from another in
10975      an arm of an if-expression whose if-part is not a constant
10976      expression */
10977   const char *g = "string";
10978   ccp = &g + (g ? g-g : 0);
10979   /* HPUX 7.0 cc rejects these. */
10980   ++ccp;
10981   p = (char**) ccp;
10982   ccp = (char const *const *) p;
10983   { /* SCO 3.2v4 cc rejects this.  */
10984     char *t;
10985     char const *s = 0 ? (char *) 0 : (char const *) 0;
10986
10987     *t++ = 0;
10988   }
10989   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10990     int x[] = {25, 17};
10991     const int *foo = &x[0];
10992     ++foo;
10993   }
10994   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10995     typedef const int *iptr;
10996     iptr p = 0;
10997     ++p;
10998   }
10999   { /* AIX XL C 1.02.0.0 rejects this saying
11000        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
11001     struct s { int j; const int *ap[3]; };
11002     struct s *b; b->j = 5;
11003   }
11004   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
11005     const int foo = 10;
11006   }
11007 #endif
11008
11009   ;
11010   return 0;
11011 }
11012 _ACEOF
11013 rm -f conftest.$ac_objext
11014 if { (eval echo "$as_me:11014: \"$ac_compile\"") >&5
11015   (eval $ac_compile) 2>&5
11016   ac_status=$?
11017   echo "$as_me:11017: \$? = $ac_status" >&5
11018   (exit $ac_status); } &&
11019          { ac_try='test -s conftest.$ac_objext'
11020   { (eval echo "$as_me:11020: \"$ac_try\"") >&5
11021   (eval $ac_try) 2>&5
11022   ac_status=$?
11023   echo "$as_me:11023: \$? = $ac_status" >&5
11024   (exit $ac_status); }; }; then
11025   ac_cv_c_const=yes
11026 else
11027   echo "$as_me: failed program was:" >&5
11028 cat conftest.$ac_ext >&5
11029 ac_cv_c_const=no
11030 fi
11031 rm -f conftest.$ac_objext conftest.$ac_ext
11032 fi
11033 echo "$as_me:11033: result: $ac_cv_c_const" >&5
11034 echo "${ECHO_T}$ac_cv_c_const" >&6
11035 if test $ac_cv_c_const = no; then
11036
11037 cat >>confdefs.h <<\EOF
11038 #define const
11039 EOF
11040
11041 fi
11042
11043 ###     Checks for external-data
11044
11045 echo "$as_me:11045: checking if data-only library module links" >&5
11046 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
11047 if test "${cf_cv_link_dataonly+set}" = set; then
11048   echo $ECHO_N "(cached) $ECHO_C" >&6
11049 else
11050
11051         rm -f conftest.a
11052         cat >conftest.$ac_ext <<EOF
11053 #line 11053 "configure"
11054 int     testdata[3] = { 123, 456, 789 };
11055 EOF
11056         if { (eval echo "$as_me:11056: \"$ac_compile\"") >&5
11057   (eval $ac_compile) 2>&5
11058   ac_status=$?
11059   echo "$as_me:11059: \$? = $ac_status" >&5
11060   (exit $ac_status); } ; then
11061                 mv conftest.o data.o && \
11062                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
11063         fi
11064         rm -f conftest.$ac_ext data.o
11065         cat >conftest.$ac_ext <<EOF
11066 #line 11066 "configure"
11067 int     testfunc()
11068 {
11069 #if defined(NeXT)
11070         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
11071 #else
11072         extern int testdata[3];
11073         return testdata[0] == 123
11074            &&  testdata[1] == 456
11075            &&  testdata[2] == 789;
11076 #endif
11077 }
11078 EOF
11079         if { (eval echo "$as_me:11079: \"$ac_compile\"") >&5
11080   (eval $ac_compile) 2>&5
11081   ac_status=$?
11082   echo "$as_me:11082: \$? = $ac_status" >&5
11083   (exit $ac_status); }; then
11084                 mv conftest.o func.o && \
11085                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
11086         fi
11087         rm -f conftest.$ac_ext func.o
11088         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
11089         cf_saveLIBS="$LIBS"
11090         LIBS="conftest.a $LIBS"
11091         if test "$cross_compiling" = yes; then
11092   cf_cv_link_dataonly=unknown
11093 else
11094   cat >conftest.$ac_ext <<_ACEOF
11095 #line 11095 "configure"
11096 #include "confdefs.h"
11097
11098         int main()
11099         {
11100                 extern int testfunc();
11101                 ${cf_cv_main_return:-return} (!testfunc());
11102         }
11103
11104 _ACEOF
11105 rm -f conftest$ac_exeext
11106 if { (eval echo "$as_me:11106: \"$ac_link\"") >&5
11107   (eval $ac_link) 2>&5
11108   ac_status=$?
11109   echo "$as_me:11109: \$? = $ac_status" >&5
11110   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11111   { (eval echo "$as_me:11111: \"$ac_try\"") >&5
11112   (eval $ac_try) 2>&5
11113   ac_status=$?
11114   echo "$as_me:11114: \$? = $ac_status" >&5
11115   (exit $ac_status); }; }; then
11116   cf_cv_link_dataonly=yes
11117 else
11118   echo "$as_me: program exited with status $ac_status" >&5
11119 echo "$as_me: failed program was:" >&5
11120 cat conftest.$ac_ext >&5
11121 cf_cv_link_dataonly=no
11122 fi
11123 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11124 fi
11125         LIBS="$cf_saveLIBS"
11126
11127 fi
11128
11129 echo "$as_me:11129: result: $cf_cv_link_dataonly" >&5
11130 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
11131
11132 if test "$cf_cv_link_dataonly" = no ; then
11133
11134 cat >>confdefs.h <<\EOF
11135 #define BROKEN_LINKER 1
11136 EOF
11137
11138         BROKEN_LINKER=1
11139 fi
11140
11141 ###     Checks for library functions.
11142
11143 echo "$as_me:11143: checking for working mkstemp" >&5
11144 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
11145 if test "${cf_cv_func_mkstemp+set}" = set; then
11146   echo $ECHO_N "(cached) $ECHO_C" >&6
11147 else
11148
11149 rm -rf conftest*
11150 if test "$cross_compiling" = yes; then
11151   cf_cv_func_mkstemp=maybe
11152 else
11153   cat >conftest.$ac_ext <<_ACEOF
11154 #line 11154 "configure"
11155 #include "confdefs.h"
11156
11157 #include <sys/types.h>
11158 #include <stdlib.h>
11159 #include <stdio.h>
11160 #include <string.h>
11161 #include <sys/stat.h>
11162 int main()
11163 {
11164         char *tmpl = "conftestXXXXXX";
11165         char name[2][80];
11166         int n;
11167         int result = 0;
11168         int fd;
11169         struct stat sb;
11170
11171         umask(077);
11172         for (n = 0; n < 2; ++n) {
11173                 strcpy(name[n], tmpl);
11174                 if ((fd = mkstemp(name[n])) >= 0) {
11175                         if (!strcmp(name[n], tmpl)
11176                          || stat(name[n], &sb) != 0
11177                          || (sb.st_mode & S_IFMT) != S_IFREG
11178                          || (sb.st_mode & 077) != 0) {
11179                                 result = 1;
11180                         }
11181                         close(fd);
11182                 }
11183         }
11184         if (result == 0
11185          && !strcmp(name[0], name[1]))
11186                 result = 1;
11187         ${cf_cv_main_return:-return}(result);
11188 }
11189
11190 _ACEOF
11191 rm -f conftest$ac_exeext
11192 if { (eval echo "$as_me:11192: \"$ac_link\"") >&5
11193   (eval $ac_link) 2>&5
11194   ac_status=$?
11195   echo "$as_me:11195: \$? = $ac_status" >&5
11196   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11197   { (eval echo "$as_me:11197: \"$ac_try\"") >&5
11198   (eval $ac_try) 2>&5
11199   ac_status=$?
11200   echo "$as_me:11200: \$? = $ac_status" >&5
11201   (exit $ac_status); }; }; then
11202   cf_cv_func_mkstemp=yes
11203
11204 else
11205   echo "$as_me: program exited with status $ac_status" >&5
11206 echo "$as_me: failed program was:" >&5
11207 cat conftest.$ac_ext >&5
11208 cf_cv_func_mkstemp=no
11209
11210 fi
11211 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11212 fi
11213
11214 fi
11215 echo "$as_me:11215: result: $cf_cv_func_mkstemp" >&5
11216 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
11217 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
11218         echo "$as_me:11218: checking for mkstemp" >&5
11219 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
11220 if test "${ac_cv_func_mkstemp+set}" = set; then
11221   echo $ECHO_N "(cached) $ECHO_C" >&6
11222 else
11223   cat >conftest.$ac_ext <<_ACEOF
11224 #line 11224 "configure"
11225 #include "confdefs.h"
11226 /* System header to define __stub macros and hopefully few prototypes,
11227     which can conflict with char mkstemp (); below.  */
11228 #include <assert.h>
11229 /* Override any gcc2 internal prototype to avoid an error.  */
11230 #ifdef __cplusplus
11231 extern "C"
11232 #endif
11233 /* We use char because int might match the return type of a gcc2
11234    builtin and then its argument prototype would still apply.  */
11235 char mkstemp ();
11236 char (*f) ();
11237
11238 int
11239 main ()
11240 {
11241 /* The GNU C library defines this for functions which it implements
11242     to always fail with ENOSYS.  Some functions are actually named
11243     something starting with __ and the normal name is an alias.  */
11244 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
11245 choke me
11246 #else
11247 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11248 #endif
11249
11250   ;
11251   return 0;
11252 }
11253 _ACEOF
11254 rm -f conftest.$ac_objext conftest$ac_exeext
11255 if { (eval echo "$as_me:11255: \"$ac_link\"") >&5
11256   (eval $ac_link) 2>&5
11257   ac_status=$?
11258   echo "$as_me:11258: \$? = $ac_status" >&5
11259   (exit $ac_status); } &&
11260          { ac_try='test -s conftest$ac_exeext'
11261   { (eval echo "$as_me:11261: \"$ac_try\"") >&5
11262   (eval $ac_try) 2>&5
11263   ac_status=$?
11264   echo "$as_me:11264: \$? = $ac_status" >&5
11265   (exit $ac_status); }; }; then
11266   ac_cv_func_mkstemp=yes
11267 else
11268   echo "$as_me: failed program was:" >&5
11269 cat conftest.$ac_ext >&5
11270 ac_cv_func_mkstemp=no
11271 fi
11272 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11273 fi
11274 echo "$as_me:11274: result: $ac_cv_func_mkstemp" >&5
11275 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
11276
11277 fi
11278 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
11279
11280 cat >>confdefs.h <<\EOF
11281 #define HAVE_MKSTEMP 1
11282 EOF
11283
11284 fi
11285
11286 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
11287         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11288         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11289 fi
11290
11291 cf_with_ada=yes
11292 if test "$cf_with_ada" != "no" ; then
11293
11294 cf_ada_make=gnatmake
11295 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
11296 set dummy $cf_ada_make; ac_word=$2
11297 echo "$as_me:11297: checking for $ac_word" >&5
11298 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11299 if test "${ac_cv_prog_gnat_exists+set}" = set; then
11300   echo $ECHO_N "(cached) $ECHO_C" >&6
11301 else
11302   if test -n "$gnat_exists"; then
11303   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
11304 else
11305   ac_save_IFS=$IFS; IFS=$ac_path_separator
11306 ac_dummy="$PATH"
11307 for ac_dir in $ac_dummy; do
11308   IFS=$ac_save_IFS
11309   test -z "$ac_dir" && ac_dir=.
11310   $as_executable_p "$ac_dir/$ac_word" || continue
11311 ac_cv_prog_gnat_exists="yes"
11312 echo "$as_me:11312: found $ac_dir/$ac_word" >&5
11313 break
11314 done
11315
11316   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
11317 fi
11318 fi
11319 gnat_exists=$ac_cv_prog_gnat_exists
11320 if test -n "$gnat_exists"; then
11321   echo "$as_me:11321: result: $gnat_exists" >&5
11322 echo "${ECHO_T}$gnat_exists" >&6
11323 else
11324   echo "$as_me:11324: result: no" >&5
11325 echo "${ECHO_T}no" >&6
11326 fi
11327
11328 if test "$ac_cv_prog_gnat_exists" = no; then
11329    cf_ada_make=
11330    cf_cv_prog_gnat_correct=no
11331 else
11332
11333 echo "$as_me:11333: checking for gnat version" >&5
11334 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
11335 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
11336         grep '[0-9].[0-9][0-9]*' |\
11337     sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
11338 echo "$as_me:11338: result: $cf_gnat_version" >&5
11339 echo "${ECHO_T}$cf_gnat_version" >&6
11340
11341 case $cf_gnat_version in #(vi
11342 3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9]) #(vi
11343         cf_cv_prog_gnat_correct=yes
11344         ;;
11345 *)
11346         { echo "$as_me:11346: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
11347 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
11348         cf_cv_prog_gnat_correct=no
11349         ;;
11350 esac
11351
11352    # Extract the first word of "m4", so it can be a program name with args.
11353 set dummy m4; ac_word=$2
11354 echo "$as_me:11354: checking for $ac_word" >&5
11355 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11356 if test "${ac_cv_prog_M4_exists+set}" = set; then
11357   echo $ECHO_N "(cached) $ECHO_C" >&6
11358 else
11359   if test -n "$M4_exists"; then
11360   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
11361 else
11362   ac_save_IFS=$IFS; IFS=$ac_path_separator
11363 ac_dummy="$PATH"
11364 for ac_dir in $ac_dummy; do
11365   IFS=$ac_save_IFS
11366   test -z "$ac_dir" && ac_dir=.
11367   $as_executable_p "$ac_dir/$ac_word" || continue
11368 ac_cv_prog_M4_exists="yes"
11369 echo "$as_me:11369: found $ac_dir/$ac_word" >&5
11370 break
11371 done
11372
11373   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
11374 fi
11375 fi
11376 M4_exists=$ac_cv_prog_M4_exists
11377 if test -n "$M4_exists"; then
11378   echo "$as_me:11378: result: $M4_exists" >&5
11379 echo "${ECHO_T}$M4_exists" >&6
11380 else
11381   echo "$as_me:11381: result: no" >&5
11382 echo "${ECHO_T}no" >&6
11383 fi
11384
11385    if test "$ac_cv_prog_M4_exists" = no; then
11386       cf_cv_prog_gnat_correct=no
11387       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
11388    fi
11389    if test "$cf_cv_prog_gnat_correct" = yes; then
11390       echo "$as_me:11390: checking if GNAT works" >&5
11391 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
11392
11393 rm -rf conftest* *~conftest*
11394 cat >>conftest.ads <<CF_EOF
11395 procedure conftest;
11396 CF_EOF
11397 cat >>conftest.adb <<CF_EOF
11398 with Text_IO;
11399 with GNAT.OS_Lib;
11400 procedure conftest is
11401 begin
11402    Text_IO.Put ("Hello World");
11403    Text_IO.New_Line;
11404    GNAT.OS_Lib.OS_Exit (0);
11405 end conftest;
11406 CF_EOF
11407 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11408    if ( ./conftest 1>&5 2>&1 ) ; then
11409       cf_cv_prog_gnat_correct=yes
11410    else
11411       cf_cv_prog_gnat_correct=no
11412    fi
11413 else
11414    cf_cv_prog_gnat_correct=no
11415 fi
11416 rm -rf conftest* *~conftest*
11417
11418       echo "$as_me:11418: result: $cf_cv_prog_gnat_correct" >&5
11419 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
11420    fi
11421 fi
11422
11423         if test "$cf_cv_prog_gnat_correct" = yes; then
11424
11425         echo "$as_me:11425: checking optimization options for ADAFLAGS" >&5
11426 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
11427         case "$CFLAGS" in
11428         *-g*)
11429
11430         ADAFLAGS="$ADAFLAGS -g"
11431
11432                 ;;
11433         esac
11434         case "$CFLAGS" in
11435         *-O*)
11436                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
11437
11438         ADAFLAGS="$ADAFLAGS $cf_O_flag"
11439
11440                 ;;
11441         esac
11442         echo "$as_me:11442: result: $ADAFLAGS" >&5
11443 echo "${ECHO_T}$ADAFLAGS" >&6
11444
11445 echo "$as_me:11445: checking if GNAT supports generics" >&5
11446 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
11447 case $cf_gnat_version in #(vi
11448 3.[1-9]*|[4-9].*) #(vi
11449         cf_gnat_generics=yes
11450         ;;
11451 *)
11452         cf_gnat_generics=no
11453         ;;
11454 esac
11455 echo "$as_me:11455: result: $cf_gnat_generics" >&5
11456 echo "${ECHO_T}$cf_gnat_generics" >&6
11457
11458 if test "$cf_gnat_generics" = yes
11459 then
11460         cf_compile_generics=generics
11461         cf_generic_objects="\${GENOBJS}"
11462 else
11463         cf_compile_generics=
11464         cf_generic_objects=
11465 fi
11466
11467 echo "$as_me:11467: checking if GNAT supports SIGINT" >&5
11468 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
11469 if test "${cf_cv_gnat_sigint+set}" = set; then
11470   echo $ECHO_N "(cached) $ECHO_C" >&6
11471 else
11472
11473 rm -rf conftest* *~conftest*
11474 cat >>conftest.ads <<CF_EOF
11475 with Ada.Interrupts.Names;
11476
11477 package ConfTest is
11478
11479    pragma Warnings (Off);  --  the next pragma exists since 3.11p
11480    pragma Unreserve_All_Interrupts;
11481    pragma Warnings (On);
11482
11483    protected Process is
11484       procedure Stop;
11485       function Continue return Boolean;
11486       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
11487    private
11488       Done : Boolean := False;
11489    end Process;
11490
11491 end ConfTest;
11492 CF_EOF
11493 cat >>conftest.adb <<CF_EOF
11494 package body ConfTest is
11495    protected body Process is
11496       procedure Stop is
11497       begin
11498          Done := True;
11499       end Stop;
11500       function Continue return Boolean is
11501       begin
11502          return not Done;
11503       end Continue;
11504    end Process;
11505 end ConfTest;
11506 CF_EOF
11507 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11508       cf_cv_gnat_sigint=yes
11509 else
11510    cf_cv_gnat_sigint=no
11511 fi
11512 rm -rf conftest* *~conftest*
11513
11514 fi
11515 echo "$as_me:11515: result: $cf_cv_gnat_sigint" >&5
11516 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
11517
11518 if test $cf_cv_gnat_sigint = yes ; then
11519         USE_GNAT_SIGINT=""
11520 else
11521         USE_GNAT_SIGINT="#"
11522 fi
11523
11524 cf_gnat_libraries=no
11525 cf_gnat_projects=no
11526
11527 if test "$enable_gnat_projects" != no ; then
11528 echo "$as_me:11528: checking if GNAT supports project files" >&5
11529 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
11530 case $cf_gnat_version in #(vi
11531 3.[0-9]*) #(vi
11532         ;;
11533 *)
11534         case $cf_cv_system_name in #(vi
11535         cygwin*|msys*) #(vi
11536                 ;;
11537         *)
11538                 mkdir conftest.src conftest.bin conftest.lib
11539                 cd conftest.src
11540                 rm -rf conftest* *~conftest*
11541                 cat >>library.gpr <<CF_EOF
11542 project Library is
11543   Kind := External ("LIB_KIND");
11544   for Library_Name use "ConfTest";
11545   for Object_Dir use ".";
11546   for Library_ALI_Dir use External("LIBRARY_DIR");
11547   for Library_Version use External ("SONAME");
11548   for Library_Kind use Kind;
11549   for Library_Dir use External("BUILD_DIR");
11550   Source_Dir := External ("SOURCE_DIR");
11551   for Source_Dirs use (Source_Dir);
11552 end Library;
11553 CF_EOF
11554                 cat >>confpackage.ads <<CF_EOF
11555 package ConfPackage is
11556    procedure conftest;
11557 end ConfPackage;
11558 CF_EOF
11559                 cat >>confpackage.adb <<CF_EOF
11560 with Text_IO;
11561 package body ConfPackage is
11562    procedure conftest is
11563    begin
11564       Text_IO.Put ("Hello World");
11565       Text_IO.New_Line;
11566    end conftest;
11567 end ConfPackage;
11568 CF_EOF
11569                 if ( $cf_ada_make $ADAFLAGS \
11570                                 -Plibrary.gpr \
11571                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
11572                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
11573                                 -XSOURCE_DIR=`pwd` \
11574                                 -XSONAME=libConfTest.so.1 \
11575                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
11576                         cf_gnat_projects=yes
11577                 fi
11578                 cd ..
11579                 if test -f conftest.lib/confpackage.ali
11580                 then
11581                         cf_gnat_libraries=yes
11582                 fi
11583                 rm -rf conftest* *~conftest*
11584                 ;;
11585         esac
11586         ;;
11587 esac
11588 echo "$as_me:11588: result: $cf_gnat_projects" >&5
11589 echo "${ECHO_T}$cf_gnat_projects" >&6
11590 fi # enable_gnat_projects
11591
11592 if test $cf_gnat_projects = yes
11593 then
11594         echo "$as_me:11594: checking if GNAT supports libraries" >&5
11595 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
11596         echo "$as_me:11596: result: $cf_gnat_libraries" >&5
11597 echo "${ECHO_T}$cf_gnat_libraries" >&6
11598 fi
11599
11600 if test "$cf_gnat_projects" = yes
11601 then
11602         USE_OLD_MAKERULES="#"
11603         USE_GNAT_PROJECTS=""
11604 else
11605         USE_OLD_MAKERULES=""
11606         USE_GNAT_PROJECTS="#"
11607 fi
11608
11609 if test "$cf_gnat_libraries" = yes
11610 then
11611         USE_GNAT_LIBRARIES=""
11612 else
11613         USE_GNAT_LIBRARIES="#"
11614 fi
11615
11616 echo "$as_me:11616: checking for ada-compiler" >&5
11617 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
11618
11619 # Check whether --with-ada-compiler or --without-ada-compiler was given.
11620 if test "${with_ada_compiler+set}" = set; then
11621   withval="$with_ada_compiler"
11622   cf_ada_compiler=$withval
11623 else
11624   cf_ada_compiler=gnatmake
11625 fi;
11626
11627 echo "$as_me:11627: result: $cf_ada_compiler" >&5
11628 echo "${ECHO_T}$cf_ada_compiler" >&6
11629
11630                 cf_ada_package=terminal_interface
11631
11632 echo "$as_me:11632: checking for ada-include" >&5
11633 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
11634
11635 # Check whether --with-ada-include or --without-ada-include was given.
11636 if test "${with_ada_include+set}" = set; then
11637   withval="$with_ada_include"
11638
11639 else
11640   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
11641 fi; if test -n "$prefix/share/ada/adainclude" ; then
11642
11643 if test "x$prefix" != xNONE; then
11644   cf_path_syntax="$prefix"
11645 else
11646   cf_path_syntax="$ac_default_prefix"
11647 fi
11648
11649 case ".$withval" in #(vi
11650 .\$\(*\)*|.\'*\'*) #(vi
11651   ;;
11652 ..|./*|.\\*) #(vi
11653   ;;
11654 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11655   ;;
11656 .\${*prefix}*|.\${*dir}*) #(vi
11657   eval withval="$withval"
11658   case ".$withval" in #(vi
11659   .NONE/*)
11660     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11661     ;;
11662   esac
11663   ;; #(vi
11664 .no|.NONE/*)
11665   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11666   ;;
11667 *)
11668   { { echo "$as_me:11668: error: expected a pathname, not \"$withval\"" >&5
11669 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11670    { (exit 1); exit 1; }; }
11671   ;;
11672 esac
11673
11674 fi
11675 eval ADA_INCLUDE="$withval"
11676
11677 echo "$as_me:11677: result: $ADA_INCLUDE" >&5
11678 echo "${ECHO_T}$ADA_INCLUDE" >&6
11679
11680 echo "$as_me:11680: checking for ada-objects" >&5
11681 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
11682
11683 # Check whether --with-ada-objects or --without-ada-objects was given.
11684 if test "${with_ada_objects+set}" = set; then
11685   withval="$with_ada_objects"
11686
11687 else
11688   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
11689 fi; if test -n "$prefix/lib/ada/adalib" ; then
11690
11691 if test "x$prefix" != xNONE; then
11692   cf_path_syntax="$prefix"
11693 else
11694   cf_path_syntax="$ac_default_prefix"
11695 fi
11696
11697 case ".$withval" in #(vi
11698 .\$\(*\)*|.\'*\'*) #(vi
11699   ;;
11700 ..|./*|.\\*) #(vi
11701   ;;
11702 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11703   ;;
11704 .\${*prefix}*|.\${*dir}*) #(vi
11705   eval withval="$withval"
11706   case ".$withval" in #(vi
11707   .NONE/*)
11708     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11709     ;;
11710   esac
11711   ;; #(vi
11712 .no|.NONE/*)
11713   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11714   ;;
11715 *)
11716   { { echo "$as_me:11716: error: expected a pathname, not \"$withval\"" >&5
11717 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11718    { (exit 1); exit 1; }; }
11719   ;;
11720 esac
11721
11722 fi
11723 eval ADA_OBJECTS="$withval"
11724
11725 echo "$as_me:11725: result: $ADA_OBJECTS" >&5
11726 echo "${ECHO_T}$ADA_OBJECTS" >&6
11727
11728 echo "$as_me:11728: checking if an Ada95 shared-library should be built" >&5
11729 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
11730
11731 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
11732 if test "${with_ada_sharedlib+set}" = set; then
11733   withval="$with_ada_sharedlib"
11734   with_ada_sharedlib=$withval
11735 else
11736   with_ada_sharedlib=no
11737 fi;
11738 echo "$as_me:11738: result: $with_ada_sharedlib" >&5
11739 echo "${ECHO_T}$with_ada_sharedlib" >&6
11740
11741 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
11742 MAKE_ADA_SHAREDLIB="#"
11743
11744 if test "x$with_ada_sharedlib" != xno
11745 then
11746         MAKE_ADA_SHAREDLIB=
11747         if test "x$with_ada_sharedlib" != xyes
11748         then
11749                 ADA_SHAREDLIB="$with_ada_sharedlib"
11750         fi
11751 fi
11752
11753         else
11754                 { { echo "$as_me:11754: error: No usable Ada compiler found" >&5
11755 echo "$as_me: error: No usable Ada compiler found" >&2;}
11756    { (exit 1); exit 1; }; }
11757         fi
11758 else
11759         { { echo "$as_me:11759: error: The Ada compiler is needed for this package" >&5
11760 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
11761    { (exit 1); exit 1; }; }
11762 fi
11763
11764 ################################################################################
11765
11766 # not needed
11767 TINFO_LDFLAGS2=
11768
11769 TINFO_LIBS=
11770
11771 ### Construct the list of include-directories to be generated
11772
11773 if test "$GCC" != yes; then
11774         CPPFLAGS="-I\${includedir} $CPPFLAGS"
11775 elif test "$includedir" != "/usr/include"; then
11776         if test "$includedir" = '${prefix}/include' ; then
11777                 if test x$prefix != x/usr ; then
11778                         CPPFLAGS="-I\${includedir} $CPPFLAGS"
11779                 fi
11780         else
11781                 CPPFLAGS="-I\${includedir} $CPPFLAGS"
11782         fi
11783 fi
11784 if test "$srcdir" != "."; then
11785         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
11786 fi
11787 CPPFLAGS="-I. -I../include $CPPFLAGS"
11788
11789 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
11790 if test "$srcdir" != "."; then
11791         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
11792 fi
11793 if test "$GCC" != yes; then
11794         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11795 elif test "$includedir" != "/usr/include"; then
11796         if test "$includedir" = '${prefix}/include' ; then
11797                 if test x$prefix != x/usr ; then
11798                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11799                 fi
11800         else
11801                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11802         fi
11803 fi
11804
11805 ### Build up pieces for makefile rules
11806 echo "$as_me:11806: checking default library suffix" >&5
11807 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
11808
11809         case $DFT_LWR_MODEL in
11810         libtool) DFT_ARG_SUFFIX=''   ;;
11811         normal)  DFT_ARG_SUFFIX=''   ;;
11812         debug)   DFT_ARG_SUFFIX='_g' ;;
11813         profile) DFT_ARG_SUFFIX='_p' ;;
11814         shared)  DFT_ARG_SUFFIX=''   ;;
11815         esac
11816         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
11817 echo "$as_me:11817: result: $DFT_ARG_SUFFIX" >&5
11818 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
11819
11820 echo "$as_me:11820: checking default library-dependency suffix" >&5
11821 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
11822
11823         case X$DFT_LWR_MODEL in #(vi
11824         Xlibtool) #(vi
11825                 DFT_LIB_SUFFIX='.la'
11826                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11827                 ;;
11828         Xdebug) #(vi
11829                 DFT_LIB_SUFFIX='_g.a'
11830                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11831                 ;;
11832         Xprofile) #(vi
11833                 DFT_LIB_SUFFIX='_p.a'
11834                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11835                 ;;
11836         Xshared) #(vi
11837                 case $cf_cv_system_name in
11838                 aix[5-7]*) #(vi
11839                         DFT_LIB_SUFFIX='.so'
11840                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11841                         ;;
11842                 cygwin*|msys*|mingw*) #(vi
11843                         DFT_LIB_SUFFIX='.dll'
11844                         DFT_DEP_SUFFIX='.dll.a'
11845                         ;;
11846                 darwin*) #(vi
11847                         DFT_LIB_SUFFIX='.dylib'
11848                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11849                         ;;
11850                 hpux*) #(vi
11851                         case $target in
11852                         ia64*) #(vi
11853                                 DFT_LIB_SUFFIX='.so'
11854                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11855                                 ;;
11856                         *) #(vi
11857                                 DFT_LIB_SUFFIX='.sl'
11858                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11859                                 ;;
11860                         esac
11861                         ;;
11862                 *) #(vi
11863                         DFT_LIB_SUFFIX='.so'
11864                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11865                         ;;
11866                 esac
11867                 ;;
11868         *)
11869                 DFT_LIB_SUFFIX='.a'
11870                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11871                 ;;
11872         esac
11873         test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
11874         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
11875 echo "$as_me:11875: result: $DFT_DEP_SUFFIX" >&5
11876 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
11877
11878 echo "$as_me:11878: checking default object directory" >&5
11879 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
11880
11881         case $DFT_LWR_MODEL in
11882         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
11883         normal)  DFT_OBJ_SUBDIR='objects' ;;
11884         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
11885         profile) DFT_OBJ_SUBDIR='obj_p' ;;
11886         shared)
11887                 case $cf_cv_system_name in #(vi
11888                 cygwin|msys) #(vi
11889                         DFT_OBJ_SUBDIR='objects' ;;
11890                 *)
11891                         DFT_OBJ_SUBDIR='obj_s' ;;
11892                 esac
11893         esac
11894 echo "$as_me:11894: result: $DFT_OBJ_SUBDIR" >&5
11895 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
11896
11897 ### Set up low-level terminfo dependencies for makefiles.
11898
11899 if test "$DFT_LWR_MODEL" = shared ; then
11900         case $cf_cv_system_name in #(vi
11901         cygwin*)
11902                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
11903                 ;;
11904         msys*)
11905                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
11906                 ;;
11907         esac
11908 fi
11909
11910 ### Construct the list of subdirectories for which we'll customize makefiles
11911 ### with the appropriate compile-rules.
11912
11913 SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
11914
11915 cat >>confdefs.h <<EOF
11916 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
11917 EOF
11918
11919 ### Now that we're done running tests, add the compiler-warnings, if any
11920
11921 cf_fix_cppflags=no
11922 cf_new_cflags=
11923 cf_new_cppflags=
11924 cf_new_extra_cppflags=
11925
11926 for cf_add_cflags in $EXTRA_CFLAGS
11927 do
11928 case $cf_fix_cppflags in
11929 no)
11930         case $cf_add_cflags in #(vi
11931         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11932                 case $cf_add_cflags in
11933                 -D*)
11934                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11935
11936                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11937                                 && test -z "${cf_tst_cflags}" \
11938                                 && cf_fix_cppflags=yes
11939
11940                         if test $cf_fix_cppflags = yes ; then
11941                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11942                                 continue
11943                         elif test "${cf_tst_cflags}" = "\"'" ; then
11944                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11945                                 continue
11946                         fi
11947                         ;;
11948                 esac
11949                 case "$CPPFLAGS" in
11950                 *$cf_add_cflags) #(vi
11951                         ;;
11952                 *) #(vi
11953                         case $cf_add_cflags in #(vi
11954                         -D*)
11955                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11956
11957 CPPFLAGS=`echo "$CPPFLAGS" | \
11958         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11959                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11960
11961                                 ;;
11962                         esac
11963                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11964                         ;;
11965                 esac
11966                 ;;
11967         *)
11968                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11969                 ;;
11970         esac
11971         ;;
11972 yes)
11973         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11974
11975         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11976
11977         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11978                 && test -z "${cf_tst_cflags}" \
11979                 && cf_fix_cppflags=no
11980         ;;
11981 esac
11982 done
11983
11984 if test -n "$cf_new_cflags" ; then
11985
11986         CFLAGS="$CFLAGS $cf_new_cflags"
11987 fi
11988
11989 if test -n "$cf_new_cppflags" ; then
11990
11991         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11992 fi
11993
11994 if test -n "$cf_new_extra_cppflags" ; then
11995
11996         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11997 fi
11998
11999 ################################################################################
12000
12001 TEST_ARG2=
12002
12003 TEST_LIBS2=
12004
12005 NCURSES_SHLIB2="sh -c"
12006
12007 ADA_SUBDIRS="include gen src doc"
12008 if test "x$cf_with_tests" != "xno" ; then
12009         ADA_SUBDIRS="$ADA_SUBDIRS samples"
12010 fi
12011 for cf_dir in $ADA_SUBDIRS
12012 do
12013         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
12014 done
12015
12016 NCURSES_TREE="#"
12017
12018 EXTERNAL_TREE=
12019
12020 # match layout used by make-tar.sh
12021 ADAHTML_DIR=../doc/ada
12022
12023 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
12024 ac_config_commands="$ac_config_commands default"
12025 cat >confcache <<\_ACEOF
12026 # This file is a shell script that caches the results of configure
12027 # tests run on this system so they can be shared between configure
12028 # scripts and configure runs, see configure's option --config-cache.
12029 # It is not useful on other systems.  If it contains results you don't
12030 # want to keep, you may remove or edit it.
12031 #
12032 # config.status only pays attention to the cache file if you give it
12033 # the --recheck option to rerun configure.
12034 #
12035 # `ac_cv_env_foo' variables (set or unset) will be overriden when
12036 # loading this file, other *unset* `ac_cv_foo' will be assigned the
12037 # following values.
12038
12039 _ACEOF
12040
12041 # The following way of writing the cache mishandles newlines in values,
12042 # but we know of no workaround that is simple, portable, and efficient.
12043 # So, don't put newlines in cache variables' values.
12044 # Ultrix sh set writes to stderr and can't be redirected directly,
12045 # and sets the high bit in the cache file unless we assign to the vars.
12046 {
12047   (set) 2>&1 |
12048     case `(ac_space=' '; set | grep ac_space) 2>&1` in
12049     *ac_space=\ *)
12050       # `set' does not quote correctly, so add quotes (double-quote
12051       # substitution turns \\\\ into \\, and sed turns \\ into \).
12052       sed -n \
12053         "s/'/'\\\\''/g;
12054           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
12055       ;;
12056     *)
12057       # `set' quotes correctly as required by POSIX, so do not add quotes.
12058       sed -n \
12059         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
12060       ;;
12061     esac;
12062 } |
12063   sed '
12064      t clear
12065      : clear
12066      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
12067      t end
12068      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
12069      : end' >>confcache
12070 if cmp -s $cache_file confcache; then :; else
12071   if test -w $cache_file; then
12072     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
12073     cat confcache >$cache_file
12074   else
12075     echo "not updating unwritable cache $cache_file"
12076   fi
12077 fi
12078 rm -f confcache
12079
12080 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12081 # Let make expand exec_prefix.
12082 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12083
12084 # VPATH may cause trouble with some makes, so we remove $(srcdir),
12085 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
12086 # trailing colons and then remove the whole line if VPATH becomes empty
12087 # (actually we leave an empty line to preserve line numbers).
12088 if test "x$srcdir" = x.; then
12089   ac_vpsub='/^[         ]*VPATH[        ]*=/{
12090 s/:*\$(srcdir):*/:/;
12091 s/:*\${srcdir}:*/:/;
12092 s/:*@srcdir@:*/:/;
12093 s/^\([^=]*=[    ]*\):*/\1/;
12094 s/:*$//;
12095 s/^[^=]*=[      ]*$//;
12096 }'
12097 fi
12098
12099 DEFS=-DHAVE_CONFIG_H
12100
12101 : ${CONFIG_STATUS=./config.status}
12102 ac_clean_files_save=$ac_clean_files
12103 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
12104 { echo "$as_me:12104: creating $CONFIG_STATUS" >&5
12105 echo "$as_me: creating $CONFIG_STATUS" >&6;}
12106 cat >$CONFIG_STATUS <<_ACEOF
12107 #! $SHELL
12108 # Generated automatically by configure.
12109 # Run this file to recreate the current configuration.
12110 # Compiler output produced by configure, useful for debugging
12111 # configure, is in config.log if it exists.
12112
12113 debug=false
12114 SHELL=\${CONFIG_SHELL-$SHELL}
12115 ac_cs_invocation="\$0 \$@"
12116
12117 _ACEOF
12118
12119 cat >>$CONFIG_STATUS <<\_ACEOF
12120 # Be Bourne compatible
12121 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
12122   emulate sh
12123   NULLCMD=:
12124 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
12125   set -o posix
12126 fi
12127
12128 # Name of the executable.
12129 as_me=`echo "$0" |sed 's,.*[\\/],,'`
12130
12131 if expr a : '\(a\)' >/dev/null 2>&1; then
12132   as_expr=expr
12133 else
12134   as_expr=false
12135 fi
12136
12137 rm -f conf$$ conf$$.exe conf$$.file
12138 echo >conf$$.file
12139 if ln -s conf$$.file conf$$ 2>/dev/null; then
12140   # We could just check for DJGPP; but this test a) works b) is more generic
12141   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
12142   if test -f conf$$.exe; then
12143     # Don't use ln at all; we don't have any links
12144     as_ln_s='cp -p'
12145   else
12146     as_ln_s='ln -s'
12147   fi
12148 elif ln conf$$.file conf$$ 2>/dev/null; then
12149   as_ln_s=ln
12150 else
12151   as_ln_s='cp -p'
12152 fi
12153 rm -f conf$$ conf$$.exe conf$$.file
12154
12155 as_executable_p="test -f"
12156
12157 # Support unset when possible.
12158 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
12159   as_unset=unset
12160 else
12161   as_unset=false
12162 fi
12163
12164 # NLS nuisances.
12165 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
12166 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
12167 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
12168 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
12169 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
12170 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
12171 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
12172 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
12173
12174 # IFS
12175 # We need space, tab and new line, in precisely that order.
12176 as_nl='
12177 '
12178 IFS="   $as_nl"
12179
12180 # CDPATH.
12181 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
12182
12183 exec 6>&1
12184
12185 _ACEOF
12186
12187 # Files that config.status was made for.
12188 if test -n "$ac_config_files"; then
12189   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
12190 fi
12191
12192 if test -n "$ac_config_headers"; then
12193   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
12194 fi
12195
12196 if test -n "$ac_config_links"; then
12197   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
12198 fi
12199
12200 if test -n "$ac_config_commands"; then
12201   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
12202 fi
12203
12204 cat >>$CONFIG_STATUS <<\EOF
12205
12206 ac_cs_usage="\
12207 \`$as_me' instantiates files from templates according to the
12208 current configuration.
12209
12210 Usage: $0 [OPTIONS] [FILE]...
12211
12212   -h, --help       print this help, then exit
12213   -V, --version    print version number, then exit
12214   -d, --debug      don't remove temporary files
12215       --recheck    update $as_me by reconfiguring in the same conditions
12216   --file=FILE[:TEMPLATE]
12217                    instantiate the configuration file FILE
12218   --header=FILE[:TEMPLATE]
12219                    instantiate the configuration header FILE
12220
12221 Configuration files:
12222 $config_files
12223
12224 Configuration headers:
12225 $config_headers
12226
12227 Configuration commands:
12228 $config_commands
12229
12230 Report bugs to <dickey@invisible-island.net>."
12231 EOF
12232
12233 cat >>$CONFIG_STATUS <<EOF
12234 ac_cs_version="\\
12235 config.status
12236 configured by $0, generated by GNU Autoconf 2.52.20121002,
12237   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
12238
12239 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
12240 Free Software Foundation, Inc.
12241 This config.status script is free software; the Free Software Foundation
12242 gives unlimited permission to copy, distribute and modify it."
12243 srcdir=$srcdir
12244 INSTALL="$INSTALL"
12245 EOF
12246
12247 cat >>$CONFIG_STATUS <<\EOF
12248 # If no file are specified by the user, then we need to provide default
12249 # value.  By we need to know if files were specified by the user.
12250 ac_need_defaults=:
12251 while test $# != 0
12252 do
12253   case $1 in
12254   --*=*)
12255     ac_option=`expr "x$1" : 'x\([^=]*\)='`
12256     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
12257     shift
12258     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
12259     shift
12260     ;;
12261   -*);;
12262   *) # This is not an option, so the user has probably given explicit
12263      # arguments.
12264      ac_need_defaults=false;;
12265   esac
12266
12267   case $1 in
12268   # Handling of the options.
12269 EOF
12270 cat >>$CONFIG_STATUS <<EOF
12271   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12272     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
12273     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
12274 EOF
12275 cat >>$CONFIG_STATUS <<\EOF
12276   --version | --vers* | -V )
12277     echo "$ac_cs_version"; exit 0 ;;
12278   --he | --h)
12279     # Conflict between --help and --header
12280     { { echo "$as_me:12280: error: ambiguous option: $1
12281 Try \`$0 --help' for more information." >&5
12282 echo "$as_me: error: ambiguous option: $1
12283 Try \`$0 --help' for more information." >&2;}
12284    { (exit 1); exit 1; }; };;
12285   --help | --hel | -h )
12286     echo "$ac_cs_usage"; exit 0 ;;
12287   --debug | --d* | -d )
12288     debug=: ;;
12289   --file | --fil | --fi | --f )
12290     shift
12291     CONFIG_FILES="$CONFIG_FILES $1"
12292     ac_need_defaults=false;;
12293   --header | --heade | --head | --hea )
12294     shift
12295     CONFIG_HEADERS="$CONFIG_HEADERS $1"
12296     ac_need_defaults=false;;
12297
12298   # This is an error.
12299   -*) { { echo "$as_me:12299: error: unrecognized option: $1
12300 Try \`$0 --help' for more information." >&5
12301 echo "$as_me: error: unrecognized option: $1
12302 Try \`$0 --help' for more information." >&2;}
12303    { (exit 1); exit 1; }; } ;;
12304
12305   *) ac_config_targets="$ac_config_targets $1" ;;
12306
12307   esac
12308   shift
12309 done
12310
12311 exec 5>>config.log
12312 cat >&5 << _ACEOF
12313
12314 ## ----------------------- ##
12315 ## Running config.status.  ##
12316 ## ----------------------- ##
12317
12318 This file was extended by $as_me 2.52.20121002, executed with
12319   CONFIG_FILES    = $CONFIG_FILES
12320   CONFIG_HEADERS  = $CONFIG_HEADERS
12321   CONFIG_LINKS    = $CONFIG_LINKS
12322   CONFIG_COMMANDS = $CONFIG_COMMANDS
12323   > $ac_cs_invocation
12324 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12325
12326 _ACEOF
12327 EOF
12328
12329 cat >>$CONFIG_STATUS <<EOF
12330 #
12331 # INIT-COMMANDS section.
12332 #
12333
12334 ### Special initialization commands, used to pass information from the
12335 ### configuration-run into config.status
12336
12337 AWK="$AWK"
12338 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
12339 DFT_LWR_MODEL="$DFT_LWR_MODEL"
12340 LIB_NAME="$LIB_NAME"
12341 LIB_PREFIX="$LIB_PREFIX"
12342 LIB_SUFFIX="$LIB_SUFFIX"
12343 LN_S="$LN_S"
12344 NCURSES_MAJOR="$NCURSES_MAJOR"
12345 NCURSES_MINOR="$NCURSES_MINOR"
12346 NCURSES_PATCH="$NCURSES_PATCH"
12347 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
12348 cf_cv_abi_version="$cf_cv_abi_version"
12349 cf_cv_rel_version="$cf_cv_rel_version"
12350 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
12351 cf_cv_shared_soname='$cf_cv_shared_soname'
12352 cf_cv_shlib_version="$cf_cv_shlib_version"
12353 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
12354 cf_cv_system_name="$cf_cv_system_name"
12355 host="$host"
12356 target="$target"
12357
12358 EOF
12359
12360 cat >>$CONFIG_STATUS <<\EOF
12361 for ac_config_target in $ac_config_targets
12362 do
12363   case "$ac_config_target" in
12364   # Handling of arguments.
12365   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
12366   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
12367   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
12368   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
12369   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
12370   *) { { echo "$as_me:12370: error: invalid argument: $ac_config_target" >&5
12371 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
12372    { (exit 1); exit 1; }; };;
12373   esac
12374 done
12375
12376 # If the user did not use the arguments to specify the items to instantiate,
12377 # then the envvar interface is used.  Set only those that are not.
12378 # We use the long form for the default assignment because of an extremely
12379 # bizarre bug on SunOS 4.1.3.
12380 if $ac_need_defaults; then
12381   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
12382   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
12383   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
12384 fi
12385
12386 # Create a temporary directory, and hook for its removal unless debugging.
12387 $debug ||
12388 {
12389   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
12390   trap '{ (exit 1); exit 1; }' 1 2 13 15
12391 }
12392
12393 # Create a (secure) tmp directory for tmp files.
12394 : ${TMPDIR=/tmp}
12395 {
12396   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
12397   test -n "$tmp" && test -d "$tmp"
12398 }  ||
12399 {
12400   tmp=$TMPDIR/cs$$-$RANDOM
12401   (umask 077 && mkdir $tmp)
12402 } ||
12403 {
12404    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
12405    { (exit 1); exit 1; }
12406 }
12407
12408 EOF
12409
12410 cat >>$CONFIG_STATUS <<EOF
12411
12412 #
12413 # CONFIG_FILES section.
12414 #
12415
12416 # No need to generate the scripts if there are no CONFIG_FILES.
12417 # This happens for instance when ./config.status config.h
12418 if test -n "\$CONFIG_FILES"; then
12419   # Protect against being on the right side of a sed subst in config.status.
12420   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
12421    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
12422 s,@SHELL@,$SHELL,;t t
12423 s,@exec_prefix@,$exec_prefix,;t t
12424 s,@prefix@,$prefix,;t t
12425 s,@program_transform_name@,$program_transform_name,;t t
12426 s,@bindir@,$bindir,;t t
12427 s,@sbindir@,$sbindir,;t t
12428 s,@libexecdir@,$libexecdir,;t t
12429 s,@datarootdir@,$datarootdir,;t t
12430 s,@datadir@,$datadir,;t t
12431 s,@sysconfdir@,$sysconfdir,;t t
12432 s,@sharedstatedir@,$sharedstatedir,;t t
12433 s,@localstatedir@,$localstatedir,;t t
12434 s,@libdir@,$libdir,;t t
12435 s,@includedir@,$includedir,;t t
12436 s,@oldincludedir@,$oldincludedir,;t t
12437 s,@infodir@,$infodir,;t t
12438 s,@mandir@,$mandir,;t t
12439 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
12440 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
12441 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
12442 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
12443 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
12444 s,@build_alias@,$build_alias,;t t
12445 s,@host_alias@,$host_alias,;t t
12446 s,@target_alias@,$target_alias,;t t
12447 s,@ECHO_C@,$ECHO_C,;t t
12448 s,@ECHO_N@,$ECHO_N,;t t
12449 s,@ECHO_T@,$ECHO_T,;t t
12450 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
12451 s,@DEFS@,$DEFS,;t t
12452 s,@LIBS@,$LIBS,;t t
12453 s,@top_builddir@,$top_builddir,;t t
12454 s,@build@,$build,;t t
12455 s,@build_cpu@,$build_cpu,;t t
12456 s,@build_vendor@,$build_vendor,;t t
12457 s,@build_os@,$build_os,;t t
12458 s,@host@,$host,;t t
12459 s,@host_cpu@,$host_cpu,;t t
12460 s,@host_vendor@,$host_vendor,;t t
12461 s,@host_os@,$host_os,;t t
12462 s,@target@,$target,;t t
12463 s,@target_cpu@,$target_cpu,;t t
12464 s,@target_vendor@,$target_vendor,;t t
12465 s,@target_os@,$target_os,;t t
12466 s,@CC@,$CC,;t t
12467 s,@CFLAGS@,$CFLAGS,;t t
12468 s,@LDFLAGS@,$LDFLAGS,;t t
12469 s,@CPPFLAGS@,$CPPFLAGS,;t t
12470 s,@ac_ct_CC@,$ac_ct_CC,;t t
12471 s,@EXEEXT@,$EXEEXT,;t t
12472 s,@OBJEXT@,$OBJEXT,;t t
12473 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
12474 s,@CPP@,$CPP,;t t
12475 s,@AWK@,$AWK,;t t
12476 s,@EGREP@,$EGREP,;t t
12477 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
12478 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
12479 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
12480 s,@LN_S@,$LN_S,;t t
12481 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
12482 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
12483 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
12484 s,@SET_MAKE@,$SET_MAKE,;t t
12485 s,@CTAGS@,$CTAGS,;t t
12486 s,@ETAGS@,$ETAGS,;t t
12487 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
12488 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
12489 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
12490 s,@RANLIB@,$RANLIB,;t t
12491 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
12492 s,@LD@,$LD,;t t
12493 s,@ac_ct_LD@,$ac_ct_LD,;t t
12494 s,@AR@,$AR,;t t
12495 s,@ac_ct_AR@,$ac_ct_AR,;t t
12496 s,@ARFLAGS@,$ARFLAGS,;t t
12497 s,@DESTDIR@,$DESTDIR,;t t
12498 s,@BUILD_CC@,$BUILD_CC,;t t
12499 s,@BUILD_CPP@,$BUILD_CPP,;t t
12500 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
12501 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
12502 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
12503 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
12504 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
12505 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
12506 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
12507 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
12508 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
12509 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
12510 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
12511 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
12512 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
12513 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
12514 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
12515 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
12516 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
12517 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
12518 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
12519 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
12520 s,@CC_G_OPT@,$CC_G_OPT,;t t
12521 s,@LD_MODEL@,$LD_MODEL,;t t
12522 s,@shlibdir@,$shlibdir,;t t
12523 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
12524 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
12525 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
12526 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
12527 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
12528 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
12529 s,@LINK_PROGS@,$LINK_PROGS,;t t
12530 s,@LINK_TESTS@,$LINK_TESTS,;t t
12531 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
12532 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
12533 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
12534 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
12535 s,@RPATH_LIST@,$RPATH_LIST,;t t
12536 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
12537 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
12538 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
12539 s,@PTHREAD@,$PTHREAD,;t t
12540 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
12541 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
12542 s,@ECHO_LT@,$ECHO_LT,;t t
12543 s,@ECHO_LD@,$ECHO_LD,;t t
12544 s,@RULE_CC@,$RULE_CC,;t t
12545 s,@SHOW_CC@,$SHOW_CC,;t t
12546 s,@ECHO_CC@,$ECHO_CC,;t t
12547 s,@ADAFLAGS@,$ADAFLAGS,;t t
12548 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
12549 s,@ADA_TRACE@,$ADA_TRACE,;t t
12550 s,@gnat_exists@,$gnat_exists,;t t
12551 s,@M4_exists@,$M4_exists,;t t
12552 s,@cf_ada_make@,$cf_ada_make,;t t
12553 s,@cf_compile_generics@,$cf_compile_generics,;t t
12554 s,@cf_generic_objects@,$cf_generic_objects,;t t
12555 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
12556 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
12557 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
12558 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
12559 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
12560 s,@cf_ada_package@,$cf_ada_package,;t t
12561 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
12562 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
12563 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
12564 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
12565 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
12566 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
12567 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
12568 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
12569 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
12570 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
12571 s,@TEST_ARG2@,$TEST_ARG2,;t t
12572 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
12573 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
12574 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
12575 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
12576 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
12577 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
12578 CEOF
12579
12580 EOF
12581
12582   cat >>$CONFIG_STATUS <<\EOF
12583   # Split the substitutions into bite-sized pieces for seds with
12584   # small command number limits, like on Digital OSF/1 and HP-UX.
12585   ac_max_sed_lines=48
12586   ac_sed_frag=1 # Number of current file.
12587   ac_beg=1 # First line for current file.
12588   ac_end=$ac_max_sed_lines # Line after last line for current file.
12589   ac_more_lines=:
12590   ac_sed_cmds=
12591   while $ac_more_lines; do
12592     if test $ac_beg -gt 1; then
12593       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12594     else
12595       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12596     fi
12597     if test ! -s $tmp/subs.frag; then
12598       ac_more_lines=false
12599     else
12600       # The purpose of the label and of the branching condition is to
12601       # speed up the sed processing (if there are no `@' at all, there
12602       # is no need to browse any of the substitutions).
12603       # These are the two extra sed commands mentioned above.
12604       (echo ':t
12605   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
12606       if test -z "$ac_sed_cmds"; then
12607         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
12608       else
12609         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
12610       fi
12611       ac_sed_frag=`expr $ac_sed_frag + 1`
12612       ac_beg=$ac_end
12613       ac_end=`expr $ac_end + $ac_max_sed_lines`
12614     fi
12615   done
12616   if test -z "$ac_sed_cmds"; then
12617     ac_sed_cmds=cat
12618   fi
12619 fi # test -n "$CONFIG_FILES"
12620
12621 EOF
12622 cat >>$CONFIG_STATUS <<\EOF
12623 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12624   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12625   case $ac_file in
12626   - | *:- | *:-:* ) # input from stdin
12627         cat >$tmp/stdin
12628         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12629         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12630   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12631         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12632   * )   ac_file_in=$ac_file.in ;;
12633   esac
12634
12635   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12636   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12637          X"$ac_file" : 'X\(//\)[^/]' \| \
12638          X"$ac_file" : 'X\(//\)$' \| \
12639          X"$ac_file" : 'X\(/\)' \| \
12640          .     : '\(.\)' 2>/dev/null ||
12641 echo X"$ac_file" |
12642     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12643           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12644           /^X\(\/\/\)$/{ s//\1/; q; }
12645           /^X\(\/\).*/{ s//\1/; q; }
12646           s/.*/./; q'`
12647   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12648     { case "$ac_dir" in
12649   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12650   *)                      as_incr_dir=.;;
12651 esac
12652 as_dummy="$ac_dir"
12653 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12654   case $as_mkdir_dir in
12655     # Skip DOS drivespec
12656     ?:) as_incr_dir=$as_mkdir_dir ;;
12657     *)
12658       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12659       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12660     ;;
12661   esac
12662 done; }
12663
12664     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
12665     # A "../" for each directory in $ac_dir_suffix.
12666     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
12667   else
12668     ac_dir_suffix= ac_dots=
12669   fi
12670
12671   case $srcdir in
12672   .)  ac_srcdir=.
12673       if test -z "$ac_dots"; then
12674          ac_top_srcdir=.
12675       else
12676          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
12677       fi ;;
12678   [\\/]* | ?:[\\/]* )
12679       ac_srcdir=$srcdir$ac_dir_suffix;
12680       ac_top_srcdir=$srcdir ;;
12681   *) # Relative path.
12682     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
12683     ac_top_srcdir=$ac_dots$srcdir ;;
12684   esac
12685
12686   case $INSTALL in
12687   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
12688   *) ac_INSTALL=$ac_dots$INSTALL ;;
12689   esac
12690
12691   if test x"$ac_file" != x-; then
12692     { echo "$as_me:12692: creating $ac_file" >&5
12693 echo "$as_me: creating $ac_file" >&6;}
12694     rm -f "$ac_file"
12695   fi
12696   # Let's still pretend it is `configure' which instantiates (i.e., don't
12697   # use $as_me), people would be surprised to read:
12698   #    /* config.h.  Generated automatically by config.status.  */
12699   configure_input="Generated automatically from `echo $ac_file_in |
12700                                                  sed 's,.*/,,'` by configure."
12701
12702   # First look for the input files in the build tree, otherwise in the
12703   # src tree.
12704   ac_file_inputs=`IFS=:
12705     for f in $ac_file_in; do
12706       case $f in
12707       -) echo $tmp/stdin ;;
12708       [\\/$]*)
12709          # Absolute (can't be DOS-style, as IFS=:)
12710          test -f "$f" || { { echo "$as_me:12710: error: cannot find input file: $f" >&5
12711 echo "$as_me: error: cannot find input file: $f" >&2;}
12712    { (exit 1); exit 1; }; }
12713          echo $f;;
12714       *) # Relative
12715          if test -f "$f"; then
12716            # Build tree
12717            echo $f
12718          elif test -f "$srcdir/$f"; then
12719            # Source tree
12720            echo $srcdir/$f
12721          else
12722            # /dev/null tree
12723            { { echo "$as_me:12723: error: cannot find input file: $f" >&5
12724 echo "$as_me: error: cannot find input file: $f" >&2;}
12725    { (exit 1); exit 1; }; }
12726          fi;;
12727       esac
12728     done` || { (exit 1); exit 1; }
12729 EOF
12730 cat >>$CONFIG_STATUS <<\EOF
12731   ac_warn_datarootdir=no
12732   if test x"$ac_file" != x-; then
12733     for ac_item in $ac_file_inputs
12734     do
12735       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
12736       if test -n "$ac_seen"; then
12737         ac_used=`grep '@datarootdir@' $ac_item`
12738         if test -z "$ac_used"; then
12739           { echo "$as_me:12739: WARNING: datarootdir was used implicitly but not set:
12740 $ac_seen" >&5
12741 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
12742 $ac_seen" >&2;}
12743           ac_warn_datarootdir=yes
12744         fi
12745       fi
12746       ac_seen=`grep '${datarootdir}' $ac_item`
12747       if test -n "$ac_seen"; then
12748         { echo "$as_me:12748: WARNING: datarootdir was used explicitly but not set:
12749 $ac_seen" >&5
12750 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
12751 $ac_seen" >&2;}
12752         ac_warn_datarootdir=yes
12753       fi
12754     done
12755   fi
12756
12757 if test "x$ac_warn_datarootdir" = xyes; then
12758   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
12759 fi
12760
12761 EOF
12762 cat >>$CONFIG_STATUS <<EOF
12763   sed "$ac_vpsub
12764 $extrasub
12765 EOF
12766 cat >>$CONFIG_STATUS <<\EOF
12767 :t
12768 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
12769 s,@configure_input@,$configure_input,;t t
12770 s,@srcdir@,$ac_srcdir,;t t
12771 s,@top_srcdir@,$ac_top_srcdir,;t t
12772 s,@INSTALL@,$ac_INSTALL,;t t
12773 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
12774   rm -f $tmp/stdin
12775   if test x"$ac_file" != x-; then
12776     cp $tmp/out $ac_file
12777
12778     for ac_name in prefix exec_prefix datarootdir
12779     do
12780         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
12781         if test -n "$ac_seen"; then
12782             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
12783             if test -z "$ac_init"; then
12784               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
12785               { echo "$as_me:12785: WARNING: Variable $ac_name is used but was not set:
12786 $ac_seen" >&5
12787 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
12788 $ac_seen" >&2;}
12789             fi
12790         fi
12791     done
12792     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
12793     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
12794     if test -s $tmp/out; then
12795       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
12796       { echo "$as_me:12796: WARNING: Some variables may not be substituted:
12797 $ac_seen" >&5
12798 echo "$as_me: WARNING: Some variables may not be substituted:
12799 $ac_seen" >&2;}
12800     fi
12801   else
12802     cat $tmp/out
12803   fi
12804   rm -f $tmp/out
12805
12806 done
12807 EOF
12808 cat >>$CONFIG_STATUS <<\EOF
12809
12810 #
12811 # CONFIG_HEADER section.
12812 #
12813
12814 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12815 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12816 #
12817 # ac_d sets the value in "#define NAME VALUE" lines.
12818 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12819 ac_dB='[        ].*$,\1#\2'
12820 ac_dC=' '
12821 ac_dD=',;t'
12822 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12823 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12824 ac_iB='\([      ]\),\1#\2define\3'
12825 ac_iC=' '
12826 ac_iD='\4,;t'
12827 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12828 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12829 ac_uB='$,\1#\2define\3'
12830 ac_uC=' '
12831 ac_uD=',;t'
12832
12833 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
12834   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12835   case $ac_file in
12836   - | *:- | *:-:* ) # input from stdin
12837         cat >$tmp/stdin
12838         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12839         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12840   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12841         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12842   * )   ac_file_in=$ac_file.in ;;
12843   esac
12844
12845   test x"$ac_file" != x- && { echo "$as_me:12845: creating $ac_file" >&5
12846 echo "$as_me: creating $ac_file" >&6;}
12847
12848   # First look for the input files in the build tree, otherwise in the
12849   # src tree.
12850   ac_file_inputs=`IFS=:
12851     for f in $ac_file_in; do
12852       case $f in
12853       -) echo $tmp/stdin ;;
12854       [\\/$]*)
12855          # Absolute (can't be DOS-style, as IFS=:)
12856          test -f "$f" || { { echo "$as_me:12856: error: cannot find input file: $f" >&5
12857 echo "$as_me: error: cannot find input file: $f" >&2;}
12858    { (exit 1); exit 1; }; }
12859          echo $f;;
12860       *) # Relative
12861          if test -f "$f"; then
12862            # Build tree
12863            echo $f
12864          elif test -f "$srcdir/$f"; then
12865            # Source tree
12866            echo $srcdir/$f
12867          else
12868            # /dev/null tree
12869            { { echo "$as_me:12869: error: cannot find input file: $f" >&5
12870 echo "$as_me: error: cannot find input file: $f" >&2;}
12871    { (exit 1); exit 1; }; }
12872          fi;;
12873       esac
12874     done` || { (exit 1); exit 1; }
12875   # Remove the trailing spaces.
12876   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
12877
12878 EOF
12879
12880 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
12881 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
12882 # be either 'cat' or 'sort'.
12883 cat confdefs.h | uniq >conftest.vals
12884
12885 # Break up conftest.vals because some shells have a limit on
12886 # the size of here documents, and old seds have small limits too.
12887
12888 rm -f conftest.tail
12889 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
12890 while grep . conftest.vals >/dev/null
12891 do
12892   # Write chunks of a limited-size here document to conftest.frag.
12893   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
12894   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
12895   echo 'CEOF' >> $CONFIG_STATUS
12896   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12897   rm -f conftest.vals
12898   mv conftest.tail conftest.vals
12899 done
12900 rm -f conftest.vals
12901
12902 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
12903 # marker @DEFS@.
12904 echo '  cat >> conftest.edit <<CEOF
12905 /@DEFS@/r conftest.frag
12906 /@DEFS@/d
12907 CEOF
12908 sed -f conftest.edit $tmp/in > $tmp/out
12909 rm -f $tmp/in
12910 mv $tmp/out $tmp/in
12911 rm -f conftest.edit conftest.frag
12912 ' >> $CONFIG_STATUS
12913
12914 cat >>$CONFIG_STATUS <<\EOF
12915   # Let's still pretend it is `configure' which instantiates (i.e., don't
12916   # use $as_me), people would be surprised to read:
12917   #    /* config.h.  Generated automatically by config.status.  */
12918   if test x"$ac_file" = x-; then
12919     echo "/* Generated automatically by configure.  */" >$tmp/config.h
12920   else
12921     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
12922   fi
12923   cat $tmp/in >>$tmp/config.h
12924   rm -f $tmp/in
12925   if test x"$ac_file" != x-; then
12926     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
12927       { echo "$as_me:12927: $ac_file is unchanged" >&5
12928 echo "$as_me: $ac_file is unchanged" >&6;}
12929     else
12930       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12931          X"$ac_file" : 'X\(//\)[^/]' \| \
12932          X"$ac_file" : 'X\(//\)$' \| \
12933          X"$ac_file" : 'X\(/\)' \| \
12934          .     : '\(.\)' 2>/dev/null ||
12935 echo X"$ac_file" |
12936     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12937           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12938           /^X\(\/\/\)$/{ s//\1/; q; }
12939           /^X\(\/\).*/{ s//\1/; q; }
12940           s/.*/./; q'`
12941       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12942         { case "$ac_dir" in
12943   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12944   *)                      as_incr_dir=.;;
12945 esac
12946 as_dummy="$ac_dir"
12947 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12948   case $as_mkdir_dir in
12949     # Skip DOS drivespec
12950     ?:) as_incr_dir=$as_mkdir_dir ;;
12951     *)
12952       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12953       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12954     ;;
12955   esac
12956 done; }
12957
12958       fi
12959       rm -f $ac_file
12960       mv $tmp/config.h $ac_file
12961     fi
12962   else
12963     cat $tmp/config.h
12964     rm -f $tmp/config.h
12965   fi
12966 done
12967 EOF
12968 cat >>$CONFIG_STATUS <<\EOF
12969 #
12970 # CONFIG_COMMANDS section.
12971 #
12972 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
12973   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
12974   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
12975
12976   case $ac_dest in
12977     default )
12978 if test -z "$USE_OLD_MAKERULES" ; then
12979         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
12980 fi
12981  ;;
12982   esac
12983 done
12984 EOF
12985
12986 cat >>$CONFIG_STATUS <<\EOF
12987
12988 { (exit 0); exit 0; }
12989 EOF
12990 chmod +x $CONFIG_STATUS
12991 ac_clean_files=$ac_clean_files_save
12992
12993 # configure is writing to config.log, and then calls config.status.
12994 # config.status does its own redirection, appending to config.log.
12995 # Unfortunately, on DOS this fails, as config.log is still kept open
12996 # by configure, so config.status won't be able to write to it; its
12997 # output is simply discarded.  So we exec the FD to /dev/null,
12998 # effectively closing config.log, so it can be properly (re)opened and
12999 # appended to by config.status.  When coming back to configure, we
13000 # need to make the FD available again.
13001 if test "$no_create" != yes; then
13002   ac_cs_success=:
13003   exec 5>/dev/null
13004   $SHELL $CONFIG_STATUS || ac_cs_success=false
13005   exec 5>>config.log
13006   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
13007   # would make configure fail if this is the last instruction.
13008   $ac_cs_success || { (exit 1); exit 1; }
13009 fi
13010 ${MAKE:-make} preinstall