]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 5.9 - patch 20130105
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.45 .
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 fi;
1144
1145 ###     Save the given $CFLAGS to allow user-override.
1146 cf_user_CFLAGS="$CFLAGS"
1147
1148 ###     Default install-location
1149
1150 echo "$as_me:1150: checking for prefix" >&5
1151 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1152 if test "x$prefix" = "xNONE" ; then
1153         case "$cf_cv_system_name" in
1154                 # non-vendor systems don't have a conflict
1155         openbsd*|freebsd*|mirbsd*|linux*|cygwin*|k*bsd*-gnu)
1156                 prefix=/usr
1157                 ;;
1158         *)      prefix=$ac_default_prefix
1159                 ;;
1160         esac
1161 fi
1162 echo "$as_me:1162: result: $prefix" >&5
1163 echo "${ECHO_T}$prefix" >&6
1164
1165 if test "x$prefix" = "xNONE" ; then
1166 echo "$as_me:1166: checking for default include-directory" >&5
1167 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1168 test -n "$verbose" && echo 1>&6
1169 for cf_symbol in \
1170         $includedir \
1171         $includedir/ncurses \
1172         $prefix/include \
1173         $prefix/include/ncurses \
1174         /usr/local/include \
1175         /usr/local/include/ncurses \
1176         /usr/include \
1177         /usr/include/ncurses
1178 do
1179         cf_dir=`eval echo $cf_symbol`
1180         if test -f $cf_dir/curses.h ; then
1181         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1182                 includedir="$cf_symbol"
1183                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1184                 break
1185         fi
1186         fi
1187         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1188 done
1189 echo "$as_me:1189: result: $includedir" >&5
1190 echo "${ECHO_T}$includedir" >&6
1191 fi
1192
1193 ###     Checks for programs.
1194
1195 ac_ext=c
1196 ac_cpp='$CPP $CPPFLAGS'
1197 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1198 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1199 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1200 ac_main_return=return
1201 if test -n "$ac_tool_prefix"; then
1202   for ac_prog in gnatgcc gcc cc
1203   do
1204     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1205 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1206 echo "$as_me:1206: checking for $ac_word" >&5
1207 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1208 if test "${ac_cv_prog_CC+set}" = set; then
1209   echo $ECHO_N "(cached) $ECHO_C" >&6
1210 else
1211   if test -n "$CC"; then
1212   ac_cv_prog_CC="$CC" # Let the user override the test.
1213 else
1214   ac_save_IFS=$IFS; IFS=$ac_path_separator
1215 ac_dummy="$PATH"
1216 for ac_dir in $ac_dummy; do
1217   IFS=$ac_save_IFS
1218   test -z "$ac_dir" && ac_dir=.
1219   $as_executable_p "$ac_dir/$ac_word" || continue
1220 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1221 echo "$as_me:1221: found $ac_dir/$ac_word" >&5
1222 break
1223 done
1224
1225 fi
1226 fi
1227 CC=$ac_cv_prog_CC
1228 if test -n "$CC"; then
1229   echo "$as_me:1229: result: $CC" >&5
1230 echo "${ECHO_T}$CC" >&6
1231 else
1232   echo "$as_me:1232: result: no" >&5
1233 echo "${ECHO_T}no" >&6
1234 fi
1235
1236     test -n "$CC" && break
1237   done
1238 fi
1239 if test -z "$CC"; then
1240   ac_ct_CC=$CC
1241   for ac_prog in gnatgcc gcc cc
1242 do
1243   # Extract the first word of "$ac_prog", so it can be a program name with args.
1244 set dummy $ac_prog; ac_word=$2
1245 echo "$as_me:1245: checking for $ac_word" >&5
1246 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1247 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1248   echo $ECHO_N "(cached) $ECHO_C" >&6
1249 else
1250   if test -n "$ac_ct_CC"; then
1251   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1252 else
1253   ac_save_IFS=$IFS; IFS=$ac_path_separator
1254 ac_dummy="$PATH"
1255 for ac_dir in $ac_dummy; do
1256   IFS=$ac_save_IFS
1257   test -z "$ac_dir" && ac_dir=.
1258   $as_executable_p "$ac_dir/$ac_word" || continue
1259 ac_cv_prog_ac_ct_CC="$ac_prog"
1260 echo "$as_me:1260: found $ac_dir/$ac_word" >&5
1261 break
1262 done
1263
1264 fi
1265 fi
1266 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1267 if test -n "$ac_ct_CC"; then
1268   echo "$as_me:1268: result: $ac_ct_CC" >&5
1269 echo "${ECHO_T}$ac_ct_CC" >&6
1270 else
1271   echo "$as_me:1271: result: no" >&5
1272 echo "${ECHO_T}no" >&6
1273 fi
1274
1275   test -n "$ac_ct_CC" && break
1276 done
1277
1278   CC=$ac_ct_CC
1279 fi
1280
1281 test -z "$CC" && { { echo "$as_me:1281: error: no acceptable cc found in \$PATH" >&5
1282 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1283    { (exit 1); exit 1; }; }
1284
1285 # Provide some information about the compiler.
1286 echo "$as_me:1286:" \
1287      "checking for C compiler version" >&5
1288 ac_compiler=`set X $ac_compile; echo $2`
1289 { (eval echo "$as_me:1289: \"$ac_compiler --version </dev/null >&5\"") >&5
1290   (eval $ac_compiler --version </dev/null >&5) 2>&5
1291   ac_status=$?
1292   echo "$as_me:1292: \$? = $ac_status" >&5
1293   (exit $ac_status); }
1294 { (eval echo "$as_me:1294: \"$ac_compiler -v </dev/null >&5\"") >&5
1295   (eval $ac_compiler -v </dev/null >&5) 2>&5
1296   ac_status=$?
1297   echo "$as_me:1297: \$? = $ac_status" >&5
1298   (exit $ac_status); }
1299 { (eval echo "$as_me:1299: \"$ac_compiler -V </dev/null >&5\"") >&5
1300   (eval $ac_compiler -V </dev/null >&5) 2>&5
1301   ac_status=$?
1302   echo "$as_me:1302: \$? = $ac_status" >&5
1303   (exit $ac_status); }
1304
1305 cat >conftest.$ac_ext <<_ACEOF
1306 #line 1306 "configure"
1307 #include "confdefs.h"
1308
1309 int
1310 main ()
1311 {
1312
1313   ;
1314   return 0;
1315 }
1316 _ACEOF
1317 ac_clean_files_save=$ac_clean_files
1318 ac_clean_files="$ac_clean_files a.out a.exe"
1319 # Try to create an executable without -o first, disregard a.out.
1320 # It will help us diagnose broken compilers, and finding out an intuition
1321 # of exeext.
1322 echo "$as_me:1322: checking for C compiler default output" >&5
1323 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1324 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1325 if { (eval echo "$as_me:1325: \"$ac_link_default\"") >&5
1326   (eval $ac_link_default) 2>&5
1327   ac_status=$?
1328   echo "$as_me:1328: \$? = $ac_status" >&5
1329   (exit $ac_status); }; then
1330   # Find the output, starting from the most likely.  This scheme is
1331 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1332 # resort.
1333 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1334                 ls a.out conftest 2>/dev/null;
1335                 ls a.* conftest.* 2>/dev/null`; do
1336   case $ac_file in
1337     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1338     a.out ) # We found the default executable, but exeext='' is most
1339             # certainly right.
1340             break;;
1341     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1342           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1343           export ac_cv_exeext
1344           break;;
1345     * ) break;;
1346   esac
1347 done
1348 else
1349   echo "$as_me: failed program was:" >&5
1350 cat conftest.$ac_ext >&5
1351 { { echo "$as_me:1351: error: C compiler cannot create executables" >&5
1352 echo "$as_me: error: C compiler cannot create executables" >&2;}
1353    { (exit 77); exit 77; }; }
1354 fi
1355
1356 ac_exeext=$ac_cv_exeext
1357 echo "$as_me:1357: result: $ac_file" >&5
1358 echo "${ECHO_T}$ac_file" >&6
1359
1360 # Check the compiler produces executables we can run.  If not, either
1361 # the compiler is broken, or we cross compile.
1362 echo "$as_me:1362: checking whether the C compiler works" >&5
1363 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1364 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1365 # If not cross compiling, check that we can run a simple program.
1366 if test "$cross_compiling" != yes; then
1367   if { ac_try='./$ac_file'
1368   { (eval echo "$as_me:1368: \"$ac_try\"") >&5
1369   (eval $ac_try) 2>&5
1370   ac_status=$?
1371   echo "$as_me:1371: \$? = $ac_status" >&5
1372   (exit $ac_status); }; }; then
1373     cross_compiling=no
1374   else
1375     if test "$cross_compiling" = maybe; then
1376         cross_compiling=yes
1377     else
1378         { { echo "$as_me:1378: error: cannot run C compiled programs.
1379 If you meant to cross compile, use \`--host'." >&5
1380 echo "$as_me: error: cannot run C compiled programs.
1381 If you meant to cross compile, use \`--host'." >&2;}
1382    { (exit 1); exit 1; }; }
1383     fi
1384   fi
1385 fi
1386 echo "$as_me:1386: result: yes" >&5
1387 echo "${ECHO_T}yes" >&6
1388
1389 rm -f a.out a.exe conftest$ac_cv_exeext
1390 ac_clean_files=$ac_clean_files_save
1391 # Check the compiler produces executables we can run.  If not, either
1392 # the compiler is broken, or we cross compile.
1393 echo "$as_me:1393: checking whether we are cross compiling" >&5
1394 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1395 echo "$as_me:1395: result: $cross_compiling" >&5
1396 echo "${ECHO_T}$cross_compiling" >&6
1397
1398 echo "$as_me:1398: checking for executable suffix" >&5
1399 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1400 if { (eval echo "$as_me:1400: \"$ac_link\"") >&5
1401   (eval $ac_link) 2>&5
1402   ac_status=$?
1403   echo "$as_me:1403: \$? = $ac_status" >&5
1404   (exit $ac_status); }; then
1405   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1406 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1407 # work properly (i.e., refer to `conftest.exe'), while it won't with
1408 # `rm'.
1409 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1410   case $ac_file in
1411     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1412     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1413           export ac_cv_exeext
1414           break;;
1415     * ) break;;
1416   esac
1417 done
1418 else
1419   { { echo "$as_me:1419: error: cannot compute EXEEXT: cannot compile and link" >&5
1420 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1421    { (exit 1); exit 1; }; }
1422 fi
1423
1424 rm -f conftest$ac_cv_exeext
1425 echo "$as_me:1425: result: $ac_cv_exeext" >&5
1426 echo "${ECHO_T}$ac_cv_exeext" >&6
1427
1428 rm -f conftest.$ac_ext
1429 EXEEXT=$ac_cv_exeext
1430 ac_exeext=$EXEEXT
1431 echo "$as_me:1431: checking for object suffix" >&5
1432 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1433 if test "${ac_cv_objext+set}" = set; then
1434   echo $ECHO_N "(cached) $ECHO_C" >&6
1435 else
1436   cat >conftest.$ac_ext <<_ACEOF
1437 #line 1437 "configure"
1438 #include "confdefs.h"
1439
1440 int
1441 main ()
1442 {
1443
1444   ;
1445   return 0;
1446 }
1447 _ACEOF
1448 rm -f conftest.o conftest.obj
1449 if { (eval echo "$as_me:1449: \"$ac_compile\"") >&5
1450   (eval $ac_compile) 2>&5
1451   ac_status=$?
1452   echo "$as_me:1452: \$? = $ac_status" >&5
1453   (exit $ac_status); }; then
1454   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1455   case $ac_file in
1456     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1457     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1458        break;;
1459   esac
1460 done
1461 else
1462   echo "$as_me: failed program was:" >&5
1463 cat conftest.$ac_ext >&5
1464 { { echo "$as_me:1464: error: cannot compute OBJEXT: cannot compile" >&5
1465 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1466    { (exit 1); exit 1; }; }
1467 fi
1468
1469 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1470 fi
1471 echo "$as_me:1471: result: $ac_cv_objext" >&5
1472 echo "${ECHO_T}$ac_cv_objext" >&6
1473 OBJEXT=$ac_cv_objext
1474 ac_objext=$OBJEXT
1475 echo "$as_me:1475: checking whether we are using the GNU C compiler" >&5
1476 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1477 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1478   echo $ECHO_N "(cached) $ECHO_C" >&6
1479 else
1480   cat >conftest.$ac_ext <<_ACEOF
1481 #line 1481 "configure"
1482 #include "confdefs.h"
1483
1484 int
1485 main ()
1486 {
1487 #ifndef __GNUC__
1488        choke me
1489 #endif
1490
1491   ;
1492   return 0;
1493 }
1494 _ACEOF
1495 rm -f conftest.$ac_objext
1496 if { (eval echo "$as_me:1496: \"$ac_compile\"") >&5
1497   (eval $ac_compile) 2>&5
1498   ac_status=$?
1499   echo "$as_me:1499: \$? = $ac_status" >&5
1500   (exit $ac_status); } &&
1501          { ac_try='test -s conftest.$ac_objext'
1502   { (eval echo "$as_me:1502: \"$ac_try\"") >&5
1503   (eval $ac_try) 2>&5
1504   ac_status=$?
1505   echo "$as_me:1505: \$? = $ac_status" >&5
1506   (exit $ac_status); }; }; then
1507   ac_compiler_gnu=yes
1508 else
1509   echo "$as_me: failed program was:" >&5
1510 cat conftest.$ac_ext >&5
1511 ac_compiler_gnu=no
1512 fi
1513 rm -f conftest.$ac_objext conftest.$ac_ext
1514 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1515
1516 fi
1517 echo "$as_me:1517: result: $ac_cv_c_compiler_gnu" >&5
1518 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1519 GCC=`test $ac_compiler_gnu = yes && echo yes`
1520 ac_test_CFLAGS=${CFLAGS+set}
1521 ac_save_CFLAGS=$CFLAGS
1522 CFLAGS="-g"
1523 echo "$as_me:1523: checking whether $CC accepts -g" >&5
1524 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1525 if test "${ac_cv_prog_cc_g+set}" = set; then
1526   echo $ECHO_N "(cached) $ECHO_C" >&6
1527 else
1528   cat >conftest.$ac_ext <<_ACEOF
1529 #line 1529 "configure"
1530 #include "confdefs.h"
1531
1532 int
1533 main ()
1534 {
1535
1536   ;
1537   return 0;
1538 }
1539 _ACEOF
1540 rm -f conftest.$ac_objext
1541 if { (eval echo "$as_me:1541: \"$ac_compile\"") >&5
1542   (eval $ac_compile) 2>&5
1543   ac_status=$?
1544   echo "$as_me:1544: \$? = $ac_status" >&5
1545   (exit $ac_status); } &&
1546          { ac_try='test -s conftest.$ac_objext'
1547   { (eval echo "$as_me:1547: \"$ac_try\"") >&5
1548   (eval $ac_try) 2>&5
1549   ac_status=$?
1550   echo "$as_me:1550: \$? = $ac_status" >&5
1551   (exit $ac_status); }; }; then
1552   ac_cv_prog_cc_g=yes
1553 else
1554   echo "$as_me: failed program was:" >&5
1555 cat conftest.$ac_ext >&5
1556 ac_cv_prog_cc_g=no
1557 fi
1558 rm -f conftest.$ac_objext conftest.$ac_ext
1559 fi
1560 echo "$as_me:1560: result: $ac_cv_prog_cc_g" >&5
1561 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1562 if test "$ac_test_CFLAGS" = set; then
1563   CFLAGS=$ac_save_CFLAGS
1564 elif test $ac_cv_prog_cc_g = yes; then
1565   if test "$GCC" = yes; then
1566     CFLAGS="-g -O2"
1567   else
1568     CFLAGS="-g"
1569   fi
1570 else
1571   if test "$GCC" = yes; then
1572     CFLAGS="-O2"
1573   else
1574     CFLAGS=
1575   fi
1576 fi
1577 # Some people use a C++ compiler to compile C.  Since we use `exit',
1578 # in C++ we need to declare it.  In case someone uses the same compiler
1579 # for both compiling C and C++ we need to have the C++ compiler decide
1580 # the declaration of exit, since it's the most demanding environment.
1581 cat >conftest.$ac_ext <<_ACEOF
1582 #ifndef __cplusplus
1583   choke me
1584 #endif
1585 _ACEOF
1586 rm -f conftest.$ac_objext
1587 if { (eval echo "$as_me:1587: \"$ac_compile\"") >&5
1588   (eval $ac_compile) 2>&5
1589   ac_status=$?
1590   echo "$as_me:1590: \$? = $ac_status" >&5
1591   (exit $ac_status); } &&
1592          { ac_try='test -s conftest.$ac_objext'
1593   { (eval echo "$as_me:1593: \"$ac_try\"") >&5
1594   (eval $ac_try) 2>&5
1595   ac_status=$?
1596   echo "$as_me:1596: \$? = $ac_status" >&5
1597   (exit $ac_status); }; }; then
1598   for ac_declaration in \
1599    ''\
1600    '#include <stdlib.h>' \
1601    'extern "C" void std::exit (int) throw (); using std::exit;' \
1602    'extern "C" void std::exit (int); using std::exit;' \
1603    'extern "C" void exit (int) throw ();' \
1604    'extern "C" void exit (int);' \
1605    'void exit (int);'
1606 do
1607   cat >conftest.$ac_ext <<_ACEOF
1608 #line 1608 "configure"
1609 #include "confdefs.h"
1610 #include <stdlib.h>
1611 $ac_declaration
1612 int
1613 main ()
1614 {
1615 exit (42);
1616   ;
1617   return 0;
1618 }
1619 _ACEOF
1620 rm -f conftest.$ac_objext
1621 if { (eval echo "$as_me:1621: \"$ac_compile\"") >&5
1622   (eval $ac_compile) 2>&5
1623   ac_status=$?
1624   echo "$as_me:1624: \$? = $ac_status" >&5
1625   (exit $ac_status); } &&
1626          { ac_try='test -s conftest.$ac_objext'
1627   { (eval echo "$as_me:1627: \"$ac_try\"") >&5
1628   (eval $ac_try) 2>&5
1629   ac_status=$?
1630   echo "$as_me:1630: \$? = $ac_status" >&5
1631   (exit $ac_status); }; }; then
1632   :
1633 else
1634   echo "$as_me: failed program was:" >&5
1635 cat conftest.$ac_ext >&5
1636 continue
1637 fi
1638 rm -f conftest.$ac_objext conftest.$ac_ext
1639   cat >conftest.$ac_ext <<_ACEOF
1640 #line 1640 "configure"
1641 #include "confdefs.h"
1642 $ac_declaration
1643 int
1644 main ()
1645 {
1646 exit (42);
1647   ;
1648   return 0;
1649 }
1650 _ACEOF
1651 rm -f conftest.$ac_objext
1652 if { (eval echo "$as_me:1652: \"$ac_compile\"") >&5
1653   (eval $ac_compile) 2>&5
1654   ac_status=$?
1655   echo "$as_me:1655: \$? = $ac_status" >&5
1656   (exit $ac_status); } &&
1657          { ac_try='test -s conftest.$ac_objext'
1658   { (eval echo "$as_me:1658: \"$ac_try\"") >&5
1659   (eval $ac_try) 2>&5
1660   ac_status=$?
1661   echo "$as_me:1661: \$? = $ac_status" >&5
1662   (exit $ac_status); }; }; then
1663   break
1664 else
1665   echo "$as_me: failed program was:" >&5
1666 cat conftest.$ac_ext >&5
1667 fi
1668 rm -f conftest.$ac_objext conftest.$ac_ext
1669 done
1670 rm -rf conftest*
1671 if test -n "$ac_declaration"; then
1672   echo '#ifdef __cplusplus' >>confdefs.h
1673   echo $ac_declaration      >>confdefs.h
1674   echo '#endif'             >>confdefs.h
1675 fi
1676
1677 else
1678   echo "$as_me: failed program was:" >&5
1679 cat conftest.$ac_ext >&5
1680 fi
1681 rm -f conftest.$ac_objext conftest.$ac_ext
1682 ac_ext=c
1683 ac_cpp='$CPP $CPPFLAGS'
1684 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1685 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1686 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1687 ac_main_return=return
1688
1689 GCC_VERSION=none
1690 if test "$GCC" = yes ; then
1691         echo "$as_me:1691: checking version of $CC" >&5
1692 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1693         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.].*//'`"
1694         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1695         echo "$as_me:1695: result: $GCC_VERSION" >&5
1696 echo "${ECHO_T}$GCC_VERSION" >&6
1697 fi
1698
1699 echo "$as_me:1699: checking for $CC option to accept ANSI C" >&5
1700 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1701 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1702   echo $ECHO_N "(cached) $ECHO_C" >&6
1703 else
1704   ac_cv_prog_cc_stdc=no
1705 ac_save_CC=$CC
1706 cat >conftest.$ac_ext <<_ACEOF
1707 #line 1707 "configure"
1708 #include "confdefs.h"
1709 #include <stdarg.h>
1710 #include <stdio.h>
1711 #include <sys/types.h>
1712 #include <sys/stat.h>
1713 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1714 struct buf { int x; };
1715 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1716 static char *e (p, i)
1717      char **p;
1718      int i;
1719 {
1720   return p[i];
1721 }
1722 static char *f (char * (*g) (char **, int), char **p, ...)
1723 {
1724   char *s;
1725   va_list v;
1726   va_start (v,p);
1727   s = g (p, va_arg (v,int));
1728   va_end (v);
1729   return s;
1730 }
1731 int test (int i, double x);
1732 struct s1 {int (*f) (int a);};
1733 struct s2 {int (*f) (double a);};
1734 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1735 int argc;
1736 char **argv;
1737 int
1738 main ()
1739 {
1740 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1741   ;
1742   return 0;
1743 }
1744 _ACEOF
1745 # Don't try gcc -ansi; that turns off useful extensions and
1746 # breaks some systems' header files.
1747 # AIX                   -qlanglvl=ansi
1748 # Ultrix and OSF/1      -std1
1749 # HP-UX 10.20 and later -Ae
1750 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1751 # SVR4                  -Xc -D__EXTENSIONS__
1752 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1753 do
1754   CC="$ac_save_CC $ac_arg"
1755   rm -f conftest.$ac_objext
1756 if { (eval echo "$as_me:1756: \"$ac_compile\"") >&5
1757   (eval $ac_compile) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit $ac_status); } &&
1761          { ac_try='test -s conftest.$ac_objext'
1762   { (eval echo "$as_me:1762: \"$ac_try\"") >&5
1763   (eval $ac_try) 2>&5
1764   ac_status=$?
1765   echo "$as_me:1765: \$? = $ac_status" >&5
1766   (exit $ac_status); }; }; then
1767   ac_cv_prog_cc_stdc=$ac_arg
1768 break
1769 else
1770   echo "$as_me: failed program was:" >&5
1771 cat conftest.$ac_ext >&5
1772 fi
1773 rm -f conftest.$ac_objext
1774 done
1775 rm -f conftest.$ac_ext conftest.$ac_objext
1776 CC=$ac_save_CC
1777
1778 fi
1779
1780 case "x$ac_cv_prog_cc_stdc" in
1781   x|xno)
1782     echo "$as_me:1782: result: none needed" >&5
1783 echo "${ECHO_T}none needed" >&6 ;;
1784   *)
1785     echo "$as_me:1785: result: $ac_cv_prog_cc_stdc" >&5
1786 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1787     CC="$CC $ac_cv_prog_cc_stdc" ;;
1788 esac
1789
1790 # This should have been defined by AC_PROG_CC
1791 : ${CC:=cc}
1792
1793 echo "$as_me:1793: checking \$CC variable" >&5
1794 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1795 case "$CC" in #(vi
1796 *[\ \   ]-[IUD]*)
1797         echo "$as_me:1797: result: broken" >&5
1798 echo "${ECHO_T}broken" >&6
1799         { echo "$as_me:1799: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1800 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1801         # humor him...
1802         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1803         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1804
1805 cf_fix_cppflags=no
1806 cf_new_cflags=
1807 cf_new_cppflags=
1808 cf_new_extra_cppflags=
1809
1810 for cf_add_cflags in $cf_flags
1811 do
1812 case $cf_fix_cppflags in
1813 no)
1814         case $cf_add_cflags in #(vi
1815         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1816                 case $cf_add_cflags in
1817                 -D*)
1818                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1819
1820                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1821                                 && test -z "${cf_tst_cflags}" \
1822                                 && cf_fix_cppflags=yes
1823
1824                         if test $cf_fix_cppflags = yes ; then
1825                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1826                                 continue
1827                         elif test "${cf_tst_cflags}" = "\"'" ; then
1828                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1829                                 continue
1830                         fi
1831                         ;;
1832                 esac
1833                 case "$CPPFLAGS" in
1834                 *$cf_add_cflags) #(vi
1835                         ;;
1836                 *) #(vi
1837                         case $cf_add_cflags in #(vi
1838                         -D*)
1839                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1840
1841 CPPFLAGS=`echo "$CPPFLAGS" | \
1842         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1843                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1844
1845                                 ;;
1846                         esac
1847                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1848                         ;;
1849                 esac
1850                 ;;
1851         *)
1852                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1853                 ;;
1854         esac
1855         ;;
1856 yes)
1857         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1858
1859         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1860
1861         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1862                 && test -z "${cf_tst_cflags}" \
1863                 && cf_fix_cppflags=no
1864         ;;
1865 esac
1866 done
1867
1868 if test -n "$cf_new_cflags" ; then
1869
1870         CFLAGS="$CFLAGS $cf_new_cflags"
1871 fi
1872
1873 if test -n "$cf_new_cppflags" ; then
1874
1875         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1876 fi
1877
1878 if test -n "$cf_new_extra_cppflags" ; then
1879
1880         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1881 fi
1882
1883         ;;
1884 *)
1885         echo "$as_me:1885: result: ok" >&5
1886 echo "${ECHO_T}ok" >&6
1887         ;;
1888 esac
1889
1890 ac_ext=c
1891 ac_cpp='$CPP $CPPFLAGS'
1892 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1893 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1894 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1895 ac_main_return=return
1896 echo "$as_me:1896: checking how to run the C preprocessor" >&5
1897 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1898 # On Suns, sometimes $CPP names a directory.
1899 if test -n "$CPP" && test -d "$CPP"; then
1900   CPP=
1901 fi
1902 if test -z "$CPP"; then
1903   if test "${ac_cv_prog_CPP+set}" = set; then
1904   echo $ECHO_N "(cached) $ECHO_C" >&6
1905 else
1906       # Double quotes because CPP needs to be expanded
1907     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1908     do
1909       ac_preproc_ok=false
1910 for ac_c_preproc_warn_flag in '' yes
1911 do
1912   # Use a header file that comes with gcc, so configuring glibc
1913   # with a fresh cross-compiler works.
1914   # On the NeXT, cc -E runs the code through the compiler's parser,
1915   # not just through cpp. "Syntax error" is here to catch this case.
1916   cat >conftest.$ac_ext <<_ACEOF
1917 #line 1917 "configure"
1918 #include "confdefs.h"
1919 #include <assert.h>
1920                      Syntax error
1921 _ACEOF
1922 if { (eval echo "$as_me:1922: \"$ac_cpp conftest.$ac_ext\"") >&5
1923   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1924   ac_status=$?
1925   egrep -v '^ *\+' conftest.er1 >conftest.err
1926   rm -f conftest.er1
1927   cat conftest.err >&5
1928   echo "$as_me:1928: \$? = $ac_status" >&5
1929   (exit $ac_status); } >/dev/null; then
1930   if test -s conftest.err; then
1931     ac_cpp_err=$ac_c_preproc_warn_flag
1932   else
1933     ac_cpp_err=
1934   fi
1935 else
1936   ac_cpp_err=yes
1937 fi
1938 if test -z "$ac_cpp_err"; then
1939   :
1940 else
1941   echo "$as_me: failed program was:" >&5
1942   cat conftest.$ac_ext >&5
1943   # Broken: fails on valid input.
1944 continue
1945 fi
1946 rm -f conftest.err conftest.$ac_ext
1947
1948   # OK, works on sane cases.  Now check whether non-existent headers
1949   # can be detected and how.
1950   cat >conftest.$ac_ext <<_ACEOF
1951 #line 1951 "configure"
1952 #include "confdefs.h"
1953 #include <ac_nonexistent.h>
1954 _ACEOF
1955 if { (eval echo "$as_me:1955: \"$ac_cpp conftest.$ac_ext\"") >&5
1956   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1957   ac_status=$?
1958   egrep -v '^ *\+' conftest.er1 >conftest.err
1959   rm -f conftest.er1
1960   cat conftest.err >&5
1961   echo "$as_me:1961: \$? = $ac_status" >&5
1962   (exit $ac_status); } >/dev/null; then
1963   if test -s conftest.err; then
1964     ac_cpp_err=$ac_c_preproc_warn_flag
1965   else
1966     ac_cpp_err=
1967   fi
1968 else
1969   ac_cpp_err=yes
1970 fi
1971 if test -z "$ac_cpp_err"; then
1972   # Broken: success on invalid input.
1973 continue
1974 else
1975   echo "$as_me: failed program was:" >&5
1976   cat conftest.$ac_ext >&5
1977   # Passes both tests.
1978 ac_preproc_ok=:
1979 break
1980 fi
1981 rm -f conftest.err conftest.$ac_ext
1982
1983 done
1984 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1985 rm -f conftest.err conftest.$ac_ext
1986 if $ac_preproc_ok; then
1987   break
1988 fi
1989
1990     done
1991     ac_cv_prog_CPP=$CPP
1992
1993 fi
1994   CPP=$ac_cv_prog_CPP
1995 else
1996   ac_cv_prog_CPP=$CPP
1997 fi
1998 echo "$as_me:1998: result: $CPP" >&5
1999 echo "${ECHO_T}$CPP" >&6
2000 ac_preproc_ok=false
2001 for ac_c_preproc_warn_flag in '' yes
2002 do
2003   # Use a header file that comes with gcc, so configuring glibc
2004   # with a fresh cross-compiler works.
2005   # On the NeXT, cc -E runs the code through the compiler's parser,
2006   # not just through cpp. "Syntax error" is here to catch this case.
2007   cat >conftest.$ac_ext <<_ACEOF
2008 #line 2008 "configure"
2009 #include "confdefs.h"
2010 #include <assert.h>
2011                      Syntax error
2012 _ACEOF
2013 if { (eval echo "$as_me:2013: \"$ac_cpp conftest.$ac_ext\"") >&5
2014   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2015   ac_status=$?
2016   egrep -v '^ *\+' conftest.er1 >conftest.err
2017   rm -f conftest.er1
2018   cat conftest.err >&5
2019   echo "$as_me:2019: \$? = $ac_status" >&5
2020   (exit $ac_status); } >/dev/null; then
2021   if test -s conftest.err; then
2022     ac_cpp_err=$ac_c_preproc_warn_flag
2023   else
2024     ac_cpp_err=
2025   fi
2026 else
2027   ac_cpp_err=yes
2028 fi
2029 if test -z "$ac_cpp_err"; then
2030   :
2031 else
2032   echo "$as_me: failed program was:" >&5
2033   cat conftest.$ac_ext >&5
2034   # Broken: fails on valid input.
2035 continue
2036 fi
2037 rm -f conftest.err conftest.$ac_ext
2038
2039   # OK, works on sane cases.  Now check whether non-existent headers
2040   # can be detected and how.
2041   cat >conftest.$ac_ext <<_ACEOF
2042 #line 2042 "configure"
2043 #include "confdefs.h"
2044 #include <ac_nonexistent.h>
2045 _ACEOF
2046 if { (eval echo "$as_me:2046: \"$ac_cpp conftest.$ac_ext\"") >&5
2047   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2048   ac_status=$?
2049   egrep -v '^ *\+' conftest.er1 >conftest.err
2050   rm -f conftest.er1
2051   cat conftest.err >&5
2052   echo "$as_me:2052: \$? = $ac_status" >&5
2053   (exit $ac_status); } >/dev/null; then
2054   if test -s conftest.err; then
2055     ac_cpp_err=$ac_c_preproc_warn_flag
2056   else
2057     ac_cpp_err=
2058   fi
2059 else
2060   ac_cpp_err=yes
2061 fi
2062 if test -z "$ac_cpp_err"; then
2063   # Broken: success on invalid input.
2064 continue
2065 else
2066   echo "$as_me: failed program was:" >&5
2067   cat conftest.$ac_ext >&5
2068   # Passes both tests.
2069 ac_preproc_ok=:
2070 break
2071 fi
2072 rm -f conftest.err conftest.$ac_ext
2073
2074 done
2075 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2076 rm -f conftest.err conftest.$ac_ext
2077 if $ac_preproc_ok; then
2078   :
2079 else
2080   { { echo "$as_me:2080: error: C preprocessor \"$CPP\" fails sanity check" >&5
2081 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2082    { (exit 1); exit 1; }; }
2083 fi
2084
2085 ac_ext=c
2086 ac_cpp='$CPP $CPPFLAGS'
2087 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2088 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2089 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2090 ac_main_return=return
2091
2092 if test $ac_cv_c_compiler_gnu = yes; then
2093     echo "$as_me:2093: checking whether $CC needs -traditional" >&5
2094 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2095 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2096   echo $ECHO_N "(cached) $ECHO_C" >&6
2097 else
2098     ac_pattern="Autoconf.*'x'"
2099   cat >conftest.$ac_ext <<_ACEOF
2100 #line 2100 "configure"
2101 #include "confdefs.h"
2102 #include <sgtty.h>
2103 int Autoconf = TIOCGETP;
2104 _ACEOF
2105 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2106   egrep "$ac_pattern" >/dev/null 2>&1; then
2107   ac_cv_prog_gcc_traditional=yes
2108 else
2109   ac_cv_prog_gcc_traditional=no
2110 fi
2111 rm -rf conftest*
2112
2113   if test $ac_cv_prog_gcc_traditional = no; then
2114     cat >conftest.$ac_ext <<_ACEOF
2115 #line 2115 "configure"
2116 #include "confdefs.h"
2117 #include <termio.h>
2118 int Autoconf = TCGETA;
2119 _ACEOF
2120 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2121   egrep "$ac_pattern" >/dev/null 2>&1; then
2122   ac_cv_prog_gcc_traditional=yes
2123 fi
2124 rm -rf conftest*
2125
2126   fi
2127 fi
2128 echo "$as_me:2128: result: $ac_cv_prog_gcc_traditional" >&5
2129 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2130   if test $ac_cv_prog_gcc_traditional = yes; then
2131     CC="$CC -traditional"
2132   fi
2133 fi
2134
2135 echo "$as_me:2135: checking whether $CC understands -c and -o together" >&5
2136 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2137 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2138   echo $ECHO_N "(cached) $ECHO_C" >&6
2139 else
2140
2141 cat > conftest.$ac_ext <<CF_EOF
2142 #include <stdio.h>
2143 int main()
2144 {
2145         ${cf_cv_main_return:-return}(0);
2146 }
2147 CF_EOF
2148 # We do the test twice because some compilers refuse to overwrite an
2149 # existing .o file with -o, though they will create one.
2150 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2151 if { (eval echo "$as_me:2151: \"$ac_try\"") >&5
2152   (eval $ac_try) 2>&5
2153   ac_status=$?
2154   echo "$as_me:2154: \$? = $ac_status" >&5
2155   (exit $ac_status); } &&
2156   test -f conftest2.$ac_objext && { (eval echo "$as_me:2156: \"$ac_try\"") >&5
2157   (eval $ac_try) 2>&5
2158   ac_status=$?
2159   echo "$as_me:2159: \$? = $ac_status" >&5
2160   (exit $ac_status); };
2161 then
2162   eval cf_cv_prog_CC_c_o=yes
2163 else
2164   eval cf_cv_prog_CC_c_o=no
2165 fi
2166 rm -rf conftest*
2167
2168 fi
2169 if test $cf_cv_prog_CC_c_o = yes; then
2170   echo "$as_me:2170: result: yes" >&5
2171 echo "${ECHO_T}yes" >&6
2172 else
2173   echo "$as_me:2173: result: no" >&5
2174 echo "${ECHO_T}no" >&6
2175 fi
2176
2177 test "$program_prefix" != NONE &&
2178   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2179 # Use a double $ so make ignores it.
2180 test "$program_suffix" != NONE &&
2181   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2182 # Double any \ or $.  echo might interpret backslashes.
2183 # By default was `s,x,x', remove it if useless.
2184 cat <<\_ACEOF >conftest.sed
2185 s/[\\$]/&&/g;s/;s,x,x,$//
2186 _ACEOF
2187 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2188 rm conftest.sed
2189
2190 for ac_prog in mawk gawk nawk awk
2191 do
2192   # Extract the first word of "$ac_prog", so it can be a program name with args.
2193 set dummy $ac_prog; ac_word=$2
2194 echo "$as_me:2194: checking for $ac_word" >&5
2195 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2196 if test "${ac_cv_prog_AWK+set}" = set; then
2197   echo $ECHO_N "(cached) $ECHO_C" >&6
2198 else
2199   if test -n "$AWK"; then
2200   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2201 else
2202   ac_save_IFS=$IFS; IFS=$ac_path_separator
2203 ac_dummy="$PATH"
2204 for ac_dir in $ac_dummy; do
2205   IFS=$ac_save_IFS
2206   test -z "$ac_dir" && ac_dir=.
2207   $as_executable_p "$ac_dir/$ac_word" || continue
2208 ac_cv_prog_AWK="$ac_prog"
2209 echo "$as_me:2209: found $ac_dir/$ac_word" >&5
2210 break
2211 done
2212
2213 fi
2214 fi
2215 AWK=$ac_cv_prog_AWK
2216 if test -n "$AWK"; then
2217   echo "$as_me:2217: result: $AWK" >&5
2218 echo "${ECHO_T}$AWK" >&6
2219 else
2220   echo "$as_me:2220: result: no" >&5
2221 echo "${ECHO_T}no" >&6
2222 fi
2223
2224   test -n "$AWK" && break
2225 done
2226
2227 test -z "$AWK" && { { echo "$as_me:2227: error: No awk program found" >&5
2228 echo "$as_me: error: No awk program found" >&2;}
2229    { (exit 1); exit 1; }; }
2230
2231 echo "$as_me:2231: checking for egrep" >&5
2232 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2233 if test "${ac_cv_prog_egrep+set}" = set; then
2234   echo $ECHO_N "(cached) $ECHO_C" >&6
2235 else
2236   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2237     then ac_cv_prog_egrep='grep -E'
2238     else ac_cv_prog_egrep='egrep'
2239     fi
2240 fi
2241 echo "$as_me:2241: result: $ac_cv_prog_egrep" >&5
2242 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2243  EGREP=$ac_cv_prog_egrep
2244
2245 test -z "$EGREP" && { { echo "$as_me:2245: error: No egrep program found" >&5
2246 echo "$as_me: error: No egrep program found" >&2;}
2247    { (exit 1); exit 1; }; }
2248
2249 # Find a good install program.  We prefer a C program (faster),
2250 # so one script is as good as another.  But avoid the broken or
2251 # incompatible versions:
2252 # SysV /etc/install, /usr/sbin/install
2253 # SunOS /usr/etc/install
2254 # IRIX /sbin/install
2255 # AIX /bin/install
2256 # AmigaOS /C/install, which installs bootblocks on floppy discs
2257 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2258 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2259 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2260 # ./install, which can be erroneously created by make from ./install.sh.
2261 echo "$as_me:2261: checking for a BSD compatible install" >&5
2262 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2263 if test -z "$INSTALL"; then
2264 if test "${ac_cv_path_install+set}" = set; then
2265   echo $ECHO_N "(cached) $ECHO_C" >&6
2266 else
2267     ac_save_IFS=$IFS; IFS=$ac_path_separator
2268   for ac_dir in $PATH; do
2269     IFS=$ac_save_IFS
2270     # Account for people who put trailing slashes in PATH elements.
2271     case $ac_dir/ in
2272     / | ./ | .// | /cC/* \
2273     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2274     | /usr/ucb/* ) ;;
2275     *)
2276       # OSF1 and SCO ODT 3.0 have their own names for install.
2277       # Don't use installbsd from OSF since it installs stuff as root
2278       # by default.
2279       for ac_prog in ginstall scoinst install; do
2280         if $as_executable_p "$ac_dir/$ac_prog"; then
2281           if test $ac_prog = install &&
2282             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2283             # AIX install.  It has an incompatible calling convention.
2284             :
2285           elif test $ac_prog = install &&
2286             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2287             # program-specific install script used by HP pwplus--don't use.
2288             :
2289           else
2290             ac_cv_path_install="$ac_dir/$ac_prog -c"
2291             break 2
2292           fi
2293         fi
2294       done
2295       ;;
2296     esac
2297   done
2298
2299 fi
2300   if test "${ac_cv_path_install+set}" = set; then
2301     INSTALL=$ac_cv_path_install
2302   else
2303     # As a last resort, use the slow shell script.  We don't cache a
2304     # path for INSTALL within a source directory, because that will
2305     # break other packages using the cache if that directory is
2306     # removed, or if the path is relative.
2307     INSTALL=$ac_install_sh
2308   fi
2309 fi
2310 echo "$as_me:2310: result: $INSTALL" >&5
2311 echo "${ECHO_T}$INSTALL" >&6
2312
2313 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2314 # It thinks the first close brace ends the variable substitution.
2315 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2316
2317 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2318
2319 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2320
2321 echo "$as_me:2321: checking whether ln -s works" >&5
2322 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2323 LN_S=$as_ln_s
2324 if test "$LN_S" = "ln -s"; then
2325   echo "$as_me:2325: result: yes" >&5
2326 echo "${ECHO_T}yes" >&6
2327 else
2328   echo "$as_me:2328: result: no, using $LN_S" >&5
2329 echo "${ECHO_T}no, using $LN_S" >&6
2330 fi
2331
2332 echo "$as_me:2332: checking if $LN_S -f options work" >&5
2333 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2334
2335 rm -f conf$$.src conf$$dst
2336 echo >conf$$.dst
2337 echo first >conf$$.src
2338 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2339         cf_prog_ln_sf=yes
2340 else
2341         cf_prog_ln_sf=no
2342 fi
2343 rm -f conf$$.dst conf$$src
2344 echo "$as_me:2344: result: $cf_prog_ln_sf" >&5
2345 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2346
2347 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2348
2349 echo "$as_me:2349: checking for long file names" >&5
2350 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2351 if test "${ac_cv_sys_long_file_names+set}" = set; then
2352   echo $ECHO_N "(cached) $ECHO_C" >&6
2353 else
2354   ac_cv_sys_long_file_names=yes
2355 # Test for long file names in all the places we know might matter:
2356 #      .                the current directory, where building will happen
2357 #      $prefix/lib      where we will be installing things
2358 #      $exec_prefix/lib likewise
2359 # eval it to expand exec_prefix.
2360 #      $TMPDIR          if set, where it might want to write temporary files
2361 # if $TMPDIR is not set:
2362 #      /tmp             where it might want to write temporary files
2363 #      /var/tmp         likewise
2364 #      /usr/tmp         likewise
2365 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2366   ac_tmpdirs=$TMPDIR
2367 else
2368   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2369 fi
2370 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2371   test -d $ac_dir || continue
2372   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2373   ac_xdir=$ac_dir/cf$$
2374   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2375   ac_tf1=$ac_xdir/conftest9012345
2376   ac_tf2=$ac_xdir/conftest9012346
2377   (echo 1 >$ac_tf1) 2>/dev/null
2378   (echo 2 >$ac_tf2) 2>/dev/null
2379   ac_val=`cat $ac_tf1 2>/dev/null`
2380   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2381     ac_cv_sys_long_file_names=no
2382     rm -rf $ac_xdir 2>/dev/null
2383     break
2384   fi
2385   rm -rf $ac_xdir 2>/dev/null
2386 done
2387 fi
2388 echo "$as_me:2388: result: $ac_cv_sys_long_file_names" >&5
2389 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2390 if test $ac_cv_sys_long_file_names = yes; then
2391
2392 cat >>confdefs.h <<\EOF
2393 #define HAVE_LONG_FILE_NAMES 1
2394 EOF
2395
2396 fi
2397
2398 # if we find pkg-config, check if we should install the ".pc" files.
2399
2400 echo "$as_me:2400: checking if you want to use pkg-config" >&5
2401 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2402
2403 # Check whether --with-pkg-config or --without-pkg-config was given.
2404 if test "${with_pkg_config+set}" = set; then
2405   withval="$with_pkg_config"
2406   cf_pkg_config=$withval
2407 else
2408   cf_pkg_config=yes
2409 fi;
2410 echo "$as_me:2410: result: $cf_pkg_config" >&5
2411 echo "${ECHO_T}$cf_pkg_config" >&6
2412
2413 case $cf_pkg_config in #(vi
2414 no) #(vi
2415         PKG_CONFIG=none
2416         ;;
2417 yes) #(vi
2418
2419 if test -n "$ac_tool_prefix"; then
2420   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2421 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2422 echo "$as_me:2422: checking for $ac_word" >&5
2423 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2424 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2425   echo $ECHO_N "(cached) $ECHO_C" >&6
2426 else
2427   case $PKG_CONFIG in
2428   [\\/]* | ?:[\\/]*)
2429   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2430   ;;
2431   *)
2432   ac_save_IFS=$IFS; IFS=$ac_path_separator
2433 ac_dummy="$PATH"
2434 for ac_dir in $ac_dummy; do
2435   IFS=$ac_save_IFS
2436   test -z "$ac_dir" && ac_dir=.
2437   if $as_executable_p "$ac_dir/$ac_word"; then
2438    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2439    echo "$as_me:2439: found $ac_dir/$ac_word" >&5
2440    break
2441 fi
2442 done
2443
2444   ;;
2445 esac
2446 fi
2447 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2448
2449 if test -n "$PKG_CONFIG"; then
2450   echo "$as_me:2450: result: $PKG_CONFIG" >&5
2451 echo "${ECHO_T}$PKG_CONFIG" >&6
2452 else
2453   echo "$as_me:2453: result: no" >&5
2454 echo "${ECHO_T}no" >&6
2455 fi
2456
2457 fi
2458 if test -z "$ac_cv_path_PKG_CONFIG"; then
2459   ac_pt_PKG_CONFIG=$PKG_CONFIG
2460   # Extract the first word of "pkg-config", so it can be a program name with args.
2461 set dummy pkg-config; ac_word=$2
2462 echo "$as_me:2462: checking for $ac_word" >&5
2463 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2464 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2465   echo $ECHO_N "(cached) $ECHO_C" >&6
2466 else
2467   case $ac_pt_PKG_CONFIG in
2468   [\\/]* | ?:[\\/]*)
2469   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2470   ;;
2471   *)
2472   ac_save_IFS=$IFS; IFS=$ac_path_separator
2473 ac_dummy="$PATH"
2474 for ac_dir in $ac_dummy; do
2475   IFS=$ac_save_IFS
2476   test -z "$ac_dir" && ac_dir=.
2477   if $as_executable_p "$ac_dir/$ac_word"; then
2478    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2479    echo "$as_me:2479: found $ac_dir/$ac_word" >&5
2480    break
2481 fi
2482 done
2483
2484   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2485   ;;
2486 esac
2487 fi
2488 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2489
2490 if test -n "$ac_pt_PKG_CONFIG"; then
2491   echo "$as_me:2491: result: $ac_pt_PKG_CONFIG" >&5
2492 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2493 else
2494   echo "$as_me:2494: result: no" >&5
2495 echo "${ECHO_T}no" >&6
2496 fi
2497
2498   PKG_CONFIG=$ac_pt_PKG_CONFIG
2499 else
2500   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2501 fi
2502
2503         ;;
2504 *)
2505         PKG_CONFIG=$withval
2506         ;;
2507 esac
2508
2509 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2510 if test "$PKG_CONFIG" != none ; then
2511
2512 if test "x$prefix" != xNONE; then
2513   cf_path_syntax="$prefix"
2514 else
2515   cf_path_syntax="$ac_default_prefix"
2516 fi
2517
2518 case ".$PKG_CONFIG" in #(vi
2519 .\$\(*\)*|.\'*\'*) #(vi
2520   ;;
2521 ..|./*|.\\*) #(vi
2522   ;;
2523 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2524   ;;
2525 .\${*prefix}*|.\${*dir}*) #(vi
2526   eval PKG_CONFIG="$PKG_CONFIG"
2527   case ".$PKG_CONFIG" in #(vi
2528   .NONE/*)
2529     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2530     ;;
2531   esac
2532   ;; #(vi
2533 .no|.NONE/*)
2534   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2535   ;;
2536 *)
2537   { { echo "$as_me:2537: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2538 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2539    { (exit 1); exit 1; }; }
2540   ;;
2541 esac
2542
2543 fi
2544
2545 if test "$PKG_CONFIG" != none ; then
2546         echo "$as_me:2546: checking for $PKG_CONFIG library directory" >&5
2547 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2548
2549 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2550 if test "${with_pkg_config_libdir+set}" = set; then
2551   withval="$with_pkg_config_libdir"
2552   PKG_CONFIG_LIBDIR=$withval
2553 else
2554   PKG_CONFIG_LIBDIR=yes
2555 fi;
2556
2557         case x$PKG_CONFIG_LIBDIR in #(vi
2558         x/*) #(vi
2559                 ;;
2560         xyes) #(vi
2561                 # look for the library directory using the same prefix as the executable
2562                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2563                 case x`(arch) 2>/dev/null` in #(vi
2564                 *64) #(vi
2565                         for cf_config in $cf_path/share $cf_path/lib64 $cf_path/lib32 $cf_path/lib
2566                         do
2567                                 if test -d $cf_config/pkgconfig
2568                                 then
2569                                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2570                                         break
2571                                 fi
2572                         done
2573                         ;;
2574                 *)
2575                         PKG_CONFIG_LIBDIR=$cf_path/lib/pkgconfig
2576                         ;;
2577                 esac
2578                 ;;
2579         *)
2580                 ;;
2581         esac
2582
2583         echo "$as_me:2583: result: $PKG_CONFIG_LIBDIR" >&5
2584 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2585 fi
2586
2587 if test "$PKG_CONFIG" != none ; then
2588         echo "$as_me:2588: checking if we should install .pc files for $PKG_CONFIG" >&5
2589 echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6
2590
2591 # Check whether --enable-pc-files or --disable-pc-files was given.
2592 if test "${enable_pc_files+set}" = set; then
2593   enableval="$enable_pc_files"
2594   enable_pc_files=$enableval
2595 else
2596   enable_pc_files=no
2597 fi;
2598         echo "$as_me:2598: result: $enable_pc_files" >&5
2599 echo "${ECHO_T}$enable_pc_files" >&6
2600         if test "$enable_pc_files" != no
2601         then
2602
2603 if test "x$prefix" != xNONE; then
2604   cf_path_syntax="$prefix"
2605 else
2606   cf_path_syntax="$ac_default_prefix"
2607 fi
2608
2609 case ".$PKG_CONFIG_LIBDIR" in #(vi
2610 .\$\(*\)*|.\'*\'*) #(vi
2611   ;;
2612 ..|./*|.\\*) #(vi
2613   ;;
2614 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2615   ;;
2616 .\${*prefix}*|.\${*dir}*) #(vi
2617   eval PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR"
2618   case ".$PKG_CONFIG_LIBDIR" in #(vi
2619   .NONE/*)
2620     PKG_CONFIG_LIBDIR=`echo $PKG_CONFIG_LIBDIR | sed -e s%NONE%$cf_path_syntax%`
2621     ;;
2622   esac
2623   ;; #(vi
2624 .no|.NONE/*)
2625   PKG_CONFIG_LIBDIR=`echo $PKG_CONFIG_LIBDIR | sed -e s%NONE%$cf_path_syntax%`
2626   ;;
2627 *)
2628   { { echo "$as_me:2628: error: expected a pathname, not \"$PKG_CONFIG_LIBDIR\"" >&5
2629 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG_LIBDIR\"" >&2;}
2630    { (exit 1); exit 1; }; }
2631   ;;
2632 esac
2633
2634         fi
2635 else
2636         enable_pc_files=no
2637 fi
2638
2639 echo "$as_me:2639: checking if you want to build test-programs" >&5
2640 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2641
2642 # Check whether --with-tests or --without-tests was given.
2643 if test "${with_tests+set}" = set; then
2644   withval="$with_tests"
2645   cf_with_tests=$withval
2646 else
2647   cf_with_tests=yes
2648 fi;
2649 echo "$as_me:2649: result: $cf_with_tests" >&5
2650 echo "${ECHO_T}$cf_with_tests" >&6
2651
2652 echo "$as_me:2652: checking if we should assume mixed-case filenames" >&5
2653 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2654
2655 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2656 if test "${enable_mixed_case+set}" = set; then
2657   enableval="$enable_mixed_case"
2658   enable_mixedcase=$enableval
2659 else
2660   enable_mixedcase=auto
2661 fi;
2662 echo "$as_me:2662: result: $enable_mixedcase" >&5
2663 echo "${ECHO_T}$enable_mixedcase" >&6
2664 if test "$enable_mixedcase" = "auto" ; then
2665
2666 echo "$as_me:2666: checking if filesystem supports mixed-case filenames" >&5
2667 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2668 if test "${cf_cv_mixedcase+set}" = set; then
2669   echo $ECHO_N "(cached) $ECHO_C" >&6
2670 else
2671
2672 if test "$cross_compiling" = yes ; then
2673         case $target_alias in #(vi
2674         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2675                 cf_cv_mixedcase=no
2676                 ;;
2677         *)
2678                 cf_cv_mixedcase=yes
2679                 ;;
2680         esac
2681 else
2682         rm -f conftest CONFTEST
2683         echo test >conftest
2684         if test -f CONFTEST ; then
2685                 cf_cv_mixedcase=no
2686         else
2687                 cf_cv_mixedcase=yes
2688         fi
2689         rm -f conftest CONFTEST
2690 fi
2691
2692 fi
2693 echo "$as_me:2693: result: $cf_cv_mixedcase" >&5
2694 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2695 test "$cf_cv_mixedcase" = yes &&
2696 cat >>confdefs.h <<\EOF
2697 #define MIXEDCASE_FILENAMES 1
2698 EOF
2699
2700 else
2701     cf_cv_mixedcase=$enable_mixedcase
2702     if test "$enable_mixedcase" = "yes" ; then
2703         cat >>confdefs.h <<\EOF
2704 #define MIXEDCASE_FILENAMES 1
2705 EOF
2706
2707     fi
2708 fi
2709
2710 # do this after mixed-case option (tags/TAGS is not as important as tic).
2711 echo "$as_me:2711: checking whether ${MAKE-make} sets \${MAKE}" >&5
2712 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2713 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2714 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2715   echo $ECHO_N "(cached) $ECHO_C" >&6
2716 else
2717   cat >conftest.make <<\EOF
2718 all:
2719         @echo 'ac_maketemp="${MAKE}"'
2720 EOF
2721 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2722 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2723 if test -n "$ac_maketemp"; then
2724   eval ac_cv_prog_make_${ac_make}_set=yes
2725 else
2726   eval ac_cv_prog_make_${ac_make}_set=no
2727 fi
2728 rm -f conftest.make
2729 fi
2730 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2731   echo "$as_me:2731: result: yes" >&5
2732 echo "${ECHO_T}yes" >&6
2733   SET_MAKE=
2734 else
2735   echo "$as_me:2735: result: no" >&5
2736 echo "${ECHO_T}no" >&6
2737   SET_MAKE="MAKE=${MAKE-make}"
2738 fi
2739
2740 for ac_prog in exctags ctags
2741 do
2742   # Extract the first word of "$ac_prog", so it can be a program name with args.
2743 set dummy $ac_prog; ac_word=$2
2744 echo "$as_me:2744: checking for $ac_word" >&5
2745 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2746 if test "${ac_cv_prog_CTAGS+set}" = set; then
2747   echo $ECHO_N "(cached) $ECHO_C" >&6
2748 else
2749   if test -n "$CTAGS"; then
2750   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2751 else
2752   ac_save_IFS=$IFS; IFS=$ac_path_separator
2753 ac_dummy="$PATH"
2754 for ac_dir in $ac_dummy; do
2755   IFS=$ac_save_IFS
2756   test -z "$ac_dir" && ac_dir=.
2757   $as_executable_p "$ac_dir/$ac_word" || continue
2758 ac_cv_prog_CTAGS="$ac_prog"
2759 echo "$as_me:2759: found $ac_dir/$ac_word" >&5
2760 break
2761 done
2762
2763 fi
2764 fi
2765 CTAGS=$ac_cv_prog_CTAGS
2766 if test -n "$CTAGS"; then
2767   echo "$as_me:2767: result: $CTAGS" >&5
2768 echo "${ECHO_T}$CTAGS" >&6
2769 else
2770   echo "$as_me:2770: result: no" >&5
2771 echo "${ECHO_T}no" >&6
2772 fi
2773
2774   test -n "$CTAGS" && break
2775 done
2776
2777 for ac_prog in exetags etags
2778 do
2779   # Extract the first word of "$ac_prog", so it can be a program name with args.
2780 set dummy $ac_prog; ac_word=$2
2781 echo "$as_me:2781: checking for $ac_word" >&5
2782 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2783 if test "${ac_cv_prog_ETAGS+set}" = set; then
2784   echo $ECHO_N "(cached) $ECHO_C" >&6
2785 else
2786   if test -n "$ETAGS"; then
2787   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2788 else
2789   ac_save_IFS=$IFS; IFS=$ac_path_separator
2790 ac_dummy="$PATH"
2791 for ac_dir in $ac_dummy; do
2792   IFS=$ac_save_IFS
2793   test -z "$ac_dir" && ac_dir=.
2794   $as_executable_p "$ac_dir/$ac_word" || continue
2795 ac_cv_prog_ETAGS="$ac_prog"
2796 echo "$as_me:2796: found $ac_dir/$ac_word" >&5
2797 break
2798 done
2799
2800 fi
2801 fi
2802 ETAGS=$ac_cv_prog_ETAGS
2803 if test -n "$ETAGS"; then
2804   echo "$as_me:2804: result: $ETAGS" >&5
2805 echo "${ECHO_T}$ETAGS" >&6
2806 else
2807   echo "$as_me:2807: result: no" >&5
2808 echo "${ECHO_T}no" >&6
2809 fi
2810
2811   test -n "$ETAGS" && break
2812 done
2813
2814 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2815 set dummy ${CTAGS:-ctags}; ac_word=$2
2816 echo "$as_me:2816: checking for $ac_word" >&5
2817 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2818 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2819   echo $ECHO_N "(cached) $ECHO_C" >&6
2820 else
2821   if test -n "$MAKE_LOWER_TAGS"; then
2822   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2823 else
2824   ac_save_IFS=$IFS; IFS=$ac_path_separator
2825 ac_dummy="$PATH"
2826 for ac_dir in $ac_dummy; do
2827   IFS=$ac_save_IFS
2828   test -z "$ac_dir" && ac_dir=.
2829   $as_executable_p "$ac_dir/$ac_word" || continue
2830 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2831 echo "$as_me:2831: found $ac_dir/$ac_word" >&5
2832 break
2833 done
2834
2835   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2836 fi
2837 fi
2838 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2839 if test -n "$MAKE_LOWER_TAGS"; then
2840   echo "$as_me:2840: result: $MAKE_LOWER_TAGS" >&5
2841 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2842 else
2843   echo "$as_me:2843: result: no" >&5
2844 echo "${ECHO_T}no" >&6
2845 fi
2846
2847 if test "$cf_cv_mixedcase" = yes ; then
2848         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2849 set dummy ${ETAGS:-etags}; ac_word=$2
2850 echo "$as_me:2850: checking for $ac_word" >&5
2851 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2852 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2853   echo $ECHO_N "(cached) $ECHO_C" >&6
2854 else
2855   if test -n "$MAKE_UPPER_TAGS"; then
2856   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2857 else
2858   ac_save_IFS=$IFS; IFS=$ac_path_separator
2859 ac_dummy="$PATH"
2860 for ac_dir in $ac_dummy; do
2861   IFS=$ac_save_IFS
2862   test -z "$ac_dir" && ac_dir=.
2863   $as_executable_p "$ac_dir/$ac_word" || continue
2864 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2865 echo "$as_me:2865: found $ac_dir/$ac_word" >&5
2866 break
2867 done
2868
2869   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2870 fi
2871 fi
2872 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2873 if test -n "$MAKE_UPPER_TAGS"; then
2874   echo "$as_me:2874: result: $MAKE_UPPER_TAGS" >&5
2875 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2876 else
2877   echo "$as_me:2877: result: no" >&5
2878 echo "${ECHO_T}no" >&6
2879 fi
2880
2881 else
2882         MAKE_UPPER_TAGS=no
2883 fi
2884
2885 if test "$MAKE_UPPER_TAGS" = yes ; then
2886         MAKE_UPPER_TAGS=
2887 else
2888         MAKE_UPPER_TAGS="#"
2889 fi
2890
2891 if test "$MAKE_LOWER_TAGS" = yes ; then
2892         MAKE_LOWER_TAGS=
2893 else
2894         MAKE_LOWER_TAGS="#"
2895 fi
2896
2897 echo "$as_me:2897: checking for makeflags variable" >&5
2898 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2899 if test "${cf_cv_makeflags+set}" = set; then
2900   echo $ECHO_N "(cached) $ECHO_C" >&6
2901 else
2902
2903         cf_cv_makeflags=''
2904         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2905         do
2906                 cat >cf_makeflags.tmp <<CF_EOF
2907 SHELL = /bin/sh
2908 all :
2909         @ echo '.$cf_option'
2910 CF_EOF
2911                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2912                 case "$cf_result" in
2913                 .*k)
2914                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2915                         case "$cf_result" in
2916                         .*CC=*) cf_cv_makeflags=
2917                                 ;;
2918                         *)      cf_cv_makeflags=$cf_option
2919                                 ;;
2920                         esac
2921                         break
2922                         ;;
2923                 .-)     ;;
2924                 *)      echo "given option \"$cf_option\", no match \"$cf_result\""
2925                         ;;
2926                 esac
2927         done
2928         rm -f cf_makeflags.tmp
2929
2930 fi
2931 echo "$as_me:2931: result: $cf_cv_makeflags" >&5
2932 echo "${ECHO_T}$cf_cv_makeflags" >&6
2933
2934 if test -n "$ac_tool_prefix"; then
2935   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2936 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2937 echo "$as_me:2937: checking for $ac_word" >&5
2938 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2939 if test "${ac_cv_prog_RANLIB+set}" = set; then
2940   echo $ECHO_N "(cached) $ECHO_C" >&6
2941 else
2942   if test -n "$RANLIB"; then
2943   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2944 else
2945   ac_save_IFS=$IFS; IFS=$ac_path_separator
2946 ac_dummy="$PATH"
2947 for ac_dir in $ac_dummy; do
2948   IFS=$ac_save_IFS
2949   test -z "$ac_dir" && ac_dir=.
2950   $as_executable_p "$ac_dir/$ac_word" || continue
2951 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2952 echo "$as_me:2952: found $ac_dir/$ac_word" >&5
2953 break
2954 done
2955
2956 fi
2957 fi
2958 RANLIB=$ac_cv_prog_RANLIB
2959 if test -n "$RANLIB"; then
2960   echo "$as_me:2960: result: $RANLIB" >&5
2961 echo "${ECHO_T}$RANLIB" >&6
2962 else
2963   echo "$as_me:2963: result: no" >&5
2964 echo "${ECHO_T}no" >&6
2965 fi
2966
2967 fi
2968 if test -z "$ac_cv_prog_RANLIB"; then
2969   ac_ct_RANLIB=$RANLIB
2970   # Extract the first word of "ranlib", so it can be a program name with args.
2971 set dummy ranlib; ac_word=$2
2972 echo "$as_me:2972: checking for $ac_word" >&5
2973 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2974 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2975   echo $ECHO_N "(cached) $ECHO_C" >&6
2976 else
2977   if test -n "$ac_ct_RANLIB"; then
2978   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2979 else
2980   ac_save_IFS=$IFS; IFS=$ac_path_separator
2981 ac_dummy="$PATH"
2982 for ac_dir in $ac_dummy; do
2983   IFS=$ac_save_IFS
2984   test -z "$ac_dir" && ac_dir=.
2985   $as_executable_p "$ac_dir/$ac_word" || continue
2986 ac_cv_prog_ac_ct_RANLIB="ranlib"
2987 echo "$as_me:2987: found $ac_dir/$ac_word" >&5
2988 break
2989 done
2990
2991   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
2992 fi
2993 fi
2994 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2995 if test -n "$ac_ct_RANLIB"; then
2996   echo "$as_me:2996: result: $ac_ct_RANLIB" >&5
2997 echo "${ECHO_T}$ac_ct_RANLIB" >&6
2998 else
2999   echo "$as_me:2999: result: no" >&5
3000 echo "${ECHO_T}no" >&6
3001 fi
3002
3003   RANLIB=$ac_ct_RANLIB
3004 else
3005   RANLIB="$ac_cv_prog_RANLIB"
3006 fi
3007
3008 if test -n "$ac_tool_prefix"; then
3009   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3010 set dummy ${ac_tool_prefix}ld; ac_word=$2
3011 echo "$as_me:3011: checking for $ac_word" >&5
3012 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3013 if test "${ac_cv_prog_LD+set}" = set; then
3014   echo $ECHO_N "(cached) $ECHO_C" >&6
3015 else
3016   if test -n "$LD"; then
3017   ac_cv_prog_LD="$LD" # Let the user override the test.
3018 else
3019   ac_save_IFS=$IFS; IFS=$ac_path_separator
3020 ac_dummy="$PATH"
3021 for ac_dir in $ac_dummy; do
3022   IFS=$ac_save_IFS
3023   test -z "$ac_dir" && ac_dir=.
3024   $as_executable_p "$ac_dir/$ac_word" || continue
3025 ac_cv_prog_LD="${ac_tool_prefix}ld"
3026 echo "$as_me:3026: found $ac_dir/$ac_word" >&5
3027 break
3028 done
3029
3030 fi
3031 fi
3032 LD=$ac_cv_prog_LD
3033 if test -n "$LD"; then
3034   echo "$as_me:3034: result: $LD" >&5
3035 echo "${ECHO_T}$LD" >&6
3036 else
3037   echo "$as_me:3037: result: no" >&5
3038 echo "${ECHO_T}no" >&6
3039 fi
3040
3041 fi
3042 if test -z "$ac_cv_prog_LD"; then
3043   ac_ct_LD=$LD
3044   # Extract the first word of "ld", so it can be a program name with args.
3045 set dummy ld; ac_word=$2
3046 echo "$as_me:3046: checking for $ac_word" >&5
3047 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3048 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3049   echo $ECHO_N "(cached) $ECHO_C" >&6
3050 else
3051   if test -n "$ac_ct_LD"; then
3052   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3053 else
3054   ac_save_IFS=$IFS; IFS=$ac_path_separator
3055 ac_dummy="$PATH"
3056 for ac_dir in $ac_dummy; do
3057   IFS=$ac_save_IFS
3058   test -z "$ac_dir" && ac_dir=.
3059   $as_executable_p "$ac_dir/$ac_word" || continue
3060 ac_cv_prog_ac_ct_LD="ld"
3061 echo "$as_me:3061: found $ac_dir/$ac_word" >&5
3062 break
3063 done
3064
3065   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3066 fi
3067 fi
3068 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3069 if test -n "$ac_ct_LD"; then
3070   echo "$as_me:3070: result: $ac_ct_LD" >&5
3071 echo "${ECHO_T}$ac_ct_LD" >&6
3072 else
3073   echo "$as_me:3073: result: no" >&5
3074 echo "${ECHO_T}no" >&6
3075 fi
3076
3077   LD=$ac_ct_LD
3078 else
3079   LD="$ac_cv_prog_LD"
3080 fi
3081
3082 if test -n "$ac_tool_prefix"; then
3083   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3084 set dummy ${ac_tool_prefix}ar; ac_word=$2
3085 echo "$as_me:3085: checking for $ac_word" >&5
3086 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3087 if test "${ac_cv_prog_AR+set}" = set; then
3088   echo $ECHO_N "(cached) $ECHO_C" >&6
3089 else
3090   if test -n "$AR"; then
3091   ac_cv_prog_AR="$AR" # Let the user override the test.
3092 else
3093   ac_save_IFS=$IFS; IFS=$ac_path_separator
3094 ac_dummy="$PATH"
3095 for ac_dir in $ac_dummy; do
3096   IFS=$ac_save_IFS
3097   test -z "$ac_dir" && ac_dir=.
3098   $as_executable_p "$ac_dir/$ac_word" || continue
3099 ac_cv_prog_AR="${ac_tool_prefix}ar"
3100 echo "$as_me:3100: found $ac_dir/$ac_word" >&5
3101 break
3102 done
3103
3104 fi
3105 fi
3106 AR=$ac_cv_prog_AR
3107 if test -n "$AR"; then
3108   echo "$as_me:3108: result: $AR" >&5
3109 echo "${ECHO_T}$AR" >&6
3110 else
3111   echo "$as_me:3111: result: no" >&5
3112 echo "${ECHO_T}no" >&6
3113 fi
3114
3115 fi
3116 if test -z "$ac_cv_prog_AR"; then
3117   ac_ct_AR=$AR
3118   # Extract the first word of "ar", so it can be a program name with args.
3119 set dummy ar; ac_word=$2
3120 echo "$as_me:3120: checking for $ac_word" >&5
3121 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3122 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3123   echo $ECHO_N "(cached) $ECHO_C" >&6
3124 else
3125   if test -n "$ac_ct_AR"; then
3126   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3127 else
3128   ac_save_IFS=$IFS; IFS=$ac_path_separator
3129 ac_dummy="$PATH"
3130 for ac_dir in $ac_dummy; do
3131   IFS=$ac_save_IFS
3132   test -z "$ac_dir" && ac_dir=.
3133   $as_executable_p "$ac_dir/$ac_word" || continue
3134 ac_cv_prog_ac_ct_AR="ar"
3135 echo "$as_me:3135: found $ac_dir/$ac_word" >&5
3136 break
3137 done
3138
3139   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3140 fi
3141 fi
3142 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3143 if test -n "$ac_ct_AR"; then
3144   echo "$as_me:3144: result: $ac_ct_AR" >&5
3145 echo "${ECHO_T}$ac_ct_AR" >&6
3146 else
3147   echo "$as_me:3147: result: no" >&5
3148 echo "${ECHO_T}no" >&6
3149 fi
3150
3151   AR=$ac_ct_AR
3152 else
3153   AR="$ac_cv_prog_AR"
3154 fi
3155
3156 if test -n "$ac_tool_prefix"; then
3157   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3158 set dummy ${ac_tool_prefix}ar; ac_word=$2
3159 echo "$as_me:3159: checking for $ac_word" >&5
3160 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3161 if test "${ac_cv_prog_AR+set}" = set; then
3162   echo $ECHO_N "(cached) $ECHO_C" >&6
3163 else
3164   if test -n "$AR"; then
3165   ac_cv_prog_AR="$AR" # Let the user override the test.
3166 else
3167   ac_save_IFS=$IFS; IFS=$ac_path_separator
3168 ac_dummy="$PATH"
3169 for ac_dir in $ac_dummy; do
3170   IFS=$ac_save_IFS
3171   test -z "$ac_dir" && ac_dir=.
3172   $as_executable_p "$ac_dir/$ac_word" || continue
3173 ac_cv_prog_AR="${ac_tool_prefix}ar"
3174 echo "$as_me:3174: found $ac_dir/$ac_word" >&5
3175 break
3176 done
3177
3178 fi
3179 fi
3180 AR=$ac_cv_prog_AR
3181 if test -n "$AR"; then
3182   echo "$as_me:3182: result: $AR" >&5
3183 echo "${ECHO_T}$AR" >&6
3184 else
3185   echo "$as_me:3185: result: no" >&5
3186 echo "${ECHO_T}no" >&6
3187 fi
3188
3189 fi
3190 if test -z "$ac_cv_prog_AR"; then
3191   ac_ct_AR=$AR
3192   # Extract the first word of "ar", so it can be a program name with args.
3193 set dummy ar; ac_word=$2
3194 echo "$as_me:3194: checking for $ac_word" >&5
3195 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3196 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3197   echo $ECHO_N "(cached) $ECHO_C" >&6
3198 else
3199   if test -n "$ac_ct_AR"; then
3200   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3201 else
3202   ac_save_IFS=$IFS; IFS=$ac_path_separator
3203 ac_dummy="$PATH"
3204 for ac_dir in $ac_dummy; do
3205   IFS=$ac_save_IFS
3206   test -z "$ac_dir" && ac_dir=.
3207   $as_executable_p "$ac_dir/$ac_word" || continue
3208 ac_cv_prog_ac_ct_AR="ar"
3209 echo "$as_me:3209: found $ac_dir/$ac_word" >&5
3210 break
3211 done
3212
3213   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3214 fi
3215 fi
3216 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3217 if test -n "$ac_ct_AR"; then
3218   echo "$as_me:3218: result: $ac_ct_AR" >&5
3219 echo "${ECHO_T}$ac_ct_AR" >&6
3220 else
3221   echo "$as_me:3221: result: no" >&5
3222 echo "${ECHO_T}no" >&6
3223 fi
3224
3225   AR=$ac_ct_AR
3226 else
3227   AR="$ac_cv_prog_AR"
3228 fi
3229
3230 echo "$as_me:3230: checking for options to update archives" >&5
3231 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3232 if test "${cf_cv_ar_flags+set}" = set; then
3233   echo $ECHO_N "(cached) $ECHO_C" >&6
3234 else
3235
3236         cf_cv_ar_flags=unknown
3237         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3238         do
3239
3240                 # check if $ARFLAGS already contains this choice
3241                 if test "x$ARFLAGS" != "x" ; then
3242                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3243                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3244                                 cf_cv_ar_flags=
3245                                 break
3246                         fi
3247                 fi
3248
3249                 rm -f conftest.$ac_cv_objext
3250                 rm -f conftest.a
3251
3252                 cat >conftest.$ac_ext <<EOF
3253 #line 3253 "configure"
3254 int     testdata[3] = { 123, 456, 789 };
3255 EOF
3256                 if { (eval echo "$as_me:3256: \"$ac_compile\"") >&5
3257   (eval $ac_compile) 2>&5
3258   ac_status=$?
3259   echo "$as_me:3259: \$? = $ac_status" >&5
3260   (exit $ac_status); } ; then
3261                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3262                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3263                         if test -f conftest.a ; then
3264                                 cf_cv_ar_flags=$cf_ar_flags
3265                                 break
3266                         fi
3267                 else
3268                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3269
3270 echo "${as_me:-configure}:3270: testing cannot compile test-program ..." 1>&5
3271
3272                         break
3273                 fi
3274         done
3275         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3276
3277 fi
3278 echo "$as_me:3278: result: $cf_cv_ar_flags" >&5
3279 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3280
3281 if test -n "$ARFLAGS" ; then
3282         if test -n "$cf_cv_ar_flags" ; then
3283                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3284         fi
3285 else
3286         ARFLAGS=$cf_cv_ar_flags
3287 fi
3288
3289         echo "$as_me:3289: checking for PATH separator" >&5
3290 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3291         case $cf_cv_system_name in
3292         os2*)   PATH_SEPARATOR=';'  ;;
3293         *)      ${PATH_SEPARATOR:=':'}  ;;
3294         esac
3295
3296         echo "$as_me:3296: result: $PATH_SEPARATOR" >&5
3297 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3298
3299 echo "$as_me:3299: checking if you have specified an install-prefix" >&5
3300 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3301
3302 # Check whether --with-install-prefix or --without-install-prefix was given.
3303 if test "${with_install_prefix+set}" = set; then
3304   withval="$with_install_prefix"
3305   case "$withval" in #(vi
3306         yes|no) #(vi
3307                 ;;
3308         *)      DESTDIR="$withval"
3309                 ;;
3310         esac
3311 fi;
3312 echo "$as_me:3312: result: $DESTDIR" >&5
3313 echo "${ECHO_T}$DESTDIR" >&6
3314
3315 ###############################################################################
3316
3317 # If we're cross-compiling, allow the user to override the tools and their
3318 # options.  The configure script is oriented toward identifying the host
3319 # compiler, etc., but we need a build compiler to generate parts of the source.
3320
3321 if test "$cross_compiling" = yes ; then
3322
3323         # defaults that we might want to override
3324         : ${BUILD_CFLAGS:=''}
3325         : ${BUILD_CPPFLAGS:=''}
3326         : ${BUILD_LDFLAGS:=''}
3327         : ${BUILD_LIBS:=''}
3328         : ${BUILD_EXEEXT:='$x'}
3329         : ${BUILD_OBJEXT:='o'}
3330
3331 # Check whether --with-build-cc or --without-build-cc was given.
3332 if test "${with_build_cc+set}" = set; then
3333   withval="$with_build_cc"
3334   BUILD_CC="$withval"
3335 else
3336   for ac_prog in gcc cc cl
3337 do
3338   # Extract the first word of "$ac_prog", so it can be a program name with args.
3339 set dummy $ac_prog; ac_word=$2
3340 echo "$as_me:3340: checking for $ac_word" >&5
3341 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3342 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3343   echo $ECHO_N "(cached) $ECHO_C" >&6
3344 else
3345   if test -n "$BUILD_CC"; then
3346   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3347 else
3348   ac_save_IFS=$IFS; IFS=$ac_path_separator
3349 ac_dummy="$PATH"
3350 for ac_dir in $ac_dummy; do
3351   IFS=$ac_save_IFS
3352   test -z "$ac_dir" && ac_dir=.
3353   $as_executable_p "$ac_dir/$ac_word" || continue
3354 ac_cv_prog_BUILD_CC="$ac_prog"
3355 echo "$as_me:3355: found $ac_dir/$ac_word" >&5
3356 break
3357 done
3358
3359 fi
3360 fi
3361 BUILD_CC=$ac_cv_prog_BUILD_CC
3362 if test -n "$BUILD_CC"; then
3363   echo "$as_me:3363: result: $BUILD_CC" >&5
3364 echo "${ECHO_T}$BUILD_CC" >&6
3365 else
3366   echo "$as_me:3366: result: no" >&5
3367 echo "${ECHO_T}no" >&6
3368 fi
3369
3370   test -n "$BUILD_CC" && break
3371 done
3372
3373 fi;
3374         echo "$as_me:3374: checking for native build C compiler" >&5
3375 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3376         echo "$as_me:3376: result: $BUILD_CC" >&5
3377 echo "${ECHO_T}$BUILD_CC" >&6
3378
3379         echo "$as_me:3379: checking for native build C preprocessor" >&5
3380 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3381
3382 # Check whether --with-build-cpp or --without-build-cpp was given.
3383 if test "${with_build_cpp+set}" = set; then
3384   withval="$with_build_cpp"
3385   BUILD_CPP="$withval"
3386 else
3387   BUILD_CPP='${BUILD_CC} -E'
3388 fi;
3389         echo "$as_me:3389: result: $BUILD_CPP" >&5
3390 echo "${ECHO_T}$BUILD_CPP" >&6
3391
3392         echo "$as_me:3392: checking for native build C flags" >&5
3393 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3394
3395 # Check whether --with-build-cflags or --without-build-cflags was given.
3396 if test "${with_build_cflags+set}" = set; then
3397   withval="$with_build_cflags"
3398   BUILD_CFLAGS="$withval"
3399 fi;
3400         echo "$as_me:3400: result: $BUILD_CFLAGS" >&5
3401 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3402
3403         echo "$as_me:3403: checking for native build C preprocessor-flags" >&5
3404 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3405
3406 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3407 if test "${with_build_cppflags+set}" = set; then
3408   withval="$with_build_cppflags"
3409   BUILD_CPPFLAGS="$withval"
3410 fi;
3411         echo "$as_me:3411: result: $BUILD_CPPFLAGS" >&5
3412 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3413
3414         echo "$as_me:3414: checking for native build linker-flags" >&5
3415 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3416
3417 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3418 if test "${with_build_ldflags+set}" = set; then
3419   withval="$with_build_ldflags"
3420   BUILD_LDFLAGS="$withval"
3421 fi;
3422         echo "$as_me:3422: result: $BUILD_LDFLAGS" >&5
3423 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3424
3425         echo "$as_me:3425: checking for native build linker-libraries" >&5
3426 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3427
3428 # Check whether --with-build-libs or --without-build-libs was given.
3429 if test "${with_build_libs+set}" = set; then
3430   withval="$with_build_libs"
3431   BUILD_LIBS="$withval"
3432 fi;
3433         echo "$as_me:3433: result: $BUILD_LIBS" >&5
3434 echo "${ECHO_T}$BUILD_LIBS" >&6
3435
3436         # this assumes we're on Unix.
3437         BUILD_EXEEXT=
3438         BUILD_OBJEXT=o
3439
3440         : ${BUILD_CC:='${CC}'}
3441
3442         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3443                 { { echo "$as_me:3443: error: Cross-build requires two compilers.
3444 Use --with-build-cc to specify the native compiler." >&5
3445 echo "$as_me: error: Cross-build requires two compilers.
3446 Use --with-build-cc to specify the native compiler." >&2;}
3447    { (exit 1); exit 1; }; }
3448         fi
3449
3450 else
3451         : ${BUILD_CC:='${CC}'}
3452         : ${BUILD_CPP:='${CPP}'}
3453         : ${BUILD_CFLAGS:='${CFLAGS}'}
3454         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3455         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3456         : ${BUILD_LIBS:='${LIBS}'}
3457         : ${BUILD_EXEEXT:='$x'}
3458         : ${BUILD_OBJEXT:='o'}
3459 fi
3460
3461 ###############################################################################
3462
3463 ### Options to allow the user to specify the set of libraries which are used.
3464 ### Use "--without-normal --with-shared" to allow the default model to be
3465 ### shared, for example.
3466 cf_list_models=""
3467
3468 echo "$as_me:3468: checking if you want to build shared C-objects" >&5
3469 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3470
3471 # Check whether --with-shared or --without-shared was given.
3472 if test "${with_shared+set}" = set; then
3473   withval="$with_shared"
3474   with_shared=$withval
3475 else
3476   with_shared=no
3477 fi;
3478 echo "$as_me:3478: result: $with_shared" >&5
3479 echo "${ECHO_T}$with_shared" >&6
3480 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3481
3482 echo "$as_me:3482: checking for specified models" >&5
3483 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3484 test -z "$cf_list_models" && cf_list_models=normal
3485 echo "$as_me:3485: result: $cf_list_models" >&5
3486 echo "${ECHO_T}$cf_list_models" >&6
3487
3488 ### Use the first model as the default, and save its suffix for use in building
3489 ### up test-applications.
3490 echo "$as_me:3490: checking for default model" >&5
3491 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3492 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3493 echo "$as_me:3493: result: $DFT_LWR_MODEL" >&5
3494 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3495
3496 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3497
3498 echo "$as_me:3498: checking for specific curses-directory" >&5
3499 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3500
3501 # Check whether --with-curses-dir or --without-curses-dir was given.
3502 if test "${with_curses_dir+set}" = set; then
3503   withval="$with_curses_dir"
3504   cf_cv_curses_dir=$withval
3505 else
3506   cf_cv_curses_dir=no
3507 fi;
3508 echo "$as_me:3508: result: $cf_cv_curses_dir" >&5
3509 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3510
3511 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3512 then
3513
3514 if test "x$prefix" != xNONE; then
3515   cf_path_syntax="$prefix"
3516 else
3517   cf_path_syntax="$ac_default_prefix"
3518 fi
3519
3520 case ".$withval" in #(vi
3521 .\$\(*\)*|.\'*\'*) #(vi
3522   ;;
3523 ..|./*|.\\*) #(vi
3524   ;;
3525 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
3526   ;;
3527 .\${*prefix}*|.\${*dir}*) #(vi
3528   eval withval="$withval"
3529   case ".$withval" in #(vi
3530   .NONE/*)
3531     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3532     ;;
3533   esac
3534   ;; #(vi
3535 .no|.NONE/*)
3536   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3537   ;;
3538 *)
3539   { { echo "$as_me:3539: error: expected a pathname, not \"$withval\"" >&5
3540 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3541    { (exit 1); exit 1; }; }
3542   ;;
3543 esac
3544
3545         if test -d "$cf_cv_curses_dir"
3546         then
3547
3548 if test -n "$cf_cv_curses_dir/include" ; then
3549   for cf_add_incdir in $cf_cv_curses_dir/include
3550   do
3551         while test $cf_add_incdir != /usr/include
3552         do
3553           if test -d $cf_add_incdir
3554           then
3555                 cf_have_incdir=no
3556                 if test -n "$CFLAGS$CPPFLAGS" ; then
3557                   # a loop is needed to ensure we can add subdirs of existing dirs
3558                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3559                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3560                           cf_have_incdir=yes; break
3561                         fi
3562                   done
3563                 fi
3564
3565                 if test "$cf_have_incdir" = no ; then
3566                   if test "$cf_add_incdir" = /usr/local/include ; then
3567                         if test "$GCC" = yes
3568                         then
3569                           cf_save_CPPFLAGS=$CPPFLAGS
3570                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3571                           cat >conftest.$ac_ext <<_ACEOF
3572 #line 3572 "configure"
3573 #include "confdefs.h"
3574 #include <stdio.h>
3575 int
3576 main ()
3577 {
3578 printf("Hello")
3579   ;
3580   return 0;
3581 }
3582 _ACEOF
3583 rm -f conftest.$ac_objext
3584 if { (eval echo "$as_me:3584: \"$ac_compile\"") >&5
3585   (eval $ac_compile) 2>&5
3586   ac_status=$?
3587   echo "$as_me:3587: \$? = $ac_status" >&5
3588   (exit $ac_status); } &&
3589          { ac_try='test -s conftest.$ac_objext'
3590   { (eval echo "$as_me:3590: \"$ac_try\"") >&5
3591   (eval $ac_try) 2>&5
3592   ac_status=$?
3593   echo "$as_me:3593: \$? = $ac_status" >&5
3594   (exit $ac_status); }; }; then
3595   :
3596 else
3597   echo "$as_me: failed program was:" >&5
3598 cat conftest.$ac_ext >&5
3599 cf_have_incdir=yes
3600 fi
3601 rm -f conftest.$ac_objext conftest.$ac_ext
3602                           CPPFLAGS=$cf_save_CPPFLAGS
3603                         fi
3604                   fi
3605                 fi
3606
3607                 if test "$cf_have_incdir" = no ; then
3608                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3609
3610 echo "${as_me:-configure}:3610: testing adding $cf_add_incdir to include-path ..." 1>&5
3611
3612                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3613
3614                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3615                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3616                   cf_add_incdir="$cf_top_incdir"
3617                 else
3618                   break
3619                 fi
3620           fi
3621         done
3622   done
3623 fi
3624
3625 if test -n "$cf_cv_curses_dir/lib" ; then
3626   for cf_add_libdir in $cf_cv_curses_dir/lib
3627   do
3628     if test $cf_add_libdir = /usr/lib ; then
3629       :
3630     elif test -d $cf_add_libdir
3631     then
3632       cf_have_libdir=no
3633       if test -n "$LDFLAGS$LIBS" ; then
3634         # a loop is needed to ensure we can add subdirs of existing dirs
3635         for cf_test_libdir in $LDFLAGS $LIBS ; do
3636           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3637             cf_have_libdir=yes; break
3638           fi
3639         done
3640       fi
3641       if test "$cf_have_libdir" = no ; then
3642         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3643
3644 echo "${as_me:-configure}:3644: testing adding $cf_add_libdir to library-path ..." 1>&5
3645
3646         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3647       fi
3648     fi
3649   done
3650 fi
3651
3652         fi
3653 fi
3654
3655 echo "$as_me:3655: checking if you want wide-character code" >&5
3656 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3657
3658 # Check whether --enable-widec or --disable-widec was given.
3659 if test "${enable_widec+set}" = set; then
3660   enableval="$enable_widec"
3661   with_widec=$enableval
3662 else
3663   with_widec=no
3664 fi;
3665 echo "$as_me:3665: result: $with_widec" >&5
3666 echo "${ECHO_T}$with_widec" >&6
3667 if test "$with_widec" = yes ; then
3668
3669 echo "$as_me:3669: checking for multibyte character support" >&5
3670 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3671 if test "${cf_cv_utf8_lib+set}" = set; then
3672   echo $ECHO_N "(cached) $ECHO_C" >&6
3673 else
3674
3675         cf_save_LIBS="$LIBS"
3676         cat >conftest.$ac_ext <<_ACEOF
3677 #line 3677 "configure"
3678 #include "confdefs.h"
3679
3680 #include <stdlib.h>
3681 int
3682 main ()
3683 {
3684 putwc(0,0);
3685   ;
3686   return 0;
3687 }
3688 _ACEOF
3689 rm -f conftest.$ac_objext conftest$ac_exeext
3690 if { (eval echo "$as_me:3690: \"$ac_link\"") >&5
3691   (eval $ac_link) 2>&5
3692   ac_status=$?
3693   echo "$as_me:3693: \$? = $ac_status" >&5
3694   (exit $ac_status); } &&
3695          { ac_try='test -s conftest$ac_exeext'
3696   { (eval echo "$as_me:3696: \"$ac_try\"") >&5
3697   (eval $ac_try) 2>&5
3698   ac_status=$?
3699   echo "$as_me:3699: \$? = $ac_status" >&5
3700   (exit $ac_status); }; }; then
3701   cf_cv_utf8_lib=yes
3702 else
3703   echo "$as_me: failed program was:" >&5
3704 cat conftest.$ac_ext >&5
3705
3706 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3707 # will be set on completion of the AC_TRY_LINK below.
3708 cf_cv_header_path_utf8=
3709 cf_cv_library_path_utf8=
3710
3711 echo "${as_me:-configure}:3711: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3712
3713 cf_save_LIBS="$LIBS"
3714
3715 cat >conftest.$ac_ext <<_ACEOF
3716 #line 3716 "configure"
3717 #include "confdefs.h"
3718
3719 #include <libutf8.h>
3720 int
3721 main ()
3722 {
3723 putwc(0,0);
3724   ;
3725   return 0;
3726 }
3727 _ACEOF
3728 rm -f conftest.$ac_objext conftest$ac_exeext
3729 if { (eval echo "$as_me:3729: \"$ac_link\"") >&5
3730   (eval $ac_link) 2>&5
3731   ac_status=$?
3732   echo "$as_me:3732: \$? = $ac_status" >&5
3733   (exit $ac_status); } &&
3734          { ac_try='test -s conftest$ac_exeext'
3735   { (eval echo "$as_me:3735: \"$ac_try\"") >&5
3736   (eval $ac_try) 2>&5
3737   ac_status=$?
3738   echo "$as_me:3738: \$? = $ac_status" >&5
3739   (exit $ac_status); }; }; then
3740
3741         cf_cv_find_linkage_utf8=yes
3742         cf_cv_header_path_utf8=/usr/include
3743         cf_cv_library_path_utf8=/usr/lib
3744
3745 else
3746   echo "$as_me: failed program was:" >&5
3747 cat conftest.$ac_ext >&5
3748
3749 LIBS="-lutf8  $cf_save_LIBS"
3750
3751 cat >conftest.$ac_ext <<_ACEOF
3752 #line 3752 "configure"
3753 #include "confdefs.h"
3754
3755 #include <libutf8.h>
3756 int
3757 main ()
3758 {
3759 putwc(0,0);
3760   ;
3761   return 0;
3762 }
3763 _ACEOF
3764 rm -f conftest.$ac_objext conftest$ac_exeext
3765 if { (eval echo "$as_me:3765: \"$ac_link\"") >&5
3766   (eval $ac_link) 2>&5
3767   ac_status=$?
3768   echo "$as_me:3768: \$? = $ac_status" >&5
3769   (exit $ac_status); } &&
3770          { ac_try='test -s conftest$ac_exeext'
3771   { (eval echo "$as_me:3771: \"$ac_try\"") >&5
3772   (eval $ac_try) 2>&5
3773   ac_status=$?
3774   echo "$as_me:3774: \$? = $ac_status" >&5
3775   (exit $ac_status); }; }; then
3776
3777         cf_cv_find_linkage_utf8=yes
3778         cf_cv_header_path_utf8=/usr/include
3779         cf_cv_library_path_utf8=/usr/lib
3780         cf_cv_library_file_utf8="-lutf8"
3781
3782 else
3783   echo "$as_me: failed program was:" >&5
3784 cat conftest.$ac_ext >&5
3785
3786         cf_cv_find_linkage_utf8=no
3787         LIBS="$cf_save_LIBS"
3788
3789     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
3790
3791 echo "${as_me:-configure}:3791: testing find linkage for utf8 library ..." 1>&5
3792
3793 echo "${as_me:-configure}:3793: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3794
3795     cf_save_CPPFLAGS="$CPPFLAGS"
3796     cf_test_CPPFLAGS="$CPPFLAGS"
3797
3798 cf_search=
3799
3800 # collect the current set of include-directories from compiler flags
3801 cf_header_path_list=""
3802 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3803         for cf_header_path in $CPPFLAGS $CFLAGS
3804         do
3805                 case $cf_header_path in #(vi
3806                 -I*)
3807                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3808
3809 test "$cf_header_path" != "NONE" && \
3810 test -d "$cf_header_path" && \
3811  {
3812         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3813         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3814         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
3815         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
3816         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
3817         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
3818 }
3819
3820                         cf_header_path_list="$cf_header_path_list $cf_search"
3821                         ;;
3822                 esac
3823         done
3824 fi
3825
3826 # add the variations for the package we are looking for
3827
3828 cf_search=
3829
3830 test "/usr" != "$prefix" && \
3831 test -d "/usr" && \
3832 (test $prefix = NONE || test "/usr" != "$prefix") && {
3833         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
3834         test -d /usr/include &&          cf_search="$cf_search /usr/include"
3835         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
3836         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
3837         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
3838         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
3839 }
3840
3841 test "$prefix" != "NONE" && \
3842 test -d "$prefix" && \
3843  {
3844         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3845         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3846         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
3847         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
3848         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
3849         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
3850 }
3851
3852 test "/usr/local" != "$prefix" && \
3853 test -d "/usr/local" && \
3854 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
3855         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
3856         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
3857         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
3858         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
3859         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
3860         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
3861 }
3862
3863 test "/opt" != "$prefix" && \
3864 test -d "/opt" && \
3865 (test $prefix = NONE || test "/opt" != "$prefix") && {
3866         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
3867         test -d /opt/include &&          cf_search="$cf_search /opt/include"
3868         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
3869         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
3870         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
3871         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
3872 }
3873
3874 test "$HOME" != "$prefix" && \
3875 test -d "$HOME" && \
3876 (test $prefix = NONE || test "$HOME" != "$prefix") && {
3877         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
3878         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
3879         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
3880         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
3881         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
3882         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
3883 }
3884
3885 test "$includedir" != NONE && \
3886 test "$includedir" != "/usr/include" && \
3887 test -d "$includedir" && {
3888         test -d $includedir &&    cf_search="$cf_search $includedir"
3889         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
3890 }
3891
3892 test "$oldincludedir" != NONE && \
3893 test "$oldincludedir" != "/usr/include" && \
3894 test -d "$oldincludedir" && {
3895         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3896         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
3897 }
3898
3899 cf_search="$cf_search $cf_header_path_list"
3900
3901     for cf_cv_header_path_utf8 in $cf_search
3902     do
3903       if test -d $cf_cv_header_path_utf8 ; then
3904         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
3905
3906 echo "${as_me:-configure}:3906: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
3907
3908         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
3909         cat >conftest.$ac_ext <<_ACEOF
3910 #line 3910 "configure"
3911 #include "confdefs.h"
3912
3913 #include <libutf8.h>
3914 int
3915 main ()
3916 {
3917 putwc(0,0);
3918   ;
3919   return 0;
3920 }
3921 _ACEOF
3922 rm -f conftest.$ac_objext
3923 if { (eval echo "$as_me:3923: \"$ac_compile\"") >&5
3924   (eval $ac_compile) 2>&5
3925   ac_status=$?
3926   echo "$as_me:3926: \$? = $ac_status" >&5
3927   (exit $ac_status); } &&
3928          { ac_try='test -s conftest.$ac_objext'
3929   { (eval echo "$as_me:3929: \"$ac_try\"") >&5
3930   (eval $ac_try) 2>&5
3931   ac_status=$?
3932   echo "$as_me:3932: \$? = $ac_status" >&5
3933   (exit $ac_status); }; }; then
3934
3935             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
3936
3937 echo "${as_me:-configure}:3937: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
3938
3939             cf_cv_find_linkage_utf8=maybe
3940             cf_test_CPPFLAGS="$CPPFLAGS"
3941             break
3942 else
3943   echo "$as_me: failed program was:" >&5
3944 cat conftest.$ac_ext >&5
3945
3946             CPPFLAGS="$cf_save_CPPFLAGS"
3947
3948 fi
3949 rm -f conftest.$ac_objext conftest.$ac_ext
3950       fi
3951     done
3952
3953     if test "$cf_cv_find_linkage_utf8" = maybe ; then
3954
3955 echo "${as_me:-configure}:3955: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
3956
3957       cf_save_LIBS="$LIBS"
3958       cf_save_LDFLAGS="$LDFLAGS"
3959
3960       if test "$cf_cv_find_linkage_utf8" != yes ; then
3961
3962 cf_search=
3963 cf_library_path_list=""
3964 if test -n "${LDFLAGS}${LIBS}" ; then
3965         for cf_library_path in $LDFLAGS $LIBS
3966         do
3967                 case $cf_library_path in #(vi
3968                 -L*)
3969                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
3970
3971 test "$cf_library_path" != "NONE" && \
3972 test -d "$cf_library_path" && \
3973  {
3974         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
3975         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
3976         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
3977         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
3978         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
3979         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
3980 }
3981
3982                         cf_library_path_list="$cf_library_path_list $cf_search"
3983                         ;;
3984                 esac
3985         done
3986 fi
3987
3988 cf_search=
3989
3990 test "/usr" != "$prefix" && \
3991 test -d "/usr" && \
3992 (test $prefix = NONE || test "/usr" != "$prefix") && {
3993         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
3994         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
3995         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
3996         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
3997         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
3998         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
3999 }
4000
4001 test "$prefix" != "NONE" && \
4002 test -d "$prefix" && \
4003  {
4004         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
4005         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4006         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
4007         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
4008         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
4009         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
4010 }
4011
4012 test "/usr/local" != "$prefix" && \
4013 test -d "/usr/local" && \
4014 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4015         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
4016         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
4017         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
4018         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
4019         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
4020         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
4021 }
4022
4023 test "/opt" != "$prefix" && \
4024 test -d "/opt" && \
4025 (test $prefix = NONE || test "/opt" != "$prefix") && {
4026         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
4027         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
4028         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
4029         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
4030         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
4031         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
4032 }
4033
4034 test "$HOME" != "$prefix" && \
4035 test -d "$HOME" && \
4036 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4037         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
4038         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
4039         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
4040         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
4041         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
4042         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
4043 }
4044
4045 cf_search="$cf_library_path_list $cf_search"
4046
4047         for cf_cv_library_path_utf8 in $cf_search
4048         do
4049           if test -d $cf_cv_library_path_utf8 ; then
4050             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
4051
4052 echo "${as_me:-configure}:4052: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
4053
4054             CPPFLAGS="$cf_test_CPPFLAGS"
4055             LIBS="-lutf8  $cf_save_LIBS"
4056             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
4057             cat >conftest.$ac_ext <<_ACEOF
4058 #line 4058 "configure"
4059 #include "confdefs.h"
4060
4061 #include <libutf8.h>
4062 int
4063 main ()
4064 {
4065 putwc(0,0);
4066   ;
4067   return 0;
4068 }
4069 _ACEOF
4070 rm -f conftest.$ac_objext conftest$ac_exeext
4071 if { (eval echo "$as_me:4071: \"$ac_link\"") >&5
4072   (eval $ac_link) 2>&5
4073   ac_status=$?
4074   echo "$as_me:4074: \$? = $ac_status" >&5
4075   (exit $ac_status); } &&
4076          { ac_try='test -s conftest$ac_exeext'
4077   { (eval echo "$as_me:4077: \"$ac_try\"") >&5
4078   (eval $ac_try) 2>&5
4079   ac_status=$?
4080   echo "$as_me:4080: \$? = $ac_status" >&5
4081   (exit $ac_status); }; }; then
4082
4083                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4084
4085 echo "${as_me:-configure}:4085: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4086
4087                 cf_cv_find_linkage_utf8=yes
4088                 cf_cv_library_file_utf8="-lutf8"
4089                 break
4090 else
4091   echo "$as_me: failed program was:" >&5
4092 cat conftest.$ac_ext >&5
4093
4094                 CPPFLAGS="$cf_save_CPPFLAGS"
4095                 LIBS="$cf_save_LIBS"
4096                 LDFLAGS="$cf_save_LDFLAGS"
4097
4098 fi
4099 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4100           fi
4101         done
4102         CPPFLAGS="$cf_save_CPPFLAGS"
4103         LDFLAGS="$cf_save_LDFLAGS"
4104       fi
4105
4106     else
4107       cf_cv_find_linkage_utf8=no
4108     fi
4109
4110 fi
4111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4112
4113 fi
4114 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4115
4116 LIBS="$cf_save_LIBS"
4117
4118 if test "$cf_cv_find_linkage_utf8" = yes ; then
4119 cf_cv_utf8_lib=add-on
4120 else
4121 cf_cv_utf8_lib=no
4122 fi
4123
4124 fi
4125 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4126 fi
4127 echo "$as_me:4127: result: $cf_cv_utf8_lib" >&5
4128 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4129
4130 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4131 # ncurses/ncursesw:
4132 if test "$cf_cv_utf8_lib" = "add-on" ; then
4133
4134 cat >>confdefs.h <<\EOF
4135 #define HAVE_LIBUTF8_H 1
4136 EOF
4137
4138 if test -n "$cf_cv_header_path_utf8" ; then
4139   for cf_add_incdir in $cf_cv_header_path_utf8
4140   do
4141         while test $cf_add_incdir != /usr/include
4142         do
4143           if test -d $cf_add_incdir
4144           then
4145                 cf_have_incdir=no
4146                 if test -n "$CFLAGS$CPPFLAGS" ; then
4147                   # a loop is needed to ensure we can add subdirs of existing dirs
4148                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4149                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4150                           cf_have_incdir=yes; break
4151                         fi
4152                   done
4153                 fi
4154
4155                 if test "$cf_have_incdir" = no ; then
4156                   if test "$cf_add_incdir" = /usr/local/include ; then
4157                         if test "$GCC" = yes
4158                         then
4159                           cf_save_CPPFLAGS=$CPPFLAGS
4160                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4161                           cat >conftest.$ac_ext <<_ACEOF
4162 #line 4162 "configure"
4163 #include "confdefs.h"
4164 #include <stdio.h>
4165 int
4166 main ()
4167 {
4168 printf("Hello")
4169   ;
4170   return 0;
4171 }
4172 _ACEOF
4173 rm -f conftest.$ac_objext
4174 if { (eval echo "$as_me:4174: \"$ac_compile\"") >&5
4175   (eval $ac_compile) 2>&5
4176   ac_status=$?
4177   echo "$as_me:4177: \$? = $ac_status" >&5
4178   (exit $ac_status); } &&
4179          { ac_try='test -s conftest.$ac_objext'
4180   { (eval echo "$as_me:4180: \"$ac_try\"") >&5
4181   (eval $ac_try) 2>&5
4182   ac_status=$?
4183   echo "$as_me:4183: \$? = $ac_status" >&5
4184   (exit $ac_status); }; }; then
4185   :
4186 else
4187   echo "$as_me: failed program was:" >&5
4188 cat conftest.$ac_ext >&5
4189 cf_have_incdir=yes
4190 fi
4191 rm -f conftest.$ac_objext conftest.$ac_ext
4192                           CPPFLAGS=$cf_save_CPPFLAGS
4193                         fi
4194                   fi
4195                 fi
4196
4197                 if test "$cf_have_incdir" = no ; then
4198                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4199
4200 echo "${as_me:-configure}:4200: testing adding $cf_add_incdir to include-path ..." 1>&5
4201
4202                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4203
4204                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4205                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4206                   cf_add_incdir="$cf_top_incdir"
4207                 else
4208                   break
4209                 fi
4210           fi
4211         done
4212   done
4213 fi
4214
4215 if test -n "$cf_cv_library_path_utf8" ; then
4216   for cf_add_libdir in $cf_cv_library_path_utf8
4217   do
4218     if test $cf_add_libdir = /usr/lib ; then
4219       :
4220     elif test -d $cf_add_libdir
4221     then
4222       cf_have_libdir=no
4223       if test -n "$LDFLAGS$LIBS" ; then
4224         # a loop is needed to ensure we can add subdirs of existing dirs
4225         for cf_test_libdir in $LDFLAGS $LIBS ; do
4226           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4227             cf_have_libdir=yes; break
4228           fi
4229         done
4230       fi
4231       if test "$cf_have_libdir" = no ; then
4232         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4233
4234 echo "${as_me:-configure}:4234: testing adding $cf_add_libdir to library-path ..." 1>&5
4235
4236         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4237       fi
4238     fi
4239   done
4240 fi
4241
4242         LIBS="$cf_cv_library_file_utf8 $LIBS"
4243 fi
4244
4245 cf_ncuconfig_root=ncursesw
4246
4247 echo "Looking for ${cf_ncuconfig_root}-config"
4248
4249 if test -n "$ac_tool_prefix"; then
4250   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4251   do
4252     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4253 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4254 echo "$as_me:4254: checking for $ac_word" >&5
4255 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4256 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4257   echo $ECHO_N "(cached) $ECHO_C" >&6
4258 else
4259   if test -n "$NCURSES_CONFIG"; then
4260   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4261 else
4262   ac_save_IFS=$IFS; IFS=$ac_path_separator
4263 ac_dummy="$PATH"
4264 for ac_dir in $ac_dummy; do
4265   IFS=$ac_save_IFS
4266   test -z "$ac_dir" && ac_dir=.
4267   $as_executable_p "$ac_dir/$ac_word" || continue
4268 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4269 echo "$as_me:4269: found $ac_dir/$ac_word" >&5
4270 break
4271 done
4272
4273 fi
4274 fi
4275 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4276 if test -n "$NCURSES_CONFIG"; then
4277   echo "$as_me:4277: result: $NCURSES_CONFIG" >&5
4278 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4279 else
4280   echo "$as_me:4280: result: no" >&5
4281 echo "${ECHO_T}no" >&6
4282 fi
4283
4284     test -n "$NCURSES_CONFIG" && break
4285   done
4286 fi
4287 if test -z "$NCURSES_CONFIG"; then
4288   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4289   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4290 do
4291   # Extract the first word of "$ac_prog", so it can be a program name with args.
4292 set dummy $ac_prog; ac_word=$2
4293 echo "$as_me:4293: checking for $ac_word" >&5
4294 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4295 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4296   echo $ECHO_N "(cached) $ECHO_C" >&6
4297 else
4298   if test -n "$ac_ct_NCURSES_CONFIG"; then
4299   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4300 else
4301   ac_save_IFS=$IFS; IFS=$ac_path_separator
4302 ac_dummy="$PATH"
4303 for ac_dir in $ac_dummy; do
4304   IFS=$ac_save_IFS
4305   test -z "$ac_dir" && ac_dir=.
4306   $as_executable_p "$ac_dir/$ac_word" || continue
4307 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4308 echo "$as_me:4308: found $ac_dir/$ac_word" >&5
4309 break
4310 done
4311
4312 fi
4313 fi
4314 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4315 if test -n "$ac_ct_NCURSES_CONFIG"; then
4316   echo "$as_me:4316: result: $ac_ct_NCURSES_CONFIG" >&5
4317 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4318 else
4319   echo "$as_me:4319: result: no" >&5
4320 echo "${ECHO_T}no" >&6
4321 fi
4322
4323   test -n "$ac_ct_NCURSES_CONFIG" && break
4324 done
4325 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4326
4327   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4328 fi
4329
4330 if test "$NCURSES_CONFIG" != none ; then
4331
4332 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4333 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
4334
4335 # even with config script, some packages use no-override for curses.h
4336
4337 echo "$as_me:4337: checking if we have identified curses headers" >&5
4338 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4339 if test "${cf_cv_ncurses_header+set}" = set; then
4340   echo $ECHO_N "(cached) $ECHO_C" >&6
4341 else
4342
4343 cf_cv_ncurses_header=none
4344 for cf_header in  \
4345     ncursesw/ncurses.h \
4346         ncursesw/curses.h \
4347         ncurses.h \
4348         curses.h
4349 do
4350 cat >conftest.$ac_ext <<_ACEOF
4351 #line 4351 "configure"
4352 #include "confdefs.h"
4353 #include <${cf_header}>
4354 int
4355 main ()
4356 {
4357 initscr(); tgoto("?", 0,0)
4358   ;
4359   return 0;
4360 }
4361 _ACEOF
4362 rm -f conftest.$ac_objext
4363 if { (eval echo "$as_me:4363: \"$ac_compile\"") >&5
4364   (eval $ac_compile) 2>&5
4365   ac_status=$?
4366   echo "$as_me:4366: \$? = $ac_status" >&5
4367   (exit $ac_status); } &&
4368          { ac_try='test -s conftest.$ac_objext'
4369   { (eval echo "$as_me:4369: \"$ac_try\"") >&5
4370   (eval $ac_try) 2>&5
4371   ac_status=$?
4372   echo "$as_me:4372: \$? = $ac_status" >&5
4373   (exit $ac_status); }; }; then
4374   cf_cv_ncurses_header=$cf_header; break
4375 else
4376   echo "$as_me: failed program was:" >&5
4377 cat conftest.$ac_ext >&5
4378 fi
4379 rm -f conftest.$ac_objext conftest.$ac_ext
4380 done
4381
4382 fi
4383 echo "$as_me:4383: result: $cf_cv_ncurses_header" >&5
4384 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4385
4386 if test "$cf_cv_ncurses_header" = none ; then
4387         { { echo "$as_me:4387: error: No curses header-files found" >&5
4388 echo "$as_me: error: No curses header-files found" >&2;}
4389    { (exit 1); exit 1; }; }
4390 fi
4391
4392 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4393
4394 for ac_header in $cf_cv_ncurses_header
4395 do
4396 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4397 echo "$as_me:4397: checking for $ac_header" >&5
4398 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4399 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4400   echo $ECHO_N "(cached) $ECHO_C" >&6
4401 else
4402   cat >conftest.$ac_ext <<_ACEOF
4403 #line 4403 "configure"
4404 #include "confdefs.h"
4405 #include <$ac_header>
4406 _ACEOF
4407 if { (eval echo "$as_me:4407: \"$ac_cpp conftest.$ac_ext\"") >&5
4408   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4409   ac_status=$?
4410   egrep -v '^ *\+' conftest.er1 >conftest.err
4411   rm -f conftest.er1
4412   cat conftest.err >&5
4413   echo "$as_me:4413: \$? = $ac_status" >&5
4414   (exit $ac_status); } >/dev/null; then
4415   if test -s conftest.err; then
4416     ac_cpp_err=$ac_c_preproc_warn_flag
4417   else
4418     ac_cpp_err=
4419   fi
4420 else
4421   ac_cpp_err=yes
4422 fi
4423 if test -z "$ac_cpp_err"; then
4424   eval "$as_ac_Header=yes"
4425 else
4426   echo "$as_me: failed program was:" >&5
4427   cat conftest.$ac_ext >&5
4428   eval "$as_ac_Header=no"
4429 fi
4430 rm -f conftest.err conftest.$ac_ext
4431 fi
4432 echo "$as_me:4432: result: `eval echo '${'$as_ac_Header'}'`" >&5
4433 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4434 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4435   cat >>confdefs.h <<EOF
4436 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4437 EOF
4438
4439 fi
4440 done
4441
4442 cat >>confdefs.h <<\EOF
4443 #define NCURSES 1
4444 EOF
4445
4446 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4447
4448 cat >>confdefs.h <<EOF
4449 #define $cf_nculib_ROOT 1
4450 EOF
4451
4452 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4453
4454 else
4455
4456 cf_ncuhdr_root=ncursesw
4457
4458 test -n "$cf_cv_curses_dir" && \
4459 test "$cf_cv_curses_dir" != "no" && { \
4460
4461 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4462   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4463   do
4464         while test $cf_add_incdir != /usr/include
4465         do
4466           if test -d $cf_add_incdir
4467           then
4468                 cf_have_incdir=no
4469                 if test -n "$CFLAGS$CPPFLAGS" ; then
4470                   # a loop is needed to ensure we can add subdirs of existing dirs
4471                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4472                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4473                           cf_have_incdir=yes; break
4474                         fi
4475                   done
4476                 fi
4477
4478                 if test "$cf_have_incdir" = no ; then
4479                   if test "$cf_add_incdir" = /usr/local/include ; then
4480                         if test "$GCC" = yes
4481                         then
4482                           cf_save_CPPFLAGS=$CPPFLAGS
4483                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4484                           cat >conftest.$ac_ext <<_ACEOF
4485 #line 4485 "configure"
4486 #include "confdefs.h"
4487 #include <stdio.h>
4488 int
4489 main ()
4490 {
4491 printf("Hello")
4492   ;
4493   return 0;
4494 }
4495 _ACEOF
4496 rm -f conftest.$ac_objext
4497 if { (eval echo "$as_me:4497: \"$ac_compile\"") >&5
4498   (eval $ac_compile) 2>&5
4499   ac_status=$?
4500   echo "$as_me:4500: \$? = $ac_status" >&5
4501   (exit $ac_status); } &&
4502          { ac_try='test -s conftest.$ac_objext'
4503   { (eval echo "$as_me:4503: \"$ac_try\"") >&5
4504   (eval $ac_try) 2>&5
4505   ac_status=$?
4506   echo "$as_me:4506: \$? = $ac_status" >&5
4507   (exit $ac_status); }; }; then
4508   :
4509 else
4510   echo "$as_me: failed program was:" >&5
4511 cat conftest.$ac_ext >&5
4512 cf_have_incdir=yes
4513 fi
4514 rm -f conftest.$ac_objext conftest.$ac_ext
4515                           CPPFLAGS=$cf_save_CPPFLAGS
4516                         fi
4517                   fi
4518                 fi
4519
4520                 if test "$cf_have_incdir" = no ; then
4521                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4522
4523 echo "${as_me:-configure}:4523: testing adding $cf_add_incdir to include-path ..." 1>&5
4524
4525                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4526
4527                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4528                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4529                   cf_add_incdir="$cf_top_incdir"
4530                 else
4531                   break
4532                 fi
4533           fi
4534         done
4535   done
4536 fi
4537
4538 }
4539
4540 echo "$as_me:4540: checking for $cf_ncuhdr_root header in include-path" >&5
4541 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4542 if test "${cf_cv_ncurses_h+set}" = set; then
4543   echo $ECHO_N "(cached) $ECHO_C" >&6
4544 else
4545
4546         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4547         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4548         for cf_header in $cf_header_list
4549         do
4550
4551         cat >conftest.$ac_ext <<_ACEOF
4552 #line 4552 "configure"
4553 #include "confdefs.h"
4554
4555 #define _XOPEN_SOURCE_EXTENDED
4556 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4557 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4558
4559 #include <$cf_header>
4560 int
4561 main ()
4562 {
4563
4564 #ifdef NCURSES_VERSION
4565
4566 #ifndef WACS_BSSB
4567         make an error
4568 #endif
4569
4570 printf("%s\n", NCURSES_VERSION);
4571 #else
4572 #ifdef __NCURSES_H
4573 printf("old\n");
4574 #else
4575         make an error
4576 #endif
4577 #endif
4578
4579   ;
4580   return 0;
4581 }
4582 _ACEOF
4583 rm -f conftest.$ac_objext
4584 if { (eval echo "$as_me:4584: \"$ac_compile\"") >&5
4585   (eval $ac_compile) 2>&5
4586   ac_status=$?
4587   echo "$as_me:4587: \$? = $ac_status" >&5
4588   (exit $ac_status); } &&
4589          { ac_try='test -s conftest.$ac_objext'
4590   { (eval echo "$as_me:4590: \"$ac_try\"") >&5
4591   (eval $ac_try) 2>&5
4592   ac_status=$?
4593   echo "$as_me:4593: \$? = $ac_status" >&5
4594   (exit $ac_status); }; }; then
4595   cf_cv_ncurses_h=$cf_header
4596
4597 else
4598   echo "$as_me: failed program was:" >&5
4599 cat conftest.$ac_ext >&5
4600 cf_cv_ncurses_h=no
4601 fi
4602 rm -f conftest.$ac_objext conftest.$ac_ext
4603
4604                 test "$cf_cv_ncurses_h" != no && break
4605         done
4606
4607 fi
4608 echo "$as_me:4608: result: $cf_cv_ncurses_h" >&5
4609 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4610
4611 if test "$cf_cv_ncurses_h" != no ; then
4612         cf_cv_ncurses_header=$cf_cv_ncurses_h
4613 else
4614
4615 echo "$as_me:4615: checking for $cf_ncuhdr_root include-path" >&5
4616 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4617 if test "${cf_cv_ncurses_h2+set}" = set; then
4618   echo $ECHO_N "(cached) $ECHO_C" >&6
4619 else
4620
4621         test -n "$verbose" && echo
4622
4623 cf_search=
4624
4625 # collect the current set of include-directories from compiler flags
4626 cf_header_path_list=""
4627 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4628         for cf_header_path in $CPPFLAGS $CFLAGS
4629         do
4630                 case $cf_header_path in #(vi
4631                 -I*)
4632                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4633
4634 test "$cf_header_path" != "NONE" && \
4635 test -d "$cf_header_path" && \
4636  {
4637         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4638         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4639         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4640         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4641         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4642         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"
4643 }
4644
4645                         cf_header_path_list="$cf_header_path_list $cf_search"
4646                         ;;
4647                 esac
4648         done
4649 fi
4650
4651 # add the variations for the package we are looking for
4652
4653 cf_search=
4654
4655 test "/usr" != "$prefix" && \
4656 test -d "/usr" && \
4657 (test $prefix = NONE || test "/usr" != "$prefix") && {
4658         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4659         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4660         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
4661         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
4662         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
4663         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4664 }
4665
4666 test "$prefix" != "NONE" && \
4667 test -d "$prefix" && \
4668  {
4669         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4670         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4671         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4672         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4673         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4674         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4675 }
4676
4677 test "/usr/local" != "$prefix" && \
4678 test -d "/usr/local" && \
4679 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4680         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4681         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4682         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
4683         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
4684         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
4685         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4686 }
4687
4688 test "/opt" != "$prefix" && \
4689 test -d "/opt" && \
4690 (test $prefix = NONE || test "/opt" != "$prefix") && {
4691         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4692         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4693         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
4694         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
4695         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
4696         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4697 }
4698
4699 test "$HOME" != "$prefix" && \
4700 test -d "$HOME" && \
4701 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4702         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4703         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4704         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
4705         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
4706         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
4707         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4708 }
4709
4710 test "$includedir" != NONE && \
4711 test "$includedir" != "/usr/include" && \
4712 test -d "$includedir" && {
4713         test -d $includedir &&    cf_search="$cf_search $includedir"
4714         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4715 }
4716
4717 test "$oldincludedir" != NONE && \
4718 test "$oldincludedir" != "/usr/include" && \
4719 test -d "$oldincludedir" && {
4720         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4721         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4722 }
4723
4724 cf_search="$cf_search $cf_header_path_list"
4725
4726         test -n "$verbose" && echo search path $cf_search
4727         cf_save2_CPPFLAGS="$CPPFLAGS"
4728         for cf_incdir in $cf_search
4729         do
4730
4731 if test -n "$cf_incdir" ; then
4732   for cf_add_incdir in $cf_incdir
4733   do
4734         while test $cf_add_incdir != /usr/include
4735         do
4736           if test -d $cf_add_incdir
4737           then
4738                 cf_have_incdir=no
4739                 if test -n "$CFLAGS$CPPFLAGS" ; then
4740                   # a loop is needed to ensure we can add subdirs of existing dirs
4741                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4742                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4743                           cf_have_incdir=yes; break
4744                         fi
4745                   done
4746                 fi
4747
4748                 if test "$cf_have_incdir" = no ; then
4749                   if test "$cf_add_incdir" = /usr/local/include ; then
4750                         if test "$GCC" = yes
4751                         then
4752                           cf_save_CPPFLAGS=$CPPFLAGS
4753                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4754                           cat >conftest.$ac_ext <<_ACEOF
4755 #line 4755 "configure"
4756 #include "confdefs.h"
4757 #include <stdio.h>
4758 int
4759 main ()
4760 {
4761 printf("Hello")
4762   ;
4763   return 0;
4764 }
4765 _ACEOF
4766 rm -f conftest.$ac_objext
4767 if { (eval echo "$as_me:4767: \"$ac_compile\"") >&5
4768   (eval $ac_compile) 2>&5
4769   ac_status=$?
4770   echo "$as_me:4770: \$? = $ac_status" >&5
4771   (exit $ac_status); } &&
4772          { ac_try='test -s conftest.$ac_objext'
4773   { (eval echo "$as_me:4773: \"$ac_try\"") >&5
4774   (eval $ac_try) 2>&5
4775   ac_status=$?
4776   echo "$as_me:4776: \$? = $ac_status" >&5
4777   (exit $ac_status); }; }; then
4778   :
4779 else
4780   echo "$as_me: failed program was:" >&5
4781 cat conftest.$ac_ext >&5
4782 cf_have_incdir=yes
4783 fi
4784 rm -f conftest.$ac_objext conftest.$ac_ext
4785                           CPPFLAGS=$cf_save_CPPFLAGS
4786                         fi
4787                   fi
4788                 fi
4789
4790                 if test "$cf_have_incdir" = no ; then
4791                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4792
4793 echo "${as_me:-configure}:4793: testing adding $cf_add_incdir to include-path ..." 1>&5
4794
4795                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4796
4797                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4798                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4799                   cf_add_incdir="$cf_top_incdir"
4800                 else
4801                   break
4802                 fi
4803           fi
4804         done
4805   done
4806 fi
4807
4808                 for cf_header in \
4809                         ncurses.h \
4810                         curses.h
4811                 do
4812
4813         cat >conftest.$ac_ext <<_ACEOF
4814 #line 4814 "configure"
4815 #include "confdefs.h"
4816
4817 #include <$cf_header>
4818 int
4819 main ()
4820 {
4821
4822 #ifdef NCURSES_VERSION
4823
4824 printf("%s\n", NCURSES_VERSION);
4825 #else
4826 #ifdef __NCURSES_H
4827 printf("old\n");
4828 #else
4829         make an error
4830 #endif
4831 #endif
4832
4833   ;
4834   return 0;
4835 }
4836 _ACEOF
4837 rm -f conftest.$ac_objext
4838 if { (eval echo "$as_me:4838: \"$ac_compile\"") >&5
4839   (eval $ac_compile) 2>&5
4840   ac_status=$?
4841   echo "$as_me:4841: \$? = $ac_status" >&5
4842   (exit $ac_status); } &&
4843          { ac_try='test -s conftest.$ac_objext'
4844   { (eval echo "$as_me:4844: \"$ac_try\"") >&5
4845   (eval $ac_try) 2>&5
4846   ac_status=$?
4847   echo "$as_me:4847: \$? = $ac_status" >&5
4848   (exit $ac_status); }; }; then
4849   cf_cv_ncurses_h2=$cf_header
4850
4851 else
4852   echo "$as_me: failed program was:" >&5
4853 cat conftest.$ac_ext >&5
4854 cf_cv_ncurses_h2=no
4855 fi
4856 rm -f conftest.$ac_objext conftest.$ac_ext
4857
4858                         if test "$cf_cv_ncurses_h2" != no ; then
4859                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4860                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4861                                 break
4862                         fi
4863                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4864                 done
4865                 CPPFLAGS="$cf_save2_CPPFLAGS"
4866                 test "$cf_cv_ncurses_h2" != no && break
4867         done
4868         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4868: error: not found" >&5
4869 echo "$as_me: error: not found" >&2;}
4870    { (exit 1); exit 1; }; }
4871
4872 fi
4873 echo "$as_me:4873: result: $cf_cv_ncurses_h2" >&5
4874 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4875
4876         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4877         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4878         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4879                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4880         fi
4881
4882 if test -n "$cf_1st_incdir" ; then
4883   for cf_add_incdir in $cf_1st_incdir
4884   do
4885         while test $cf_add_incdir != /usr/include
4886         do
4887           if test -d $cf_add_incdir
4888           then
4889                 cf_have_incdir=no
4890                 if test -n "$CFLAGS$CPPFLAGS" ; then
4891                   # a loop is needed to ensure we can add subdirs of existing dirs
4892                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4893                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4894                           cf_have_incdir=yes; break
4895                         fi
4896                   done
4897                 fi
4898
4899                 if test "$cf_have_incdir" = no ; then
4900                   if test "$cf_add_incdir" = /usr/local/include ; then
4901                         if test "$GCC" = yes
4902                         then
4903                           cf_save_CPPFLAGS=$CPPFLAGS
4904                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4905                           cat >conftest.$ac_ext <<_ACEOF
4906 #line 4906 "configure"
4907 #include "confdefs.h"
4908 #include <stdio.h>
4909 int
4910 main ()
4911 {
4912 printf("Hello")
4913   ;
4914   return 0;
4915 }
4916 _ACEOF
4917 rm -f conftest.$ac_objext
4918 if { (eval echo "$as_me:4918: \"$ac_compile\"") >&5
4919   (eval $ac_compile) 2>&5
4920   ac_status=$?
4921   echo "$as_me:4921: \$? = $ac_status" >&5
4922   (exit $ac_status); } &&
4923          { ac_try='test -s conftest.$ac_objext'
4924   { (eval echo "$as_me:4924: \"$ac_try\"") >&5
4925   (eval $ac_try) 2>&5
4926   ac_status=$?
4927   echo "$as_me:4927: \$? = $ac_status" >&5
4928   (exit $ac_status); }; }; then
4929   :
4930 else
4931   echo "$as_me: failed program was:" >&5
4932 cat conftest.$ac_ext >&5
4933 cf_have_incdir=yes
4934 fi
4935 rm -f conftest.$ac_objext conftest.$ac_ext
4936                           CPPFLAGS=$cf_save_CPPFLAGS
4937                         fi
4938                   fi
4939                 fi
4940
4941                 if test "$cf_have_incdir" = no ; then
4942                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4943
4944 echo "${as_me:-configure}:4944: testing adding $cf_add_incdir to include-path ..." 1>&5
4945
4946                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4947
4948                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4949                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4950                   cf_add_incdir="$cf_top_incdir"
4951                 else
4952                   break
4953                 fi
4954           fi
4955         done
4956   done
4957 fi
4958
4959 fi
4960
4961 # Set definitions to allow ifdef'ing for ncurses.h
4962
4963 case $cf_cv_ncurses_header in # (vi
4964 *ncurses.h)
4965
4966 cat >>confdefs.h <<\EOF
4967 #define HAVE_NCURSES_H 1
4968 EOF
4969
4970         ;;
4971 esac
4972
4973 case $cf_cv_ncurses_header in # (vi
4974 ncurses/curses.h|ncurses/ncurses.h)
4975
4976 cat >>confdefs.h <<\EOF
4977 #define HAVE_NCURSES_NCURSES_H 1
4978 EOF
4979
4980         ;;
4981 ncursesw/curses.h|ncursesw/ncurses.h)
4982
4983 cat >>confdefs.h <<\EOF
4984 #define HAVE_NCURSESW_NCURSES_H 1
4985 EOF
4986
4987         ;;
4988 esac
4989
4990 echo "$as_me:4990: checking for terminfo header" >&5
4991 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4992 if test "${cf_cv_term_header+set}" = set; then
4993   echo $ECHO_N "(cached) $ECHO_C" >&6
4994 else
4995
4996 case ${cf_cv_ncurses_header} in #(vi
4997 */ncurses.h|*/ncursesw.h) #(vi
4998         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4999         ;;
5000 *)
5001         cf_term_header=term.h
5002         ;;
5003 esac
5004
5005 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5006 do
5007 cat >conftest.$ac_ext <<_ACEOF
5008 #line 5008 "configure"
5009 #include "confdefs.h"
5010 #include <stdio.h>
5011 #include <${cf_cv_ncurses_header:-curses.h}>
5012 #include <$cf_test>
5013
5014 int
5015 main ()
5016 {
5017 int x = auto_left_margin
5018   ;
5019   return 0;
5020 }
5021 _ACEOF
5022 rm -f conftest.$ac_objext
5023 if { (eval echo "$as_me:5023: \"$ac_compile\"") >&5
5024   (eval $ac_compile) 2>&5
5025   ac_status=$?
5026   echo "$as_me:5026: \$? = $ac_status" >&5
5027   (exit $ac_status); } &&
5028          { ac_try='test -s conftest.$ac_objext'
5029   { (eval echo "$as_me:5029: \"$ac_try\"") >&5
5030   (eval $ac_try) 2>&5
5031   ac_status=$?
5032   echo "$as_me:5032: \$? = $ac_status" >&5
5033   (exit $ac_status); }; }; then
5034
5035         cf_cv_term_header="$cf_test"
5036 else
5037   echo "$as_me: failed program was:" >&5
5038 cat conftest.$ac_ext >&5
5039
5040         cf_cv_term_header=unknown
5041
5042 fi
5043 rm -f conftest.$ac_objext conftest.$ac_ext
5044         test "$cf_cv_term_header" != unknown && break
5045 done
5046
5047 fi
5048 echo "$as_me:5048: result: $cf_cv_term_header" >&5
5049 echo "${ECHO_T}$cf_cv_term_header" >&6
5050
5051 # Set definitions to allow ifdef'ing to accommodate subdirectories
5052
5053 case $cf_cv_term_header in # (vi
5054 *term.h)
5055
5056 cat >>confdefs.h <<\EOF
5057 #define HAVE_TERM_H 1
5058 EOF
5059
5060         ;;
5061 esac
5062
5063 case $cf_cv_term_header in # (vi
5064 ncurses/term.h) #(vi
5065
5066 cat >>confdefs.h <<\EOF
5067 #define HAVE_NCURSES_TERM_H 1
5068 EOF
5069
5070         ;;
5071 ncursesw/term.h)
5072
5073 cat >>confdefs.h <<\EOF
5074 #define HAVE_NCURSESW_TERM_H 1
5075 EOF
5076
5077         ;;
5078 esac
5079
5080 # some applications need this, but should check for NCURSES_VERSION
5081
5082 cat >>confdefs.h <<\EOF
5083 #define NCURSES 1
5084 EOF
5085
5086 echo "$as_me:5086: checking for ncurses version" >&5
5087 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5088 if test "${cf_cv_ncurses_version+set}" = set; then
5089   echo $ECHO_N "(cached) $ECHO_C" >&6
5090 else
5091
5092         cf_cv_ncurses_version=no
5093         cf_tempfile=out$$
5094         rm -f $cf_tempfile
5095         if test "$cross_compiling" = yes; then
5096
5097         # This will not work if the preprocessor splits the line after the
5098         # Autoconf token.  The 'unproto' program does that.
5099         cat > conftest.$ac_ext <<EOF
5100 #include <${cf_cv_ncurses_header:-curses.h}>
5101 #undef Autoconf
5102 #ifdef NCURSES_VERSION
5103 Autoconf NCURSES_VERSION
5104 #else
5105 #ifdef __NCURSES_H
5106 Autoconf "old"
5107 #endif
5108 ;
5109 #endif
5110 EOF
5111         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5112         { (eval echo "$as_me:5112: \"$cf_try\"") >&5
5113   (eval $cf_try) 2>&5
5114   ac_status=$?
5115   echo "$as_me:5115: \$? = $ac_status" >&5
5116   (exit $ac_status); }
5117         if test -f conftest.out ; then
5118                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5119                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5120                 rm -f conftest.out
5121         fi
5122
5123 else
5124   cat >conftest.$ac_ext <<_ACEOF
5125 #line 5125 "configure"
5126 #include "confdefs.h"
5127
5128 #include <${cf_cv_ncurses_header:-curses.h}>
5129 #include <stdio.h>
5130 int main()
5131 {
5132         FILE *fp = fopen("$cf_tempfile", "w");
5133 #ifdef NCURSES_VERSION
5134 # ifdef NCURSES_VERSION_PATCH
5135         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5136 # else
5137         fprintf(fp, "%s\n", NCURSES_VERSION);
5138 # endif
5139 #else
5140 # ifdef __NCURSES_H
5141         fprintf(fp, "old\n");
5142 # else
5143         make an error
5144 # endif
5145 #endif
5146         ${cf_cv_main_return:-return}(0);
5147 }
5148 _ACEOF
5149 rm -f conftest$ac_exeext
5150 if { (eval echo "$as_me:5150: \"$ac_link\"") >&5
5151   (eval $ac_link) 2>&5
5152   ac_status=$?
5153   echo "$as_me:5153: \$? = $ac_status" >&5
5154   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5155   { (eval echo "$as_me:5155: \"$ac_try\"") >&5
5156   (eval $ac_try) 2>&5
5157   ac_status=$?
5158   echo "$as_me:5158: \$? = $ac_status" >&5
5159   (exit $ac_status); }; }; then
5160
5161         cf_cv_ncurses_version=`cat $cf_tempfile`
5162 else
5163   echo "$as_me: program exited with status $ac_status" >&5
5164 echo "$as_me: failed program was:" >&5
5165 cat conftest.$ac_ext >&5
5166 fi
5167 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5168 fi
5169         rm -f $cf_tempfile
5170
5171 fi
5172 echo "$as_me:5172: result: $cf_cv_ncurses_version" >&5
5173 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5174 test "$cf_cv_ncurses_version" = no ||
5175 cat >>confdefs.h <<\EOF
5176 #define NCURSES 1
5177 EOF
5178
5179 cf_nculib_root=ncursesw
5180         # This works, except for the special case where we find gpm, but
5181         # ncurses is in a nonstandard location via $LIBS, and we really want
5182         # to link gpm.
5183 cf_ncurses_LIBS=""
5184 cf_ncurses_SAVE="$LIBS"
5185 echo "$as_me:5185: checking for Gpm_Open in -lgpm" >&5
5186 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5187 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5188   echo $ECHO_N "(cached) $ECHO_C" >&6
5189 else
5190   ac_check_lib_save_LIBS=$LIBS
5191 LIBS="-lgpm  $LIBS"
5192 cat >conftest.$ac_ext <<_ACEOF
5193 #line 5193 "configure"
5194 #include "confdefs.h"
5195
5196 /* Override any gcc2 internal prototype to avoid an error.  */
5197 #ifdef __cplusplus
5198 extern "C"
5199 #endif
5200 /* We use char because int might match the return type of a gcc2
5201    builtin and then its argument prototype would still apply.  */
5202 char Gpm_Open ();
5203 int
5204 main ()
5205 {
5206 Gpm_Open ();
5207   ;
5208   return 0;
5209 }
5210 _ACEOF
5211 rm -f conftest.$ac_objext conftest$ac_exeext
5212 if { (eval echo "$as_me:5212: \"$ac_link\"") >&5
5213   (eval $ac_link) 2>&5
5214   ac_status=$?
5215   echo "$as_me:5215: \$? = $ac_status" >&5
5216   (exit $ac_status); } &&
5217          { ac_try='test -s conftest$ac_exeext'
5218   { (eval echo "$as_me:5218: \"$ac_try\"") >&5
5219   (eval $ac_try) 2>&5
5220   ac_status=$?
5221   echo "$as_me:5221: \$? = $ac_status" >&5
5222   (exit $ac_status); }; }; then
5223   ac_cv_lib_gpm_Gpm_Open=yes
5224 else
5225   echo "$as_me: failed program was:" >&5
5226 cat conftest.$ac_ext >&5
5227 ac_cv_lib_gpm_Gpm_Open=no
5228 fi
5229 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5230 LIBS=$ac_check_lib_save_LIBS
5231 fi
5232 echo "$as_me:5232: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5233 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5234 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5235   echo "$as_me:5235: checking for initscr in -lgpm" >&5
5236 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5237 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5238   echo $ECHO_N "(cached) $ECHO_C" >&6
5239 else
5240   ac_check_lib_save_LIBS=$LIBS
5241 LIBS="-lgpm  $LIBS"
5242 cat >conftest.$ac_ext <<_ACEOF
5243 #line 5243 "configure"
5244 #include "confdefs.h"
5245
5246 /* Override any gcc2 internal prototype to avoid an error.  */
5247 #ifdef __cplusplus
5248 extern "C"
5249 #endif
5250 /* We use char because int might match the return type of a gcc2
5251    builtin and then its argument prototype would still apply.  */
5252 char initscr ();
5253 int
5254 main ()
5255 {
5256 initscr ();
5257   ;
5258   return 0;
5259 }
5260 _ACEOF
5261 rm -f conftest.$ac_objext conftest$ac_exeext
5262 if { (eval echo "$as_me:5262: \"$ac_link\"") >&5
5263   (eval $ac_link) 2>&5
5264   ac_status=$?
5265   echo "$as_me:5265: \$? = $ac_status" >&5
5266   (exit $ac_status); } &&
5267          { ac_try='test -s conftest$ac_exeext'
5268   { (eval echo "$as_me:5268: \"$ac_try\"") >&5
5269   (eval $ac_try) 2>&5
5270   ac_status=$?
5271   echo "$as_me:5271: \$? = $ac_status" >&5
5272   (exit $ac_status); }; }; then
5273   ac_cv_lib_gpm_initscr=yes
5274 else
5275   echo "$as_me: failed program was:" >&5
5276 cat conftest.$ac_ext >&5
5277 ac_cv_lib_gpm_initscr=no
5278 fi
5279 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5280 LIBS=$ac_check_lib_save_LIBS
5281 fi
5282 echo "$as_me:5282: result: $ac_cv_lib_gpm_initscr" >&5
5283 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5284 if test $ac_cv_lib_gpm_initscr = yes; then
5285   LIBS="$cf_ncurses_SAVE"
5286 else
5287   cf_ncurses_LIBS="-lgpm"
5288 fi
5289
5290 fi
5291
5292 case $host_os in #(vi
5293 freebsd*)
5294         # This is only necessary if you are linking against an obsolete
5295         # version of ncurses (but it should do no harm, since it's static).
5296         if test "$cf_nculib_root" = ncurses ; then
5297                 echo "$as_me:5297: checking for tgoto in -lmytinfo" >&5
5298 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5299 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5300   echo $ECHO_N "(cached) $ECHO_C" >&6
5301 else
5302   ac_check_lib_save_LIBS=$LIBS
5303 LIBS="-lmytinfo  $LIBS"
5304 cat >conftest.$ac_ext <<_ACEOF
5305 #line 5305 "configure"
5306 #include "confdefs.h"
5307
5308 /* Override any gcc2 internal prototype to avoid an error.  */
5309 #ifdef __cplusplus
5310 extern "C"
5311 #endif
5312 /* We use char because int might match the return type of a gcc2
5313    builtin and then its argument prototype would still apply.  */
5314 char tgoto ();
5315 int
5316 main ()
5317 {
5318 tgoto ();
5319   ;
5320   return 0;
5321 }
5322 _ACEOF
5323 rm -f conftest.$ac_objext conftest$ac_exeext
5324 if { (eval echo "$as_me:5324: \"$ac_link\"") >&5
5325   (eval $ac_link) 2>&5
5326   ac_status=$?
5327   echo "$as_me:5327: \$? = $ac_status" >&5
5328   (exit $ac_status); } &&
5329          { ac_try='test -s conftest$ac_exeext'
5330   { (eval echo "$as_me:5330: \"$ac_try\"") >&5
5331   (eval $ac_try) 2>&5
5332   ac_status=$?
5333   echo "$as_me:5333: \$? = $ac_status" >&5
5334   (exit $ac_status); }; }; then
5335   ac_cv_lib_mytinfo_tgoto=yes
5336 else
5337   echo "$as_me: failed program was:" >&5
5338 cat conftest.$ac_ext >&5
5339 ac_cv_lib_mytinfo_tgoto=no
5340 fi
5341 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5342 LIBS=$ac_check_lib_save_LIBS
5343 fi
5344 echo "$as_me:5344: result: $ac_cv_lib_mytinfo_tgoto" >&5
5345 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5346 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5347   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5348 fi
5349
5350         fi
5351         ;;
5352 esac
5353
5354 LIBS="$cf_ncurses_LIBS $LIBS"
5355
5356 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5357 then
5358         LIBS="-l$cf_nculib_root $LIBS"
5359 else
5360
5361         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5362         cf_libdir=""
5363         echo "$as_me:5363: checking for initscr" >&5
5364 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5365 if test "${ac_cv_func_initscr+set}" = set; then
5366   echo $ECHO_N "(cached) $ECHO_C" >&6
5367 else
5368   cat >conftest.$ac_ext <<_ACEOF
5369 #line 5369 "configure"
5370 #include "confdefs.h"
5371 /* System header to define __stub macros and hopefully few prototypes,
5372     which can conflict with char initscr (); below.  */
5373 #include <assert.h>
5374 /* Override any gcc2 internal prototype to avoid an error.  */
5375 #ifdef __cplusplus
5376 extern "C"
5377 #endif
5378 /* We use char because int might match the return type of a gcc2
5379    builtin and then its argument prototype would still apply.  */
5380 char initscr ();
5381 char (*f) ();
5382
5383 int
5384 main ()
5385 {
5386 /* The GNU C library defines this for functions which it implements
5387     to always fail with ENOSYS.  Some functions are actually named
5388     something starting with __ and the normal name is an alias.  */
5389 #if defined (__stub_initscr) || defined (__stub___initscr)
5390 choke me
5391 #else
5392 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5393 #endif
5394
5395   ;
5396   return 0;
5397 }
5398 _ACEOF
5399 rm -f conftest.$ac_objext conftest$ac_exeext
5400 if { (eval echo "$as_me:5400: \"$ac_link\"") >&5
5401   (eval $ac_link) 2>&5
5402   ac_status=$?
5403   echo "$as_me:5403: \$? = $ac_status" >&5
5404   (exit $ac_status); } &&
5405          { ac_try='test -s conftest$ac_exeext'
5406   { (eval echo "$as_me:5406: \"$ac_try\"") >&5
5407   (eval $ac_try) 2>&5
5408   ac_status=$?
5409   echo "$as_me:5409: \$? = $ac_status" >&5
5410   (exit $ac_status); }; }; then
5411   ac_cv_func_initscr=yes
5412 else
5413   echo "$as_me: failed program was:" >&5
5414 cat conftest.$ac_ext >&5
5415 ac_cv_func_initscr=no
5416 fi
5417 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5418 fi
5419 echo "$as_me:5419: result: $ac_cv_func_initscr" >&5
5420 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5421 if test $ac_cv_func_initscr = yes; then
5422   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5423 else
5424
5425                 cf_save_LIBS="$LIBS"
5426                 echo "$as_me:5426: checking for initscr in -l$cf_nculib_root" >&5
5427 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5428                 LIBS="-l$cf_nculib_root $LIBS"
5429                 cat >conftest.$ac_ext <<_ACEOF
5430 #line 5430 "configure"
5431 #include "confdefs.h"
5432 #include <${cf_cv_ncurses_header:-curses.h}>
5433 int
5434 main ()
5435 {
5436 initscr()
5437   ;
5438   return 0;
5439 }
5440 _ACEOF
5441 rm -f conftest.$ac_objext conftest$ac_exeext
5442 if { (eval echo "$as_me:5442: \"$ac_link\"") >&5
5443   (eval $ac_link) 2>&5
5444   ac_status=$?
5445   echo "$as_me:5445: \$? = $ac_status" >&5
5446   (exit $ac_status); } &&
5447          { ac_try='test -s conftest$ac_exeext'
5448   { (eval echo "$as_me:5448: \"$ac_try\"") >&5
5449   (eval $ac_try) 2>&5
5450   ac_status=$?
5451   echo "$as_me:5451: \$? = $ac_status" >&5
5452   (exit $ac_status); }; }; then
5453   echo "$as_me:5453: result: yes" >&5
5454 echo "${ECHO_T}yes" >&6
5455                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5456
5457 else
5458   echo "$as_me: failed program was:" >&5
5459 cat conftest.$ac_ext >&5
5460 echo "$as_me:5460: result: no" >&5
5461 echo "${ECHO_T}no" >&6
5462
5463 cf_search=
5464 cf_library_path_list=""
5465 if test -n "${LDFLAGS}${LIBS}" ; then
5466         for cf_library_path in $LDFLAGS $LIBS
5467         do
5468                 case $cf_library_path in #(vi
5469                 -L*)
5470                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5471
5472 test "$cf_library_path" != "NONE" && \
5473 test -d "$cf_library_path" && \
5474  {
5475         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5476         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5477         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5478         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5479         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5480         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"
5481 }
5482
5483                         cf_library_path_list="$cf_library_path_list $cf_search"
5484                         ;;
5485                 esac
5486         done
5487 fi
5488
5489 cf_search=
5490
5491 test "/usr" != "$prefix" && \
5492 test -d "/usr" && \
5493 (test $prefix = NONE || test "/usr" != "$prefix") && {
5494         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
5495         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
5496         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
5497         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
5498         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
5499         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
5500 }
5501
5502 test "$prefix" != "NONE" && \
5503 test -d "$prefix" && \
5504  {
5505         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5506         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5507         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5508         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5509         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5510         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5511 }
5512
5513 test "/usr/local" != "$prefix" && \
5514 test -d "/usr/local" && \
5515 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
5516         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
5517         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
5518         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
5519         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
5520         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
5521         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
5522 }
5523
5524 test "/opt" != "$prefix" && \
5525 test -d "/opt" && \
5526 (test $prefix = NONE || test "/opt" != "$prefix") && {
5527         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
5528         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
5529         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
5530         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
5531         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
5532         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
5533 }
5534
5535 test "$HOME" != "$prefix" && \
5536 test -d "$HOME" && \
5537 (test $prefix = NONE || test "$HOME" != "$prefix") && {
5538         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
5539         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
5540         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
5541         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
5542         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
5543         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
5544 }
5545
5546 cf_search="$cf_library_path_list $cf_search"
5547
5548                         for cf_libdir in $cf_search
5549                         do
5550                                 echo "$as_me:5550: checking for -l$cf_nculib_root in $cf_libdir" >&5
5551 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5552                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5553                                 cat >conftest.$ac_ext <<_ACEOF
5554 #line 5554 "configure"
5555 #include "confdefs.h"
5556 #include <${cf_cv_ncurses_header:-curses.h}>
5557 int
5558 main ()
5559 {
5560 initscr()
5561   ;
5562   return 0;
5563 }
5564 _ACEOF
5565 rm -f conftest.$ac_objext conftest$ac_exeext
5566 if { (eval echo "$as_me:5566: \"$ac_link\"") >&5
5567   (eval $ac_link) 2>&5
5568   ac_status=$?
5569   echo "$as_me:5569: \$? = $ac_status" >&5
5570   (exit $ac_status); } &&
5571          { ac_try='test -s conftest$ac_exeext'
5572   { (eval echo "$as_me:5572: \"$ac_try\"") >&5
5573   (eval $ac_try) 2>&5
5574   ac_status=$?
5575   echo "$as_me:5575: \$? = $ac_status" >&5
5576   (exit $ac_status); }; }; then
5577   echo "$as_me:5577: result: yes" >&5
5578 echo "${ECHO_T}yes" >&6
5579                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5580                                          break
5581 else
5582   echo "$as_me: failed program was:" >&5
5583 cat conftest.$ac_ext >&5
5584 echo "$as_me:5584: result: no" >&5
5585 echo "${ECHO_T}no" >&6
5586                                          LIBS="$cf_save_LIBS"
5587 fi
5588 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5589                         done
5590
5591 fi
5592 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5593
5594 fi
5595
5596 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5597
5598 if test $cf_found_library = no ; then
5599         { { echo "$as_me:5599: error: Cannot link $cf_nculib_root library" >&5
5600 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5601    { (exit 1); exit 1; }; }
5602 fi
5603
5604 fi
5605
5606 if test -n "$cf_ncurses_LIBS" ; then
5607         echo "$as_me:5607: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5608 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5609         cf_ncurses_SAVE="$LIBS"
5610         for p in $cf_ncurses_LIBS ; do
5611                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5612                 if test "$q" != "$LIBS" ; then
5613                         LIBS="$q"
5614                 fi
5615         done
5616         cat >conftest.$ac_ext <<_ACEOF
5617 #line 5617 "configure"
5618 #include "confdefs.h"
5619 #include <${cf_cv_ncurses_header:-curses.h}>
5620 int
5621 main ()
5622 {
5623 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5624   ;
5625   return 0;
5626 }
5627 _ACEOF
5628 rm -f conftest.$ac_objext conftest$ac_exeext
5629 if { (eval echo "$as_me:5629: \"$ac_link\"") >&5
5630   (eval $ac_link) 2>&5
5631   ac_status=$?
5632   echo "$as_me:5632: \$? = $ac_status" >&5
5633   (exit $ac_status); } &&
5634          { ac_try='test -s conftest$ac_exeext'
5635   { (eval echo "$as_me:5635: \"$ac_try\"") >&5
5636   (eval $ac_try) 2>&5
5637   ac_status=$?
5638   echo "$as_me:5638: \$? = $ac_status" >&5
5639   (exit $ac_status); }; }; then
5640   echo "$as_me:5640: result: yes" >&5
5641 echo "${ECHO_T}yes" >&6
5642 else
5643   echo "$as_me: failed program was:" >&5
5644 cat conftest.$ac_ext >&5
5645 echo "$as_me:5645: result: no" >&5
5646 echo "${ECHO_T}no" >&6
5647                  LIBS="$cf_ncurses_SAVE"
5648 fi
5649 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5650 fi
5651
5652 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5653
5654 cat >>confdefs.h <<EOF
5655 #define $cf_nculib_ROOT 1
5656 EOF
5657
5658 fi
5659
5660 else
5661
5662 cf_ncuconfig_root=ncurses
5663
5664 echo "Looking for ${cf_ncuconfig_root}-config"
5665
5666 if test -n "$ac_tool_prefix"; then
5667   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5668   do
5669     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5670 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5671 echo "$as_me:5671: checking for $ac_word" >&5
5672 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5673 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5674   echo $ECHO_N "(cached) $ECHO_C" >&6
5675 else
5676   if test -n "$NCURSES_CONFIG"; then
5677   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5678 else
5679   ac_save_IFS=$IFS; IFS=$ac_path_separator
5680 ac_dummy="$PATH"
5681 for ac_dir in $ac_dummy; do
5682   IFS=$ac_save_IFS
5683   test -z "$ac_dir" && ac_dir=.
5684   $as_executable_p "$ac_dir/$ac_word" || continue
5685 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5686 echo "$as_me:5686: found $ac_dir/$ac_word" >&5
5687 break
5688 done
5689
5690 fi
5691 fi
5692 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5693 if test -n "$NCURSES_CONFIG"; then
5694   echo "$as_me:5694: result: $NCURSES_CONFIG" >&5
5695 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5696 else
5697   echo "$as_me:5697: result: no" >&5
5698 echo "${ECHO_T}no" >&6
5699 fi
5700
5701     test -n "$NCURSES_CONFIG" && break
5702   done
5703 fi
5704 if test -z "$NCURSES_CONFIG"; then
5705   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5706   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5707 do
5708   # Extract the first word of "$ac_prog", so it can be a program name with args.
5709 set dummy $ac_prog; ac_word=$2
5710 echo "$as_me:5710: checking for $ac_word" >&5
5711 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5712 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5713   echo $ECHO_N "(cached) $ECHO_C" >&6
5714 else
5715   if test -n "$ac_ct_NCURSES_CONFIG"; then
5716   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5717 else
5718   ac_save_IFS=$IFS; IFS=$ac_path_separator
5719 ac_dummy="$PATH"
5720 for ac_dir in $ac_dummy; do
5721   IFS=$ac_save_IFS
5722   test -z "$ac_dir" && ac_dir=.
5723   $as_executable_p "$ac_dir/$ac_word" || continue
5724 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5725 echo "$as_me:5725: found $ac_dir/$ac_word" >&5
5726 break
5727 done
5728
5729 fi
5730 fi
5731 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5732 if test -n "$ac_ct_NCURSES_CONFIG"; then
5733   echo "$as_me:5733: result: $ac_ct_NCURSES_CONFIG" >&5
5734 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5735 else
5736   echo "$as_me:5736: result: no" >&5
5737 echo "${ECHO_T}no" >&6
5738 fi
5739
5740   test -n "$ac_ct_NCURSES_CONFIG" && break
5741 done
5742 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5743
5744   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5745 fi
5746
5747 if test "$NCURSES_CONFIG" != none ; then
5748
5749 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5750 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5751
5752 # even with config script, some packages use no-override for curses.h
5753
5754 echo "$as_me:5754: checking if we have identified curses headers" >&5
5755 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5756 if test "${cf_cv_ncurses_header+set}" = set; then
5757   echo $ECHO_N "(cached) $ECHO_C" >&6
5758 else
5759
5760 cf_cv_ncurses_header=none
5761 for cf_header in  \
5762     ncurses/ncurses.h \
5763         ncurses/curses.h \
5764         ncurses.h \
5765         curses.h
5766 do
5767 cat >conftest.$ac_ext <<_ACEOF
5768 #line 5768 "configure"
5769 #include "confdefs.h"
5770 #include <${cf_header}>
5771 int
5772 main ()
5773 {
5774 initscr(); tgoto("?", 0,0)
5775   ;
5776   return 0;
5777 }
5778 _ACEOF
5779 rm -f conftest.$ac_objext
5780 if { (eval echo "$as_me:5780: \"$ac_compile\"") >&5
5781   (eval $ac_compile) 2>&5
5782   ac_status=$?
5783   echo "$as_me:5783: \$? = $ac_status" >&5
5784   (exit $ac_status); } &&
5785          { ac_try='test -s conftest.$ac_objext'
5786   { (eval echo "$as_me:5786: \"$ac_try\"") >&5
5787   (eval $ac_try) 2>&5
5788   ac_status=$?
5789   echo "$as_me:5789: \$? = $ac_status" >&5
5790   (exit $ac_status); }; }; then
5791   cf_cv_ncurses_header=$cf_header; break
5792 else
5793   echo "$as_me: failed program was:" >&5
5794 cat conftest.$ac_ext >&5
5795 fi
5796 rm -f conftest.$ac_objext conftest.$ac_ext
5797 done
5798
5799 fi
5800 echo "$as_me:5800: result: $cf_cv_ncurses_header" >&5
5801 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5802
5803 if test "$cf_cv_ncurses_header" = none ; then
5804         { { echo "$as_me:5804: error: No curses header-files found" >&5
5805 echo "$as_me: error: No curses header-files found" >&2;}
5806    { (exit 1); exit 1; }; }
5807 fi
5808
5809 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5810
5811 for ac_header in $cf_cv_ncurses_header
5812 do
5813 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5814 echo "$as_me:5814: checking for $ac_header" >&5
5815 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5816 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5817   echo $ECHO_N "(cached) $ECHO_C" >&6
5818 else
5819   cat >conftest.$ac_ext <<_ACEOF
5820 #line 5820 "configure"
5821 #include "confdefs.h"
5822 #include <$ac_header>
5823 _ACEOF
5824 if { (eval echo "$as_me:5824: \"$ac_cpp conftest.$ac_ext\"") >&5
5825   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5826   ac_status=$?
5827   egrep -v '^ *\+' conftest.er1 >conftest.err
5828   rm -f conftest.er1
5829   cat conftest.err >&5
5830   echo "$as_me:5830: \$? = $ac_status" >&5
5831   (exit $ac_status); } >/dev/null; then
5832   if test -s conftest.err; then
5833     ac_cpp_err=$ac_c_preproc_warn_flag
5834   else
5835     ac_cpp_err=
5836   fi
5837 else
5838   ac_cpp_err=yes
5839 fi
5840 if test -z "$ac_cpp_err"; then
5841   eval "$as_ac_Header=yes"
5842 else
5843   echo "$as_me: failed program was:" >&5
5844   cat conftest.$ac_ext >&5
5845   eval "$as_ac_Header=no"
5846 fi
5847 rm -f conftest.err conftest.$ac_ext
5848 fi
5849 echo "$as_me:5849: result: `eval echo '${'$as_ac_Header'}'`" >&5
5850 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5851 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5852   cat >>confdefs.h <<EOF
5853 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5854 EOF
5855
5856 fi
5857 done
5858
5859 cat >>confdefs.h <<\EOF
5860 #define NCURSES 1
5861 EOF
5862
5863 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5864
5865 cat >>confdefs.h <<EOF
5866 #define $cf_nculib_ROOT 1
5867 EOF
5868
5869 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5870
5871 else
5872
5873 cf_ncuhdr_root=ncurses
5874
5875 test -n "$cf_cv_curses_dir" && \
5876 test "$cf_cv_curses_dir" != "no" && { \
5877
5878 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5879   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5880   do
5881         while test $cf_add_incdir != /usr/include
5882         do
5883           if test -d $cf_add_incdir
5884           then
5885                 cf_have_incdir=no
5886                 if test -n "$CFLAGS$CPPFLAGS" ; then
5887                   # a loop is needed to ensure we can add subdirs of existing dirs
5888                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5889                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5890                           cf_have_incdir=yes; break
5891                         fi
5892                   done
5893                 fi
5894
5895                 if test "$cf_have_incdir" = no ; then
5896                   if test "$cf_add_incdir" = /usr/local/include ; then
5897                         if test "$GCC" = yes
5898                         then
5899                           cf_save_CPPFLAGS=$CPPFLAGS
5900                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5901                           cat >conftest.$ac_ext <<_ACEOF
5902 #line 5902 "configure"
5903 #include "confdefs.h"
5904 #include <stdio.h>
5905 int
5906 main ()
5907 {
5908 printf("Hello")
5909   ;
5910   return 0;
5911 }
5912 _ACEOF
5913 rm -f conftest.$ac_objext
5914 if { (eval echo "$as_me:5914: \"$ac_compile\"") >&5
5915   (eval $ac_compile) 2>&5
5916   ac_status=$?
5917   echo "$as_me:5917: \$? = $ac_status" >&5
5918   (exit $ac_status); } &&
5919          { ac_try='test -s conftest.$ac_objext'
5920   { (eval echo "$as_me:5920: \"$ac_try\"") >&5
5921   (eval $ac_try) 2>&5
5922   ac_status=$?
5923   echo "$as_me:5923: \$? = $ac_status" >&5
5924   (exit $ac_status); }; }; then
5925   :
5926 else
5927   echo "$as_me: failed program was:" >&5
5928 cat conftest.$ac_ext >&5
5929 cf_have_incdir=yes
5930 fi
5931 rm -f conftest.$ac_objext conftest.$ac_ext
5932                           CPPFLAGS=$cf_save_CPPFLAGS
5933                         fi
5934                   fi
5935                 fi
5936
5937                 if test "$cf_have_incdir" = no ; then
5938                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5939
5940 echo "${as_me:-configure}:5940: testing adding $cf_add_incdir to include-path ..." 1>&5
5941
5942                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5943
5944                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5945                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5946                   cf_add_incdir="$cf_top_incdir"
5947                 else
5948                   break
5949                 fi
5950           fi
5951         done
5952   done
5953 fi
5954
5955 }
5956
5957 echo "$as_me:5957: checking for $cf_ncuhdr_root header in include-path" >&5
5958 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5959 if test "${cf_cv_ncurses_h+set}" = set; then
5960   echo $ECHO_N "(cached) $ECHO_C" >&6
5961 else
5962
5963         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5964         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5965         for cf_header in $cf_header_list
5966         do
5967
5968         cat >conftest.$ac_ext <<_ACEOF
5969 #line 5969 "configure"
5970 #include "confdefs.h"
5971
5972 #include <$cf_header>
5973 int
5974 main ()
5975 {
5976
5977 #ifdef NCURSES_VERSION
5978
5979 printf("%s\n", NCURSES_VERSION);
5980 #else
5981 #ifdef __NCURSES_H
5982 printf("old\n");
5983 #else
5984         make an error
5985 #endif
5986 #endif
5987
5988   ;
5989   return 0;
5990 }
5991 _ACEOF
5992 rm -f conftest.$ac_objext
5993 if { (eval echo "$as_me:5993: \"$ac_compile\"") >&5
5994   (eval $ac_compile) 2>&5
5995   ac_status=$?
5996   echo "$as_me:5996: \$? = $ac_status" >&5
5997   (exit $ac_status); } &&
5998          { ac_try='test -s conftest.$ac_objext'
5999   { (eval echo "$as_me:5999: \"$ac_try\"") >&5
6000   (eval $ac_try) 2>&5
6001   ac_status=$?
6002   echo "$as_me:6002: \$? = $ac_status" >&5
6003   (exit $ac_status); }; }; then
6004   cf_cv_ncurses_h=$cf_header
6005
6006 else
6007   echo "$as_me: failed program was:" >&5
6008 cat conftest.$ac_ext >&5
6009 cf_cv_ncurses_h=no
6010 fi
6011 rm -f conftest.$ac_objext conftest.$ac_ext
6012
6013                 test "$cf_cv_ncurses_h" != no && break
6014         done
6015
6016 fi
6017 echo "$as_me:6017: result: $cf_cv_ncurses_h" >&5
6018 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6019
6020 if test "$cf_cv_ncurses_h" != no ; then
6021         cf_cv_ncurses_header=$cf_cv_ncurses_h
6022 else
6023
6024 echo "$as_me:6024: checking for $cf_ncuhdr_root include-path" >&5
6025 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6026 if test "${cf_cv_ncurses_h2+set}" = set; then
6027   echo $ECHO_N "(cached) $ECHO_C" >&6
6028 else
6029
6030         test -n "$verbose" && echo
6031
6032 cf_search=
6033
6034 # collect the current set of include-directories from compiler flags
6035 cf_header_path_list=""
6036 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6037         for cf_header_path in $CPPFLAGS $CFLAGS
6038         do
6039                 case $cf_header_path in #(vi
6040                 -I*)
6041                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6042
6043 test "$cf_header_path" != "NONE" && \
6044 test -d "$cf_header_path" && \
6045  {
6046         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6047         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6048         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6049         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6050         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6051         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"
6052 }
6053
6054                         cf_header_path_list="$cf_header_path_list $cf_search"
6055                         ;;
6056                 esac
6057         done
6058 fi
6059
6060 # add the variations for the package we are looking for
6061
6062 cf_search=
6063
6064 test "/usr" != "$prefix" && \
6065 test -d "/usr" && \
6066 (test $prefix = NONE || test "/usr" != "$prefix") && {
6067         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6068         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6069         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6070         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6071         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6072         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6073 }
6074
6075 test "$prefix" != "NONE" && \
6076 test -d "$prefix" && \
6077  {
6078         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6079         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6080         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6081         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6082         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6083         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6084 }
6085
6086 test "/usr/local" != "$prefix" && \
6087 test -d "/usr/local" && \
6088 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6089         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6090         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6091         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6092         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6093         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6094         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6095 }
6096
6097 test "/opt" != "$prefix" && \
6098 test -d "/opt" && \
6099 (test $prefix = NONE || test "/opt" != "$prefix") && {
6100         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6101         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6102         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6103         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6104         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6105         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6106 }
6107
6108 test "$HOME" != "$prefix" && \
6109 test -d "$HOME" && \
6110 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6111         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6112         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6113         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6114         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6115         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6116         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6117 }
6118
6119 test "$includedir" != NONE && \
6120 test "$includedir" != "/usr/include" && \
6121 test -d "$includedir" && {
6122         test -d $includedir &&    cf_search="$cf_search $includedir"
6123         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6124 }
6125
6126 test "$oldincludedir" != NONE && \
6127 test "$oldincludedir" != "/usr/include" && \
6128 test -d "$oldincludedir" && {
6129         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6130         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6131 }
6132
6133 cf_search="$cf_search $cf_header_path_list"
6134
6135         test -n "$verbose" && echo search path $cf_search
6136         cf_save2_CPPFLAGS="$CPPFLAGS"
6137         for cf_incdir in $cf_search
6138         do
6139
6140 if test -n "$cf_incdir" ; then
6141   for cf_add_incdir in $cf_incdir
6142   do
6143         while test $cf_add_incdir != /usr/include
6144         do
6145           if test -d $cf_add_incdir
6146           then
6147                 cf_have_incdir=no
6148                 if test -n "$CFLAGS$CPPFLAGS" ; then
6149                   # a loop is needed to ensure we can add subdirs of existing dirs
6150                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6151                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6152                           cf_have_incdir=yes; break
6153                         fi
6154                   done
6155                 fi
6156
6157                 if test "$cf_have_incdir" = no ; then
6158                   if test "$cf_add_incdir" = /usr/local/include ; then
6159                         if test "$GCC" = yes
6160                         then
6161                           cf_save_CPPFLAGS=$CPPFLAGS
6162                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6163                           cat >conftest.$ac_ext <<_ACEOF
6164 #line 6164 "configure"
6165 #include "confdefs.h"
6166 #include <stdio.h>
6167 int
6168 main ()
6169 {
6170 printf("Hello")
6171   ;
6172   return 0;
6173 }
6174 _ACEOF
6175 rm -f conftest.$ac_objext
6176 if { (eval echo "$as_me:6176: \"$ac_compile\"") >&5
6177   (eval $ac_compile) 2>&5
6178   ac_status=$?
6179   echo "$as_me:6179: \$? = $ac_status" >&5
6180   (exit $ac_status); } &&
6181          { ac_try='test -s conftest.$ac_objext'
6182   { (eval echo "$as_me:6182: \"$ac_try\"") >&5
6183   (eval $ac_try) 2>&5
6184   ac_status=$?
6185   echo "$as_me:6185: \$? = $ac_status" >&5
6186   (exit $ac_status); }; }; then
6187   :
6188 else
6189   echo "$as_me: failed program was:" >&5
6190 cat conftest.$ac_ext >&5
6191 cf_have_incdir=yes
6192 fi
6193 rm -f conftest.$ac_objext conftest.$ac_ext
6194                           CPPFLAGS=$cf_save_CPPFLAGS
6195                         fi
6196                   fi
6197                 fi
6198
6199                 if test "$cf_have_incdir" = no ; then
6200                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6201
6202 echo "${as_me:-configure}:6202: testing adding $cf_add_incdir to include-path ..." 1>&5
6203
6204                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6205
6206                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6207                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6208                   cf_add_incdir="$cf_top_incdir"
6209                 else
6210                   break
6211                 fi
6212           fi
6213         done
6214   done
6215 fi
6216
6217                 for cf_header in \
6218                         ncurses.h \
6219                         curses.h
6220                 do
6221
6222         cat >conftest.$ac_ext <<_ACEOF
6223 #line 6223 "configure"
6224 #include "confdefs.h"
6225
6226 #include <$cf_header>
6227 int
6228 main ()
6229 {
6230
6231 #ifdef NCURSES_VERSION
6232
6233 printf("%s\n", NCURSES_VERSION);
6234 #else
6235 #ifdef __NCURSES_H
6236 printf("old\n");
6237 #else
6238         make an error
6239 #endif
6240 #endif
6241
6242   ;
6243   return 0;
6244 }
6245 _ACEOF
6246 rm -f conftest.$ac_objext
6247 if { (eval echo "$as_me:6247: \"$ac_compile\"") >&5
6248   (eval $ac_compile) 2>&5
6249   ac_status=$?
6250   echo "$as_me:6250: \$? = $ac_status" >&5
6251   (exit $ac_status); } &&
6252          { ac_try='test -s conftest.$ac_objext'
6253   { (eval echo "$as_me:6253: \"$ac_try\"") >&5
6254   (eval $ac_try) 2>&5
6255   ac_status=$?
6256   echo "$as_me:6256: \$? = $ac_status" >&5
6257   (exit $ac_status); }; }; then
6258   cf_cv_ncurses_h2=$cf_header
6259
6260 else
6261   echo "$as_me: failed program was:" >&5
6262 cat conftest.$ac_ext >&5
6263 cf_cv_ncurses_h2=no
6264 fi
6265 rm -f conftest.$ac_objext conftest.$ac_ext
6266
6267                         if test "$cf_cv_ncurses_h2" != no ; then
6268                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6269                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6270                                 break
6271                         fi
6272                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6273                 done
6274                 CPPFLAGS="$cf_save2_CPPFLAGS"
6275                 test "$cf_cv_ncurses_h2" != no && break
6276         done
6277         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6277: error: not found" >&5
6278 echo "$as_me: error: not found" >&2;}
6279    { (exit 1); exit 1; }; }
6280
6281 fi
6282 echo "$as_me:6282: result: $cf_cv_ncurses_h2" >&5
6283 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6284
6285         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6286         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6287         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6288                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6289         fi
6290
6291 if test -n "$cf_1st_incdir" ; then
6292   for cf_add_incdir in $cf_1st_incdir
6293   do
6294         while test $cf_add_incdir != /usr/include
6295         do
6296           if test -d $cf_add_incdir
6297           then
6298                 cf_have_incdir=no
6299                 if test -n "$CFLAGS$CPPFLAGS" ; then
6300                   # a loop is needed to ensure we can add subdirs of existing dirs
6301                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6302                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6303                           cf_have_incdir=yes; break
6304                         fi
6305                   done
6306                 fi
6307
6308                 if test "$cf_have_incdir" = no ; then
6309                   if test "$cf_add_incdir" = /usr/local/include ; then
6310                         if test "$GCC" = yes
6311                         then
6312                           cf_save_CPPFLAGS=$CPPFLAGS
6313                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6314                           cat >conftest.$ac_ext <<_ACEOF
6315 #line 6315 "configure"
6316 #include "confdefs.h"
6317 #include <stdio.h>
6318 int
6319 main ()
6320 {
6321 printf("Hello")
6322   ;
6323   return 0;
6324 }
6325 _ACEOF
6326 rm -f conftest.$ac_objext
6327 if { (eval echo "$as_me:6327: \"$ac_compile\"") >&5
6328   (eval $ac_compile) 2>&5
6329   ac_status=$?
6330   echo "$as_me:6330: \$? = $ac_status" >&5
6331   (exit $ac_status); } &&
6332          { ac_try='test -s conftest.$ac_objext'
6333   { (eval echo "$as_me:6333: \"$ac_try\"") >&5
6334   (eval $ac_try) 2>&5
6335   ac_status=$?
6336   echo "$as_me:6336: \$? = $ac_status" >&5
6337   (exit $ac_status); }; }; then
6338   :
6339 else
6340   echo "$as_me: failed program was:" >&5
6341 cat conftest.$ac_ext >&5
6342 cf_have_incdir=yes
6343 fi
6344 rm -f conftest.$ac_objext conftest.$ac_ext
6345                           CPPFLAGS=$cf_save_CPPFLAGS
6346                         fi
6347                   fi
6348                 fi
6349
6350                 if test "$cf_have_incdir" = no ; then
6351                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6352
6353 echo "${as_me:-configure}:6353: testing adding $cf_add_incdir to include-path ..." 1>&5
6354
6355                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6356
6357                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6358                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6359                   cf_add_incdir="$cf_top_incdir"
6360                 else
6361                   break
6362                 fi
6363           fi
6364         done
6365   done
6366 fi
6367
6368 fi
6369
6370 # Set definitions to allow ifdef'ing for ncurses.h
6371
6372 case $cf_cv_ncurses_header in # (vi
6373 *ncurses.h)
6374
6375 cat >>confdefs.h <<\EOF
6376 #define HAVE_NCURSES_H 1
6377 EOF
6378
6379         ;;
6380 esac
6381
6382 case $cf_cv_ncurses_header in # (vi
6383 ncurses/curses.h|ncurses/ncurses.h)
6384
6385 cat >>confdefs.h <<\EOF
6386 #define HAVE_NCURSES_NCURSES_H 1
6387 EOF
6388
6389         ;;
6390 ncursesw/curses.h|ncursesw/ncurses.h)
6391
6392 cat >>confdefs.h <<\EOF
6393 #define HAVE_NCURSESW_NCURSES_H 1
6394 EOF
6395
6396         ;;
6397 esac
6398
6399 echo "$as_me:6399: checking for terminfo header" >&5
6400 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6401 if test "${cf_cv_term_header+set}" = set; then
6402   echo $ECHO_N "(cached) $ECHO_C" >&6
6403 else
6404
6405 case ${cf_cv_ncurses_header} in #(vi
6406 */ncurses.h|*/ncursesw.h) #(vi
6407         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6408         ;;
6409 *)
6410         cf_term_header=term.h
6411         ;;
6412 esac
6413
6414 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6415 do
6416 cat >conftest.$ac_ext <<_ACEOF
6417 #line 6417 "configure"
6418 #include "confdefs.h"
6419 #include <stdio.h>
6420 #include <${cf_cv_ncurses_header:-curses.h}>
6421 #include <$cf_test>
6422
6423 int
6424 main ()
6425 {
6426 int x = auto_left_margin
6427   ;
6428   return 0;
6429 }
6430 _ACEOF
6431 rm -f conftest.$ac_objext
6432 if { (eval echo "$as_me:6432: \"$ac_compile\"") >&5
6433   (eval $ac_compile) 2>&5
6434   ac_status=$?
6435   echo "$as_me:6435: \$? = $ac_status" >&5
6436   (exit $ac_status); } &&
6437          { ac_try='test -s conftest.$ac_objext'
6438   { (eval echo "$as_me:6438: \"$ac_try\"") >&5
6439   (eval $ac_try) 2>&5
6440   ac_status=$?
6441   echo "$as_me:6441: \$? = $ac_status" >&5
6442   (exit $ac_status); }; }; then
6443
6444         cf_cv_term_header="$cf_test"
6445 else
6446   echo "$as_me: failed program was:" >&5
6447 cat conftest.$ac_ext >&5
6448
6449         cf_cv_term_header=unknown
6450
6451 fi
6452 rm -f conftest.$ac_objext conftest.$ac_ext
6453         test "$cf_cv_term_header" != unknown && break
6454 done
6455
6456 fi
6457 echo "$as_me:6457: result: $cf_cv_term_header" >&5
6458 echo "${ECHO_T}$cf_cv_term_header" >&6
6459
6460 # Set definitions to allow ifdef'ing to accommodate subdirectories
6461
6462 case $cf_cv_term_header in # (vi
6463 *term.h)
6464
6465 cat >>confdefs.h <<\EOF
6466 #define HAVE_TERM_H 1
6467 EOF
6468
6469         ;;
6470 esac
6471
6472 case $cf_cv_term_header in # (vi
6473 ncurses/term.h) #(vi
6474
6475 cat >>confdefs.h <<\EOF
6476 #define HAVE_NCURSES_TERM_H 1
6477 EOF
6478
6479         ;;
6480 ncursesw/term.h)
6481
6482 cat >>confdefs.h <<\EOF
6483 #define HAVE_NCURSESW_TERM_H 1
6484 EOF
6485
6486         ;;
6487 esac
6488
6489 # some applications need this, but should check for NCURSES_VERSION
6490
6491 cat >>confdefs.h <<\EOF
6492 #define NCURSES 1
6493 EOF
6494
6495 echo "$as_me:6495: checking for ncurses version" >&5
6496 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6497 if test "${cf_cv_ncurses_version+set}" = set; then
6498   echo $ECHO_N "(cached) $ECHO_C" >&6
6499 else
6500
6501         cf_cv_ncurses_version=no
6502         cf_tempfile=out$$
6503         rm -f $cf_tempfile
6504         if test "$cross_compiling" = yes; then
6505
6506         # This will not work if the preprocessor splits the line after the
6507         # Autoconf token.  The 'unproto' program does that.
6508         cat > conftest.$ac_ext <<EOF
6509 #include <${cf_cv_ncurses_header:-curses.h}>
6510 #undef Autoconf
6511 #ifdef NCURSES_VERSION
6512 Autoconf NCURSES_VERSION
6513 #else
6514 #ifdef __NCURSES_H
6515 Autoconf "old"
6516 #endif
6517 ;
6518 #endif
6519 EOF
6520         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6521         { (eval echo "$as_me:6521: \"$cf_try\"") >&5
6522   (eval $cf_try) 2>&5
6523   ac_status=$?
6524   echo "$as_me:6524: \$? = $ac_status" >&5
6525   (exit $ac_status); }
6526         if test -f conftest.out ; then
6527                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6528                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6529                 rm -f conftest.out
6530         fi
6531
6532 else
6533   cat >conftest.$ac_ext <<_ACEOF
6534 #line 6534 "configure"
6535 #include "confdefs.h"
6536
6537 #include <${cf_cv_ncurses_header:-curses.h}>
6538 #include <stdio.h>
6539 int main()
6540 {
6541         FILE *fp = fopen("$cf_tempfile", "w");
6542 #ifdef NCURSES_VERSION
6543 # ifdef NCURSES_VERSION_PATCH
6544         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6545 # else
6546         fprintf(fp, "%s\n", NCURSES_VERSION);
6547 # endif
6548 #else
6549 # ifdef __NCURSES_H
6550         fprintf(fp, "old\n");
6551 # else
6552         make an error
6553 # endif
6554 #endif
6555         ${cf_cv_main_return:-return}(0);
6556 }
6557 _ACEOF
6558 rm -f conftest$ac_exeext
6559 if { (eval echo "$as_me:6559: \"$ac_link\"") >&5
6560   (eval $ac_link) 2>&5
6561   ac_status=$?
6562   echo "$as_me:6562: \$? = $ac_status" >&5
6563   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6564   { (eval echo "$as_me:6564: \"$ac_try\"") >&5
6565   (eval $ac_try) 2>&5
6566   ac_status=$?
6567   echo "$as_me:6567: \$? = $ac_status" >&5
6568   (exit $ac_status); }; }; then
6569
6570         cf_cv_ncurses_version=`cat $cf_tempfile`
6571 else
6572   echo "$as_me: program exited with status $ac_status" >&5
6573 echo "$as_me: failed program was:" >&5
6574 cat conftest.$ac_ext >&5
6575 fi
6576 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6577 fi
6578         rm -f $cf_tempfile
6579
6580 fi
6581 echo "$as_me:6581: result: $cf_cv_ncurses_version" >&5
6582 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6583 test "$cf_cv_ncurses_version" = no ||
6584 cat >>confdefs.h <<\EOF
6585 #define NCURSES 1
6586 EOF
6587
6588 cf_nculib_root=ncurses
6589         # This works, except for the special case where we find gpm, but
6590         # ncurses is in a nonstandard location via $LIBS, and we really want
6591         # to link gpm.
6592 cf_ncurses_LIBS=""
6593 cf_ncurses_SAVE="$LIBS"
6594 echo "$as_me:6594: checking for Gpm_Open in -lgpm" >&5
6595 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6596 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6597   echo $ECHO_N "(cached) $ECHO_C" >&6
6598 else
6599   ac_check_lib_save_LIBS=$LIBS
6600 LIBS="-lgpm  $LIBS"
6601 cat >conftest.$ac_ext <<_ACEOF
6602 #line 6602 "configure"
6603 #include "confdefs.h"
6604
6605 /* Override any gcc2 internal prototype to avoid an error.  */
6606 #ifdef __cplusplus
6607 extern "C"
6608 #endif
6609 /* We use char because int might match the return type of a gcc2
6610    builtin and then its argument prototype would still apply.  */
6611 char Gpm_Open ();
6612 int
6613 main ()
6614 {
6615 Gpm_Open ();
6616   ;
6617   return 0;
6618 }
6619 _ACEOF
6620 rm -f conftest.$ac_objext conftest$ac_exeext
6621 if { (eval echo "$as_me:6621: \"$ac_link\"") >&5
6622   (eval $ac_link) 2>&5
6623   ac_status=$?
6624   echo "$as_me:6624: \$? = $ac_status" >&5
6625   (exit $ac_status); } &&
6626          { ac_try='test -s conftest$ac_exeext'
6627   { (eval echo "$as_me:6627: \"$ac_try\"") >&5
6628   (eval $ac_try) 2>&5
6629   ac_status=$?
6630   echo "$as_me:6630: \$? = $ac_status" >&5
6631   (exit $ac_status); }; }; then
6632   ac_cv_lib_gpm_Gpm_Open=yes
6633 else
6634   echo "$as_me: failed program was:" >&5
6635 cat conftest.$ac_ext >&5
6636 ac_cv_lib_gpm_Gpm_Open=no
6637 fi
6638 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6639 LIBS=$ac_check_lib_save_LIBS
6640 fi
6641 echo "$as_me:6641: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6642 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6643 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6644   echo "$as_me:6644: checking for initscr in -lgpm" >&5
6645 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6646 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6647   echo $ECHO_N "(cached) $ECHO_C" >&6
6648 else
6649   ac_check_lib_save_LIBS=$LIBS
6650 LIBS="-lgpm  $LIBS"
6651 cat >conftest.$ac_ext <<_ACEOF
6652 #line 6652 "configure"
6653 #include "confdefs.h"
6654
6655 /* Override any gcc2 internal prototype to avoid an error.  */
6656 #ifdef __cplusplus
6657 extern "C"
6658 #endif
6659 /* We use char because int might match the return type of a gcc2
6660    builtin and then its argument prototype would still apply.  */
6661 char initscr ();
6662 int
6663 main ()
6664 {
6665 initscr ();
6666   ;
6667   return 0;
6668 }
6669 _ACEOF
6670 rm -f conftest.$ac_objext conftest$ac_exeext
6671 if { (eval echo "$as_me:6671: \"$ac_link\"") >&5
6672   (eval $ac_link) 2>&5
6673   ac_status=$?
6674   echo "$as_me:6674: \$? = $ac_status" >&5
6675   (exit $ac_status); } &&
6676          { ac_try='test -s conftest$ac_exeext'
6677   { (eval echo "$as_me:6677: \"$ac_try\"") >&5
6678   (eval $ac_try) 2>&5
6679   ac_status=$?
6680   echo "$as_me:6680: \$? = $ac_status" >&5
6681   (exit $ac_status); }; }; then
6682   ac_cv_lib_gpm_initscr=yes
6683 else
6684   echo "$as_me: failed program was:" >&5
6685 cat conftest.$ac_ext >&5
6686 ac_cv_lib_gpm_initscr=no
6687 fi
6688 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6689 LIBS=$ac_check_lib_save_LIBS
6690 fi
6691 echo "$as_me:6691: result: $ac_cv_lib_gpm_initscr" >&5
6692 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6693 if test $ac_cv_lib_gpm_initscr = yes; then
6694   LIBS="$cf_ncurses_SAVE"
6695 else
6696   cf_ncurses_LIBS="-lgpm"
6697 fi
6698
6699 fi
6700
6701 case $host_os in #(vi
6702 freebsd*)
6703         # This is only necessary if you are linking against an obsolete
6704         # version of ncurses (but it should do no harm, since it's static).
6705         if test "$cf_nculib_root" = ncurses ; then
6706                 echo "$as_me:6706: checking for tgoto in -lmytinfo" >&5
6707 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6708 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6709   echo $ECHO_N "(cached) $ECHO_C" >&6
6710 else
6711   ac_check_lib_save_LIBS=$LIBS
6712 LIBS="-lmytinfo  $LIBS"
6713 cat >conftest.$ac_ext <<_ACEOF
6714 #line 6714 "configure"
6715 #include "confdefs.h"
6716
6717 /* Override any gcc2 internal prototype to avoid an error.  */
6718 #ifdef __cplusplus
6719 extern "C"
6720 #endif
6721 /* We use char because int might match the return type of a gcc2
6722    builtin and then its argument prototype would still apply.  */
6723 char tgoto ();
6724 int
6725 main ()
6726 {
6727 tgoto ();
6728   ;
6729   return 0;
6730 }
6731 _ACEOF
6732 rm -f conftest.$ac_objext conftest$ac_exeext
6733 if { (eval echo "$as_me:6733: \"$ac_link\"") >&5
6734   (eval $ac_link) 2>&5
6735   ac_status=$?
6736   echo "$as_me:6736: \$? = $ac_status" >&5
6737   (exit $ac_status); } &&
6738          { ac_try='test -s conftest$ac_exeext'
6739   { (eval echo "$as_me:6739: \"$ac_try\"") >&5
6740   (eval $ac_try) 2>&5
6741   ac_status=$?
6742   echo "$as_me:6742: \$? = $ac_status" >&5
6743   (exit $ac_status); }; }; then
6744   ac_cv_lib_mytinfo_tgoto=yes
6745 else
6746   echo "$as_me: failed program was:" >&5
6747 cat conftest.$ac_ext >&5
6748 ac_cv_lib_mytinfo_tgoto=no
6749 fi
6750 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6751 LIBS=$ac_check_lib_save_LIBS
6752 fi
6753 echo "$as_me:6753: result: $ac_cv_lib_mytinfo_tgoto" >&5
6754 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6755 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6756   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6757 fi
6758
6759         fi
6760         ;;
6761 esac
6762
6763 LIBS="$cf_ncurses_LIBS $LIBS"
6764
6765 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6766 then
6767         LIBS="-l$cf_nculib_root $LIBS"
6768 else
6769
6770         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6771         cf_libdir=""
6772         echo "$as_me:6772: checking for initscr" >&5
6773 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6774 if test "${ac_cv_func_initscr+set}" = set; then
6775   echo $ECHO_N "(cached) $ECHO_C" >&6
6776 else
6777   cat >conftest.$ac_ext <<_ACEOF
6778 #line 6778 "configure"
6779 #include "confdefs.h"
6780 /* System header to define __stub macros and hopefully few prototypes,
6781     which can conflict with char initscr (); below.  */
6782 #include <assert.h>
6783 /* Override any gcc2 internal prototype to avoid an error.  */
6784 #ifdef __cplusplus
6785 extern "C"
6786 #endif
6787 /* We use char because int might match the return type of a gcc2
6788    builtin and then its argument prototype would still apply.  */
6789 char initscr ();
6790 char (*f) ();
6791
6792 int
6793 main ()
6794 {
6795 /* The GNU C library defines this for functions which it implements
6796     to always fail with ENOSYS.  Some functions are actually named
6797     something starting with __ and the normal name is an alias.  */
6798 #if defined (__stub_initscr) || defined (__stub___initscr)
6799 choke me
6800 #else
6801 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6802 #endif
6803
6804   ;
6805   return 0;
6806 }
6807 _ACEOF
6808 rm -f conftest.$ac_objext conftest$ac_exeext
6809 if { (eval echo "$as_me:6809: \"$ac_link\"") >&5
6810   (eval $ac_link) 2>&5
6811   ac_status=$?
6812   echo "$as_me:6812: \$? = $ac_status" >&5
6813   (exit $ac_status); } &&
6814          { ac_try='test -s conftest$ac_exeext'
6815   { (eval echo "$as_me:6815: \"$ac_try\"") >&5
6816   (eval $ac_try) 2>&5
6817   ac_status=$?
6818   echo "$as_me:6818: \$? = $ac_status" >&5
6819   (exit $ac_status); }; }; then
6820   ac_cv_func_initscr=yes
6821 else
6822   echo "$as_me: failed program was:" >&5
6823 cat conftest.$ac_ext >&5
6824 ac_cv_func_initscr=no
6825 fi
6826 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6827 fi
6828 echo "$as_me:6828: result: $ac_cv_func_initscr" >&5
6829 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6830 if test $ac_cv_func_initscr = yes; then
6831   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6832 else
6833
6834                 cf_save_LIBS="$LIBS"
6835                 echo "$as_me:6835: checking for initscr in -l$cf_nculib_root" >&5
6836 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6837                 LIBS="-l$cf_nculib_root $LIBS"
6838                 cat >conftest.$ac_ext <<_ACEOF
6839 #line 6839 "configure"
6840 #include "confdefs.h"
6841 #include <${cf_cv_ncurses_header:-curses.h}>
6842 int
6843 main ()
6844 {
6845 initscr()
6846   ;
6847   return 0;
6848 }
6849 _ACEOF
6850 rm -f conftest.$ac_objext conftest$ac_exeext
6851 if { (eval echo "$as_me:6851: \"$ac_link\"") >&5
6852   (eval $ac_link) 2>&5
6853   ac_status=$?
6854   echo "$as_me:6854: \$? = $ac_status" >&5
6855   (exit $ac_status); } &&
6856          { ac_try='test -s conftest$ac_exeext'
6857   { (eval echo "$as_me:6857: \"$ac_try\"") >&5
6858   (eval $ac_try) 2>&5
6859   ac_status=$?
6860   echo "$as_me:6860: \$? = $ac_status" >&5
6861   (exit $ac_status); }; }; then
6862   echo "$as_me:6862: result: yes" >&5
6863 echo "${ECHO_T}yes" >&6
6864                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6865
6866 else
6867   echo "$as_me: failed program was:" >&5
6868 cat conftest.$ac_ext >&5
6869 echo "$as_me:6869: result: no" >&5
6870 echo "${ECHO_T}no" >&6
6871
6872 cf_search=
6873 cf_library_path_list=""
6874 if test -n "${LDFLAGS}${LIBS}" ; then
6875         for cf_library_path in $LDFLAGS $LIBS
6876         do
6877                 case $cf_library_path in #(vi
6878                 -L*)
6879                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6880
6881 test "$cf_library_path" != "NONE" && \
6882 test -d "$cf_library_path" && \
6883  {
6884         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6885         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6886         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6887         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6888         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6889         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"
6890 }
6891
6892                         cf_library_path_list="$cf_library_path_list $cf_search"
6893                         ;;
6894                 esac
6895         done
6896 fi
6897
6898 cf_search=
6899
6900 test "/usr" != "$prefix" && \
6901 test -d "/usr" && \
6902 (test $prefix = NONE || test "/usr" != "$prefix") && {
6903         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6904         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6905         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6906         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6907         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6908         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6909 }
6910
6911 test "$prefix" != "NONE" && \
6912 test -d "$prefix" && \
6913  {
6914         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6915         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6916         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6917         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6918         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6919         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6920 }
6921
6922 test "/usr/local" != "$prefix" && \
6923 test -d "/usr/local" && \
6924 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6925         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6926         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6927         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6928         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6929         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6930         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6931 }
6932
6933 test "/opt" != "$prefix" && \
6934 test -d "/opt" && \
6935 (test $prefix = NONE || test "/opt" != "$prefix") && {
6936         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6937         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6938         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6939         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6940         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6941         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6942 }
6943
6944 test "$HOME" != "$prefix" && \
6945 test -d "$HOME" && \
6946 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6947         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6948         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6949         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6950         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6951         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6952         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6953 }
6954
6955 cf_search="$cf_library_path_list $cf_search"
6956
6957                         for cf_libdir in $cf_search
6958                         do
6959                                 echo "$as_me:6959: checking for -l$cf_nculib_root in $cf_libdir" >&5
6960 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6961                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6962                                 cat >conftest.$ac_ext <<_ACEOF
6963 #line 6963 "configure"
6964 #include "confdefs.h"
6965 #include <${cf_cv_ncurses_header:-curses.h}>
6966 int
6967 main ()
6968 {
6969 initscr()
6970   ;
6971   return 0;
6972 }
6973 _ACEOF
6974 rm -f conftest.$ac_objext conftest$ac_exeext
6975 if { (eval echo "$as_me:6975: \"$ac_link\"") >&5
6976   (eval $ac_link) 2>&5
6977   ac_status=$?
6978   echo "$as_me:6978: \$? = $ac_status" >&5
6979   (exit $ac_status); } &&
6980          { ac_try='test -s conftest$ac_exeext'
6981   { (eval echo "$as_me:6981: \"$ac_try\"") >&5
6982   (eval $ac_try) 2>&5
6983   ac_status=$?
6984   echo "$as_me:6984: \$? = $ac_status" >&5
6985   (exit $ac_status); }; }; then
6986   echo "$as_me:6986: result: yes" >&5
6987 echo "${ECHO_T}yes" >&6
6988                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6989                                          break
6990 else
6991   echo "$as_me: failed program was:" >&5
6992 cat conftest.$ac_ext >&5
6993 echo "$as_me:6993: result: no" >&5
6994 echo "${ECHO_T}no" >&6
6995                                          LIBS="$cf_save_LIBS"
6996 fi
6997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6998                         done
6999
7000 fi
7001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7002
7003 fi
7004
7005 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7006
7007 if test $cf_found_library = no ; then
7008         { { echo "$as_me:7008: error: Cannot link $cf_nculib_root library" >&5
7009 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7010    { (exit 1); exit 1; }; }
7011 fi
7012
7013 fi
7014
7015 if test -n "$cf_ncurses_LIBS" ; then
7016         echo "$as_me:7016: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7017 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7018         cf_ncurses_SAVE="$LIBS"
7019         for p in $cf_ncurses_LIBS ; do
7020                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7021                 if test "$q" != "$LIBS" ; then
7022                         LIBS="$q"
7023                 fi
7024         done
7025         cat >conftest.$ac_ext <<_ACEOF
7026 #line 7026 "configure"
7027 #include "confdefs.h"
7028 #include <${cf_cv_ncurses_header:-curses.h}>
7029 int
7030 main ()
7031 {
7032 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7033   ;
7034   return 0;
7035 }
7036 _ACEOF
7037 rm -f conftest.$ac_objext conftest$ac_exeext
7038 if { (eval echo "$as_me:7038: \"$ac_link\"") >&5
7039   (eval $ac_link) 2>&5
7040   ac_status=$?
7041   echo "$as_me:7041: \$? = $ac_status" >&5
7042   (exit $ac_status); } &&
7043          { ac_try='test -s conftest$ac_exeext'
7044   { (eval echo "$as_me:7044: \"$ac_try\"") >&5
7045   (eval $ac_try) 2>&5
7046   ac_status=$?
7047   echo "$as_me:7047: \$? = $ac_status" >&5
7048   (exit $ac_status); }; }; then
7049   echo "$as_me:7049: result: yes" >&5
7050 echo "${ECHO_T}yes" >&6
7051 else
7052   echo "$as_me: failed program was:" >&5
7053 cat conftest.$ac_ext >&5
7054 echo "$as_me:7054: result: no" >&5
7055 echo "${ECHO_T}no" >&6
7056                  LIBS="$cf_ncurses_SAVE"
7057 fi
7058 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7059 fi
7060
7061 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7062
7063 cat >>confdefs.h <<EOF
7064 #define $cf_nculib_ROOT 1
7065 EOF
7066
7067 fi
7068
7069 fi
7070
7071 if test "$NCURSES_CONFIG" != none ; then
7072
7073 cf_version=`$NCURSES_CONFIG --version`
7074
7075 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7076 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
7077 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
7078
7079 # ABI version is not available from headers
7080 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7081
7082 else
7083
7084 for cf_name in MAJOR MINOR PATCH
7085 do
7086 cat >conftest.$ac_ext <<CF_EOF
7087 #include <${cf_cv_ncurses_header:-curses.h}>
7088 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7089 CF_EOF
7090         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7091         { (eval echo "$as_me:7091: \"$cf_try\"") >&5
7092   (eval $cf_try) 2>&5
7093   ac_status=$?
7094   echo "$as_me:7094: \$? = $ac_status" >&5
7095   (exit $ac_status); }
7096         if test -f conftest.out ; then
7097                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
7098                 eval NCURSES_$cf_name=\"$cf_result\"
7099                 # cat conftest.$ac_ext
7100                 # cat conftest.out
7101         fi
7102 done
7103
7104 cf_cv_abi_version=${NCURSES_MAJOR}
7105
7106 fi
7107
7108 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7109
7110 cf_cv_timestamp=`date`
7111
7112 echo "$as_me:7112: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7113 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7114
7115 echo "$as_me:7115: checking if you want to have a library-prefix" >&5
7116 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
7117
7118 # Check whether --with-lib-prefix or --without-lib-prefix was given.
7119 if test "${with_lib_prefix+set}" = set; then
7120   withval="$with_lib_prefix"
7121   with_lib_prefix=$withval
7122 else
7123   with_lib_prefix=auto
7124 fi;
7125 echo "$as_me:7125: result: $with_lib_prefix" >&5
7126 echo "${ECHO_T}$with_lib_prefix" >&6
7127
7128 if test $with_lib_prefix = auto
7129 then
7130
7131         case $cf_cv_system_name in #(vi
7132         OS/2*|os2*) #(vi
7133         LIB_PREFIX=''
7134         ;;
7135         *)      LIB_PREFIX='lib'
7136         ;;
7137         esac
7138 cf_prefix=$LIB_PREFIX
7139
7140 elif test $with_lib_prefix = no
7141 then
7142         LIB_PREFIX=
7143 else
7144         LIB_PREFIX=$with_lib_prefix
7145 fi
7146
7147 LIB_SUFFIX=
7148
7149 ###############################################################################
7150
7151 if test X"$CC_G_OPT" = X"" ; then
7152         CC_G_OPT='-g'
7153         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7154 fi
7155
7156 echo "$as_me:7156: checking for default loader flags" >&5
7157 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7158 case $DFT_LWR_MODEL in
7159 normal)  LD_MODEL=''   ;;
7160 debug)   LD_MODEL=$CC_G_OPT ;;
7161 profile) LD_MODEL='-pg';;
7162 shared)  LD_MODEL=''   ;;
7163 esac
7164 echo "$as_me:7164: result: $LD_MODEL" >&5
7165 echo "${ECHO_T}$LD_MODEL" >&6
7166
7167 LD_RPATH_OPT=
7168 echo "$as_me:7168: checking for an rpath option" >&5
7169 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7170 case $cf_cv_system_name in #(vi
7171 irix*) #(vi
7172         if test "$GCC" = yes; then
7173                 LD_RPATH_OPT="-Wl,-rpath,"
7174         else
7175                 LD_RPATH_OPT="-rpath "
7176         fi
7177         ;;
7178 linux*|gnu*|k*bsd*-gnu) #(vi
7179         LD_RPATH_OPT="-Wl,-rpath,"
7180         ;;
7181 openbsd[2-9].*|mirbsd*) #(vi
7182         LD_RPATH_OPT="-Wl,-rpath,"
7183         ;;
7184 dragonfly*|freebsd*) #(vi
7185         LD_RPATH_OPT="-rpath "
7186         ;;
7187 netbsd*) #(vi
7188         LD_RPATH_OPT="-Wl,-rpath,"
7189         ;;
7190 osf*|mls+*) #(vi
7191         LD_RPATH_OPT="-rpath "
7192         ;;
7193 solaris2*) #(vi
7194         LD_RPATH_OPT="-R"
7195         ;;
7196 *)
7197         ;;
7198 esac
7199 echo "$as_me:7199: result: $LD_RPATH_OPT" >&5
7200 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7201
7202 case "x$LD_RPATH_OPT" in #(vi
7203 x-R*)
7204         echo "$as_me:7204: checking if we need a space after rpath option" >&5
7205 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7206         cf_save_LIBS="$LIBS"
7207         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
7208         cat >conftest.$ac_ext <<_ACEOF
7209 #line 7209 "configure"
7210 #include "confdefs.h"
7211
7212 int
7213 main ()
7214 {
7215
7216   ;
7217   return 0;
7218 }
7219 _ACEOF
7220 rm -f conftest.$ac_objext conftest$ac_exeext
7221 if { (eval echo "$as_me:7221: \"$ac_link\"") >&5
7222   (eval $ac_link) 2>&5
7223   ac_status=$?
7224   echo "$as_me:7224: \$? = $ac_status" >&5
7225   (exit $ac_status); } &&
7226          { ac_try='test -s conftest$ac_exeext'
7227   { (eval echo "$as_me:7227: \"$ac_try\"") >&5
7228   (eval $ac_try) 2>&5
7229   ac_status=$?
7230   echo "$as_me:7230: \$? = $ac_status" >&5
7231   (exit $ac_status); }; }; then
7232   cf_rpath_space=no
7233 else
7234   echo "$as_me: failed program was:" >&5
7235 cat conftest.$ac_ext >&5
7236 cf_rpath_space=yes
7237 fi
7238 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7239         LIBS="$cf_save_LIBS"
7240         echo "$as_me:7240: result: $cf_rpath_space" >&5
7241 echo "${ECHO_T}$cf_rpath_space" >&6
7242         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7243         ;;
7244 esac
7245
7246         LOCAL_LDFLAGS=
7247         LOCAL_LDFLAGS2=
7248         LD_SHARED_OPTS=
7249         INSTALL_LIB="-m 644"
7250
7251         cf_cv_do_symlinks=no
7252         cf_ld_rpath_opt=
7253         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7254
7255         echo "$as_me:7255: checking if release/abi version should be used for shared libs" >&5
7256 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7257
7258 # Check whether --with-shlib-version or --without-shlib-version was given.
7259 if test "${with_shlib_version+set}" = set; then
7260   withval="$with_shlib_version"
7261   test -z "$withval" && withval=auto
7262         case $withval in #(vi
7263         yes) #(vi
7264                 cf_cv_shlib_version=auto
7265                 ;;
7266         rel|abi|auto|no) #(vi
7267                 cf_cv_shlib_version=$withval
7268                 ;;
7269         *)
7270                 { { echo "$as_me:7270: error: option value must be one of: rel, abi, auto or no" >&5
7271 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7272    { (exit 1); exit 1; }; }
7273                 ;;
7274         esac
7275
7276 else
7277   cf_cv_shlib_version=auto
7278 fi;
7279         echo "$as_me:7279: result: $cf_cv_shlib_version" >&5
7280 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7281
7282         cf_cv_rm_so_locs=no
7283         cf_try_cflags=
7284
7285         # Some less-capable ports of gcc support only -fpic
7286         CC_SHARED_OPTS=
7287         if test "$GCC" = yes
7288         then
7289                 echo "$as_me:7289: checking which $CC option to use" >&5
7290 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7291                 cf_save_CFLAGS="$CFLAGS"
7292                 for CC_SHARED_OPTS in -fPIC -fpic ''
7293                 do
7294                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7295                         cat >conftest.$ac_ext <<_ACEOF
7296 #line 7296 "configure"
7297 #include "confdefs.h"
7298 #include <stdio.h>
7299 int
7300 main ()
7301 {
7302 int x = 1
7303   ;
7304   return 0;
7305 }
7306 _ACEOF
7307 rm -f conftest.$ac_objext
7308 if { (eval echo "$as_me:7308: \"$ac_compile\"") >&5
7309   (eval $ac_compile) 2>&5
7310   ac_status=$?
7311   echo "$as_me:7311: \$? = $ac_status" >&5
7312   (exit $ac_status); } &&
7313          { ac_try='test -s conftest.$ac_objext'
7314   { (eval echo "$as_me:7314: \"$ac_try\"") >&5
7315   (eval $ac_try) 2>&5
7316   ac_status=$?
7317   echo "$as_me:7317: \$? = $ac_status" >&5
7318   (exit $ac_status); }; }; then
7319   break
7320 else
7321   echo "$as_me: failed program was:" >&5
7322 cat conftest.$ac_ext >&5
7323 fi
7324 rm -f conftest.$ac_objext conftest.$ac_ext
7325                 done
7326                 echo "$as_me:7326: result: $CC_SHARED_OPTS" >&5
7327 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7328                 CFLAGS="$cf_save_CFLAGS"
7329         fi
7330
7331         cf_cv_shlib_version_infix=no
7332
7333         case $cf_cv_system_name in #(vi
7334         aix4.3-9*|aix[5-7]*) #(vi
7335                 if test "$GCC" = yes; then
7336                         CC_SHARED_OPTS=
7337                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7338                 else
7339                         # CC_SHARED_OPTS='-qpic=large -G'
7340                         # perhaps "-bM:SRE -bnoentry -bexpall"
7341                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7342                 fi
7343                 ;;
7344         beos*) #(vi
7345                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7346                 ;;
7347         cygwin*) #(vi
7348                 CC_SHARED_OPTS=
7349                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7350                 cf_cv_shlib_version=cygdll
7351                 cf_cv_shlib_version_infix=cygdll
7352                 cat >mk_shared_lib.sh <<-CF_EOF
7353                 #!/bin/sh
7354                 SHARED_LIB=\$1
7355                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7356                 shift
7357                 cat <<-EOF
7358                 Linking shared library
7359                 ** SHARED_LIB \$SHARED_LIB
7360                 ** IMPORT_LIB \$IMPORT_LIB
7361 EOF
7362                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7363 CF_EOF
7364                 chmod +x mk_shared_lib.sh
7365                 ;;
7366         darwin*) #(vi
7367                 cf_try_cflags="no-cpp-precomp"
7368                 CC_SHARED_OPTS="-dynamic"
7369                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7370                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7371                 cf_cv_shlib_version_infix=yes
7372                 echo "$as_me:7372: checking if ld -search_paths_first works" >&5
7373 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7374 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7375   echo $ECHO_N "(cached) $ECHO_C" >&6
7376 else
7377
7378                         cf_save_LDFLAGS=$LDFLAGS
7379                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7380                         cat >conftest.$ac_ext <<_ACEOF
7381 #line 7381 "configure"
7382 #include "confdefs.h"
7383
7384 int
7385 main ()
7386 {
7387 int i;
7388   ;
7389   return 0;
7390 }
7391 _ACEOF
7392 rm -f conftest.$ac_objext conftest$ac_exeext
7393 if { (eval echo "$as_me:7393: \"$ac_link\"") >&5
7394   (eval $ac_link) 2>&5
7395   ac_status=$?
7396   echo "$as_me:7396: \$? = $ac_status" >&5
7397   (exit $ac_status); } &&
7398          { ac_try='test -s conftest$ac_exeext'
7399   { (eval echo "$as_me:7399: \"$ac_try\"") >&5
7400   (eval $ac_try) 2>&5
7401   ac_status=$?
7402   echo "$as_me:7402: \$? = $ac_status" >&5
7403   (exit $ac_status); }; }; then
7404   cf_cv_ldflags_search_paths_first=yes
7405 else
7406   echo "$as_me: failed program was:" >&5
7407 cat conftest.$ac_ext >&5
7408 cf_cv_ldflags_search_paths_first=no
7409 fi
7410 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7411                                 LDFLAGS=$cf_save_LDFLAGS
7412 fi
7413 echo "$as_me:7413: result: $cf_cv_ldflags_search_paths_first" >&5
7414 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7415                 if test $cf_cv_ldflags_search_paths_first = yes; then
7416                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7417                 fi
7418                 ;;
7419         hpux*) #(vi
7420                 # (tested with gcc 2.7.2 -- I don't have c89)
7421                 if test "$GCC" = yes; then
7422                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7423                 else
7424                         CC_SHARED_OPTS='+Z'
7425                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7426                 fi
7427                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7428                 # HP-UX shared libraries must be executable, and should be
7429                 # readonly to exploit a quirk in the memory manager.
7430                 INSTALL_LIB="-m 555"
7431                 ;;
7432         interix*)
7433                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7434                 if test "$cf_cv_shlib_version" = rel; then
7435                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
7436                 else
7437                         cf_shared_soname='`basename `'
7438                 fi
7439                 CC_SHARED_OPTS=
7440                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
7441                 ;;
7442         irix*) #(vi
7443                 if test "$cf_cv_enable_rpath" = yes ; then
7444                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7445                 fi
7446                 # tested with IRIX 5.2 and 'cc'.
7447                 if test "$GCC" != yes; then
7448                         CC_SHARED_OPTS='-KPIC'
7449                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7450                 else
7451                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7452                 fi
7453                 cf_cv_rm_so_locs=yes
7454                 ;;
7455         linux*|gnu*|k*bsd*-gnu) #(vi
7456                 if test "$DFT_LWR_MODEL" = "shared" ; then
7457                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7458                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7459                 fi
7460                 if test "$cf_cv_enable_rpath" = yes ; then
7461                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7462                 fi
7463
7464         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7465         if test "$cf_cv_shlib_version" = rel; then
7466                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7467         else
7468                 cf_cv_shared_soname='`basename $@`'
7469         fi
7470
7471                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7472                 ;;
7473         mingw*) #(vi
7474                 cf_cv_shlib_version=mingw
7475                 cf_cv_shlib_version_infix=mingw
7476                 CC_SHARED_OPTS=
7477                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7478                 #MK_SHARED_LIB='${CC} ${CFLAGS} -mdll -Wl,-soname,'$cf_cv_shared_soname',-stats -o $[@]'
7479                 #MK_SHARED_LIB='${DLLTOOL} --export-all-symbols --output-exp --output-lib $[@]'
7480                 cat >mk_shared_lib.sh <<-CF_EOF
7481                 #!/bin/sh
7482                 SHARED_LIB=\$1
7483                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
7484                 shift
7485                 cat <<-EOF
7486                 Linking shared library
7487                 ** SHARED_LIB \$SHARED_LIB
7488                 ** IMPORT_LIB \$IMPORT_LIB
7489 EOF
7490                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7491 CF_EOF
7492                 chmod +x mk_shared_lib.sh
7493                 ;;
7494         openbsd[2-9].*|mirbsd*) #(vi
7495                 if test "$DFT_LWR_MODEL" = "shared" ; then
7496                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7497                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7498                 fi
7499                 if test "$cf_cv_enable_rpath" = yes ; then
7500                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7501                 fi
7502                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7503
7504         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7505         if test "$cf_cv_shlib_version" = rel; then
7506                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7507         else
7508                 cf_cv_shared_soname='`basename $@`'
7509         fi
7510
7511                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7512                 ;;
7513         nto-qnx*|openbsd*|freebsd[12].*) #(vi
7514                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7515                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7516                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7517                 ;;
7518         dragonfly*|freebsd*) #(vi
7519                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7520                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7521                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7522                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
7523                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7524                 fi
7525
7526         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7527         if test "$cf_cv_shlib_version" = rel; then
7528                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7529         else
7530                 cf_cv_shared_soname='`basename $@`'
7531         fi
7532
7533                 MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
7534                 ;;
7535         netbsd*) #(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="$LOCAL_LDFLAGS"
7540                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7541                         if test "$cf_cv_shlib_version" = auto; then
7542                         if test -f /usr/libexec/ld.elf_so; then
7543                                 cf_cv_shlib_version=abi
7544                         else
7545                                 cf_cv_shlib_version=rel
7546                         fi
7547                         fi
7548
7549         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7550         if test "$cf_cv_shlib_version" = rel; then
7551                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7552         else
7553                 cf_cv_shared_soname='`basename $@`'
7554         fi
7555
7556                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7557                 else
7558                         MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
7559                 fi
7560                 ;;
7561         osf*|mls+*) #(vi
7562                 # tested with OSF/1 V3.2 and 'cc'
7563                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7564                 # link with shared libs).
7565                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7566                 case $host_os in #(vi
7567                 osf4*)
7568                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7569                         ;;
7570                 esac
7571                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7572                 if test "$DFT_LWR_MODEL" = "shared" ; then
7573                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7574                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7575                 fi
7576                 cf_cv_rm_so_locs=yes
7577                 ;;
7578         sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
7579                 # tested with osr5.0.5
7580                 if test "$GCC" != yes; then
7581                         CC_SHARED_OPTS='-belf -KPIC'
7582                 fi
7583                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7584                 if test "$cf_cv_enable_rpath" = yes ; then
7585                         # only way is to set LD_RUN_PATH but no switch for it
7586                         RUN_PATH=$libdir
7587                 fi
7588                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7589                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7590                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7591                 ;;
7592         sunos4*) #(vi
7593                 # tested with SunOS 4.1.1 and gcc 2.7.0
7594                 if test "$GCC" != yes; then
7595                         CC_SHARED_OPTS='-KPIC'
7596                 fi
7597                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7598                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7599                 ;;
7600         solaris2*) #(vi
7601                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7602                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7603                 if test "$DFT_LWR_MODEL" = "shared" ; then
7604                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7605                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7606                 fi
7607                 if test "$cf_cv_enable_rpath" = yes ; then
7608                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7609                 fi
7610
7611         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7612         if test "$cf_cv_shlib_version" = rel; then
7613                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7614         else
7615                 cf_cv_shared_soname='`basename $@`'
7616         fi
7617
7618                 if test "$GCC" != yes; then
7619                         cf_save_CFLAGS="$CFLAGS"
7620                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7621                         do
7622                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7623                                 cat >conftest.$ac_ext <<_ACEOF
7624 #line 7624 "configure"
7625 #include "confdefs.h"
7626 #include <stdio.h>
7627 int
7628 main ()
7629 {
7630 printf("Hello\n");
7631   ;
7632   return 0;
7633 }
7634 _ACEOF
7635 rm -f conftest.$ac_objext
7636 if { (eval echo "$as_me:7636: \"$ac_compile\"") >&5
7637   (eval $ac_compile) 2>&5
7638   ac_status=$?
7639   echo "$as_me:7639: \$? = $ac_status" >&5
7640   (exit $ac_status); } &&
7641          { ac_try='test -s conftest.$ac_objext'
7642   { (eval echo "$as_me:7642: \"$ac_try\"") >&5
7643   (eval $ac_try) 2>&5
7644   ac_status=$?
7645   echo "$as_me:7645: \$? = $ac_status" >&5
7646   (exit $ac_status); }; }; then
7647   break
7648 else
7649   echo "$as_me: failed program was:" >&5
7650 cat conftest.$ac_ext >&5
7651 fi
7652 rm -f conftest.$ac_objext conftest.$ac_ext
7653                         done
7654                         CFLAGS="$cf_save_CFLAGS"
7655                         CC_SHARED_OPTS=$cf_shared_opts
7656                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7657                 else
7658                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7659                 fi
7660                 ;;
7661         sysv5uw7*|unix_sv*) #(vi
7662                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7663                 if test "$GCC" != yes; then
7664                         CC_SHARED_OPTS='-KPIC'
7665                 fi
7666                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7667                 ;;
7668         *)
7669                 CC_SHARED_OPTS='unknown'
7670                 MK_SHARED_LIB='echo unknown'
7671                 ;;
7672         esac
7673
7674         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7675         case "$cf_cv_shlib_version" in #(vi
7676         rel|abi)
7677                 case "$MK_SHARED_LIB" in #(vi
7678                 *'-o $@') #(vi
7679                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7680                         ;;
7681                 *)
7682                         { echo "$as_me:7682: WARNING: ignored --with-shlib-version" >&5
7683 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7684                         ;;
7685                 esac
7686                 ;;
7687         esac
7688
7689         if test -n "$cf_try_cflags"
7690         then
7691 cat > conftest.$ac_ext <<EOF
7692 #line 7692 "${as_me:-configure}"
7693 #include <stdio.h>
7694 int main(int argc, char *argv[])
7695 {
7696         printf("hello\n");
7697         return (argv[argc-1] == 0) ;
7698 }
7699 EOF
7700                 cf_save_CFLAGS="$CFLAGS"
7701                 for cf_opt in $cf_try_cflags
7702                 do
7703                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
7704                         echo "$as_me:7704: checking if CFLAGS option -$cf_opt works" >&5
7705 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
7706                         if { (eval echo "$as_me:7706: \"$ac_compile\"") >&5
7707   (eval $ac_compile) 2>&5
7708   ac_status=$?
7709   echo "$as_me:7709: \$? = $ac_status" >&5
7710   (exit $ac_status); }; then
7711                                 echo "$as_me:7711: result: yes" >&5
7712 echo "${ECHO_T}yes" >&6
7713                                 cf_save_CFLAGS="$CFLAGS"
7714                         else
7715                                 echo "$as_me:7715: result: no" >&5
7716 echo "${ECHO_T}no" >&6
7717                         fi
7718                 done
7719                 CFLAGS="$cf_save_CFLAGS"
7720         fi
7721
7722         # RPATH_LIST is a colon-separated list of directories
7723         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
7724         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
7725
7726         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
7727
7728 echo "${as_me:-configure}:7728: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
7729
7730         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
7731
7732 echo "${as_me:-configure}:7732: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
7733
7734 # The test/sample programs in the original tree link using rpath option.
7735 # Make it optional for packagers.
7736 if test -n "$LOCAL_LDFLAGS"
7737 then
7738         echo "$as_me:7738: checking if you want to link sample programs with rpath option" >&5
7739 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
7740
7741 # Check whether --enable-rpath-link or --disable-rpath-link was given.
7742 if test "${enable_rpath_link+set}" = set; then
7743   enableval="$enable_rpath_link"
7744   with_rpath_link=$enableval
7745 else
7746   with_rpath_link=yes
7747 fi;
7748         echo "$as_me:7748: result: $with_rpath_link" >&5
7749 echo "${ECHO_T}$with_rpath_link" >&6
7750         if test "$with_rpath_link" = no
7751         then
7752                 LOCAL_LDFLAGS=
7753                 LOCAL_LDFLAGS2=
7754         fi
7755 fi
7756
7757 ###############################################################################
7758
7759 ###   use option --enable-broken-linker to force on use of broken-linker support
7760 echo "$as_me:7760: checking if you want broken-linker support code" >&5
7761 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7762
7763 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7764 if test "${enable_broken_linker+set}" = set; then
7765   enableval="$enable_broken_linker"
7766   with_broken_linker=$enableval
7767 else
7768   with_broken_linker=${BROKEN_LINKER:-no}
7769 fi;
7770 echo "$as_me:7770: result: $with_broken_linker" >&5
7771 echo "${ECHO_T}$with_broken_linker" >&6
7772
7773 BROKEN_LINKER=0
7774 if test "$with_broken_linker" = yes ; then
7775         cat >>confdefs.h <<\EOF
7776 #define BROKEN_LINKER 1
7777 EOF
7778
7779         BROKEN_LINKER=1
7780 elif test "$DFT_LWR_MODEL" = shared ; then
7781         case $cf_cv_system_name in #(vi
7782         cygwin*)
7783                 cat >>confdefs.h <<\EOF
7784 #define BROKEN_LINKER 1
7785 EOF
7786
7787                 BROKEN_LINKER=1
7788                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7789
7790 echo "${as_me:-configure}:7790: testing cygwin linker is broken anyway ..." 1>&5
7791
7792                 ;;
7793         esac
7794 fi
7795
7796 # Check to define _XOPEN_SOURCE "automatically"
7797
7798 cf_XOPEN_SOURCE=500
7799 cf_POSIX_C_SOURCE=199506L
7800 cf_xopen_source=
7801
7802 case $host_os in #(vi
7803 aix[4-7]*) #(vi
7804         cf_xopen_source="-D_ALL_SOURCE"
7805         ;;
7806 cygwin) #(vi
7807         cf_XOPEN_SOURCE=600
7808         ;;
7809 darwin[0-8].*) #(vi
7810         cf_xopen_source="-D_APPLE_C_SOURCE"
7811         ;;
7812 darwin*) #(vi
7813         cf_xopen_source="-D_DARWIN_C_SOURCE"
7814         cf_XOPEN_SOURCE=
7815         ;;
7816 freebsd*|dragonfly*) #(vi
7817         # 5.x headers associate
7818         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7819         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7820         cf_POSIX_C_SOURCE=200112L
7821         cf_XOPEN_SOURCE=600
7822         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7823         ;;
7824 hpux11*) #(vi
7825         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7826         ;;
7827 hpux*) #(vi
7828         cf_xopen_source="-D_HPUX_SOURCE"
7829         ;;
7830 irix[56].*) #(vi
7831         cf_xopen_source="-D_SGI_SOURCE"
7832         cf_XOPEN_SOURCE=
7833         ;;
7834 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
7835
7836 echo "$as_me:7836: checking if we must define _GNU_SOURCE" >&5
7837 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7838 if test "${cf_cv_gnu_source+set}" = set; then
7839   echo $ECHO_N "(cached) $ECHO_C" >&6
7840 else
7841
7842 cat >conftest.$ac_ext <<_ACEOF
7843 #line 7843 "configure"
7844 #include "confdefs.h"
7845 #include <sys/types.h>
7846 int
7847 main ()
7848 {
7849
7850 #ifndef _XOPEN_SOURCE
7851 make an error
7852 #endif
7853   ;
7854   return 0;
7855 }
7856 _ACEOF
7857 rm -f conftest.$ac_objext
7858 if { (eval echo "$as_me:7858: \"$ac_compile\"") >&5
7859   (eval $ac_compile) 2>&5
7860   ac_status=$?
7861   echo "$as_me:7861: \$? = $ac_status" >&5
7862   (exit $ac_status); } &&
7863          { ac_try='test -s conftest.$ac_objext'
7864   { (eval echo "$as_me:7864: \"$ac_try\"") >&5
7865   (eval $ac_try) 2>&5
7866   ac_status=$?
7867   echo "$as_me:7867: \$? = $ac_status" >&5
7868   (exit $ac_status); }; }; then
7869   cf_cv_gnu_source=no
7870 else
7871   echo "$as_me: failed program was:" >&5
7872 cat conftest.$ac_ext >&5
7873 cf_save="$CPPFLAGS"
7874          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7875          cat >conftest.$ac_ext <<_ACEOF
7876 #line 7876 "configure"
7877 #include "confdefs.h"
7878 #include <sys/types.h>
7879 int
7880 main ()
7881 {
7882
7883 #ifdef _XOPEN_SOURCE
7884 make an error
7885 #endif
7886   ;
7887   return 0;
7888 }
7889 _ACEOF
7890 rm -f conftest.$ac_objext
7891 if { (eval echo "$as_me:7891: \"$ac_compile\"") >&5
7892   (eval $ac_compile) 2>&5
7893   ac_status=$?
7894   echo "$as_me:7894: \$? = $ac_status" >&5
7895   (exit $ac_status); } &&
7896          { ac_try='test -s conftest.$ac_objext'
7897   { (eval echo "$as_me:7897: \"$ac_try\"") >&5
7898   (eval $ac_try) 2>&5
7899   ac_status=$?
7900   echo "$as_me:7900: \$? = $ac_status" >&5
7901   (exit $ac_status); }; }; then
7902   cf_cv_gnu_source=no
7903 else
7904   echo "$as_me: failed program was:" >&5
7905 cat conftest.$ac_ext >&5
7906 cf_cv_gnu_source=yes
7907 fi
7908 rm -f conftest.$ac_objext conftest.$ac_ext
7909         CPPFLAGS="$cf_save"
7910
7911 fi
7912 rm -f conftest.$ac_objext conftest.$ac_ext
7913
7914 fi
7915 echo "$as_me:7915: result: $cf_cv_gnu_source" >&5
7916 echo "${ECHO_T}$cf_cv_gnu_source" >&6
7917 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7918
7919         ;;
7920 mirbsd*) #(vi
7921         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
7922         cf_XOPEN_SOURCE=
7923
7924 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
7925
7926 cf_save_CFLAGS="$CFLAGS"
7927 cf_save_CPPFLAGS="$CPPFLAGS"
7928
7929 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
7930         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7931                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7932
7933 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
7934         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7935                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7936
7937 echo "$as_me:7937: checking if we should define _POSIX_C_SOURCE" >&5
7938 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
7939 if test "${cf_cv_posix_c_source+set}" = set; then
7940   echo $ECHO_N "(cached) $ECHO_C" >&6
7941 else
7942
7943 echo "${as_me:-configure}:7943: testing if the symbol is already defined go no further ..." 1>&5
7944
7945         cat >conftest.$ac_ext <<_ACEOF
7946 #line 7946 "configure"
7947 #include "confdefs.h"
7948 #include <sys/types.h>
7949 int
7950 main ()
7951 {
7952
7953 #ifndef _POSIX_C_SOURCE
7954 make an error
7955 #endif
7956   ;
7957   return 0;
7958 }
7959 _ACEOF
7960 rm -f conftest.$ac_objext
7961 if { (eval echo "$as_me:7961: \"$ac_compile\"") >&5
7962   (eval $ac_compile) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit $ac_status); } &&
7966          { ac_try='test -s conftest.$ac_objext'
7967   { (eval echo "$as_me:7967: \"$ac_try\"") >&5
7968   (eval $ac_try) 2>&5
7969   ac_status=$?
7970   echo "$as_me:7970: \$? = $ac_status" >&5
7971   (exit $ac_status); }; }; then
7972   cf_cv_posix_c_source=no
7973 else
7974   echo "$as_me: failed program was:" >&5
7975 cat conftest.$ac_ext >&5
7976 cf_want_posix_source=no
7977          case .$cf_POSIX_C_SOURCE in #(vi
7978          .[12]??*) #(vi
7979                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
7980                 ;;
7981          .2) #(vi
7982                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
7983                 cf_want_posix_source=yes
7984                 ;;
7985          .*)
7986                 cf_want_posix_source=yes
7987                 ;;
7988          esac
7989          if test "$cf_want_posix_source" = yes ; then
7990                 cat >conftest.$ac_ext <<_ACEOF
7991 #line 7991 "configure"
7992 #include "confdefs.h"
7993 #include <sys/types.h>
7994 int
7995 main ()
7996 {
7997
7998 #ifdef _POSIX_SOURCE
7999 make an error
8000 #endif
8001   ;
8002   return 0;
8003 }
8004 _ACEOF
8005 rm -f conftest.$ac_objext
8006 if { (eval echo "$as_me:8006: \"$ac_compile\"") >&5
8007   (eval $ac_compile) 2>&5
8008   ac_status=$?
8009   echo "$as_me:8009: \$? = $ac_status" >&5
8010   (exit $ac_status); } &&
8011          { ac_try='test -s conftest.$ac_objext'
8012   { (eval echo "$as_me:8012: \"$ac_try\"") >&5
8013   (eval $ac_try) 2>&5
8014   ac_status=$?
8015   echo "$as_me:8015: \$? = $ac_status" >&5
8016   (exit $ac_status); }; }; then
8017   :
8018 else
8019   echo "$as_me: failed program was:" >&5
8020 cat conftest.$ac_ext >&5
8021 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8022 fi
8023 rm -f conftest.$ac_objext conftest.$ac_ext
8024          fi
8025
8026 echo "${as_me:-configure}:8026: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8027
8028          CFLAGS="$cf_trim_CFLAGS"
8029          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8030
8031 echo "${as_me:-configure}:8031: testing if the second compile does not leave our definition intact error ..." 1>&5
8032
8033          cat >conftest.$ac_ext <<_ACEOF
8034 #line 8034 "configure"
8035 #include "confdefs.h"
8036 #include <sys/types.h>
8037 int
8038 main ()
8039 {
8040
8041 #ifndef _POSIX_C_SOURCE
8042 make an error
8043 #endif
8044   ;
8045   return 0;
8046 }
8047 _ACEOF
8048 rm -f conftest.$ac_objext
8049 if { (eval echo "$as_me:8049: \"$ac_compile\"") >&5
8050   (eval $ac_compile) 2>&5
8051   ac_status=$?
8052   echo "$as_me:8052: \$? = $ac_status" >&5
8053   (exit $ac_status); } &&
8054          { ac_try='test -s conftest.$ac_objext'
8055   { (eval echo "$as_me:8055: \"$ac_try\"") >&5
8056   (eval $ac_try) 2>&5
8057   ac_status=$?
8058   echo "$as_me:8058: \$? = $ac_status" >&5
8059   (exit $ac_status); }; }; then
8060   :
8061 else
8062   echo "$as_me: failed program was:" >&5
8063 cat conftest.$ac_ext >&5
8064 cf_cv_posix_c_source=no
8065 fi
8066 rm -f conftest.$ac_objext conftest.$ac_ext
8067          CFLAGS="$cf_save_CFLAGS"
8068          CPPFLAGS="$cf_save_CPPFLAGS"
8069
8070 fi
8071 rm -f conftest.$ac_objext conftest.$ac_ext
8072
8073 fi
8074 echo "$as_me:8074: result: $cf_cv_posix_c_source" >&5
8075 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8076
8077 if test "$cf_cv_posix_c_source" != no ; then
8078         CFLAGS="$cf_trim_CFLAGS"
8079         CPPFLAGS="$cf_trim_CPPFLAGS"
8080
8081 cf_fix_cppflags=no
8082 cf_new_cflags=
8083 cf_new_cppflags=
8084 cf_new_extra_cppflags=
8085
8086 for cf_add_cflags in $cf_cv_posix_c_source
8087 do
8088 case $cf_fix_cppflags in
8089 no)
8090         case $cf_add_cflags in #(vi
8091         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8092                 case $cf_add_cflags in
8093                 -D*)
8094                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8095
8096                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8097                                 && test -z "${cf_tst_cflags}" \
8098                                 && cf_fix_cppflags=yes
8099
8100                         if test $cf_fix_cppflags = yes ; then
8101                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8102                                 continue
8103                         elif test "${cf_tst_cflags}" = "\"'" ; then
8104                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8105                                 continue
8106                         fi
8107                         ;;
8108                 esac
8109                 case "$CPPFLAGS" in
8110                 *$cf_add_cflags) #(vi
8111                         ;;
8112                 *) #(vi
8113                         case $cf_add_cflags in #(vi
8114                         -D*)
8115                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8116
8117 CPPFLAGS=`echo "$CPPFLAGS" | \
8118         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8119                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8120
8121                                 ;;
8122                         esac
8123                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8124                         ;;
8125                 esac
8126                 ;;
8127         *)
8128                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8129                 ;;
8130         esac
8131         ;;
8132 yes)
8133         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8134
8135         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8136
8137         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8138                 && test -z "${cf_tst_cflags}" \
8139                 && cf_fix_cppflags=no
8140         ;;
8141 esac
8142 done
8143
8144 if test -n "$cf_new_cflags" ; then
8145
8146         CFLAGS="$CFLAGS $cf_new_cflags"
8147 fi
8148
8149 if test -n "$cf_new_cppflags" ; then
8150
8151         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8152 fi
8153
8154 if test -n "$cf_new_extra_cppflags" ; then
8155
8156         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8157 fi
8158
8159 fi
8160
8161         ;;
8162 netbsd*) #(vi
8163         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
8164         ;;
8165 openbsd[4-9]*) #(vi
8166         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
8167         cf_xopen_source="-D_BSD_SOURCE"
8168         cf_XOPEN_SOURCE=600
8169         ;;
8170 openbsd*) #(vi
8171         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
8172         ;;
8173 osf[45]*) #(vi
8174         cf_xopen_source="-D_OSF_SOURCE"
8175         ;;
8176 nto-qnx*) #(vi
8177         cf_xopen_source="-D_QNX_SOURCE"
8178         ;;
8179 sco*) #(vi
8180         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
8181         ;;
8182 solaris2.*) #(vi
8183         cf_xopen_source="-D__EXTENSIONS__"
8184         ;;
8185 *)
8186
8187 echo "$as_me:8187: checking if we should define _XOPEN_SOURCE" >&5
8188 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8189 if test "${cf_cv_xopen_source+set}" = set; then
8190   echo $ECHO_N "(cached) $ECHO_C" >&6
8191 else
8192
8193         cat >conftest.$ac_ext <<_ACEOF
8194 #line 8194 "configure"
8195 #include "confdefs.h"
8196
8197 #include <stdlib.h>
8198 #include <string.h>
8199 #include <sys/types.h>
8200
8201 int
8202 main ()
8203 {
8204
8205 #ifndef _XOPEN_SOURCE
8206 make an error
8207 #endif
8208   ;
8209   return 0;
8210 }
8211 _ACEOF
8212 rm -f conftest.$ac_objext
8213 if { (eval echo "$as_me:8213: \"$ac_compile\"") >&5
8214   (eval $ac_compile) 2>&5
8215   ac_status=$?
8216   echo "$as_me:8216: \$? = $ac_status" >&5
8217   (exit $ac_status); } &&
8218          { ac_try='test -s conftest.$ac_objext'
8219   { (eval echo "$as_me:8219: \"$ac_try\"") >&5
8220   (eval $ac_try) 2>&5
8221   ac_status=$?
8222   echo "$as_me:8222: \$? = $ac_status" >&5
8223   (exit $ac_status); }; }; then
8224   cf_cv_xopen_source=no
8225 else
8226   echo "$as_me: failed program was:" >&5
8227 cat conftest.$ac_ext >&5
8228 cf_save="$CPPFLAGS"
8229          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8230          cat >conftest.$ac_ext <<_ACEOF
8231 #line 8231 "configure"
8232 #include "confdefs.h"
8233
8234 #include <stdlib.h>
8235 #include <string.h>
8236 #include <sys/types.h>
8237
8238 int
8239 main ()
8240 {
8241
8242 #ifdef _XOPEN_SOURCE
8243 make an error
8244 #endif
8245   ;
8246   return 0;
8247 }
8248 _ACEOF
8249 rm -f conftest.$ac_objext
8250 if { (eval echo "$as_me:8250: \"$ac_compile\"") >&5
8251   (eval $ac_compile) 2>&5
8252   ac_status=$?
8253   echo "$as_me:8253: \$? = $ac_status" >&5
8254   (exit $ac_status); } &&
8255          { ac_try='test -s conftest.$ac_objext'
8256   { (eval echo "$as_me:8256: \"$ac_try\"") >&5
8257   (eval $ac_try) 2>&5
8258   ac_status=$?
8259   echo "$as_me:8259: \$? = $ac_status" >&5
8260   (exit $ac_status); }; }; then
8261   cf_cv_xopen_source=no
8262 else
8263   echo "$as_me: failed program was:" >&5
8264 cat conftest.$ac_ext >&5
8265 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8266 fi
8267 rm -f conftest.$ac_objext conftest.$ac_ext
8268         CPPFLAGS="$cf_save"
8269
8270 fi
8271 rm -f conftest.$ac_objext conftest.$ac_ext
8272
8273 fi
8274 echo "$as_me:8274: result: $cf_cv_xopen_source" >&5
8275 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8276
8277 if test "$cf_cv_xopen_source" != no ; then
8278
8279 CFLAGS=`echo "$CFLAGS" | \
8280         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8281                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8282
8283 CPPFLAGS=`echo "$CPPFLAGS" | \
8284         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8285                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8286
8287         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8288
8289 cf_fix_cppflags=no
8290 cf_new_cflags=
8291 cf_new_cppflags=
8292 cf_new_extra_cppflags=
8293
8294 for cf_add_cflags in $cf_temp_xopen_source
8295 do
8296 case $cf_fix_cppflags in
8297 no)
8298         case $cf_add_cflags in #(vi
8299         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8300                 case $cf_add_cflags in
8301                 -D*)
8302                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8303
8304                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8305                                 && test -z "${cf_tst_cflags}" \
8306                                 && cf_fix_cppflags=yes
8307
8308                         if test $cf_fix_cppflags = yes ; then
8309                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8310                                 continue
8311                         elif test "${cf_tst_cflags}" = "\"'" ; then
8312                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8313                                 continue
8314                         fi
8315                         ;;
8316                 esac
8317                 case "$CPPFLAGS" in
8318                 *$cf_add_cflags) #(vi
8319                         ;;
8320                 *) #(vi
8321                         case $cf_add_cflags in #(vi
8322                         -D*)
8323                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8324
8325 CPPFLAGS=`echo "$CPPFLAGS" | \
8326         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8327                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8328
8329                                 ;;
8330                         esac
8331                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8332                         ;;
8333                 esac
8334                 ;;
8335         *)
8336                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8337                 ;;
8338         esac
8339         ;;
8340 yes)
8341         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8342
8343         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8344
8345         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8346                 && test -z "${cf_tst_cflags}" \
8347                 && cf_fix_cppflags=no
8348         ;;
8349 esac
8350 done
8351
8352 if test -n "$cf_new_cflags" ; then
8353
8354         CFLAGS="$CFLAGS $cf_new_cflags"
8355 fi
8356
8357 if test -n "$cf_new_cppflags" ; then
8358
8359         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8360 fi
8361
8362 if test -n "$cf_new_extra_cppflags" ; then
8363
8364         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8365 fi
8366
8367 fi
8368
8369 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8370
8371 cf_save_CFLAGS="$CFLAGS"
8372 cf_save_CPPFLAGS="$CPPFLAGS"
8373
8374 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8375         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8376                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8377
8378 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8379         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8380                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8381
8382 echo "$as_me:8382: checking if we should define _POSIX_C_SOURCE" >&5
8383 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8384 if test "${cf_cv_posix_c_source+set}" = set; then
8385   echo $ECHO_N "(cached) $ECHO_C" >&6
8386 else
8387
8388 echo "${as_me:-configure}:8388: testing if the symbol is already defined go no further ..." 1>&5
8389
8390         cat >conftest.$ac_ext <<_ACEOF
8391 #line 8391 "configure"
8392 #include "confdefs.h"
8393 #include <sys/types.h>
8394 int
8395 main ()
8396 {
8397
8398 #ifndef _POSIX_C_SOURCE
8399 make an error
8400 #endif
8401   ;
8402   return 0;
8403 }
8404 _ACEOF
8405 rm -f conftest.$ac_objext
8406 if { (eval echo "$as_me:8406: \"$ac_compile\"") >&5
8407   (eval $ac_compile) 2>&5
8408   ac_status=$?
8409   echo "$as_me:8409: \$? = $ac_status" >&5
8410   (exit $ac_status); } &&
8411          { ac_try='test -s conftest.$ac_objext'
8412   { (eval echo "$as_me:8412: \"$ac_try\"") >&5
8413   (eval $ac_try) 2>&5
8414   ac_status=$?
8415   echo "$as_me:8415: \$? = $ac_status" >&5
8416   (exit $ac_status); }; }; then
8417   cf_cv_posix_c_source=no
8418 else
8419   echo "$as_me: failed program was:" >&5
8420 cat conftest.$ac_ext >&5
8421 cf_want_posix_source=no
8422          case .$cf_POSIX_C_SOURCE in #(vi
8423          .[12]??*) #(vi
8424                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8425                 ;;
8426          .2) #(vi
8427                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8428                 cf_want_posix_source=yes
8429                 ;;
8430          .*)
8431                 cf_want_posix_source=yes
8432                 ;;
8433          esac
8434          if test "$cf_want_posix_source" = yes ; then
8435                 cat >conftest.$ac_ext <<_ACEOF
8436 #line 8436 "configure"
8437 #include "confdefs.h"
8438 #include <sys/types.h>
8439 int
8440 main ()
8441 {
8442
8443 #ifdef _POSIX_SOURCE
8444 make an error
8445 #endif
8446   ;
8447   return 0;
8448 }
8449 _ACEOF
8450 rm -f conftest.$ac_objext
8451 if { (eval echo "$as_me:8451: \"$ac_compile\"") >&5
8452   (eval $ac_compile) 2>&5
8453   ac_status=$?
8454   echo "$as_me:8454: \$? = $ac_status" >&5
8455   (exit $ac_status); } &&
8456          { ac_try='test -s conftest.$ac_objext'
8457   { (eval echo "$as_me:8457: \"$ac_try\"") >&5
8458   (eval $ac_try) 2>&5
8459   ac_status=$?
8460   echo "$as_me:8460: \$? = $ac_status" >&5
8461   (exit $ac_status); }; }; then
8462   :
8463 else
8464   echo "$as_me: failed program was:" >&5
8465 cat conftest.$ac_ext >&5
8466 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8467 fi
8468 rm -f conftest.$ac_objext conftest.$ac_ext
8469          fi
8470
8471 echo "${as_me:-configure}:8471: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8472
8473          CFLAGS="$cf_trim_CFLAGS"
8474          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8475
8476 echo "${as_me:-configure}:8476: testing if the second compile does not leave our definition intact error ..." 1>&5
8477
8478          cat >conftest.$ac_ext <<_ACEOF
8479 #line 8479 "configure"
8480 #include "confdefs.h"
8481 #include <sys/types.h>
8482 int
8483 main ()
8484 {
8485
8486 #ifndef _POSIX_C_SOURCE
8487 make an error
8488 #endif
8489   ;
8490   return 0;
8491 }
8492 _ACEOF
8493 rm -f conftest.$ac_objext
8494 if { (eval echo "$as_me:8494: \"$ac_compile\"") >&5
8495   (eval $ac_compile) 2>&5
8496   ac_status=$?
8497   echo "$as_me:8497: \$? = $ac_status" >&5
8498   (exit $ac_status); } &&
8499          { ac_try='test -s conftest.$ac_objext'
8500   { (eval echo "$as_me:8500: \"$ac_try\"") >&5
8501   (eval $ac_try) 2>&5
8502   ac_status=$?
8503   echo "$as_me:8503: \$? = $ac_status" >&5
8504   (exit $ac_status); }; }; then
8505   :
8506 else
8507   echo "$as_me: failed program was:" >&5
8508 cat conftest.$ac_ext >&5
8509 cf_cv_posix_c_source=no
8510 fi
8511 rm -f conftest.$ac_objext conftest.$ac_ext
8512          CFLAGS="$cf_save_CFLAGS"
8513          CPPFLAGS="$cf_save_CPPFLAGS"
8514
8515 fi
8516 rm -f conftest.$ac_objext conftest.$ac_ext
8517
8518 fi
8519 echo "$as_me:8519: result: $cf_cv_posix_c_source" >&5
8520 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8521
8522 if test "$cf_cv_posix_c_source" != no ; then
8523         CFLAGS="$cf_trim_CFLAGS"
8524         CPPFLAGS="$cf_trim_CPPFLAGS"
8525
8526 cf_fix_cppflags=no
8527 cf_new_cflags=
8528 cf_new_cppflags=
8529 cf_new_extra_cppflags=
8530
8531 for cf_add_cflags in $cf_cv_posix_c_source
8532 do
8533 case $cf_fix_cppflags in
8534 no)
8535         case $cf_add_cflags in #(vi
8536         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8537                 case $cf_add_cflags in
8538                 -D*)
8539                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8540
8541                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8542                                 && test -z "${cf_tst_cflags}" \
8543                                 && cf_fix_cppflags=yes
8544
8545                         if test $cf_fix_cppflags = yes ; then
8546                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8547                                 continue
8548                         elif test "${cf_tst_cflags}" = "\"'" ; then
8549                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8550                                 continue
8551                         fi
8552                         ;;
8553                 esac
8554                 case "$CPPFLAGS" in
8555                 *$cf_add_cflags) #(vi
8556                         ;;
8557                 *) #(vi
8558                         case $cf_add_cflags in #(vi
8559                         -D*)
8560                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8561
8562 CPPFLAGS=`echo "$CPPFLAGS" | \
8563         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8564                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8565
8566                                 ;;
8567                         esac
8568                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8569                         ;;
8570                 esac
8571                 ;;
8572         *)
8573                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8574                 ;;
8575         esac
8576         ;;
8577 yes)
8578         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8579
8580         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8581
8582         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8583                 && test -z "${cf_tst_cflags}" \
8584                 && cf_fix_cppflags=no
8585         ;;
8586 esac
8587 done
8588
8589 if test -n "$cf_new_cflags" ; then
8590
8591         CFLAGS="$CFLAGS $cf_new_cflags"
8592 fi
8593
8594 if test -n "$cf_new_cppflags" ; then
8595
8596         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8597 fi
8598
8599 if test -n "$cf_new_extra_cppflags" ; then
8600
8601         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8602 fi
8603
8604 fi
8605
8606         ;;
8607 esac
8608
8609 if test -n "$cf_xopen_source" ; then
8610
8611 cf_fix_cppflags=no
8612 cf_new_cflags=
8613 cf_new_cppflags=
8614 cf_new_extra_cppflags=
8615
8616 for cf_add_cflags in $cf_xopen_source
8617 do
8618 case $cf_fix_cppflags in
8619 no)
8620         case $cf_add_cflags in #(vi
8621         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8622                 case $cf_add_cflags in
8623                 -D*)
8624                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8625
8626                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8627                                 && test -z "${cf_tst_cflags}" \
8628                                 && cf_fix_cppflags=yes
8629
8630                         if test $cf_fix_cppflags = yes ; then
8631                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8632                                 continue
8633                         elif test "${cf_tst_cflags}" = "\"'" ; then
8634                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8635                                 continue
8636                         fi
8637                         ;;
8638                 esac
8639                 case "$CPPFLAGS" in
8640                 *$cf_add_cflags) #(vi
8641                         ;;
8642                 *) #(vi
8643                         case $cf_add_cflags in #(vi
8644                         -D*)
8645                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8646
8647 CPPFLAGS=`echo "$CPPFLAGS" | \
8648         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8649                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8650
8651                                 ;;
8652                         esac
8653                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8654                         ;;
8655                 esac
8656                 ;;
8657         *)
8658                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8659                 ;;
8660         esac
8661         ;;
8662 yes)
8663         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8664
8665         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8666
8667         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8668                 && test -z "${cf_tst_cflags}" \
8669                 && cf_fix_cppflags=no
8670         ;;
8671 esac
8672 done
8673
8674 if test -n "$cf_new_cflags" ; then
8675
8676         CFLAGS="$CFLAGS $cf_new_cflags"
8677 fi
8678
8679 if test -n "$cf_new_cppflags" ; then
8680
8681         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8682 fi
8683
8684 if test -n "$cf_new_extra_cppflags" ; then
8685
8686         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8687 fi
8688
8689 fi
8690
8691 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
8692         echo "$as_me:8692: checking if _XOPEN_SOURCE really is set" >&5
8693 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
8694         cat >conftest.$ac_ext <<_ACEOF
8695 #line 8695 "configure"
8696 #include "confdefs.h"
8697 #include <stdlib.h>
8698 int
8699 main ()
8700 {
8701
8702 #ifndef _XOPEN_SOURCE
8703 make an error
8704 #endif
8705   ;
8706   return 0;
8707 }
8708 _ACEOF
8709 rm -f conftest.$ac_objext
8710 if { (eval echo "$as_me:8710: \"$ac_compile\"") >&5
8711   (eval $ac_compile) 2>&5
8712   ac_status=$?
8713   echo "$as_me:8713: \$? = $ac_status" >&5
8714   (exit $ac_status); } &&
8715          { ac_try='test -s conftest.$ac_objext'
8716   { (eval echo "$as_me:8716: \"$ac_try\"") >&5
8717   (eval $ac_try) 2>&5
8718   ac_status=$?
8719   echo "$as_me:8719: \$? = $ac_status" >&5
8720   (exit $ac_status); }; }; then
8721   cf_XOPEN_SOURCE_set=yes
8722 else
8723   echo "$as_me: failed program was:" >&5
8724 cat conftest.$ac_ext >&5
8725 cf_XOPEN_SOURCE_set=no
8726 fi
8727 rm -f conftest.$ac_objext conftest.$ac_ext
8728         echo "$as_me:8728: result: $cf_XOPEN_SOURCE_set" >&5
8729 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
8730         if test $cf_XOPEN_SOURCE_set = yes
8731         then
8732                 cat >conftest.$ac_ext <<_ACEOF
8733 #line 8733 "configure"
8734 #include "confdefs.h"
8735 #include <stdlib.h>
8736 int
8737 main ()
8738 {
8739
8740 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
8741 make an error
8742 #endif
8743   ;
8744   return 0;
8745 }
8746 _ACEOF
8747 rm -f conftest.$ac_objext
8748 if { (eval echo "$as_me:8748: \"$ac_compile\"") >&5
8749   (eval $ac_compile) 2>&5
8750   ac_status=$?
8751   echo "$as_me:8751: \$? = $ac_status" >&5
8752   (exit $ac_status); } &&
8753          { ac_try='test -s conftest.$ac_objext'
8754   { (eval echo "$as_me:8754: \"$ac_try\"") >&5
8755   (eval $ac_try) 2>&5
8756   ac_status=$?
8757   echo "$as_me:8757: \$? = $ac_status" >&5
8758   (exit $ac_status); }; }; then
8759   cf_XOPEN_SOURCE_set_ok=yes
8760 else
8761   echo "$as_me: failed program was:" >&5
8762 cat conftest.$ac_ext >&5
8763 cf_XOPEN_SOURCE_set_ok=no
8764 fi
8765 rm -f conftest.$ac_objext conftest.$ac_ext
8766                 if test $cf_XOPEN_SOURCE_set_ok = no
8767                 then
8768                         { echo "$as_me:8768: WARNING: _XOPEN_SOURCE is lower than requested" >&5
8769 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
8770                 fi
8771         else
8772
8773 echo "$as_me:8773: checking if we should define _XOPEN_SOURCE" >&5
8774 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8775 if test "${cf_cv_xopen_source+set}" = set; then
8776   echo $ECHO_N "(cached) $ECHO_C" >&6
8777 else
8778
8779         cat >conftest.$ac_ext <<_ACEOF
8780 #line 8780 "configure"
8781 #include "confdefs.h"
8782
8783 #include <stdlib.h>
8784 #include <string.h>
8785 #include <sys/types.h>
8786
8787 int
8788 main ()
8789 {
8790
8791 #ifndef _XOPEN_SOURCE
8792 make an error
8793 #endif
8794   ;
8795   return 0;
8796 }
8797 _ACEOF
8798 rm -f conftest.$ac_objext
8799 if { (eval echo "$as_me:8799: \"$ac_compile\"") >&5
8800   (eval $ac_compile) 2>&5
8801   ac_status=$?
8802   echo "$as_me:8802: \$? = $ac_status" >&5
8803   (exit $ac_status); } &&
8804          { ac_try='test -s conftest.$ac_objext'
8805   { (eval echo "$as_me:8805: \"$ac_try\"") >&5
8806   (eval $ac_try) 2>&5
8807   ac_status=$?
8808   echo "$as_me:8808: \$? = $ac_status" >&5
8809   (exit $ac_status); }; }; then
8810   cf_cv_xopen_source=no
8811 else
8812   echo "$as_me: failed program was:" >&5
8813 cat conftest.$ac_ext >&5
8814 cf_save="$CPPFLAGS"
8815          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8816          cat >conftest.$ac_ext <<_ACEOF
8817 #line 8817 "configure"
8818 #include "confdefs.h"
8819
8820 #include <stdlib.h>
8821 #include <string.h>
8822 #include <sys/types.h>
8823
8824 int
8825 main ()
8826 {
8827
8828 #ifdef _XOPEN_SOURCE
8829 make an error
8830 #endif
8831   ;
8832   return 0;
8833 }
8834 _ACEOF
8835 rm -f conftest.$ac_objext
8836 if { (eval echo "$as_me:8836: \"$ac_compile\"") >&5
8837   (eval $ac_compile) 2>&5
8838   ac_status=$?
8839   echo "$as_me:8839: \$? = $ac_status" >&5
8840   (exit $ac_status); } &&
8841          { ac_try='test -s conftest.$ac_objext'
8842   { (eval echo "$as_me:8842: \"$ac_try\"") >&5
8843   (eval $ac_try) 2>&5
8844   ac_status=$?
8845   echo "$as_me:8845: \$? = $ac_status" >&5
8846   (exit $ac_status); }; }; then
8847   cf_cv_xopen_source=no
8848 else
8849   echo "$as_me: failed program was:" >&5
8850 cat conftest.$ac_ext >&5
8851 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8852 fi
8853 rm -f conftest.$ac_objext conftest.$ac_ext
8854         CPPFLAGS="$cf_save"
8855
8856 fi
8857 rm -f conftest.$ac_objext conftest.$ac_ext
8858
8859 fi
8860 echo "$as_me:8860: result: $cf_cv_xopen_source" >&5
8861 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8862
8863 if test "$cf_cv_xopen_source" != no ; then
8864
8865 CFLAGS=`echo "$CFLAGS" | \
8866         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8867                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8868
8869 CPPFLAGS=`echo "$CPPFLAGS" | \
8870         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8871                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8872
8873         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8874
8875 cf_fix_cppflags=no
8876 cf_new_cflags=
8877 cf_new_cppflags=
8878 cf_new_extra_cppflags=
8879
8880 for cf_add_cflags in $cf_temp_xopen_source
8881 do
8882 case $cf_fix_cppflags in
8883 no)
8884         case $cf_add_cflags in #(vi
8885         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8886                 case $cf_add_cflags in
8887                 -D*)
8888                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8889
8890                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8891                                 && test -z "${cf_tst_cflags}" \
8892                                 && cf_fix_cppflags=yes
8893
8894                         if test $cf_fix_cppflags = yes ; then
8895                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8896                                 continue
8897                         elif test "${cf_tst_cflags}" = "\"'" ; then
8898                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8899                                 continue
8900                         fi
8901                         ;;
8902                 esac
8903                 case "$CPPFLAGS" in
8904                 *$cf_add_cflags) #(vi
8905                         ;;
8906                 *) #(vi
8907                         case $cf_add_cflags in #(vi
8908                         -D*)
8909                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8910
8911 CPPFLAGS=`echo "$CPPFLAGS" | \
8912         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8913                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8914
8915                                 ;;
8916                         esac
8917                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8918                         ;;
8919                 esac
8920                 ;;
8921         *)
8922                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8923                 ;;
8924         esac
8925         ;;
8926 yes)
8927         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8928
8929         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8930
8931         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8932                 && test -z "${cf_tst_cflags}" \
8933                 && cf_fix_cppflags=no
8934         ;;
8935 esac
8936 done
8937
8938 if test -n "$cf_new_cflags" ; then
8939
8940         CFLAGS="$CFLAGS $cf_new_cflags"
8941 fi
8942
8943 if test -n "$cf_new_cppflags" ; then
8944
8945         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8946 fi
8947
8948 if test -n "$cf_new_extra_cppflags" ; then
8949
8950         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8951 fi
8952
8953 fi
8954
8955         fi
8956 fi
8957
8958 # Check whether --enable-largefile or --disable-largefile was given.
8959 if test "${enable_largefile+set}" = set; then
8960   enableval="$enable_largefile"
8961
8962 fi;
8963 if test "$enable_largefile" != no; then
8964
8965   echo "$as_me:8965: checking for special C compiler options needed for large files" >&5
8966 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
8967 if test "${ac_cv_sys_largefile_CC+set}" = set; then
8968   echo $ECHO_N "(cached) $ECHO_C" >&6
8969 else
8970   ac_cv_sys_largefile_CC=no
8971      if test "$GCC" != yes; then
8972        ac_save_CC=$CC
8973        while :; do
8974          # IRIX 6.2 and later do not support large files by default,
8975          # so use the C compiler's -n32 option if that helps.
8976          cat >conftest.$ac_ext <<_ACEOF
8977 #line 8977 "configure"
8978 #include "confdefs.h"
8979 #include <sys/types.h>
8980  /* Check that off_t can represent 2**63 - 1 correctly.
8981     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8982     since some C++ compilers masquerading as C compilers
8983     incorrectly reject 9223372036854775807.  */
8984 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8985   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8986                        && LARGE_OFF_T % 2147483647 == 1)
8987                       ? 1 : -1];
8988 int
8989 main ()
8990 {
8991
8992   ;
8993   return 0;
8994 }
8995 _ACEOF
8996          rm -f conftest.$ac_objext
8997 if { (eval echo "$as_me:8997: \"$ac_compile\"") >&5
8998   (eval $ac_compile) 2>&5
8999   ac_status=$?
9000   echo "$as_me:9000: \$? = $ac_status" >&5
9001   (exit $ac_status); } &&
9002          { ac_try='test -s conftest.$ac_objext'
9003   { (eval echo "$as_me:9003: \"$ac_try\"") >&5
9004   (eval $ac_try) 2>&5
9005   ac_status=$?
9006   echo "$as_me:9006: \$? = $ac_status" >&5
9007   (exit $ac_status); }; }; then
9008   break
9009 else
9010   echo "$as_me: failed program was:" >&5
9011 cat conftest.$ac_ext >&5
9012 fi
9013 rm -f conftest.$ac_objext
9014          CC="$CC -n32"
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   ac_cv_sys_largefile_CC=' -n32'; 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          break
9034        done
9035        CC=$ac_save_CC
9036        rm -f conftest.$ac_ext
9037     fi
9038 fi
9039 echo "$as_me:9039: result: $ac_cv_sys_largefile_CC" >&5
9040 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
9041   if test "$ac_cv_sys_largefile_CC" != no; then
9042     CC=$CC$ac_cv_sys_largefile_CC
9043   fi
9044
9045   echo "$as_me:9045: checking for _FILE_OFFSET_BITS value needed for large files" >&5
9046 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
9047 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
9048   echo $ECHO_N "(cached) $ECHO_C" >&6
9049 else
9050   while :; do
9051   ac_cv_sys_file_offset_bits=no
9052   cat >conftest.$ac_ext <<_ACEOF
9053 #line 9053 "configure"
9054 #include "confdefs.h"
9055 #include <sys/types.h>
9056  /* Check that off_t can represent 2**63 - 1 correctly.
9057     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9058     since some C++ compilers masquerading as C compilers
9059     incorrectly reject 9223372036854775807.  */
9060 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9061   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9062                        && LARGE_OFF_T % 2147483647 == 1)
9063                       ? 1 : -1];
9064 int
9065 main ()
9066 {
9067
9068   ;
9069   return 0;
9070 }
9071 _ACEOF
9072 rm -f conftest.$ac_objext
9073 if { (eval echo "$as_me:9073: \"$ac_compile\"") >&5
9074   (eval $ac_compile) 2>&5
9075   ac_status=$?
9076   echo "$as_me:9076: \$? = $ac_status" >&5
9077   (exit $ac_status); } &&
9078          { ac_try='test -s conftest.$ac_objext'
9079   { (eval echo "$as_me:9079: \"$ac_try\"") >&5
9080   (eval $ac_try) 2>&5
9081   ac_status=$?
9082   echo "$as_me:9082: \$? = $ac_status" >&5
9083   (exit $ac_status); }; }; then
9084   break
9085 else
9086   echo "$as_me: failed program was:" >&5
9087 cat conftest.$ac_ext >&5
9088 fi
9089 rm -f conftest.$ac_objext conftest.$ac_ext
9090   cat >conftest.$ac_ext <<_ACEOF
9091 #line 9091 "configure"
9092 #include "confdefs.h"
9093 #define _FILE_OFFSET_BITS 64
9094 #include <sys/types.h>
9095  /* Check that off_t can represent 2**63 - 1 correctly.
9096     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9097     since some C++ compilers masquerading as C compilers
9098     incorrectly reject 9223372036854775807.  */
9099 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9100   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9101                        && LARGE_OFF_T % 2147483647 == 1)
9102                       ? 1 : -1];
9103 int
9104 main ()
9105 {
9106
9107   ;
9108   return 0;
9109 }
9110 _ACEOF
9111 rm -f conftest.$ac_objext
9112 if { (eval echo "$as_me:9112: \"$ac_compile\"") >&5
9113   (eval $ac_compile) 2>&5
9114   ac_status=$?
9115   echo "$as_me:9115: \$? = $ac_status" >&5
9116   (exit $ac_status); } &&
9117          { ac_try='test -s conftest.$ac_objext'
9118   { (eval echo "$as_me:9118: \"$ac_try\"") >&5
9119   (eval $ac_try) 2>&5
9120   ac_status=$?
9121   echo "$as_me:9121: \$? = $ac_status" >&5
9122   (exit $ac_status); }; }; then
9123   ac_cv_sys_file_offset_bits=64; break
9124 else
9125   echo "$as_me: failed program was:" >&5
9126 cat conftest.$ac_ext >&5
9127 fi
9128 rm -f conftest.$ac_objext conftest.$ac_ext
9129   break
9130 done
9131 fi
9132 echo "$as_me:9132: result: $ac_cv_sys_file_offset_bits" >&5
9133 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
9134 if test "$ac_cv_sys_file_offset_bits" != no; then
9135
9136 cat >>confdefs.h <<EOF
9137 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
9138 EOF
9139
9140 fi
9141 rm -rf conftest*
9142   echo "$as_me:9142: checking for _LARGE_FILES value needed for large files" >&5
9143 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
9144 if test "${ac_cv_sys_large_files+set}" = set; then
9145   echo $ECHO_N "(cached) $ECHO_C" >&6
9146 else
9147   while :; do
9148   ac_cv_sys_large_files=no
9149   cat >conftest.$ac_ext <<_ACEOF
9150 #line 9150 "configure"
9151 #include "confdefs.h"
9152 #include <sys/types.h>
9153  /* Check that off_t can represent 2**63 - 1 correctly.
9154     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9155     since some C++ compilers masquerading as C compilers
9156     incorrectly reject 9223372036854775807.  */
9157 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9158   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9159                        && LARGE_OFF_T % 2147483647 == 1)
9160                       ? 1 : -1];
9161 int
9162 main ()
9163 {
9164
9165   ;
9166   return 0;
9167 }
9168 _ACEOF
9169 rm -f conftest.$ac_objext
9170 if { (eval echo "$as_me:9170: \"$ac_compile\"") >&5
9171   (eval $ac_compile) 2>&5
9172   ac_status=$?
9173   echo "$as_me:9173: \$? = $ac_status" >&5
9174   (exit $ac_status); } &&
9175          { ac_try='test -s conftest.$ac_objext'
9176   { (eval echo "$as_me:9176: \"$ac_try\"") >&5
9177   (eval $ac_try) 2>&5
9178   ac_status=$?
9179   echo "$as_me:9179: \$? = $ac_status" >&5
9180   (exit $ac_status); }; }; then
9181   break
9182 else
9183   echo "$as_me: failed program was:" >&5
9184 cat conftest.$ac_ext >&5
9185 fi
9186 rm -f conftest.$ac_objext conftest.$ac_ext
9187   cat >conftest.$ac_ext <<_ACEOF
9188 #line 9188 "configure"
9189 #include "confdefs.h"
9190 #define _LARGE_FILES 1
9191 #include <sys/types.h>
9192  /* Check that off_t can represent 2**63 - 1 correctly.
9193     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9194     since some C++ compilers masquerading as C compilers
9195     incorrectly reject 9223372036854775807.  */
9196 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9197   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9198                        && LARGE_OFF_T % 2147483647 == 1)
9199                       ? 1 : -1];
9200 int
9201 main ()
9202 {
9203
9204   ;
9205   return 0;
9206 }
9207 _ACEOF
9208 rm -f conftest.$ac_objext
9209 if { (eval echo "$as_me:9209: \"$ac_compile\"") >&5
9210   (eval $ac_compile) 2>&5
9211   ac_status=$?
9212   echo "$as_me:9212: \$? = $ac_status" >&5
9213   (exit $ac_status); } &&
9214          { ac_try='test -s conftest.$ac_objext'
9215   { (eval echo "$as_me:9215: \"$ac_try\"") >&5
9216   (eval $ac_try) 2>&5
9217   ac_status=$?
9218   echo "$as_me:9218: \$? = $ac_status" >&5
9219   (exit $ac_status); }; }; then
9220   ac_cv_sys_large_files=1; break
9221 else
9222   echo "$as_me: failed program was:" >&5
9223 cat conftest.$ac_ext >&5
9224 fi
9225 rm -f conftest.$ac_objext conftest.$ac_ext
9226   break
9227 done
9228 fi
9229 echo "$as_me:9229: result: $ac_cv_sys_large_files" >&5
9230 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
9231 if test "$ac_cv_sys_large_files" != no; then
9232
9233 cat >>confdefs.h <<EOF
9234 #define _LARGE_FILES $ac_cv_sys_large_files
9235 EOF
9236
9237 fi
9238 rm -rf conftest*
9239 fi
9240
9241     if test "$enable_largefile" != no ; then
9242         echo "$as_me:9242: checking for _LARGEFILE_SOURCE value needed for large files" >&5
9243 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
9244 if test "${ac_cv_sys_largefile_source+set}" = set; then
9245   echo $ECHO_N "(cached) $ECHO_C" >&6
9246 else
9247   while :; do
9248   ac_cv_sys_largefile_source=no
9249   cat >conftest.$ac_ext <<_ACEOF
9250 #line 9250 "configure"
9251 #include "confdefs.h"
9252 #include <stdio.h>
9253 int
9254 main ()
9255 {
9256 return !fseeko;
9257   ;
9258   return 0;
9259 }
9260 _ACEOF
9261 rm -f conftest.$ac_objext
9262 if { (eval echo "$as_me:9262: \"$ac_compile\"") >&5
9263   (eval $ac_compile) 2>&5
9264   ac_status=$?
9265   echo "$as_me:9265: \$? = $ac_status" >&5
9266   (exit $ac_status); } &&
9267          { ac_try='test -s conftest.$ac_objext'
9268   { (eval echo "$as_me:9268: \"$ac_try\"") >&5
9269   (eval $ac_try) 2>&5
9270   ac_status=$?
9271   echo "$as_me:9271: \$? = $ac_status" >&5
9272   (exit $ac_status); }; }; then
9273   break
9274 else
9275   echo "$as_me: failed program was:" >&5
9276 cat conftest.$ac_ext >&5
9277 fi
9278 rm -f conftest.$ac_objext conftest.$ac_ext
9279   cat >conftest.$ac_ext <<_ACEOF
9280 #line 9280 "configure"
9281 #include "confdefs.h"
9282 #define _LARGEFILE_SOURCE 1
9283 #include <stdio.h>
9284 int
9285 main ()
9286 {
9287 return !fseeko;
9288   ;
9289   return 0;
9290 }
9291 _ACEOF
9292 rm -f conftest.$ac_objext
9293 if { (eval echo "$as_me:9293: \"$ac_compile\"") >&5
9294   (eval $ac_compile) 2>&5
9295   ac_status=$?
9296   echo "$as_me:9296: \$? = $ac_status" >&5
9297   (exit $ac_status); } &&
9298          { ac_try='test -s conftest.$ac_objext'
9299   { (eval echo "$as_me:9299: \"$ac_try\"") >&5
9300   (eval $ac_try) 2>&5
9301   ac_status=$?
9302   echo "$as_me:9302: \$? = $ac_status" >&5
9303   (exit $ac_status); }; }; then
9304   ac_cv_sys_largefile_source=1; break
9305 else
9306   echo "$as_me: failed program was:" >&5
9307 cat conftest.$ac_ext >&5
9308 fi
9309 rm -f conftest.$ac_objext conftest.$ac_ext
9310   break
9311 done
9312 fi
9313 echo "$as_me:9313: result: $ac_cv_sys_largefile_source" >&5
9314 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
9315 if test "$ac_cv_sys_largefile_source" != no; then
9316
9317 cat >>confdefs.h <<EOF
9318 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
9319 EOF
9320
9321 fi
9322 rm -rf conftest*
9323
9324 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
9325 # in glibc 2.1.3, but that breaks too many other things.
9326 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
9327 echo "$as_me:9327: checking for fseeko" >&5
9328 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
9329 if test "${ac_cv_func_fseeko+set}" = set; then
9330   echo $ECHO_N "(cached) $ECHO_C" >&6
9331 else
9332   cat >conftest.$ac_ext <<_ACEOF
9333 #line 9333 "configure"
9334 #include "confdefs.h"
9335 #include <stdio.h>
9336 int
9337 main ()
9338 {
9339 return fseeko && fseeko (stdin, 0, 0);
9340   ;
9341   return 0;
9342 }
9343 _ACEOF
9344 rm -f conftest.$ac_objext conftest$ac_exeext
9345 if { (eval echo "$as_me:9345: \"$ac_link\"") >&5
9346   (eval $ac_link) 2>&5
9347   ac_status=$?
9348   echo "$as_me:9348: \$? = $ac_status" >&5
9349   (exit $ac_status); } &&
9350          { ac_try='test -s conftest$ac_exeext'
9351   { (eval echo "$as_me:9351: \"$ac_try\"") >&5
9352   (eval $ac_try) 2>&5
9353   ac_status=$?
9354   echo "$as_me:9354: \$? = $ac_status" >&5
9355   (exit $ac_status); }; }; then
9356   ac_cv_func_fseeko=yes
9357 else
9358   echo "$as_me: failed program was:" >&5
9359 cat conftest.$ac_ext >&5
9360 ac_cv_func_fseeko=no
9361 fi
9362 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9363 fi
9364 echo "$as_me:9364: result: $ac_cv_func_fseeko" >&5
9365 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
9366 if test $ac_cv_func_fseeko = yes; then
9367
9368 cat >>confdefs.h <<\EOF
9369 #define HAVE_FSEEKO 1
9370 EOF
9371
9372 fi
9373
9374         # Normally we would collect these definitions in the config.h,
9375         # but (like _XOPEN_SOURCE), some environments rely on having these
9376         # defined before any of the system headers are included.  Another
9377         # case comes up with C++, e.g., on AIX the compiler compiles the
9378         # header files by themselves before looking at the body files it is
9379         # told to compile.  For ncurses, those header files do not include
9380         # the config.h
9381         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
9382         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
9383         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
9384
9385         echo "$as_me:9385: checking whether to use struct dirent64" >&5
9386 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
9387 if test "${cf_cv_struct_dirent64+set}" = set; then
9388   echo $ECHO_N "(cached) $ECHO_C" >&6
9389 else
9390
9391                 cat >conftest.$ac_ext <<_ACEOF
9392 #line 9392 "configure"
9393 #include "confdefs.h"
9394
9395 #include <sys/types.h>
9396 #include <dirent.h>
9397
9398 int
9399 main ()
9400 {
9401
9402                 /* if transitional largefile support is setup, this is true */
9403                 extern struct dirent64 * readdir(DIR *);
9404                 struct dirent64 *x = readdir((DIR *)0);
9405                 struct dirent *y = readdir((DIR *)0);
9406                 int z = x - y;
9407
9408   ;
9409   return 0;
9410 }
9411 _ACEOF
9412 rm -f conftest.$ac_objext
9413 if { (eval echo "$as_me:9413: \"$ac_compile\"") >&5
9414   (eval $ac_compile) 2>&5
9415   ac_status=$?
9416   echo "$as_me:9416: \$? = $ac_status" >&5
9417   (exit $ac_status); } &&
9418          { ac_try='test -s conftest.$ac_objext'
9419   { (eval echo "$as_me:9419: \"$ac_try\"") >&5
9420   (eval $ac_try) 2>&5
9421   ac_status=$?
9422   echo "$as_me:9422: \$? = $ac_status" >&5
9423   (exit $ac_status); }; }; then
9424   cf_cv_struct_dirent64=yes
9425 else
9426   echo "$as_me: failed program was:" >&5
9427 cat conftest.$ac_ext >&5
9428 cf_cv_struct_dirent64=no
9429 fi
9430 rm -f conftest.$ac_objext conftest.$ac_ext
9431
9432 fi
9433 echo "$as_me:9433: result: $cf_cv_struct_dirent64" >&5
9434 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
9435         test "$cf_cv_struct_dirent64" = yes &&
9436 cat >>confdefs.h <<\EOF
9437 #define HAVE_STRUCT_DIRENT64 1
9438 EOF
9439
9440     fi
9441
9442 ### Enable compiling-in rcs id's
9443 echo "$as_me:9443: checking if RCS identifiers should be compiled-in" >&5
9444 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
9445
9446 # Check whether --with-rcs-ids or --without-rcs-ids was given.
9447 if test "${with_rcs_ids+set}" = set; then
9448   withval="$with_rcs_ids"
9449   with_rcs_ids=$withval
9450 else
9451   with_rcs_ids=no
9452 fi;
9453 echo "$as_me:9453: result: $with_rcs_ids" >&5
9454 echo "${ECHO_T}$with_rcs_ids" >&6
9455 test "$with_rcs_ids" = yes &&
9456 cat >>confdefs.h <<\EOF
9457 #define USE_RCS_IDS 1
9458 EOF
9459
9460 ###############################################################################
9461
9462 ### Note that some functions (such as const) are normally disabled anyway.
9463 echo "$as_me:9463: checking if you want to build with function extensions" >&5
9464 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
9465
9466 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
9467 if test "${enable_ext_funcs+set}" = set; then
9468   enableval="$enable_ext_funcs"
9469   with_ext_funcs=$enableval
9470 else
9471   with_ext_funcs=yes
9472 fi;
9473 echo "$as_me:9473: result: $with_ext_funcs" >&5
9474 echo "${ECHO_T}$with_ext_funcs" >&6
9475 if test "$with_ext_funcs" = yes ; then
9476         NCURSES_EXT_FUNCS=1
9477
9478 cat >>confdefs.h <<\EOF
9479 #define HAVE_USE_DEFAULT_COLORS 1
9480 EOF
9481
9482 cat >>confdefs.h <<\EOF
9483 #define NCURSES_EXT_FUNCS 1
9484 EOF
9485
9486 else
9487         NCURSES_EXT_FUNCS=0
9488 fi
9489
9490 ###   use option --enable-const to turn on use of const beyond that in XSI.
9491 echo "$as_me:9491: checking for extended use of const keyword" >&5
9492 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
9493
9494 # Check whether --enable-const or --disable-const was given.
9495 if test "${enable_const+set}" = set; then
9496   enableval="$enable_const"
9497   with_ext_const=$enableval
9498 else
9499   with_ext_const=no
9500 fi;
9501 echo "$as_me:9501: result: $with_ext_const" >&5
9502 echo "${ECHO_T}$with_ext_const" >&6
9503 NCURSES_CONST='/*nothing*/'
9504 if test "$with_ext_const" = yes ; then
9505         NCURSES_CONST=const
9506 fi
9507
9508 ###############################################################################
9509 # These options are relatively safe to experiment with.
9510
9511 echo "$as_me:9511: checking if you want all development code" >&5
9512 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
9513
9514 # Check whether --with-develop or --without-develop was given.
9515 if test "${with_develop+set}" = set; then
9516   withval="$with_develop"
9517   with_develop=$withval
9518 else
9519   with_develop=no
9520 fi;
9521 echo "$as_me:9521: result: $with_develop" >&5
9522 echo "${ECHO_T}$with_develop" >&6
9523
9524 ###############################################################################
9525 # These are just experimental, probably should not be in a package:
9526
9527 # This is still experimental (20080329), but should ultimately be moved to
9528 # the script-block --with-normal, etc.
9529
9530 echo "$as_me:9530: checking if you want to link with the pthread library" >&5
9531 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
9532
9533 # Check whether --with-pthread or --without-pthread was given.
9534 if test "${with_pthread+set}" = set; then
9535   withval="$with_pthread"
9536   with_pthread=$withval
9537 else
9538   with_pthread=no
9539 fi;
9540 echo "$as_me:9540: result: $with_pthread" >&5
9541 echo "${ECHO_T}$with_pthread" >&6
9542
9543 if test "$with_pthread" != no ; then
9544     echo "$as_me:9544: checking for pthread.h" >&5
9545 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
9546 if test "${ac_cv_header_pthread_h+set}" = set; then
9547   echo $ECHO_N "(cached) $ECHO_C" >&6
9548 else
9549   cat >conftest.$ac_ext <<_ACEOF
9550 #line 9550 "configure"
9551 #include "confdefs.h"
9552 #include <pthread.h>
9553 _ACEOF
9554 if { (eval echo "$as_me:9554: \"$ac_cpp conftest.$ac_ext\"") >&5
9555   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9556   ac_status=$?
9557   egrep -v '^ *\+' conftest.er1 >conftest.err
9558   rm -f conftest.er1
9559   cat conftest.err >&5
9560   echo "$as_me:9560: \$? = $ac_status" >&5
9561   (exit $ac_status); } >/dev/null; then
9562   if test -s conftest.err; then
9563     ac_cpp_err=$ac_c_preproc_warn_flag
9564   else
9565     ac_cpp_err=
9566   fi
9567 else
9568   ac_cpp_err=yes
9569 fi
9570 if test -z "$ac_cpp_err"; then
9571   ac_cv_header_pthread_h=yes
9572 else
9573   echo "$as_me: failed program was:" >&5
9574   cat conftest.$ac_ext >&5
9575   ac_cv_header_pthread_h=no
9576 fi
9577 rm -f conftest.err conftest.$ac_ext
9578 fi
9579 echo "$as_me:9579: result: $ac_cv_header_pthread_h" >&5
9580 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
9581 if test $ac_cv_header_pthread_h = yes; then
9582
9583 cat >>confdefs.h <<\EOF
9584 #define HAVE_PTHREADS_H 1
9585 EOF
9586
9587         for cf_lib_pthread in pthread c_r
9588         do
9589             echo "$as_me:9589: checking if we can link with the $cf_lib_pthread library" >&5
9590 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
9591             cf_save_LIBS="$LIBS"
9592             LIBS="-l$cf_lib_pthread $LIBS"
9593             cat >conftest.$ac_ext <<_ACEOF
9594 #line 9594 "configure"
9595 #include "confdefs.h"
9596
9597 #include <pthread.h>
9598
9599 int
9600 main ()
9601 {
9602
9603                 int rc = pthread_create(0,0,0,0);
9604                 int r2 = pthread_mutexattr_settype(0, 0);
9605
9606   ;
9607   return 0;
9608 }
9609 _ACEOF
9610 rm -f conftest.$ac_objext conftest$ac_exeext
9611 if { (eval echo "$as_me:9611: \"$ac_link\"") >&5
9612   (eval $ac_link) 2>&5
9613   ac_status=$?
9614   echo "$as_me:9614: \$? = $ac_status" >&5
9615   (exit $ac_status); } &&
9616          { ac_try='test -s conftest$ac_exeext'
9617   { (eval echo "$as_me:9617: \"$ac_try\"") >&5
9618   (eval $ac_try) 2>&5
9619   ac_status=$?
9620   echo "$as_me:9620: \$? = $ac_status" >&5
9621   (exit $ac_status); }; }; then
9622   with_pthread=yes
9623 else
9624   echo "$as_me: failed program was:" >&5
9625 cat conftest.$ac_ext >&5
9626 with_pthread=no
9627 fi
9628 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9629             LIBS="$cf_save_LIBS"
9630             echo "$as_me:9630: result: $with_pthread" >&5
9631 echo "${ECHO_T}$with_pthread" >&6
9632             test "$with_pthread" = yes && break
9633         done
9634
9635         if test "$with_pthread" = yes ; then
9636             LIBS="-l$cf_lib_pthread $LIBS"
9637
9638 cat >>confdefs.h <<\EOF
9639 #define HAVE_LIBPTHREADS 1
9640 EOF
9641
9642         else
9643             { { echo "$as_me:9643: error: Cannot link with pthread library" >&5
9644 echo "$as_me: error: Cannot link with pthread library" >&2;}
9645    { (exit 1); exit 1; }; }
9646         fi
9647
9648 fi
9649
9650 fi
9651
9652 echo "$as_me:9652: checking if you want to use weak-symbols for pthreads" >&5
9653 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
9654
9655 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
9656 if test "${enable_weak_symbols+set}" = set; then
9657   enableval="$enable_weak_symbols"
9658   use_weak_symbols=$withval
9659 else
9660   use_weak_symbols=no
9661 fi;
9662 echo "$as_me:9662: result: $use_weak_symbols" >&5
9663 echo "${ECHO_T}$use_weak_symbols" >&6
9664 if test "$use_weak_symbols" = yes ; then
9665
9666 echo "$as_me:9666: checking if $CC supports weak symbols" >&5
9667 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9668 if test "${cf_cv_weak_symbols+set}" = set; then
9669   echo $ECHO_N "(cached) $ECHO_C" >&6
9670 else
9671
9672 cat >conftest.$ac_ext <<_ACEOF
9673 #line 9673 "configure"
9674 #include "confdefs.h"
9675
9676 #include <stdio.h>
9677 int
9678 main ()
9679 {
9680
9681 #if defined(__GNUC__)
9682 #  if defined __USE_ISOC99
9683 #    define _cat_pragma(exp)    _Pragma(#exp)
9684 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9685 #  else
9686 #    define _weak_pragma(exp)
9687 #  endif
9688 #  define _declare(name)        __extension__ extern __typeof__(name) name
9689 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9690 #endif
9691
9692 weak_symbol(fopen);
9693
9694   ;
9695   return 0;
9696 }
9697 _ACEOF
9698 rm -f conftest.$ac_objext
9699 if { (eval echo "$as_me:9699: \"$ac_compile\"") >&5
9700   (eval $ac_compile) 2>&5
9701   ac_status=$?
9702   echo "$as_me:9702: \$? = $ac_status" >&5
9703   (exit $ac_status); } &&
9704          { ac_try='test -s conftest.$ac_objext'
9705   { (eval echo "$as_me:9705: \"$ac_try\"") >&5
9706   (eval $ac_try) 2>&5
9707   ac_status=$?
9708   echo "$as_me:9708: \$? = $ac_status" >&5
9709   (exit $ac_status); }; }; then
9710   cf_cv_weak_symbols=yes
9711 else
9712   echo "$as_me: failed program was:" >&5
9713 cat conftest.$ac_ext >&5
9714 cf_cv_weak_symbols=no
9715 fi
9716 rm -f conftest.$ac_objext conftest.$ac_ext
9717
9718 fi
9719 echo "$as_me:9719: result: $cf_cv_weak_symbols" >&5
9720 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9721
9722 else
9723     cf_cv_weak_symbols=no
9724 fi
9725
9726 if test $cf_cv_weak_symbols = yes ; then
9727
9728 cat >>confdefs.h <<\EOF
9729 #define USE_WEAK_SYMBOLS 1
9730 EOF
9731
9732 fi
9733
9734 PTHREAD=
9735 if test "$with_pthread" = "yes" ; then
9736
9737 cat >>confdefs.h <<\EOF
9738 #define USE_PTHREADS 1
9739 EOF
9740
9741     enable_reentrant=yes
9742     if test $cf_cv_weak_symbols = yes ; then
9743         PTHREAD=-lpthread
9744     fi
9745 fi
9746
9747 # OpenSUSE is installing ncurses6, using reentrant option.
9748 echo "$as_me:9748: checking for _nc_TABSIZE" >&5
9749 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
9750 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
9751   echo $ECHO_N "(cached) $ECHO_C" >&6
9752 else
9753   cat >conftest.$ac_ext <<_ACEOF
9754 #line 9754 "configure"
9755 #include "confdefs.h"
9756 /* System header to define __stub macros and hopefully few prototypes,
9757     which can conflict with char _nc_TABSIZE (); below.  */
9758 #include <assert.h>
9759 /* Override any gcc2 internal prototype to avoid an error.  */
9760 #ifdef __cplusplus
9761 extern "C"
9762 #endif
9763 /* We use char because int might match the return type of a gcc2
9764    builtin and then its argument prototype would still apply.  */
9765 char _nc_TABSIZE ();
9766 char (*f) ();
9767
9768 int
9769 main ()
9770 {
9771 /* The GNU C library defines this for functions which it implements
9772     to always fail with ENOSYS.  Some functions are actually named
9773     something starting with __ and the normal name is an alias.  */
9774 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
9775 choke me
9776 #else
9777 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9778 #endif
9779
9780   ;
9781   return 0;
9782 }
9783 _ACEOF
9784 rm -f conftest.$ac_objext conftest$ac_exeext
9785 if { (eval echo "$as_me:9785: \"$ac_link\"") >&5
9786   (eval $ac_link) 2>&5
9787   ac_status=$?
9788   echo "$as_me:9788: \$? = $ac_status" >&5
9789   (exit $ac_status); } &&
9790          { ac_try='test -s conftest$ac_exeext'
9791   { (eval echo "$as_me:9791: \"$ac_try\"") >&5
9792   (eval $ac_try) 2>&5
9793   ac_status=$?
9794   echo "$as_me:9794: \$? = $ac_status" >&5
9795   (exit $ac_status); }; }; then
9796   ac_cv_func__nc_TABSIZE=yes
9797 else
9798   echo "$as_me: failed program was:" >&5
9799 cat conftest.$ac_ext >&5
9800 ac_cv_func__nc_TABSIZE=no
9801 fi
9802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9803 fi
9804 echo "$as_me:9804: result: $ac_cv_func__nc_TABSIZE" >&5
9805 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
9806 if test $ac_cv_func__nc_TABSIZE = yes; then
9807   assume_reentrant=yes
9808 else
9809   assume_reentrant=no
9810 fi
9811
9812 # Reentrant code has to be opaque; there's little advantage to making ncurses
9813 # opaque outside of that, so there is no --enable-opaque option.  We can use
9814 # this option without --with-pthreads, but this will be always set for
9815 # pthreads.
9816 echo "$as_me:9816: checking if you want experimental reentrant code" >&5
9817 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9818
9819 # Check whether --enable-reentrant or --disable-reentrant was given.
9820 if test "${enable_reentrant+set}" = set; then
9821   enableval="$enable_reentrant"
9822   with_reentrant=$enableval
9823 else
9824   with_reentrant=$assume_reentrant
9825 fi;
9826 echo "$as_me:9826: result: $with_reentrant" >&5
9827 echo "${ECHO_T}$with_reentrant" >&6
9828 if test "$with_reentrant" = yes ; then
9829         cf_cv_enable_reentrant=1
9830         if test $cf_cv_weak_symbols = yes ; then
9831
9832 # remove pthread library from $LIBS
9833 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9834
9835         elif test "$assume_reentrant" = no ; then
9836                 LIB_SUFFIX="t${LIB_SUFFIX}"
9837         fi
9838
9839 cat >>confdefs.h <<\EOF
9840 #define USE_REENTRANT 1
9841 EOF
9842
9843 else
9844         cf_cv_enable_reentrant=0
9845 fi
9846
9847 ### Allow using a different wrap-prefix
9848 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9849         echo "$as_me:9849: checking for prefix used to wrap public variables" >&5
9850 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9851
9852 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9853 if test "${with_wrap_prefix+set}" = set; then
9854   withval="$with_wrap_prefix"
9855   NCURSES_WRAP_PREFIX=$withval
9856 else
9857   NCURSES_WRAP_PREFIX=_nc_
9858 fi;
9859         echo "$as_me:9859: result: $NCURSES_WRAP_PREFIX" >&5
9860 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9861 else
9862         NCURSES_WRAP_PREFIX=_nc_
9863 fi
9864
9865 cat >>confdefs.h <<EOF
9866 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9867 EOF
9868
9869 ###############################################################################
9870
9871 ###     use option --disable-echo to suppress full display compiling commands
9872
9873 echo "$as_me:9873: checking if you want to see long compiling messages" >&5
9874 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
9875
9876 # Check whether --enable-echo or --disable-echo was given.
9877 if test "${enable_echo+set}" = set; then
9878   enableval="$enable_echo"
9879   test "$enableval" != no && enableval=yes
9880   if test "$enableval" != "yes" ; then
9881
9882     ECHO_LT='--silent'
9883     ECHO_LD='@echo linking $@;'
9884     RULE_CC='@echo compiling $<'
9885     SHOW_CC='@echo compiling $@'
9886     ECHO_CC='@'
9887
9888   else
9889
9890     ECHO_LT=''
9891     ECHO_LD=''
9892     RULE_CC=''
9893     SHOW_CC=''
9894     ECHO_CC=''
9895
9896   fi
9897 else
9898   enableval=yes
9899
9900     ECHO_LT=''
9901     ECHO_LD=''
9902     RULE_CC=''
9903     SHOW_CC=''
9904     ECHO_CC=''
9905
9906 fi;
9907 echo "$as_me:9907: result: $enableval" >&5
9908 echo "${ECHO_T}$enableval" >&6
9909
9910 ###     use option --enable-warnings to turn on all gcc warnings
9911 echo "$as_me:9911: checking if you want to see compiler warnings" >&5
9912 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
9913
9914 # Check whether --enable-warnings or --disable-warnings was given.
9915 if test "${enable_warnings+set}" = set; then
9916   enableval="$enable_warnings"
9917   with_warnings=$enableval
9918 fi;
9919 echo "$as_me:9919: result: $with_warnings" >&5
9920 echo "${ECHO_T}$with_warnings" >&6
9921
9922 if test "x$with_warnings" = "xyes"; then
9923
9924         ADAFLAGS="$ADAFLAGS -gnatg"
9925
9926 INTEL_COMPILER=no
9927
9928 if test "$GCC" = yes ; then
9929         case $host_os in
9930         linux*|gnu*)
9931                 echo "$as_me:9931: checking if this is really Intel C compiler" >&5
9932 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
9933                 cf_save_CFLAGS="$CFLAGS"
9934                 CFLAGS="$CFLAGS -no-gcc"
9935                 cat >conftest.$ac_ext <<_ACEOF
9936 #line 9936 "configure"
9937 #include "confdefs.h"
9938
9939 int
9940 main ()
9941 {
9942
9943 #ifdef __INTEL_COMPILER
9944 #else
9945 make an error
9946 #endif
9947
9948   ;
9949   return 0;
9950 }
9951 _ACEOF
9952 rm -f conftest.$ac_objext
9953 if { (eval echo "$as_me:9953: \"$ac_compile\"") >&5
9954   (eval $ac_compile) 2>&5
9955   ac_status=$?
9956   echo "$as_me:9956: \$? = $ac_status" >&5
9957   (exit $ac_status); } &&
9958          { ac_try='test -s conftest.$ac_objext'
9959   { (eval echo "$as_me:9959: \"$ac_try\"") >&5
9960   (eval $ac_try) 2>&5
9961   ac_status=$?
9962   echo "$as_me:9962: \$? = $ac_status" >&5
9963   (exit $ac_status); }; }; then
9964   INTEL_COMPILER=yes
9965 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
9966
9967 else
9968   echo "$as_me: failed program was:" >&5
9969 cat conftest.$ac_ext >&5
9970 fi
9971 rm -f conftest.$ac_objext conftest.$ac_ext
9972                 CFLAGS="$cf_save_CFLAGS"
9973                 echo "$as_me:9973: result: $INTEL_COMPILER" >&5
9974 echo "${ECHO_T}$INTEL_COMPILER" >&6
9975                 ;;
9976         esac
9977 fi
9978
9979 CLANG_COMPILER=no
9980
9981 if test "$GCC" = yes ; then
9982         echo "$as_me:9982: checking if this is really Clang C compiler" >&5
9983 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
9984         cf_save_CFLAGS="$CFLAGS"
9985         CFLAGS="$CFLAGS -Qunused-arguments"
9986         cat >conftest.$ac_ext <<_ACEOF
9987 #line 9987 "configure"
9988 #include "confdefs.h"
9989
9990 int
9991 main ()
9992 {
9993
9994 #ifdef __clang__
9995 #else
9996 make an error
9997 #endif
9998
9999   ;
10000   return 0;
10001 }
10002 _ACEOF
10003 rm -f conftest.$ac_objext
10004 if { (eval echo "$as_me:10004: \"$ac_compile\"") >&5
10005   (eval $ac_compile) 2>&5
10006   ac_status=$?
10007   echo "$as_me:10007: \$? = $ac_status" >&5
10008   (exit $ac_status); } &&
10009          { ac_try='test -s conftest.$ac_objext'
10010   { (eval echo "$as_me:10010: \"$ac_try\"") >&5
10011   (eval $ac_try) 2>&5
10012   ac_status=$?
10013   echo "$as_me:10013: \$? = $ac_status" >&5
10014   (exit $ac_status); }; }; then
10015   CLANG_COMPILER=yes
10016 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
10017
10018 else
10019   echo "$as_me: failed program was:" >&5
10020 cat conftest.$ac_ext >&5
10021 fi
10022 rm -f conftest.$ac_objext conftest.$ac_ext
10023         CFLAGS="$cf_save_CFLAGS"
10024         echo "$as_me:10024: result: $CLANG_COMPILER" >&5
10025 echo "${ECHO_T}$CLANG_COMPILER" >&6
10026 fi
10027
10028 cat > conftest.$ac_ext <<EOF
10029 #line 10029 "${as_me:-configure}"
10030 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
10031 EOF
10032
10033 if test "$INTEL_COMPILER" = yes
10034 then
10035 # The "-wdXXX" options suppress warnings:
10036 # remark #1419: external declaration in primary source file
10037 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
10038 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
10039 # remark #193: zero used for undefined preprocessing identifier
10040 # remark #593: variable "curs_sb_left_arrow" was set but never used
10041 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
10042 # remark #869: parameter "tw" was never referenced
10043 # remark #981: operands are evaluated in unspecified order
10044 # warning #279: controlling expression is constant
10045
10046         { echo "$as_me:10046: checking for $CC warning options..." >&5
10047 echo "$as_me: checking for $CC warning options..." >&6;}
10048         cf_save_CFLAGS="$CFLAGS"
10049         EXTRA_CFLAGS="-Wall"
10050         for cf_opt in \
10051                 wd1419 \
10052                 wd1683 \
10053                 wd1684 \
10054                 wd193 \
10055                 wd593 \
10056                 wd279 \
10057                 wd810 \
10058                 wd869 \
10059                 wd981
10060         do
10061                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10062                 if { (eval echo "$as_me:10062: \"$ac_compile\"") >&5
10063   (eval $ac_compile) 2>&5
10064   ac_status=$?
10065   echo "$as_me:10065: \$? = $ac_status" >&5
10066   (exit $ac_status); }; then
10067                         test -n "$verbose" && echo "$as_me:10067: result: ... -$cf_opt" >&5
10068 echo "${ECHO_T}... -$cf_opt" >&6
10069                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10070                 fi
10071         done
10072         CFLAGS="$cf_save_CFLAGS"
10073
10074 elif test "$GCC" = yes
10075 then
10076         { echo "$as_me:10076: checking for $CC warning options..." >&5
10077 echo "$as_me: checking for $CC warning options..." >&6;}
10078         cf_save_CFLAGS="$CFLAGS"
10079         EXTRA_CFLAGS=
10080         cf_warn_CONST=""
10081         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
10082         for cf_opt in W Wall \
10083                 Wbad-function-cast \
10084                 Wcast-align \
10085                 Wcast-qual \
10086                 Winline \
10087                 Wmissing-declarations \
10088                 Wmissing-prototypes \
10089                 Wnested-externs \
10090                 Wpointer-arith \
10091                 Wshadow \
10092                 Wstrict-prototypes \
10093                 Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
10094         do
10095                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10096                 if { (eval echo "$as_me:10096: \"$ac_compile\"") >&5
10097   (eval $ac_compile) 2>&5
10098   ac_status=$?
10099   echo "$as_me:10099: \$? = $ac_status" >&5
10100   (exit $ac_status); }; then
10101                         test -n "$verbose" && echo "$as_me:10101: result: ... -$cf_opt" >&5
10102 echo "${ECHO_T}... -$cf_opt" >&6
10103                         case $cf_opt in #(vi
10104                         Wcast-qual) #(vi
10105                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
10106                                 ;;
10107                         Winline) #(vi
10108                                 case $GCC_VERSION in
10109                                 [34].*)
10110                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10111
10112 echo "${as_me:-configure}:10112: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10113
10114                                         continue;;
10115                                 esac
10116                                 ;;
10117                         Wpointer-arith) #(vi
10118                                 case $GCC_VERSION in
10119                                 [12].*)
10120                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10121
10122 echo "${as_me:-configure}:10122: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10123
10124                                         continue;;
10125                                 esac
10126                                 ;;
10127                         esac
10128                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10129                 fi
10130         done
10131         CFLAGS="$cf_save_CFLAGS"
10132 fi
10133 rm -rf conftest*
10134
10135 fi
10136
10137 if test "$GCC" = yes
10138 then
10139 cat > conftest.i <<EOF
10140 #ifndef GCC_PRINTF
10141 #define GCC_PRINTF 0
10142 #endif
10143 #ifndef GCC_SCANF
10144 #define GCC_SCANF 0
10145 #endif
10146 #ifndef GCC_NORETURN
10147 #define GCC_NORETURN /* nothing */
10148 #endif
10149 #ifndef GCC_UNUSED
10150 #define GCC_UNUSED /* nothing */
10151 #endif
10152 EOF
10153 if test "$GCC" = yes
10154 then
10155         { echo "$as_me:10155: checking for $CC __attribute__ directives..." >&5
10156 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
10157 cat > conftest.$ac_ext <<EOF
10158 #line 10158 "${as_me:-configure}"
10159 #include "confdefs.h"
10160 #include "conftest.h"
10161 #include "conftest.i"
10162 #if     GCC_PRINTF
10163 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
10164 #else
10165 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
10166 #endif
10167 #if     GCC_SCANF
10168 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
10169 #else
10170 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
10171 #endif
10172 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
10173 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
10174 extern void foo(void) GCC_NORETURN;
10175 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
10176 EOF
10177         cf_printf_attribute=no
10178         cf_scanf_attribute=no
10179         for cf_attribute in scanf printf unused noreturn
10180         do
10181
10182 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10183
10184                 cf_directive="__attribute__(($cf_attribute))"
10185                 echo "checking for $CC $cf_directive" 1>&5
10186
10187                 case $cf_attribute in #(vi
10188                 printf) #(vi
10189                         cf_printf_attribute=yes
10190                         cat >conftest.h <<EOF
10191 #define GCC_$cf_ATTRIBUTE 1
10192 EOF
10193                         ;;
10194                 scanf) #(vi
10195                         cf_scanf_attribute=yes
10196                         cat >conftest.h <<EOF
10197 #define GCC_$cf_ATTRIBUTE 1
10198 EOF
10199                         ;;
10200                 *) #(vi
10201                         cat >conftest.h <<EOF
10202 #define GCC_$cf_ATTRIBUTE $cf_directive
10203 EOF
10204                         ;;
10205                 esac
10206
10207                 if { (eval echo "$as_me:10207: \"$ac_compile\"") >&5
10208   (eval $ac_compile) 2>&5
10209   ac_status=$?
10210   echo "$as_me:10210: \$? = $ac_status" >&5
10211   (exit $ac_status); }; then
10212                         test -n "$verbose" && echo "$as_me:10212: result: ... $cf_attribute" >&5
10213 echo "${ECHO_T}... $cf_attribute" >&6
10214                         cat conftest.h >>confdefs.h
10215                         case $cf_attribute in #(vi
10216                         noreturn) #(vi
10217
10218 cat >>confdefs.h <<EOF
10219 #define GCC_NORETURN $cf_directive
10220 EOF
10221
10222                                 ;;
10223                         printf) #(vi
10224                                 cf_value='/* nothing */'
10225                                 if test "$cf_printf_attribute" != no ; then
10226                                         cf_value='__attribute__((format(printf,fmt,var)))'
10227
10228 cat >>confdefs.h <<\EOF
10229 #define GCC_PRINTF 1
10230 EOF
10231
10232                                 fi
10233
10234 cat >>confdefs.h <<EOF
10235 #define GCC_PRINTFLIKE(fmt,var) $cf_value
10236 EOF
10237
10238                                 ;;
10239                         scanf) #(vi
10240                                 cf_value='/* nothing */'
10241                                 if test "$cf_scanf_attribute" != no ; then
10242                                         cf_value='__attribute__((format(scanf,fmt,var)))'
10243
10244 cat >>confdefs.h <<\EOF
10245 #define GCC_SCANF 1
10246 EOF
10247
10248                                 fi
10249
10250 cat >>confdefs.h <<EOF
10251 #define GCC_SCANFLIKE(fmt,var) $cf_value
10252 EOF
10253
10254                                 ;;
10255                         unused) #(vi
10256
10257 cat >>confdefs.h <<EOF
10258 #define GCC_UNUSED $cf_directive
10259 EOF
10260
10261                                 ;;
10262                         esac
10263                 fi
10264         done
10265 else
10266         fgrep define conftest.i >>confdefs.h
10267 fi
10268 rm -rf conftest*
10269 fi
10270
10271 ###     use option --enable-assertions to turn on generation of assertion code
10272 echo "$as_me:10272: checking if you want to enable runtime assertions" >&5
10273 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
10274
10275 # Check whether --enable-assertions or --disable-assertions was given.
10276 if test "${enable_assertions+set}" = set; then
10277   enableval="$enable_assertions"
10278   with_assertions=$enableval
10279 else
10280   with_assertions=no
10281 fi;
10282 echo "$as_me:10282: result: $with_assertions" >&5
10283 echo "${ECHO_T}$with_assertions" >&6
10284 if test -n "$GCC"
10285 then
10286         if test "$with_assertions" = no
10287         then
10288                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
10289         else
10290
10291         ADAFLAGS="$ADAFLAGS -gnata"
10292
10293         fi
10294 fi
10295
10296 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
10297
10298 cat >>confdefs.h <<\EOF
10299 #define HAVE_NC_ALLOC_H 1
10300 EOF
10301
10302 ###     use option --enable-expanded to generate certain macros as functions
10303
10304 # Check whether --enable-expanded or --disable-expanded was given.
10305 if test "${enable_expanded+set}" = set; then
10306   enableval="$enable_expanded"
10307   test "$enableval" = yes &&
10308 cat >>confdefs.h <<\EOF
10309 #define NCURSES_EXPANDED 1
10310 EOF
10311
10312 fi;
10313
10314 ###     use option --disable-macros to suppress macros in favor of functions
10315
10316 # Check whether --enable-macros or --disable-macros was given.
10317 if test "${enable_macros+set}" = set; then
10318   enableval="$enable_macros"
10319   test "$enableval" = no &&
10320 cat >>confdefs.h <<\EOF
10321 #define NCURSES_NOMACROS 1
10322 EOF
10323
10324 fi;
10325
10326 # Normally we only add trace() to the debug-library.  Allow this to be
10327 # extended to all models of the ncurses library:
10328 cf_all_traces=no
10329 case "$CFLAGS $CPPFLAGS" in
10330 *-DTRACE*)
10331         cf_all_traces=yes
10332         ;;
10333 esac
10334
10335 echo "$as_me:10335: checking whether to add trace feature to all models" >&5
10336 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
10337
10338 # Check whether --with-trace or --without-trace was given.
10339 if test "${with_trace+set}" = set; then
10340   withval="$with_trace"
10341   cf_with_trace=$withval
10342 else
10343   cf_with_trace=$cf_all_traces
10344 fi;
10345 echo "$as_me:10345: result: $cf_with_trace" >&5
10346 echo "${ECHO_T}$cf_with_trace" >&6
10347
10348 if test "$cf_with_trace" = yes ; then
10349         ADA_TRACE=TRUE
10350
10351 cf_fix_cppflags=no
10352 cf_new_cflags=
10353 cf_new_cppflags=
10354 cf_new_extra_cppflags=
10355
10356 for cf_add_cflags in -DTRACE
10357 do
10358 case $cf_fix_cppflags in
10359 no)
10360         case $cf_add_cflags in #(vi
10361         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10362                 case $cf_add_cflags in
10363                 -D*)
10364                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10365
10366                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10367                                 && test -z "${cf_tst_cflags}" \
10368                                 && cf_fix_cppflags=yes
10369
10370                         if test $cf_fix_cppflags = yes ; then
10371                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10372                                 continue
10373                         elif test "${cf_tst_cflags}" = "\"'" ; then
10374                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10375                                 continue
10376                         fi
10377                         ;;
10378                 esac
10379                 case "$CPPFLAGS" in
10380                 *$cf_add_cflags) #(vi
10381                         ;;
10382                 *) #(vi
10383                         case $cf_add_cflags in #(vi
10384                         -D*)
10385                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10386
10387 CPPFLAGS=`echo "$CPPFLAGS" | \
10388         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10389                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10390
10391                                 ;;
10392                         esac
10393                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10394                         ;;
10395                 esac
10396                 ;;
10397         *)
10398                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10399                 ;;
10400         esac
10401         ;;
10402 yes)
10403         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10404
10405         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10406
10407         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10408                 && test -z "${cf_tst_cflags}" \
10409                 && cf_fix_cppflags=no
10410         ;;
10411 esac
10412 done
10413
10414 if test -n "$cf_new_cflags" ; then
10415
10416         CFLAGS="$CFLAGS $cf_new_cflags"
10417 fi
10418
10419 if test -n "$cf_new_cppflags" ; then
10420
10421         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10422 fi
10423
10424 if test -n "$cf_new_extra_cppflags" ; then
10425
10426         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10427 fi
10428
10429 else
10430         ADA_TRACE=FALSE
10431 fi
10432
10433 ###     Checks for libraries.
10434 case $cf_cv_system_name in #(vi
10435 *mingw32*) #(vi
10436         ;;
10437 *)
10438 echo "$as_me:10438: checking for gettimeofday" >&5
10439 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
10440 if test "${ac_cv_func_gettimeofday+set}" = set; then
10441   echo $ECHO_N "(cached) $ECHO_C" >&6
10442 else
10443   cat >conftest.$ac_ext <<_ACEOF
10444 #line 10444 "configure"
10445 #include "confdefs.h"
10446 /* System header to define __stub macros and hopefully few prototypes,
10447     which can conflict with char gettimeofday (); below.  */
10448 #include <assert.h>
10449 /* Override any gcc2 internal prototype to avoid an error.  */
10450 #ifdef __cplusplus
10451 extern "C"
10452 #endif
10453 /* We use char because int might match the return type of a gcc2
10454    builtin and then its argument prototype would still apply.  */
10455 char gettimeofday ();
10456 char (*f) ();
10457
10458 int
10459 main ()
10460 {
10461 /* The GNU C library defines this for functions which it implements
10462     to always fail with ENOSYS.  Some functions are actually named
10463     something starting with __ and the normal name is an alias.  */
10464 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
10465 choke me
10466 #else
10467 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10468 #endif
10469
10470   ;
10471   return 0;
10472 }
10473 _ACEOF
10474 rm -f conftest.$ac_objext conftest$ac_exeext
10475 if { (eval echo "$as_me:10475: \"$ac_link\"") >&5
10476   (eval $ac_link) 2>&5
10477   ac_status=$?
10478   echo "$as_me:10478: \$? = $ac_status" >&5
10479   (exit $ac_status); } &&
10480          { ac_try='test -s conftest$ac_exeext'
10481   { (eval echo "$as_me:10481: \"$ac_try\"") >&5
10482   (eval $ac_try) 2>&5
10483   ac_status=$?
10484   echo "$as_me:10484: \$? = $ac_status" >&5
10485   (exit $ac_status); }; }; then
10486   ac_cv_func_gettimeofday=yes
10487 else
10488   echo "$as_me: failed program was:" >&5
10489 cat conftest.$ac_ext >&5
10490 ac_cv_func_gettimeofday=no
10491 fi
10492 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10493 fi
10494 echo "$as_me:10494: result: $ac_cv_func_gettimeofday" >&5
10495 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
10496 if test $ac_cv_func_gettimeofday = yes; then
10497   cat >>confdefs.h <<\EOF
10498 #define HAVE_GETTIMEOFDAY 1
10499 EOF
10500
10501 else
10502
10503 echo "$as_me:10503: checking for gettimeofday in -lbsd" >&5
10504 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
10505 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
10506   echo $ECHO_N "(cached) $ECHO_C" >&6
10507 else
10508   ac_check_lib_save_LIBS=$LIBS
10509 LIBS="-lbsd  $LIBS"
10510 cat >conftest.$ac_ext <<_ACEOF
10511 #line 10511 "configure"
10512 #include "confdefs.h"
10513
10514 /* Override any gcc2 internal prototype to avoid an error.  */
10515 #ifdef __cplusplus
10516 extern "C"
10517 #endif
10518 /* We use char because int might match the return type of a gcc2
10519    builtin and then its argument prototype would still apply.  */
10520 char gettimeofday ();
10521 int
10522 main ()
10523 {
10524 gettimeofday ();
10525   ;
10526   return 0;
10527 }
10528 _ACEOF
10529 rm -f conftest.$ac_objext conftest$ac_exeext
10530 if { (eval echo "$as_me:10530: \"$ac_link\"") >&5
10531   (eval $ac_link) 2>&5
10532   ac_status=$?
10533   echo "$as_me:10533: \$? = $ac_status" >&5
10534   (exit $ac_status); } &&
10535          { ac_try='test -s conftest$ac_exeext'
10536   { (eval echo "$as_me:10536: \"$ac_try\"") >&5
10537   (eval $ac_try) 2>&5
10538   ac_status=$?
10539   echo "$as_me:10539: \$? = $ac_status" >&5
10540   (exit $ac_status); }; }; then
10541   ac_cv_lib_bsd_gettimeofday=yes
10542 else
10543   echo "$as_me: failed program was:" >&5
10544 cat conftest.$ac_ext >&5
10545 ac_cv_lib_bsd_gettimeofday=no
10546 fi
10547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10548 LIBS=$ac_check_lib_save_LIBS
10549 fi
10550 echo "$as_me:10550: result: $ac_cv_lib_bsd_gettimeofday" >&5
10551 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
10552 if test $ac_cv_lib_bsd_gettimeofday = yes; then
10553
10554 cat >>confdefs.h <<\EOF
10555 #define HAVE_GETTIMEOFDAY 1
10556 EOF
10557
10558         LIBS="$LIBS -lbsd"
10559 fi
10560
10561 fi
10562         ;;
10563 esac
10564
10565 ###     Checks for header files.
10566 echo "$as_me:10566: checking for ANSI C header files" >&5
10567 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10568 if test "${ac_cv_header_stdc+set}" = set; then
10569   echo $ECHO_N "(cached) $ECHO_C" >&6
10570 else
10571   cat >conftest.$ac_ext <<_ACEOF
10572 #line 10572 "configure"
10573 #include "confdefs.h"
10574 #include <stdlib.h>
10575 #include <stdarg.h>
10576 #include <string.h>
10577 #include <float.h>
10578
10579 _ACEOF
10580 if { (eval echo "$as_me:10580: \"$ac_cpp conftest.$ac_ext\"") >&5
10581   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10582   ac_status=$?
10583   egrep -v '^ *\+' conftest.er1 >conftest.err
10584   rm -f conftest.er1
10585   cat conftest.err >&5
10586   echo "$as_me:10586: \$? = $ac_status" >&5
10587   (exit $ac_status); } >/dev/null; then
10588   if test -s conftest.err; then
10589     ac_cpp_err=$ac_c_preproc_warn_flag
10590   else
10591     ac_cpp_err=
10592   fi
10593 else
10594   ac_cpp_err=yes
10595 fi
10596 if test -z "$ac_cpp_err"; then
10597   ac_cv_header_stdc=yes
10598 else
10599   echo "$as_me: failed program was:" >&5
10600   cat conftest.$ac_ext >&5
10601   ac_cv_header_stdc=no
10602 fi
10603 rm -f conftest.err conftest.$ac_ext
10604
10605 if test $ac_cv_header_stdc = yes; then
10606   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10607   cat >conftest.$ac_ext <<_ACEOF
10608 #line 10608 "configure"
10609 #include "confdefs.h"
10610 #include <string.h>
10611
10612 _ACEOF
10613 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10614   egrep "memchr" >/dev/null 2>&1; then
10615   :
10616 else
10617   ac_cv_header_stdc=no
10618 fi
10619 rm -rf conftest*
10620
10621 fi
10622
10623 if test $ac_cv_header_stdc = yes; then
10624   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10625   cat >conftest.$ac_ext <<_ACEOF
10626 #line 10626 "configure"
10627 #include "confdefs.h"
10628 #include <stdlib.h>
10629
10630 _ACEOF
10631 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10632   egrep "free" >/dev/null 2>&1; then
10633   :
10634 else
10635   ac_cv_header_stdc=no
10636 fi
10637 rm -rf conftest*
10638
10639 fi
10640
10641 if test $ac_cv_header_stdc = yes; then
10642   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10643   if test "$cross_compiling" = yes; then
10644   :
10645 else
10646   cat >conftest.$ac_ext <<_ACEOF
10647 #line 10647 "configure"
10648 #include "confdefs.h"
10649 #include <ctype.h>
10650 #if ((' ' & 0x0FF) == 0x020)
10651 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10652 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10653 #else
10654 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
10655                      || ('j' <= (c) && (c) <= 'r') \
10656                      || ('s' <= (c) && (c) <= 'z'))
10657 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10658 #endif
10659
10660 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10661 int
10662 main ()
10663 {
10664   int i;
10665   for (i = 0; i < 256; i++)
10666     if (XOR (islower (i), ISLOWER (i))
10667         || toupper (i) != TOUPPER (i))
10668       $ac_main_return(2);
10669   $ac_main_return (0);
10670 }
10671 _ACEOF
10672 rm -f conftest$ac_exeext
10673 if { (eval echo "$as_me:10673: \"$ac_link\"") >&5
10674   (eval $ac_link) 2>&5
10675   ac_status=$?
10676   echo "$as_me:10676: \$? = $ac_status" >&5
10677   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10678   { (eval echo "$as_me:10678: \"$ac_try\"") >&5
10679   (eval $ac_try) 2>&5
10680   ac_status=$?
10681   echo "$as_me:10681: \$? = $ac_status" >&5
10682   (exit $ac_status); }; }; then
10683   :
10684 else
10685   echo "$as_me: program exited with status $ac_status" >&5
10686 echo "$as_me: failed program was:" >&5
10687 cat conftest.$ac_ext >&5
10688 ac_cv_header_stdc=no
10689 fi
10690 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10691 fi
10692 fi
10693 fi
10694 echo "$as_me:10694: result: $ac_cv_header_stdc" >&5
10695 echo "${ECHO_T}$ac_cv_header_stdc" >&6
10696 if test $ac_cv_header_stdc = yes; then
10697
10698 cat >>confdefs.h <<\EOF
10699 #define STDC_HEADERS 1
10700 EOF
10701
10702 fi
10703
10704 ac_header_dirent=no
10705 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
10706   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
10707 echo "$as_me:10707: checking for $ac_hdr that defines DIR" >&5
10708 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
10709 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10710   echo $ECHO_N "(cached) $ECHO_C" >&6
10711 else
10712   cat >conftest.$ac_ext <<_ACEOF
10713 #line 10713 "configure"
10714 #include "confdefs.h"
10715 #include <sys/types.h>
10716 #include <$ac_hdr>
10717
10718 int
10719 main ()
10720 {
10721 if ((DIR *) 0)
10722 return 0;
10723   ;
10724   return 0;
10725 }
10726 _ACEOF
10727 rm -f conftest.$ac_objext
10728 if { (eval echo "$as_me:10728: \"$ac_compile\"") >&5
10729   (eval $ac_compile) 2>&5
10730   ac_status=$?
10731   echo "$as_me:10731: \$? = $ac_status" >&5
10732   (exit $ac_status); } &&
10733          { ac_try='test -s conftest.$ac_objext'
10734   { (eval echo "$as_me:10734: \"$ac_try\"") >&5
10735   (eval $ac_try) 2>&5
10736   ac_status=$?
10737   echo "$as_me:10737: \$? = $ac_status" >&5
10738   (exit $ac_status); }; }; then
10739   eval "$as_ac_Header=yes"
10740 else
10741   echo "$as_me: failed program was:" >&5
10742 cat conftest.$ac_ext >&5
10743 eval "$as_ac_Header=no"
10744 fi
10745 rm -f conftest.$ac_objext conftest.$ac_ext
10746 fi
10747 echo "$as_me:10747: result: `eval echo '${'$as_ac_Header'}'`" >&5
10748 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10749 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10750   cat >>confdefs.h <<EOF
10751 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
10752 EOF
10753
10754 ac_header_dirent=$ac_hdr; break
10755 fi
10756
10757 done
10758 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
10759 if test $ac_header_dirent = dirent.h; then
10760   echo "$as_me:10760: checking for opendir in -ldir" >&5
10761 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
10762 if test "${ac_cv_lib_dir_opendir+set}" = set; then
10763   echo $ECHO_N "(cached) $ECHO_C" >&6
10764 else
10765   ac_check_lib_save_LIBS=$LIBS
10766 LIBS="-ldir  $LIBS"
10767 cat >conftest.$ac_ext <<_ACEOF
10768 #line 10768 "configure"
10769 #include "confdefs.h"
10770
10771 /* Override any gcc2 internal prototype to avoid an error.  */
10772 #ifdef __cplusplus
10773 extern "C"
10774 #endif
10775 /* We use char because int might match the return type of a gcc2
10776    builtin and then its argument prototype would still apply.  */
10777 char opendir ();
10778 int
10779 main ()
10780 {
10781 opendir ();
10782   ;
10783   return 0;
10784 }
10785 _ACEOF
10786 rm -f conftest.$ac_objext conftest$ac_exeext
10787 if { (eval echo "$as_me:10787: \"$ac_link\"") >&5
10788   (eval $ac_link) 2>&5
10789   ac_status=$?
10790   echo "$as_me:10790: \$? = $ac_status" >&5
10791   (exit $ac_status); } &&
10792          { ac_try='test -s conftest$ac_exeext'
10793   { (eval echo "$as_me:10793: \"$ac_try\"") >&5
10794   (eval $ac_try) 2>&5
10795   ac_status=$?
10796   echo "$as_me:10796: \$? = $ac_status" >&5
10797   (exit $ac_status); }; }; then
10798   ac_cv_lib_dir_opendir=yes
10799 else
10800   echo "$as_me: failed program was:" >&5
10801 cat conftest.$ac_ext >&5
10802 ac_cv_lib_dir_opendir=no
10803 fi
10804 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10805 LIBS=$ac_check_lib_save_LIBS
10806 fi
10807 echo "$as_me:10807: result: $ac_cv_lib_dir_opendir" >&5
10808 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
10809 if test $ac_cv_lib_dir_opendir = yes; then
10810   LIBS="$LIBS -ldir"
10811 fi
10812
10813 else
10814   echo "$as_me:10814: checking for opendir in -lx" >&5
10815 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
10816 if test "${ac_cv_lib_x_opendir+set}" = set; then
10817   echo $ECHO_N "(cached) $ECHO_C" >&6
10818 else
10819   ac_check_lib_save_LIBS=$LIBS
10820 LIBS="-lx  $LIBS"
10821 cat >conftest.$ac_ext <<_ACEOF
10822 #line 10822 "configure"
10823 #include "confdefs.h"
10824
10825 /* Override any gcc2 internal prototype to avoid an error.  */
10826 #ifdef __cplusplus
10827 extern "C"
10828 #endif
10829 /* We use char because int might match the return type of a gcc2
10830    builtin and then its argument prototype would still apply.  */
10831 char opendir ();
10832 int
10833 main ()
10834 {
10835 opendir ();
10836   ;
10837   return 0;
10838 }
10839 _ACEOF
10840 rm -f conftest.$ac_objext conftest$ac_exeext
10841 if { (eval echo "$as_me:10841: \"$ac_link\"") >&5
10842   (eval $ac_link) 2>&5
10843   ac_status=$?
10844   echo "$as_me:10844: \$? = $ac_status" >&5
10845   (exit $ac_status); } &&
10846          { ac_try='test -s conftest$ac_exeext'
10847   { (eval echo "$as_me:10847: \"$ac_try\"") >&5
10848   (eval $ac_try) 2>&5
10849   ac_status=$?
10850   echo "$as_me:10850: \$? = $ac_status" >&5
10851   (exit $ac_status); }; }; then
10852   ac_cv_lib_x_opendir=yes
10853 else
10854   echo "$as_me: failed program was:" >&5
10855 cat conftest.$ac_ext >&5
10856 ac_cv_lib_x_opendir=no
10857 fi
10858 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10859 LIBS=$ac_check_lib_save_LIBS
10860 fi
10861 echo "$as_me:10861: result: $ac_cv_lib_x_opendir" >&5
10862 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10863 if test $ac_cv_lib_x_opendir = yes; then
10864   LIBS="$LIBS -lx"
10865 fi
10866
10867 fi
10868
10869 echo "$as_me:10869: checking whether time.h and sys/time.h may both be included" >&5
10870 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10871 if test "${ac_cv_header_time+set}" = set; then
10872   echo $ECHO_N "(cached) $ECHO_C" >&6
10873 else
10874   cat >conftest.$ac_ext <<_ACEOF
10875 #line 10875 "configure"
10876 #include "confdefs.h"
10877 #include <sys/types.h>
10878 #include <sys/time.h>
10879 #include <time.h>
10880
10881 int
10882 main ()
10883 {
10884 if ((struct tm *) 0)
10885 return 0;
10886   ;
10887   return 0;
10888 }
10889 _ACEOF
10890 rm -f conftest.$ac_objext
10891 if { (eval echo "$as_me:10891: \"$ac_compile\"") >&5
10892   (eval $ac_compile) 2>&5
10893   ac_status=$?
10894   echo "$as_me:10894: \$? = $ac_status" >&5
10895   (exit $ac_status); } &&
10896          { ac_try='test -s conftest.$ac_objext'
10897   { (eval echo "$as_me:10897: \"$ac_try\"") >&5
10898   (eval $ac_try) 2>&5
10899   ac_status=$?
10900   echo "$as_me:10900: \$? = $ac_status" >&5
10901   (exit $ac_status); }; }; then
10902   ac_cv_header_time=yes
10903 else
10904   echo "$as_me: failed program was:" >&5
10905 cat conftest.$ac_ext >&5
10906 ac_cv_header_time=no
10907 fi
10908 rm -f conftest.$ac_objext conftest.$ac_ext
10909 fi
10910 echo "$as_me:10910: result: $ac_cv_header_time" >&5
10911 echo "${ECHO_T}$ac_cv_header_time" >&6
10912 if test $ac_cv_header_time = yes; then
10913
10914 cat >>confdefs.h <<\EOF
10915 #define TIME_WITH_SYS_TIME 1
10916 EOF
10917
10918 fi
10919
10920 ###     checks for compiler characteristics
10921 ac_ext=c
10922 ac_cpp='$CPP $CPPFLAGS'
10923 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10924 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10925 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10926 ac_main_return=return
10927
10928 echo "$as_me:10928: checking for an ANSI C-conforming const" >&5
10929 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
10930 if test "${ac_cv_c_const+set}" = set; then
10931   echo $ECHO_N "(cached) $ECHO_C" >&6
10932 else
10933   cat >conftest.$ac_ext <<_ACEOF
10934 #line 10934 "configure"
10935 #include "confdefs.h"
10936
10937 int
10938 main ()
10939 {
10940 /* FIXME: Include the comments suggested by Paul. */
10941 #ifndef __cplusplus
10942   /* Ultrix mips cc rejects this.  */
10943   typedef int charset[2];
10944   const charset x;
10945   /* SunOS 4.1.1 cc rejects this.  */
10946   char const *const *ccp;
10947   char **p;
10948   /* NEC SVR4.0.2 mips cc rejects this.  */
10949   struct point {int x, y;};
10950   static struct point const zero = {0,0};
10951   /* AIX XL C 1.02.0.0 rejects this.
10952      It does not let you subtract one const X* pointer from another in
10953      an arm of an if-expression whose if-part is not a constant
10954      expression */
10955   const char *g = "string";
10956   ccp = &g + (g ? g-g : 0);
10957   /* HPUX 7.0 cc rejects these. */
10958   ++ccp;
10959   p = (char**) ccp;
10960   ccp = (char const *const *) p;
10961   { /* SCO 3.2v4 cc rejects this.  */
10962     char *t;
10963     char const *s = 0 ? (char *) 0 : (char const *) 0;
10964
10965     *t++ = 0;
10966   }
10967   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10968     int x[] = {25, 17};
10969     const int *foo = &x[0];
10970     ++foo;
10971   }
10972   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10973     typedef const int *iptr;
10974     iptr p = 0;
10975     ++p;
10976   }
10977   { /* AIX XL C 1.02.0.0 rejects this saying
10978        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10979     struct s { int j; const int *ap[3]; };
10980     struct s *b; b->j = 5;
10981   }
10982   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10983     const int foo = 10;
10984   }
10985 #endif
10986
10987   ;
10988   return 0;
10989 }
10990 _ACEOF
10991 rm -f conftest.$ac_objext
10992 if { (eval echo "$as_me:10992: \"$ac_compile\"") >&5
10993   (eval $ac_compile) 2>&5
10994   ac_status=$?
10995   echo "$as_me:10995: \$? = $ac_status" >&5
10996   (exit $ac_status); } &&
10997          { ac_try='test -s conftest.$ac_objext'
10998   { (eval echo "$as_me:10998: \"$ac_try\"") >&5
10999   (eval $ac_try) 2>&5
11000   ac_status=$?
11001   echo "$as_me:11001: \$? = $ac_status" >&5
11002   (exit $ac_status); }; }; then
11003   ac_cv_c_const=yes
11004 else
11005   echo "$as_me: failed program was:" >&5
11006 cat conftest.$ac_ext >&5
11007 ac_cv_c_const=no
11008 fi
11009 rm -f conftest.$ac_objext conftest.$ac_ext
11010 fi
11011 echo "$as_me:11011: result: $ac_cv_c_const" >&5
11012 echo "${ECHO_T}$ac_cv_c_const" >&6
11013 if test $ac_cv_c_const = no; then
11014
11015 cat >>confdefs.h <<\EOF
11016 #define const
11017 EOF
11018
11019 fi
11020
11021 ###     Checks for external-data
11022
11023 echo "$as_me:11023: checking if data-only library module links" >&5
11024 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
11025 if test "${cf_cv_link_dataonly+set}" = set; then
11026   echo $ECHO_N "(cached) $ECHO_C" >&6
11027 else
11028
11029         rm -f conftest.a
11030         cat >conftest.$ac_ext <<EOF
11031 #line 11031 "configure"
11032 int     testdata[3] = { 123, 456, 789 };
11033 EOF
11034         if { (eval echo "$as_me:11034: \"$ac_compile\"") >&5
11035   (eval $ac_compile) 2>&5
11036   ac_status=$?
11037   echo "$as_me:11037: \$? = $ac_status" >&5
11038   (exit $ac_status); } ; then
11039                 mv conftest.o data.o && \
11040                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
11041         fi
11042         rm -f conftest.$ac_ext data.o
11043         cat >conftest.$ac_ext <<EOF
11044 #line 11044 "configure"
11045 int     testfunc()
11046 {
11047 #if defined(NeXT)
11048         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
11049 #else
11050         extern int testdata[3];
11051         return testdata[0] == 123
11052            &&  testdata[1] == 456
11053            &&  testdata[2] == 789;
11054 #endif
11055 }
11056 EOF
11057         if { (eval echo "$as_me:11057: \"$ac_compile\"") >&5
11058   (eval $ac_compile) 2>&5
11059   ac_status=$?
11060   echo "$as_me:11060: \$? = $ac_status" >&5
11061   (exit $ac_status); }; then
11062                 mv conftest.o func.o && \
11063                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
11064         fi
11065         rm -f conftest.$ac_ext func.o
11066         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
11067         cf_saveLIBS="$LIBS"
11068         LIBS="conftest.a $LIBS"
11069         if test "$cross_compiling" = yes; then
11070   cf_cv_link_dataonly=unknown
11071 else
11072   cat >conftest.$ac_ext <<_ACEOF
11073 #line 11073 "configure"
11074 #include "confdefs.h"
11075
11076         int main()
11077         {
11078                 extern int testfunc();
11079                 ${cf_cv_main_return:-return} (!testfunc());
11080         }
11081
11082 _ACEOF
11083 rm -f conftest$ac_exeext
11084 if { (eval echo "$as_me:11084: \"$ac_link\"") >&5
11085   (eval $ac_link) 2>&5
11086   ac_status=$?
11087   echo "$as_me:11087: \$? = $ac_status" >&5
11088   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11089   { (eval echo "$as_me:11089: \"$ac_try\"") >&5
11090   (eval $ac_try) 2>&5
11091   ac_status=$?
11092   echo "$as_me:11092: \$? = $ac_status" >&5
11093   (exit $ac_status); }; }; then
11094   cf_cv_link_dataonly=yes
11095 else
11096   echo "$as_me: program exited with status $ac_status" >&5
11097 echo "$as_me: failed program was:" >&5
11098 cat conftest.$ac_ext >&5
11099 cf_cv_link_dataonly=no
11100 fi
11101 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11102 fi
11103         LIBS="$cf_saveLIBS"
11104
11105 fi
11106
11107 echo "$as_me:11107: result: $cf_cv_link_dataonly" >&5
11108 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
11109
11110 if test "$cf_cv_link_dataonly" = no ; then
11111
11112 cat >>confdefs.h <<\EOF
11113 #define BROKEN_LINKER 1
11114 EOF
11115
11116         BROKEN_LINKER=1
11117 fi
11118
11119 ###     Checks for library functions.
11120
11121 echo "$as_me:11121: checking for working mkstemp" >&5
11122 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
11123 if test "${cf_cv_func_mkstemp+set}" = set; then
11124   echo $ECHO_N "(cached) $ECHO_C" >&6
11125 else
11126
11127 rm -rf conftest*
11128 if test "$cross_compiling" = yes; then
11129   cf_cv_func_mkstemp=maybe
11130 else
11131   cat >conftest.$ac_ext <<_ACEOF
11132 #line 11132 "configure"
11133 #include "confdefs.h"
11134
11135 #include <sys/types.h>
11136 #include <stdlib.h>
11137 #include <stdio.h>
11138 #include <string.h>
11139 #include <sys/stat.h>
11140 int main()
11141 {
11142         char *tmpl = "conftestXXXXXX";
11143         char name[2][80];
11144         int n;
11145         int result = 0;
11146         int fd;
11147         struct stat sb;
11148
11149         umask(077);
11150         for (n = 0; n < 2; ++n) {
11151                 strcpy(name[n], tmpl);
11152                 if ((fd = mkstemp(name[n])) >= 0) {
11153                         if (!strcmp(name[n], tmpl)
11154                          || stat(name[n], &sb) != 0
11155                          || (sb.st_mode & S_IFMT) != S_IFREG
11156                          || (sb.st_mode & 077) != 0) {
11157                                 result = 1;
11158                         }
11159                         close(fd);
11160                 }
11161         }
11162         if (result == 0
11163          && !strcmp(name[0], name[1]))
11164                 result = 1;
11165         ${cf_cv_main_return:-return}(result);
11166 }
11167
11168 _ACEOF
11169 rm -f conftest$ac_exeext
11170 if { (eval echo "$as_me:11170: \"$ac_link\"") >&5
11171   (eval $ac_link) 2>&5
11172   ac_status=$?
11173   echo "$as_me:11173: \$? = $ac_status" >&5
11174   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11175   { (eval echo "$as_me:11175: \"$ac_try\"") >&5
11176   (eval $ac_try) 2>&5
11177   ac_status=$?
11178   echo "$as_me:11178: \$? = $ac_status" >&5
11179   (exit $ac_status); }; }; then
11180   cf_cv_func_mkstemp=yes
11181
11182 else
11183   echo "$as_me: program exited with status $ac_status" >&5
11184 echo "$as_me: failed program was:" >&5
11185 cat conftest.$ac_ext >&5
11186 cf_cv_func_mkstemp=no
11187
11188 fi
11189 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11190 fi
11191
11192 fi
11193 echo "$as_me:11193: result: $cf_cv_func_mkstemp" >&5
11194 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
11195 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
11196         echo "$as_me:11196: checking for mkstemp" >&5
11197 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
11198 if test "${ac_cv_func_mkstemp+set}" = set; then
11199   echo $ECHO_N "(cached) $ECHO_C" >&6
11200 else
11201   cat >conftest.$ac_ext <<_ACEOF
11202 #line 11202 "configure"
11203 #include "confdefs.h"
11204 /* System header to define __stub macros and hopefully few prototypes,
11205     which can conflict with char mkstemp (); below.  */
11206 #include <assert.h>
11207 /* Override any gcc2 internal prototype to avoid an error.  */
11208 #ifdef __cplusplus
11209 extern "C"
11210 #endif
11211 /* We use char because int might match the return type of a gcc2
11212    builtin and then its argument prototype would still apply.  */
11213 char mkstemp ();
11214 char (*f) ();
11215
11216 int
11217 main ()
11218 {
11219 /* The GNU C library defines this for functions which it implements
11220     to always fail with ENOSYS.  Some functions are actually named
11221     something starting with __ and the normal name is an alias.  */
11222 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
11223 choke me
11224 #else
11225 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11226 #endif
11227
11228   ;
11229   return 0;
11230 }
11231 _ACEOF
11232 rm -f conftest.$ac_objext conftest$ac_exeext
11233 if { (eval echo "$as_me:11233: \"$ac_link\"") >&5
11234   (eval $ac_link) 2>&5
11235   ac_status=$?
11236   echo "$as_me:11236: \$? = $ac_status" >&5
11237   (exit $ac_status); } &&
11238          { ac_try='test -s conftest$ac_exeext'
11239   { (eval echo "$as_me:11239: \"$ac_try\"") >&5
11240   (eval $ac_try) 2>&5
11241   ac_status=$?
11242   echo "$as_me:11242: \$? = $ac_status" >&5
11243   (exit $ac_status); }; }; then
11244   ac_cv_func_mkstemp=yes
11245 else
11246   echo "$as_me: failed program was:" >&5
11247 cat conftest.$ac_ext >&5
11248 ac_cv_func_mkstemp=no
11249 fi
11250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11251 fi
11252 echo "$as_me:11252: result: $ac_cv_func_mkstemp" >&5
11253 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
11254
11255 fi
11256 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
11257
11258 cat >>confdefs.h <<\EOF
11259 #define HAVE_MKSTEMP 1
11260 EOF
11261
11262 fi
11263
11264 echo "$as_me:11264: checking return type of signal handlers" >&5
11265 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
11266 if test "${ac_cv_type_signal+set}" = set; then
11267   echo $ECHO_N "(cached) $ECHO_C" >&6
11268 else
11269   cat >conftest.$ac_ext <<_ACEOF
11270 #line 11270 "configure"
11271 #include "confdefs.h"
11272 #include <sys/types.h>
11273 #include <signal.h>
11274 #ifdef signal
11275 # undef signal
11276 #endif
11277 #ifdef __cplusplus
11278 extern "C" void (*signal (int, void (*)(int)))(int);
11279 #else
11280 void (*signal ()) ();
11281 #endif
11282
11283 int
11284 main ()
11285 {
11286 int i;
11287   ;
11288   return 0;
11289 }
11290 _ACEOF
11291 rm -f conftest.$ac_objext
11292 if { (eval echo "$as_me:11292: \"$ac_compile\"") >&5
11293   (eval $ac_compile) 2>&5
11294   ac_status=$?
11295   echo "$as_me:11295: \$? = $ac_status" >&5
11296   (exit $ac_status); } &&
11297          { ac_try='test -s conftest.$ac_objext'
11298   { (eval echo "$as_me:11298: \"$ac_try\"") >&5
11299   (eval $ac_try) 2>&5
11300   ac_status=$?
11301   echo "$as_me:11301: \$? = $ac_status" >&5
11302   (exit $ac_status); }; }; then
11303   ac_cv_type_signal=void
11304 else
11305   echo "$as_me: failed program was:" >&5
11306 cat conftest.$ac_ext >&5
11307 ac_cv_type_signal=int
11308 fi
11309 rm -f conftest.$ac_objext conftest.$ac_ext
11310 fi
11311 echo "$as_me:11311: result: $ac_cv_type_signal" >&5
11312 echo "${ECHO_T}$ac_cv_type_signal" >&6
11313
11314 cat >>confdefs.h <<EOF
11315 #define RETSIGTYPE $ac_cv_type_signal
11316 EOF
11317
11318 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
11319         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11320         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11321 fi
11322
11323 cf_with_ada=yes
11324 if test "$cf_with_ada" != "no" ; then
11325
11326 cf_ada_make=gnatmake
11327 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
11328 set dummy $cf_ada_make; ac_word=$2
11329 echo "$as_me:11329: checking for $ac_word" >&5
11330 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11331 if test "${ac_cv_prog_gnat_exists+set}" = set; then
11332   echo $ECHO_N "(cached) $ECHO_C" >&6
11333 else
11334   if test -n "$gnat_exists"; then
11335   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
11336 else
11337   ac_save_IFS=$IFS; IFS=$ac_path_separator
11338 ac_dummy="$PATH"
11339 for ac_dir in $ac_dummy; do
11340   IFS=$ac_save_IFS
11341   test -z "$ac_dir" && ac_dir=.
11342   $as_executable_p "$ac_dir/$ac_word" || continue
11343 ac_cv_prog_gnat_exists="yes"
11344 echo "$as_me:11344: found $ac_dir/$ac_word" >&5
11345 break
11346 done
11347
11348   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
11349 fi
11350 fi
11351 gnat_exists=$ac_cv_prog_gnat_exists
11352 if test -n "$gnat_exists"; then
11353   echo "$as_me:11353: result: $gnat_exists" >&5
11354 echo "${ECHO_T}$gnat_exists" >&6
11355 else
11356   echo "$as_me:11356: result: no" >&5
11357 echo "${ECHO_T}no" >&6
11358 fi
11359
11360 if test "$ac_cv_prog_gnat_exists" = no; then
11361    cf_ada_make=
11362    cf_cv_prog_gnat_correct=no
11363 else
11364
11365 echo "$as_me:11365: checking for gnat version" >&5
11366 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
11367 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
11368         grep '[0-9].[0-9][0-9]*' |\
11369     sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
11370 echo "$as_me:11370: result: $cf_gnat_version" >&5
11371 echo "${ECHO_T}$cf_gnat_version" >&6
11372
11373 case $cf_gnat_version in #(vi
11374 3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9]) #(vi
11375         cf_cv_prog_gnat_correct=yes
11376         ;;
11377 *)
11378         { echo "$as_me:11378: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
11379 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
11380         cf_cv_prog_gnat_correct=no
11381         ;;
11382 esac
11383
11384    # Extract the first word of "m4", so it can be a program name with args.
11385 set dummy m4; ac_word=$2
11386 echo "$as_me:11386: checking for $ac_word" >&5
11387 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11388 if test "${ac_cv_prog_M4_exists+set}" = set; then
11389   echo $ECHO_N "(cached) $ECHO_C" >&6
11390 else
11391   if test -n "$M4_exists"; then
11392   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
11393 else
11394   ac_save_IFS=$IFS; IFS=$ac_path_separator
11395 ac_dummy="$PATH"
11396 for ac_dir in $ac_dummy; do
11397   IFS=$ac_save_IFS
11398   test -z "$ac_dir" && ac_dir=.
11399   $as_executable_p "$ac_dir/$ac_word" || continue
11400 ac_cv_prog_M4_exists="yes"
11401 echo "$as_me:11401: found $ac_dir/$ac_word" >&5
11402 break
11403 done
11404
11405   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
11406 fi
11407 fi
11408 M4_exists=$ac_cv_prog_M4_exists
11409 if test -n "$M4_exists"; then
11410   echo "$as_me:11410: result: $M4_exists" >&5
11411 echo "${ECHO_T}$M4_exists" >&6
11412 else
11413   echo "$as_me:11413: result: no" >&5
11414 echo "${ECHO_T}no" >&6
11415 fi
11416
11417    if test "$ac_cv_prog_M4_exists" = no; then
11418       cf_cv_prog_gnat_correct=no
11419       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
11420    fi
11421    if test "$cf_cv_prog_gnat_correct" = yes; then
11422       echo "$as_me:11422: checking if GNAT works" >&5
11423 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
11424
11425 rm -rf conftest* *~conftest*
11426 cat >>conftest.ads <<CF_EOF
11427 procedure conftest;
11428 CF_EOF
11429 cat >>conftest.adb <<CF_EOF
11430 with Text_IO;
11431 with GNAT.OS_Lib;
11432 procedure conftest is
11433 begin
11434    Text_IO.Put ("Hello World");
11435    Text_IO.New_Line;
11436    GNAT.OS_Lib.OS_Exit (0);
11437 end conftest;
11438 CF_EOF
11439 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11440    if ( ./conftest 1>&5 2>&1 ) ; then
11441       cf_cv_prog_gnat_correct=yes
11442    else
11443       cf_cv_prog_gnat_correct=no
11444    fi
11445 else
11446    cf_cv_prog_gnat_correct=no
11447 fi
11448 rm -rf conftest* *~conftest*
11449
11450       echo "$as_me:11450: result: $cf_cv_prog_gnat_correct" >&5
11451 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
11452    fi
11453 fi
11454
11455         if test "$cf_cv_prog_gnat_correct" = yes; then
11456
11457         echo "$as_me:11457: checking optimization options for ADAFLAGS" >&5
11458 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
11459         case "$CFLAGS" in
11460         *-g*)
11461
11462         ADAFLAGS="$ADAFLAGS -g"
11463
11464                 ;;
11465         esac
11466         case "$CFLAGS" in
11467         *-O*)
11468                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
11469
11470         ADAFLAGS="$ADAFLAGS $cf_O_flag"
11471
11472                 ;;
11473         esac
11474         echo "$as_me:11474: result: $ADAFLAGS" >&5
11475 echo "${ECHO_T}$ADAFLAGS" >&6
11476
11477 echo "$as_me:11477: checking if GNAT supports generics" >&5
11478 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
11479 case $cf_gnat_version in #(vi
11480 3.[1-9]*|[4-9].*) #(vi
11481         cf_gnat_generics=yes
11482         ;;
11483 *)
11484         cf_gnat_generics=no
11485         ;;
11486 esac
11487 echo "$as_me:11487: result: $cf_gnat_generics" >&5
11488 echo "${ECHO_T}$cf_gnat_generics" >&6
11489
11490 if test "$cf_gnat_generics" = yes
11491 then
11492         cf_compile_generics=generics
11493         cf_generic_objects="\${GENOBJS}"
11494 else
11495         cf_compile_generics=
11496         cf_generic_objects=
11497 fi
11498
11499 echo "$as_me:11499: checking if GNAT supports SIGINT" >&5
11500 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
11501 if test "${cf_cv_gnat_sigint+set}" = set; then
11502   echo $ECHO_N "(cached) $ECHO_C" >&6
11503 else
11504
11505 rm -rf conftest* *~conftest*
11506 cat >>conftest.ads <<CF_EOF
11507 with Ada.Interrupts.Names;
11508
11509 package ConfTest is
11510
11511    pragma Warnings (Off);  --  the next pragma exists since 3.11p
11512    pragma Unreserve_All_Interrupts;
11513    pragma Warnings (On);
11514
11515    protected Process is
11516       procedure Stop;
11517       function Continue return Boolean;
11518       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
11519    private
11520       Done : Boolean := False;
11521    end Process;
11522
11523 end ConfTest;
11524 CF_EOF
11525 cat >>conftest.adb <<CF_EOF
11526 package body ConfTest is
11527    protected body Process is
11528       procedure Stop is
11529       begin
11530          Done := True;
11531       end Stop;
11532       function Continue return Boolean is
11533       begin
11534          return not Done;
11535       end Continue;
11536    end Process;
11537 end ConfTest;
11538 CF_EOF
11539 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11540       cf_cv_gnat_sigint=yes
11541 else
11542    cf_cv_gnat_sigint=no
11543 fi
11544 rm -rf conftest* *~conftest*
11545
11546 fi
11547 echo "$as_me:11547: result: $cf_cv_gnat_sigint" >&5
11548 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
11549
11550 if test $cf_cv_gnat_sigint = yes ; then
11551         USE_GNAT_SIGINT=""
11552 else
11553         USE_GNAT_SIGINT="#"
11554 fi
11555
11556 echo "$as_me:11556: checking if GNAT pragma Unreferenced works" >&5
11557 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
11558 if test "${cf_cv_pragma_unreferenced+set}" = set; then
11559   echo $ECHO_N "(cached) $ECHO_C" >&6
11560 else
11561
11562 rm -rf conftest* *~conftest*
11563 cat >>conftest.ads <<CF_EOF
11564 procedure conftest;
11565 CF_EOF
11566 cat >>conftest.adb <<CF_EOF
11567 with Text_IO;
11568 with GNAT.OS_Lib;
11569 procedure conftest is
11570    test : Integer;
11571    pragma Unreferenced (test);
11572 begin
11573    test := 1;
11574    Text_IO.Put ("Hello World");
11575    Text_IO.New_Line;
11576    GNAT.OS_Lib.OS_Exit (0);
11577 end conftest;
11578 CF_EOF
11579 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11580       cf_cv_pragma_unreferenced=yes
11581 else
11582    cf_cv_pragma_unreferenced=no
11583 fi
11584 rm -rf conftest* *~conftest*
11585
11586 fi
11587 echo "$as_me:11587: result: $cf_cv_pragma_unreferenced" >&5
11588 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
11589
11590 # if the pragma is supported, use it (needed in the Trace code).
11591 if test $cf_cv_pragma_unreferenced = yes ; then
11592         PRAGMA_UNREF=TRUE
11593 else
11594         PRAGMA_UNREF=FALSE
11595 fi
11596
11597 cf_gnat_libraries=no
11598 cf_gnat_projects=no
11599
11600 echo "$as_me:11600: checking if GNAT supports project files" >&5
11601 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
11602 case $cf_gnat_version in #(vi
11603 3.[0-9]*) #(vi
11604         ;;
11605 *)
11606         case $cf_cv_system_name in #(vi
11607         cygwin*) #(vi
11608                 ;;
11609         *)
11610                 mkdir conftest.src conftest.bin conftest.lib
11611                 cd conftest.src
11612                 rm -rf conftest* *~conftest*
11613                 cat >>library.gpr <<CF_EOF
11614 project Library is
11615   Kind := External ("LIB_KIND");
11616   for Library_Name use "ConfTest";
11617   for Object_Dir use ".";
11618   for Library_ALI_Dir use External("LIBRARY_DIR");
11619   for Library_Version use External ("SONAME");
11620   for Library_Kind use Kind;
11621   for Library_Dir use External("BUILD_DIR");
11622   Source_Dir := External ("SOURCE_DIR");
11623   for Source_Dirs use (Source_Dir);
11624   package Compiler is
11625      for Default_Switches ("Ada") use
11626        ("-g",
11627         "-O2",
11628         "-gnatafno",
11629         "-gnatVa",   -- All validity checks
11630         "-gnatwa");  -- Activate all optional errors
11631   end Compiler;
11632 end Library;
11633 CF_EOF
11634                 cat >>confpackage.ads <<CF_EOF
11635 package ConfPackage is
11636    procedure conftest;
11637 end ConfPackage;
11638 CF_EOF
11639                 cat >>confpackage.adb <<CF_EOF
11640 with Text_IO;
11641 package body ConfPackage is
11642    procedure conftest is
11643    begin
11644       Text_IO.Put ("Hello World");
11645       Text_IO.New_Line;
11646    end conftest;
11647 end ConfPackage;
11648 CF_EOF
11649                 if ( $cf_ada_make $ADAFLAGS \
11650                                 -Plibrary.gpr \
11651                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
11652                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
11653                                 -XSOURCE_DIR=`pwd` \
11654                                 -XSONAME=libConfTest.so.1 \
11655                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
11656                         cf_gnat_projects=yes
11657                 fi
11658                 cd ..
11659                 if test -f conftest.lib/confpackage.ali
11660                 then
11661                         cf_gnat_libraries=yes
11662                 fi
11663                 rm -rf conftest* *~conftest*
11664                 ;;
11665         esac
11666         ;;
11667 esac
11668 echo "$as_me:11668: result: $cf_gnat_projects" >&5
11669 echo "${ECHO_T}$cf_gnat_projects" >&6
11670
11671 if test $cf_gnat_projects = yes
11672 then
11673         echo "$as_me:11673: checking if GNAT supports libraries" >&5
11674 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
11675         echo "$as_me:11675: result: $cf_gnat_libraries" >&5
11676 echo "${ECHO_T}$cf_gnat_libraries" >&6
11677 fi
11678
11679 if test "$cf_gnat_projects" = yes
11680 then
11681         USE_OLD_MAKERULES="#"
11682         USE_GNAT_PROJECTS=""
11683 else
11684         USE_OLD_MAKERULES=""
11685         USE_GNAT_PROJECTS="#"
11686 fi
11687
11688 if test "$cf_gnat_libraries" = yes
11689 then
11690         USE_GNAT_LIBRARIES=""
11691 else
11692         USE_GNAT_LIBRARIES="#"
11693 fi
11694
11695 echo "$as_me:11695: checking for ada-compiler" >&5
11696 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
11697
11698 # Check whether --with-ada-compiler or --without-ada-compiler was given.
11699 if test "${with_ada_compiler+set}" = set; then
11700   withval="$with_ada_compiler"
11701   cf_ada_compiler=$withval
11702 else
11703   cf_ada_compiler=gnatmake
11704 fi;
11705
11706 echo "$as_me:11706: result: $cf_ada_compiler" >&5
11707 echo "${ECHO_T}$cf_ada_compiler" >&6
11708
11709                 cf_ada_package=terminal_interface
11710
11711 echo "$as_me:11711: checking for ada-include" >&5
11712 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
11713
11714 # Check whether --with-ada-include or --without-ada-include was given.
11715 if test "${with_ada_include+set}" = set; then
11716   withval="$with_ada_include"
11717
11718 else
11719   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
11720 fi; if test -n "$prefix/share/ada/adainclude" ; then
11721
11722 if test "x$prefix" != xNONE; then
11723   cf_path_syntax="$prefix"
11724 else
11725   cf_path_syntax="$ac_default_prefix"
11726 fi
11727
11728 case ".$withval" in #(vi
11729 .\$\(*\)*|.\'*\'*) #(vi
11730   ;;
11731 ..|./*|.\\*) #(vi
11732   ;;
11733 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11734   ;;
11735 .\${*prefix}*|.\${*dir}*) #(vi
11736   eval withval="$withval"
11737   case ".$withval" in #(vi
11738   .NONE/*)
11739     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11740     ;;
11741   esac
11742   ;; #(vi
11743 .no|.NONE/*)
11744   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11745   ;;
11746 *)
11747   { { echo "$as_me:11747: error: expected a pathname, not \"$withval\"" >&5
11748 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11749    { (exit 1); exit 1; }; }
11750   ;;
11751 esac
11752
11753 fi
11754 eval ADA_INCLUDE="$withval"
11755
11756 echo "$as_me:11756: result: $ADA_INCLUDE" >&5
11757 echo "${ECHO_T}$ADA_INCLUDE" >&6
11758
11759 echo "$as_me:11759: checking for ada-objects" >&5
11760 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
11761
11762 # Check whether --with-ada-objects or --without-ada-objects was given.
11763 if test "${with_ada_objects+set}" = set; then
11764   withval="$with_ada_objects"
11765
11766 else
11767   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
11768 fi; if test -n "$prefix/lib/ada/adalib" ; then
11769
11770 if test "x$prefix" != xNONE; then
11771   cf_path_syntax="$prefix"
11772 else
11773   cf_path_syntax="$ac_default_prefix"
11774 fi
11775
11776 case ".$withval" in #(vi
11777 .\$\(*\)*|.\'*\'*) #(vi
11778   ;;
11779 ..|./*|.\\*) #(vi
11780   ;;
11781 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11782   ;;
11783 .\${*prefix}*|.\${*dir}*) #(vi
11784   eval withval="$withval"
11785   case ".$withval" in #(vi
11786   .NONE/*)
11787     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11788     ;;
11789   esac
11790   ;; #(vi
11791 .no|.NONE/*)
11792   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11793   ;;
11794 *)
11795   { { echo "$as_me:11795: error: expected a pathname, not \"$withval\"" >&5
11796 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11797    { (exit 1); exit 1; }; }
11798   ;;
11799 esac
11800
11801 fi
11802 eval ADA_OBJECTS="$withval"
11803
11804 echo "$as_me:11804: result: $ADA_OBJECTS" >&5
11805 echo "${ECHO_T}$ADA_OBJECTS" >&6
11806
11807 echo "$as_me:11807: checking if an Ada95 shared-library should be built" >&5
11808 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
11809
11810 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
11811 if test "${with_ada_sharedlib+set}" = set; then
11812   withval="$with_ada_sharedlib"
11813   with_ada_sharedlib=$withval
11814 else
11815   with_ada_sharedlib=no
11816 fi;
11817 echo "$as_me:11817: result: $with_ada_sharedlib" >&5
11818 echo "${ECHO_T}$with_ada_sharedlib" >&6
11819
11820 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
11821 MAKE_ADA_SHAREDLIB="#"
11822
11823 if test "x$with_ada_sharedlib" != xno
11824 then
11825         MAKE_ADA_SHAREDLIB=
11826         if test "x$with_ada_sharedlib" != xyes
11827         then
11828                 ADA_SHAREDLIB="$with_ada_sharedlib"
11829         fi
11830 fi
11831
11832         else
11833                 { { echo "$as_me:11833: error: No usable Ada compiler found" >&5
11834 echo "$as_me: error: No usable Ada compiler found" >&2;}
11835    { (exit 1); exit 1; }; }
11836         fi
11837 else
11838         { { echo "$as_me:11838: error: The Ada compiler is needed for this package" >&5
11839 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
11840    { (exit 1); exit 1; }; }
11841 fi
11842
11843 ################################################################################
11844
11845 # not needed
11846 TINFO_LDFLAGS2=
11847
11848 TINFO_LIBS=
11849
11850 ### Construct the list of include-directories to be generated
11851
11852 if test "$GCC" != yes; then
11853         CPPFLAGS="-I\${includedir} $CPPFLAGS"
11854 elif test "$includedir" != "/usr/include"; then
11855         if test "$includedir" = '${prefix}/include' ; then
11856                 if test $prefix != /usr ; then
11857                         CPPFLAGS="-I\${includedir} $CPPFLAGS"
11858                 fi
11859         else
11860                 CPPFLAGS="-I\${includedir} $CPPFLAGS"
11861         fi
11862 fi
11863 if test "$srcdir" != "."; then
11864         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
11865 fi
11866 CPPFLAGS="-I. -I../include $CPPFLAGS"
11867
11868 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
11869 if test "$srcdir" != "."; then
11870         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
11871 fi
11872 if test "$GCC" != yes; then
11873         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11874 elif test "$includedir" != "/usr/include"; then
11875         if test "$includedir" = '${prefix}/include' ; then
11876                 if test $prefix != /usr ; then
11877                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11878                 fi
11879         else
11880                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11881         fi
11882 fi
11883
11884 ### Build up pieces for makefile rules
11885 echo "$as_me:11885: checking default library suffix" >&5
11886 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
11887
11888         case $DFT_LWR_MODEL in
11889         libtool) DFT_ARG_SUFFIX=''   ;;
11890         normal)  DFT_ARG_SUFFIX=''   ;;
11891         debug)   DFT_ARG_SUFFIX='_g' ;;
11892         profile) DFT_ARG_SUFFIX='_p' ;;
11893         shared)  DFT_ARG_SUFFIX=''   ;;
11894         esac
11895         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
11896 echo "$as_me:11896: result: $DFT_ARG_SUFFIX" >&5
11897 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
11898
11899 echo "$as_me:11899: checking default library-dependency suffix" >&5
11900 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
11901
11902         case $DFT_LWR_MODEL in #(vi
11903         libtool) #(vi
11904                 DFT_LIB_SUFFIX='.la'
11905                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11906                 ;;
11907         normal) #(vi
11908                 DFT_LIB_SUFFIX='.a'
11909                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11910                 ;;
11911         debug) #(vi
11912                 DFT_LIB_SUFFIX='_g.a'
11913                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11914                 ;;
11915         profile) #(vi
11916                 DFT_LIB_SUFFIX='_p.a'
11917                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11918                 ;;
11919         shared) #(vi
11920                 case $cf_cv_system_name in
11921                 aix[5-7]*) #(vi
11922                         DFT_LIB_SUFFIX='.a'
11923                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11924                         ;;
11925                 cygwin*|mingw*) #(vi
11926                         DFT_LIB_SUFFIX='.dll'
11927                         DFT_DEP_SUFFIX='.dll.a'
11928                         ;;
11929                 darwin*) #(vi
11930                         DFT_LIB_SUFFIX='.dylib'
11931                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11932                         ;;
11933                 hpux*) #(vi
11934                         case $target in
11935                         ia64*) #(vi
11936                                 DFT_LIB_SUFFIX='.so'
11937                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11938                                 ;;
11939                         *) #(vi
11940                                 DFT_LIB_SUFFIX='.sl'
11941                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11942                                 ;;
11943                         esac
11944                         ;;
11945                 *)      DFT_LIB_SUFFIX='.so'
11946                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11947                         ;;
11948                 esac
11949         esac
11950         test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
11951         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
11952 echo "$as_me:11952: result: $DFT_DEP_SUFFIX" >&5
11953 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
11954
11955 echo "$as_me:11955: checking default object directory" >&5
11956 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
11957
11958         case $DFT_LWR_MODEL in
11959         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
11960         normal)  DFT_OBJ_SUBDIR='objects' ;;
11961         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
11962         profile) DFT_OBJ_SUBDIR='obj_p' ;;
11963         shared)
11964                 case $cf_cv_system_name in #(vi
11965                 cygwin) #(vi
11966                         DFT_OBJ_SUBDIR='objects' ;;
11967                 *)
11968                         DFT_OBJ_SUBDIR='obj_s' ;;
11969                 esac
11970         esac
11971 echo "$as_me:11971: result: $DFT_OBJ_SUBDIR" >&5
11972 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
11973
11974 ### Set up low-level terminfo dependencies for makefiles.
11975
11976 if test "$DFT_LWR_MODEL" = shared ; then
11977         case $cf_cv_system_name in #(vi
11978         cygwin*)
11979                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
11980                 ;;
11981         esac
11982 fi
11983
11984 ### Construct the list of subdirectories for which we'll customize makefiles
11985 ### with the appropriate compile-rules.
11986
11987 SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
11988
11989 cat >>confdefs.h <<EOF
11990 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
11991 EOF
11992
11993 ### Now that we're done running tests, add the compiler-warnings, if any
11994
11995 cf_fix_cppflags=no
11996 cf_new_cflags=
11997 cf_new_cppflags=
11998 cf_new_extra_cppflags=
11999
12000 for cf_add_cflags in $EXTRA_CFLAGS
12001 do
12002 case $cf_fix_cppflags in
12003 no)
12004         case $cf_add_cflags in #(vi
12005         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12006                 case $cf_add_cflags in
12007                 -D*)
12008                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12009
12010                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12011                                 && test -z "${cf_tst_cflags}" \
12012                                 && cf_fix_cppflags=yes
12013
12014                         if test $cf_fix_cppflags = yes ; then
12015                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12016                                 continue
12017                         elif test "${cf_tst_cflags}" = "\"'" ; then
12018                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12019                                 continue
12020                         fi
12021                         ;;
12022                 esac
12023                 case "$CPPFLAGS" in
12024                 *$cf_add_cflags) #(vi
12025                         ;;
12026                 *) #(vi
12027                         case $cf_add_cflags in #(vi
12028                         -D*)
12029                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12030
12031 CPPFLAGS=`echo "$CPPFLAGS" | \
12032         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12033                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12034
12035                                 ;;
12036                         esac
12037                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12038                         ;;
12039                 esac
12040                 ;;
12041         *)
12042                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12043                 ;;
12044         esac
12045         ;;
12046 yes)
12047         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12048
12049         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12050
12051         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12052                 && test -z "${cf_tst_cflags}" \
12053                 && cf_fix_cppflags=no
12054         ;;
12055 esac
12056 done
12057
12058 if test -n "$cf_new_cflags" ; then
12059
12060         CFLAGS="$CFLAGS $cf_new_cflags"
12061 fi
12062
12063 if test -n "$cf_new_cppflags" ; then
12064
12065         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12066 fi
12067
12068 if test -n "$cf_new_extra_cppflags" ; then
12069
12070         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12071 fi
12072
12073 ################################################################################
12074
12075 if test x"$enable_pc_files" = xyes ; then \
12076 SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
12077 MAKE_PC_FILES=
12078 else
12079 MAKE_PC_FILES="#"
12080 fi
12081
12082 ################################################################################
12083
12084 TEST_ARG2=
12085
12086 TEST_LIBS2=
12087
12088 NCURSES_SHLIB2="sh -c"
12089
12090 ADA_SUBDIRS="include gen src doc"
12091 if test "x$cf_with_tests" != "xno" ; then
12092         ADA_SUBDIRS="$ADA_SUBDIRS samples"
12093 fi
12094 for cf_dir in $ADA_SUBDIRS
12095 do
12096         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
12097 done
12098
12099 NCURSES_TREE="#"
12100
12101 EXTERNAL_TREE=
12102
12103 # match layout used by make-tar.sh
12104 ADAHTML_DIR=../doc/ada
12105
12106 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
12107 ac_config_commands="$ac_config_commands default"
12108 cat >confcache <<\_ACEOF
12109 # This file is a shell script that caches the results of configure
12110 # tests run on this system so they can be shared between configure
12111 # scripts and configure runs, see configure's option --config-cache.
12112 # It is not useful on other systems.  If it contains results you don't
12113 # want to keep, you may remove or edit it.
12114 #
12115 # config.status only pays attention to the cache file if you give it
12116 # the --recheck option to rerun configure.
12117 #
12118 # `ac_cv_env_foo' variables (set or unset) will be overriden when
12119 # loading this file, other *unset* `ac_cv_foo' will be assigned the
12120 # following values.
12121
12122 _ACEOF
12123
12124 # The following way of writing the cache mishandles newlines in values,
12125 # but we know of no workaround that is simple, portable, and efficient.
12126 # So, don't put newlines in cache variables' values.
12127 # Ultrix sh set writes to stderr and can't be redirected directly,
12128 # and sets the high bit in the cache file unless we assign to the vars.
12129 {
12130   (set) 2>&1 |
12131     case `(ac_space=' '; set | grep ac_space) 2>&1` in
12132     *ac_space=\ *)
12133       # `set' does not quote correctly, so add quotes (double-quote
12134       # substitution turns \\\\ into \\, and sed turns \\ into \).
12135       sed -n \
12136         "s/'/'\\\\''/g;
12137           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
12138       ;;
12139     *)
12140       # `set' quotes correctly as required by POSIX, so do not add quotes.
12141       sed -n \
12142         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
12143       ;;
12144     esac;
12145 } |
12146   sed '
12147      t clear
12148      : clear
12149      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
12150      t end
12151      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
12152      : end' >>confcache
12153 if cmp -s $cache_file confcache; then :; else
12154   if test -w $cache_file; then
12155     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
12156     cat confcache >$cache_file
12157   else
12158     echo "not updating unwritable cache $cache_file"
12159   fi
12160 fi
12161 rm -f confcache
12162
12163 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12164 # Let make expand exec_prefix.
12165 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12166
12167 # VPATH may cause trouble with some makes, so we remove $(srcdir),
12168 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
12169 # trailing colons and then remove the whole line if VPATH becomes empty
12170 # (actually we leave an empty line to preserve line numbers).
12171 if test "x$srcdir" = x.; then
12172   ac_vpsub='/^[         ]*VPATH[        ]*=/{
12173 s/:*\$(srcdir):*/:/;
12174 s/:*\${srcdir}:*/:/;
12175 s/:*@srcdir@:*/:/;
12176 s/^\([^=]*=[    ]*\):*/\1/;
12177 s/:*$//;
12178 s/^[^=]*=[      ]*$//;
12179 }'
12180 fi
12181
12182 DEFS=-DHAVE_CONFIG_H
12183
12184 : ${CONFIG_STATUS=./config.status}
12185 ac_clean_files_save=$ac_clean_files
12186 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
12187 { echo "$as_me:12187: creating $CONFIG_STATUS" >&5
12188 echo "$as_me: creating $CONFIG_STATUS" >&6;}
12189 cat >$CONFIG_STATUS <<_ACEOF
12190 #! $SHELL
12191 # Generated automatically by configure.
12192 # Run this file to recreate the current configuration.
12193 # Compiler output produced by configure, useful for debugging
12194 # configure, is in config.log if it exists.
12195
12196 debug=false
12197 SHELL=\${CONFIG_SHELL-$SHELL}
12198 ac_cs_invocation="\$0 \$@"
12199
12200 _ACEOF
12201
12202 cat >>$CONFIG_STATUS <<\_ACEOF
12203 # Be Bourne compatible
12204 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
12205   emulate sh
12206   NULLCMD=:
12207 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
12208   set -o posix
12209 fi
12210
12211 # Name of the executable.
12212 as_me=`echo "$0" |sed 's,.*[\\/],,'`
12213
12214 if expr a : '\(a\)' >/dev/null 2>&1; then
12215   as_expr=expr
12216 else
12217   as_expr=false
12218 fi
12219
12220 rm -f conf$$ conf$$.exe conf$$.file
12221 echo >conf$$.file
12222 if ln -s conf$$.file conf$$ 2>/dev/null; then
12223   # We could just check for DJGPP; but this test a) works b) is more generic
12224   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
12225   if test -f conf$$.exe; then
12226     # Don't use ln at all; we don't have any links
12227     as_ln_s='cp -p'
12228   else
12229     as_ln_s='ln -s'
12230   fi
12231 elif ln conf$$.file conf$$ 2>/dev/null; then
12232   as_ln_s=ln
12233 else
12234   as_ln_s='cp -p'
12235 fi
12236 rm -f conf$$ conf$$.exe conf$$.file
12237
12238 as_executable_p="test -f"
12239
12240 # Support unset when possible.
12241 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
12242   as_unset=unset
12243 else
12244   as_unset=false
12245 fi
12246
12247 # NLS nuisances.
12248 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
12249 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
12250 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
12251 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
12252 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
12253 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
12254 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
12255 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
12256
12257 # IFS
12258 # We need space, tab and new line, in precisely that order.
12259 as_nl='
12260 '
12261 IFS="   $as_nl"
12262
12263 # CDPATH.
12264 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
12265
12266 exec 6>&1
12267
12268 _ACEOF
12269
12270 # Files that config.status was made for.
12271 if test -n "$ac_config_files"; then
12272   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
12273 fi
12274
12275 if test -n "$ac_config_headers"; then
12276   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
12277 fi
12278
12279 if test -n "$ac_config_links"; then
12280   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
12281 fi
12282
12283 if test -n "$ac_config_commands"; then
12284   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
12285 fi
12286
12287 cat >>$CONFIG_STATUS <<\EOF
12288
12289 ac_cs_usage="\
12290 \`$as_me' instantiates files from templates according to the
12291 current configuration.
12292
12293 Usage: $0 [OPTIONS] [FILE]...
12294
12295   -h, --help       print this help, then exit
12296   -V, --version    print version number, then exit
12297   -d, --debug      don't remove temporary files
12298       --recheck    update $as_me by reconfiguring in the same conditions
12299   --file=FILE[:TEMPLATE]
12300                    instantiate the configuration file FILE
12301   --header=FILE[:TEMPLATE]
12302                    instantiate the configuration header FILE
12303
12304 Configuration files:
12305 $config_files
12306
12307 Configuration headers:
12308 $config_headers
12309
12310 Configuration commands:
12311 $config_commands
12312
12313 Report bugs to <dickey@invisible-island.net>."
12314 EOF
12315
12316 cat >>$CONFIG_STATUS <<EOF
12317 ac_cs_version="\\
12318 config.status
12319 configured by $0, generated by GNU Autoconf 2.52.20121002,
12320   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
12321
12322 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
12323 Free Software Foundation, Inc.
12324 This config.status script is free software; the Free Software Foundation
12325 gives unlimited permission to copy, distribute and modify it."
12326 srcdir=$srcdir
12327 INSTALL="$INSTALL"
12328 EOF
12329
12330 cat >>$CONFIG_STATUS <<\EOF
12331 # If no file are specified by the user, then we need to provide default
12332 # value.  By we need to know if files were specified by the user.
12333 ac_need_defaults=:
12334 while test $# != 0
12335 do
12336   case $1 in
12337   --*=*)
12338     ac_option=`expr "x$1" : 'x\([^=]*\)='`
12339     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
12340     shift
12341     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
12342     shift
12343     ;;
12344   -*);;
12345   *) # This is not an option, so the user has probably given explicit
12346      # arguments.
12347      ac_need_defaults=false;;
12348   esac
12349
12350   case $1 in
12351   # Handling of the options.
12352 EOF
12353 cat >>$CONFIG_STATUS <<EOF
12354   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12355     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
12356     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
12357 EOF
12358 cat >>$CONFIG_STATUS <<\EOF
12359   --version | --vers* | -V )
12360     echo "$ac_cs_version"; exit 0 ;;
12361   --he | --h)
12362     # Conflict between --help and --header
12363     { { echo "$as_me:12363: error: ambiguous option: $1
12364 Try \`$0 --help' for more information." >&5
12365 echo "$as_me: error: ambiguous option: $1
12366 Try \`$0 --help' for more information." >&2;}
12367    { (exit 1); exit 1; }; };;
12368   --help | --hel | -h )
12369     echo "$ac_cs_usage"; exit 0 ;;
12370   --debug | --d* | -d )
12371     debug=: ;;
12372   --file | --fil | --fi | --f )
12373     shift
12374     CONFIG_FILES="$CONFIG_FILES $1"
12375     ac_need_defaults=false;;
12376   --header | --heade | --head | --hea )
12377     shift
12378     CONFIG_HEADERS="$CONFIG_HEADERS $1"
12379     ac_need_defaults=false;;
12380
12381   # This is an error.
12382   -*) { { echo "$as_me:12382: error: unrecognized option: $1
12383 Try \`$0 --help' for more information." >&5
12384 echo "$as_me: error: unrecognized option: $1
12385 Try \`$0 --help' for more information." >&2;}
12386    { (exit 1); exit 1; }; } ;;
12387
12388   *) ac_config_targets="$ac_config_targets $1" ;;
12389
12390   esac
12391   shift
12392 done
12393
12394 exec 5>>config.log
12395 cat >&5 << _ACEOF
12396
12397 ## ----------------------- ##
12398 ## Running config.status.  ##
12399 ## ----------------------- ##
12400
12401 This file was extended by $as_me 2.52.20121002, executed with
12402   CONFIG_FILES    = $CONFIG_FILES
12403   CONFIG_HEADERS  = $CONFIG_HEADERS
12404   CONFIG_LINKS    = $CONFIG_LINKS
12405   CONFIG_COMMANDS = $CONFIG_COMMANDS
12406   > $ac_cs_invocation
12407 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12408
12409 _ACEOF
12410 EOF
12411
12412 cat >>$CONFIG_STATUS <<EOF
12413 #
12414 # INIT-COMMANDS section.
12415 #
12416
12417 ### Special initialization commands, used to pass information from the
12418 ### configuration-run into config.status
12419
12420 AWK="$AWK"
12421 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
12422 DFT_LWR_MODEL="$DFT_LWR_MODEL"
12423 LIB_NAME="$LIB_NAME"
12424 LIB_PREFIX="$LIB_PREFIX"
12425 LIB_SUFFIX="$LIB_SUFFIX"
12426 LN_S="$LN_S"
12427 NCURSES_MAJOR="$NCURSES_MAJOR"
12428 NCURSES_MINOR="$NCURSES_MINOR"
12429 NCURSES_PATCH="$NCURSES_PATCH"
12430 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
12431 cf_cv_abi_version="$cf_cv_abi_version"
12432 cf_cv_rel_version="$cf_cv_rel_version"
12433 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
12434 cf_cv_shared_soname='$cf_cv_shared_soname'
12435 cf_cv_shlib_version="$cf_cv_shlib_version"
12436 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
12437 cf_cv_system_name="$cf_cv_system_name"
12438 host="$host"
12439 target="$target"
12440
12441 EOF
12442
12443 cat >>$CONFIG_STATUS <<\EOF
12444 for ac_config_target in $ac_config_targets
12445 do
12446   case "$ac_config_target" in
12447   # Handling of arguments.
12448   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
12449   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
12450   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
12451   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
12452   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
12453   *) { { echo "$as_me:12453: error: invalid argument: $ac_config_target" >&5
12454 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
12455    { (exit 1); exit 1; }; };;
12456   esac
12457 done
12458
12459 # If the user did not use the arguments to specify the items to instantiate,
12460 # then the envvar interface is used.  Set only those that are not.
12461 # We use the long form for the default assignment because of an extremely
12462 # bizarre bug on SunOS 4.1.3.
12463 if $ac_need_defaults; then
12464   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
12465   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
12466   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
12467 fi
12468
12469 # Create a temporary directory, and hook for its removal unless debugging.
12470 $debug ||
12471 {
12472   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
12473   trap '{ (exit 1); exit 1; }' 1 2 13 15
12474 }
12475
12476 # Create a (secure) tmp directory for tmp files.
12477 : ${TMPDIR=/tmp}
12478 {
12479   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
12480   test -n "$tmp" && test -d "$tmp"
12481 }  ||
12482 {
12483   tmp=$TMPDIR/cs$$-$RANDOM
12484   (umask 077 && mkdir $tmp)
12485 } ||
12486 {
12487    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
12488    { (exit 1); exit 1; }
12489 }
12490
12491 EOF
12492
12493 cat >>$CONFIG_STATUS <<EOF
12494
12495 #
12496 # CONFIG_FILES section.
12497 #
12498
12499 # No need to generate the scripts if there are no CONFIG_FILES.
12500 # This happens for instance when ./config.status config.h
12501 if test -n "\$CONFIG_FILES"; then
12502   # Protect against being on the right side of a sed subst in config.status.
12503   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
12504    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
12505 s,@SHELL@,$SHELL,;t t
12506 s,@exec_prefix@,$exec_prefix,;t t
12507 s,@prefix@,$prefix,;t t
12508 s,@program_transform_name@,$program_transform_name,;t t
12509 s,@bindir@,$bindir,;t t
12510 s,@sbindir@,$sbindir,;t t
12511 s,@libexecdir@,$libexecdir,;t t
12512 s,@datarootdir@,$datarootdir,;t t
12513 s,@datadir@,$datadir,;t t
12514 s,@sysconfdir@,$sysconfdir,;t t
12515 s,@sharedstatedir@,$sharedstatedir,;t t
12516 s,@localstatedir@,$localstatedir,;t t
12517 s,@libdir@,$libdir,;t t
12518 s,@includedir@,$includedir,;t t
12519 s,@oldincludedir@,$oldincludedir,;t t
12520 s,@infodir@,$infodir,;t t
12521 s,@mandir@,$mandir,;t t
12522 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
12523 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
12524 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
12525 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
12526 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
12527 s,@build_alias@,$build_alias,;t t
12528 s,@host_alias@,$host_alias,;t t
12529 s,@target_alias@,$target_alias,;t t
12530 s,@ECHO_C@,$ECHO_C,;t t
12531 s,@ECHO_N@,$ECHO_N,;t t
12532 s,@ECHO_T@,$ECHO_T,;t t
12533 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
12534 s,@DEFS@,$DEFS,;t t
12535 s,@LIBS@,$LIBS,;t t
12536 s,@top_builddir@,$top_builddir,;t t
12537 s,@build@,$build,;t t
12538 s,@build_cpu@,$build_cpu,;t t
12539 s,@build_vendor@,$build_vendor,;t t
12540 s,@build_os@,$build_os,;t t
12541 s,@host@,$host,;t t
12542 s,@host_cpu@,$host_cpu,;t t
12543 s,@host_vendor@,$host_vendor,;t t
12544 s,@host_os@,$host_os,;t t
12545 s,@target@,$target,;t t
12546 s,@target_cpu@,$target_cpu,;t t
12547 s,@target_vendor@,$target_vendor,;t t
12548 s,@target_os@,$target_os,;t t
12549 s,@CC@,$CC,;t t
12550 s,@CFLAGS@,$CFLAGS,;t t
12551 s,@LDFLAGS@,$LDFLAGS,;t t
12552 s,@CPPFLAGS@,$CPPFLAGS,;t t
12553 s,@ac_ct_CC@,$ac_ct_CC,;t t
12554 s,@EXEEXT@,$EXEEXT,;t t
12555 s,@OBJEXT@,$OBJEXT,;t t
12556 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
12557 s,@CPP@,$CPP,;t t
12558 s,@AWK@,$AWK,;t t
12559 s,@EGREP@,$EGREP,;t t
12560 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
12561 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
12562 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
12563 s,@LN_S@,$LN_S,;t t
12564 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
12565 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
12566 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
12567 s,@SET_MAKE@,$SET_MAKE,;t t
12568 s,@CTAGS@,$CTAGS,;t t
12569 s,@ETAGS@,$ETAGS,;t t
12570 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
12571 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
12572 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
12573 s,@RANLIB@,$RANLIB,;t t
12574 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
12575 s,@LD@,$LD,;t t
12576 s,@ac_ct_LD@,$ac_ct_LD,;t t
12577 s,@AR@,$AR,;t t
12578 s,@ac_ct_AR@,$ac_ct_AR,;t t
12579 s,@ARFLAGS@,$ARFLAGS,;t t
12580 s,@DESTDIR@,$DESTDIR,;t t
12581 s,@BUILD_CC@,$BUILD_CC,;t t
12582 s,@BUILD_CPP@,$BUILD_CPP,;t t
12583 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
12584 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
12585 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
12586 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
12587 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
12588 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
12589 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
12590 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
12591 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
12592 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
12593 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
12594 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
12595 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
12596 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
12597 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
12598 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
12599 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
12600 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
12601 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
12602 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
12603 s,@CC_G_OPT@,$CC_G_OPT,;t t
12604 s,@LD_MODEL@,$LD_MODEL,;t t
12605 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
12606 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
12607 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
12608 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
12609 s,@LINK_PROGS@,$LINK_PROGS,;t t
12610 s,@LINK_TESTS@,$LINK_TESTS,;t t
12611 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
12612 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
12613 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
12614 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
12615 s,@RPATH_LIST@,$RPATH_LIST,;t t
12616 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
12617 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
12618 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
12619 s,@PTHREAD@,$PTHREAD,;t t
12620 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
12621 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
12622 s,@ECHO_LT@,$ECHO_LT,;t t
12623 s,@ECHO_LD@,$ECHO_LD,;t t
12624 s,@RULE_CC@,$RULE_CC,;t t
12625 s,@SHOW_CC@,$SHOW_CC,;t t
12626 s,@ECHO_CC@,$ECHO_CC,;t t
12627 s,@ADAFLAGS@,$ADAFLAGS,;t t
12628 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
12629 s,@ADA_TRACE@,$ADA_TRACE,;t t
12630 s,@gnat_exists@,$gnat_exists,;t t
12631 s,@M4_exists@,$M4_exists,;t t
12632 s,@cf_ada_make@,$cf_ada_make,;t t
12633 s,@cf_compile_generics@,$cf_compile_generics,;t t
12634 s,@cf_generic_objects@,$cf_generic_objects,;t t
12635 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
12636 s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
12637 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
12638 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
12639 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
12640 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
12641 s,@cf_ada_package@,$cf_ada_package,;t t
12642 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
12643 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
12644 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
12645 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
12646 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
12647 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
12648 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
12649 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
12650 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
12651 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
12652 s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
12653 s,@cross_compiling@,$cross_compiling,;t t
12654 s,@TEST_ARG2@,$TEST_ARG2,;t t
12655 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
12656 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
12657 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
12658 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
12659 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
12660 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
12661 CEOF
12662
12663 EOF
12664
12665   cat >>$CONFIG_STATUS <<\EOF
12666   # Split the substitutions into bite-sized pieces for seds with
12667   # small command number limits, like on Digital OSF/1 and HP-UX.
12668   ac_max_sed_lines=48
12669   ac_sed_frag=1 # Number of current file.
12670   ac_beg=1 # First line for current file.
12671   ac_end=$ac_max_sed_lines # Line after last line for current file.
12672   ac_more_lines=:
12673   ac_sed_cmds=
12674   while $ac_more_lines; do
12675     if test $ac_beg -gt 1; then
12676       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12677     else
12678       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12679     fi
12680     if test ! -s $tmp/subs.frag; then
12681       ac_more_lines=false
12682     else
12683       # The purpose of the label and of the branching condition is to
12684       # speed up the sed processing (if there are no `@' at all, there
12685       # is no need to browse any of the substitutions).
12686       # These are the two extra sed commands mentioned above.
12687       (echo ':t
12688   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
12689       if test -z "$ac_sed_cmds"; then
12690         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
12691       else
12692         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
12693       fi
12694       ac_sed_frag=`expr $ac_sed_frag + 1`
12695       ac_beg=$ac_end
12696       ac_end=`expr $ac_end + $ac_max_sed_lines`
12697     fi
12698   done
12699   if test -z "$ac_sed_cmds"; then
12700     ac_sed_cmds=cat
12701   fi
12702 fi # test -n "$CONFIG_FILES"
12703
12704 EOF
12705 cat >>$CONFIG_STATUS <<\EOF
12706 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12707   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12708   case $ac_file in
12709   - | *:- | *:-:* ) # input from stdin
12710         cat >$tmp/stdin
12711         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12712         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12713   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12714         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12715   * )   ac_file_in=$ac_file.in ;;
12716   esac
12717
12718   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12719   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12720          X"$ac_file" : 'X\(//\)[^/]' \| \
12721          X"$ac_file" : 'X\(//\)$' \| \
12722          X"$ac_file" : 'X\(/\)' \| \
12723          .     : '\(.\)' 2>/dev/null ||
12724 echo X"$ac_file" |
12725     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12726           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12727           /^X\(\/\/\)$/{ s//\1/; q; }
12728           /^X\(\/\).*/{ s//\1/; q; }
12729           s/.*/./; q'`
12730   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12731     { case "$ac_dir" in
12732   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12733   *)                      as_incr_dir=.;;
12734 esac
12735 as_dummy="$ac_dir"
12736 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12737   case $as_mkdir_dir in
12738     # Skip DOS drivespec
12739     ?:) as_incr_dir=$as_mkdir_dir ;;
12740     *)
12741       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12742       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12743     ;;
12744   esac
12745 done; }
12746
12747     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
12748     # A "../" for each directory in $ac_dir_suffix.
12749     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
12750   else
12751     ac_dir_suffix= ac_dots=
12752   fi
12753
12754   case $srcdir in
12755   .)  ac_srcdir=.
12756       if test -z "$ac_dots"; then
12757          ac_top_srcdir=.
12758       else
12759          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
12760       fi ;;
12761   [\\/]* | ?:[\\/]* )
12762       ac_srcdir=$srcdir$ac_dir_suffix;
12763       ac_top_srcdir=$srcdir ;;
12764   *) # Relative path.
12765     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
12766     ac_top_srcdir=$ac_dots$srcdir ;;
12767   esac
12768
12769   case $INSTALL in
12770   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
12771   *) ac_INSTALL=$ac_dots$INSTALL ;;
12772   esac
12773
12774   if test x"$ac_file" != x-; then
12775     { echo "$as_me:12775: creating $ac_file" >&5
12776 echo "$as_me: creating $ac_file" >&6;}
12777     rm -f "$ac_file"
12778   fi
12779   # Let's still pretend it is `configure' which instantiates (i.e., don't
12780   # use $as_me), people would be surprised to read:
12781   #    /* config.h.  Generated automatically by config.status.  */
12782   configure_input="Generated automatically from `echo $ac_file_in |
12783                                                  sed 's,.*/,,'` by configure."
12784
12785   # First look for the input files in the build tree, otherwise in the
12786   # src tree.
12787   ac_file_inputs=`IFS=:
12788     for f in $ac_file_in; do
12789       case $f in
12790       -) echo $tmp/stdin ;;
12791       [\\/$]*)
12792          # Absolute (can't be DOS-style, as IFS=:)
12793          test -f "$f" || { { echo "$as_me:12793: error: cannot find input file: $f" >&5
12794 echo "$as_me: error: cannot find input file: $f" >&2;}
12795    { (exit 1); exit 1; }; }
12796          echo $f;;
12797       *) # Relative
12798          if test -f "$f"; then
12799            # Build tree
12800            echo $f
12801          elif test -f "$srcdir/$f"; then
12802            # Source tree
12803            echo $srcdir/$f
12804          else
12805            # /dev/null tree
12806            { { echo "$as_me:12806: error: cannot find input file: $f" >&5
12807 echo "$as_me: error: cannot find input file: $f" >&2;}
12808    { (exit 1); exit 1; }; }
12809          fi;;
12810       esac
12811     done` || { (exit 1); exit 1; }
12812 EOF
12813 cat >>$CONFIG_STATUS <<\EOF
12814   ac_warn_datarootdir=no
12815   if test x"$ac_file" != x-; then
12816     for ac_item in $ac_file_inputs
12817     do
12818       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
12819       if test -n "$ac_seen"; then
12820         ac_used=`grep '@datarootdir@' $ac_item`
12821         if test -z "$ac_used"; then
12822           { echo "$as_me:12822: WARNING: datarootdir was used implicitly but not set:
12823 $ac_seen" >&5
12824 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
12825 $ac_seen" >&2;}
12826           ac_warn_datarootdir=yes
12827         fi
12828       fi
12829       ac_seen=`grep '${datarootdir}' $ac_item`
12830       if test -n "$ac_seen"; then
12831         { echo "$as_me:12831: WARNING: datarootdir was used explicitly but not set:
12832 $ac_seen" >&5
12833 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
12834 $ac_seen" >&2;}
12835         ac_warn_datarootdir=yes
12836       fi
12837     done
12838   fi
12839
12840 if test "x$ac_warn_datarootdir" = xyes; then
12841   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
12842 fi
12843
12844 EOF
12845 cat >>$CONFIG_STATUS <<EOF
12846   sed "$ac_vpsub
12847 $extrasub
12848 EOF
12849 cat >>$CONFIG_STATUS <<\EOF
12850 :t
12851 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
12852 s,@configure_input@,$configure_input,;t t
12853 s,@srcdir@,$ac_srcdir,;t t
12854 s,@top_srcdir@,$ac_top_srcdir,;t t
12855 s,@INSTALL@,$ac_INSTALL,;t t
12856 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
12857   rm -f $tmp/stdin
12858   if test x"$ac_file" != x-; then
12859     cp $tmp/out $ac_file
12860
12861     for ac_name in prefix exec_prefix datarootdir
12862     do
12863         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
12864         if test -n "$ac_seen"; then
12865             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
12866             if test -z "$ac_init"; then
12867               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
12868               { echo "$as_me:12868: WARNING: Variable $ac_name is used but was not set:
12869 $ac_seen" >&5
12870 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
12871 $ac_seen" >&2;}
12872             fi
12873         fi
12874     done
12875     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
12876     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
12877     if test -s $tmp/out; then
12878       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
12879       { echo "$as_me:12879: WARNING: Some variables may not be substituted:
12880 $ac_seen" >&5
12881 echo "$as_me: WARNING: Some variables may not be substituted:
12882 $ac_seen" >&2;}
12883     fi
12884   else
12885     cat $tmp/out
12886   fi
12887   rm -f $tmp/out
12888
12889 done
12890 EOF
12891 cat >>$CONFIG_STATUS <<\EOF
12892
12893 #
12894 # CONFIG_HEADER section.
12895 #
12896
12897 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12898 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12899 #
12900 # ac_d sets the value in "#define NAME VALUE" lines.
12901 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12902 ac_dB='[        ].*$,\1#\2'
12903 ac_dC=' '
12904 ac_dD=',;t'
12905 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12906 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12907 ac_iB='\([      ]\),\1#\2define\3'
12908 ac_iC=' '
12909 ac_iD='\4,;t'
12910 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12911 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12912 ac_uB='$,\1#\2define\3'
12913 ac_uC=' '
12914 ac_uD=',;t'
12915
12916 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
12917   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12918   case $ac_file in
12919   - | *:- | *:-:* ) # input from stdin
12920         cat >$tmp/stdin
12921         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12922         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12923   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12924         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12925   * )   ac_file_in=$ac_file.in ;;
12926   esac
12927
12928   test x"$ac_file" != x- && { echo "$as_me:12928: creating $ac_file" >&5
12929 echo "$as_me: creating $ac_file" >&6;}
12930
12931   # First look for the input files in the build tree, otherwise in the
12932   # src tree.
12933   ac_file_inputs=`IFS=:
12934     for f in $ac_file_in; do
12935       case $f in
12936       -) echo $tmp/stdin ;;
12937       [\\/$]*)
12938          # Absolute (can't be DOS-style, as IFS=:)
12939          test -f "$f" || { { echo "$as_me:12939: error: cannot find input file: $f" >&5
12940 echo "$as_me: error: cannot find input file: $f" >&2;}
12941    { (exit 1); exit 1; }; }
12942          echo $f;;
12943       *) # Relative
12944          if test -f "$f"; then
12945            # Build tree
12946            echo $f
12947          elif test -f "$srcdir/$f"; then
12948            # Source tree
12949            echo $srcdir/$f
12950          else
12951            # /dev/null tree
12952            { { echo "$as_me:12952: error: cannot find input file: $f" >&5
12953 echo "$as_me: error: cannot find input file: $f" >&2;}
12954    { (exit 1); exit 1; }; }
12955          fi;;
12956       esac
12957     done` || { (exit 1); exit 1; }
12958   # Remove the trailing spaces.
12959   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
12960
12961 EOF
12962
12963 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
12964 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
12965 # be either 'cat' or 'sort'.
12966 cat confdefs.h | uniq >conftest.vals
12967
12968 # Break up conftest.vals because some shells have a limit on
12969 # the size of here documents, and old seds have small limits too.
12970
12971 rm -f conftest.tail
12972 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
12973 while grep . conftest.vals >/dev/null
12974 do
12975   # Write chunks of a limited-size here document to conftest.frag.
12976   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
12977   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
12978   echo 'CEOF' >> $CONFIG_STATUS
12979   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12980   rm -f conftest.vals
12981   mv conftest.tail conftest.vals
12982 done
12983 rm -f conftest.vals
12984
12985 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
12986 # marker @DEFS@.
12987 echo '  cat >> conftest.edit <<CEOF
12988 /@DEFS@/r conftest.frag
12989 /@DEFS@/d
12990 CEOF
12991 sed -f conftest.edit $tmp/in > $tmp/out
12992 rm -f $tmp/in
12993 mv $tmp/out $tmp/in
12994 rm -f conftest.edit conftest.frag
12995 ' >> $CONFIG_STATUS
12996
12997 cat >>$CONFIG_STATUS <<\EOF
12998   # Let's still pretend it is `configure' which instantiates (i.e., don't
12999   # use $as_me), people would be surprised to read:
13000   #    /* config.h.  Generated automatically by config.status.  */
13001   if test x"$ac_file" = x-; then
13002     echo "/* Generated automatically by configure.  */" >$tmp/config.h
13003   else
13004     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
13005   fi
13006   cat $tmp/in >>$tmp/config.h
13007   rm -f $tmp/in
13008   if test x"$ac_file" != x-; then
13009     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
13010       { echo "$as_me:13010: $ac_file is unchanged" >&5
13011 echo "$as_me: $ac_file is unchanged" >&6;}
13012     else
13013       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13014          X"$ac_file" : 'X\(//\)[^/]' \| \
13015          X"$ac_file" : 'X\(//\)$' \| \
13016          X"$ac_file" : 'X\(/\)' \| \
13017          .     : '\(.\)' 2>/dev/null ||
13018 echo X"$ac_file" |
13019     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13020           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13021           /^X\(\/\/\)$/{ s//\1/; q; }
13022           /^X\(\/\).*/{ s//\1/; q; }
13023           s/.*/./; q'`
13024       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13025         { case "$ac_dir" in
13026   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
13027   *)                      as_incr_dir=.;;
13028 esac
13029 as_dummy="$ac_dir"
13030 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
13031   case $as_mkdir_dir in
13032     # Skip DOS drivespec
13033     ?:) as_incr_dir=$as_mkdir_dir ;;
13034     *)
13035       as_incr_dir=$as_incr_dir/$as_mkdir_dir
13036       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
13037     ;;
13038   esac
13039 done; }
13040
13041       fi
13042       rm -f $ac_file
13043       mv $tmp/config.h $ac_file
13044     fi
13045   else
13046     cat $tmp/config.h
13047     rm -f $tmp/config.h
13048   fi
13049 done
13050 EOF
13051 cat >>$CONFIG_STATUS <<\EOF
13052 #
13053 # CONFIG_COMMANDS section.
13054 #
13055 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
13056   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
13057   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
13058
13059   case $ac_dest in
13060     default )
13061 if test -z "$USE_OLD_MAKERULES" ; then
13062         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
13063 fi
13064  ;;
13065   esac
13066 done
13067 EOF
13068
13069 cat >>$CONFIG_STATUS <<\EOF
13070
13071 { (exit 0); exit 0; }
13072 EOF
13073 chmod +x $CONFIG_STATUS
13074 ac_clean_files=$ac_clean_files_save
13075
13076 # configure is writing to config.log, and then calls config.status.
13077 # config.status does its own redirection, appending to config.log.
13078 # Unfortunately, on DOS this fails, as config.log is still kept open
13079 # by configure, so config.status won't be able to write to it; its
13080 # output is simply discarded.  So we exec the FD to /dev/null,
13081 # effectively closing config.log, so it can be properly (re)opened and
13082 # appended to by config.status.  When coming back to configure, we
13083 # need to make the FD available again.
13084 if test "$no_create" != yes; then
13085   ac_cs_success=:
13086   exec 5>/dev/null
13087   $SHELL $CONFIG_STATUS || ac_cs_success=false
13088   exec 5>>config.log
13089   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
13090   # would make configure fail if this is the last instruction.
13091   $ac_cs_success || { (exit 1); exit 1; }
13092 fi
13093 ${MAKE:-make} preinstall