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