]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
b0108b64ce7e8482aa751ea8057cdbbbb7686812
[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
7284         # Some less-capable ports of gcc support only -fpic
7285         CC_SHARED_OPTS=
7286         if test "$GCC" = yes
7287         then
7288                 echo "$as_me:7288: checking which $CC option to use" >&5
7289 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7290                 cf_save_CFLAGS="$CFLAGS"
7291                 for CC_SHARED_OPTS in -fPIC -fpic ''
7292                 do
7293                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7294                         cat >conftest.$ac_ext <<_ACEOF
7295 #line 7295 "configure"
7296 #include "confdefs.h"
7297 #include <stdio.h>
7298 int
7299 main ()
7300 {
7301 int x = 1
7302   ;
7303   return 0;
7304 }
7305 _ACEOF
7306 rm -f conftest.$ac_objext
7307 if { (eval echo "$as_me:7307: \"$ac_compile\"") >&5
7308   (eval $ac_compile) 2>&5
7309   ac_status=$?
7310   echo "$as_me:7310: \$? = $ac_status" >&5
7311   (exit $ac_status); } &&
7312          { ac_try='test -s conftest.$ac_objext'
7313   { (eval echo "$as_me:7313: \"$ac_try\"") >&5
7314   (eval $ac_try) 2>&5
7315   ac_status=$?
7316   echo "$as_me:7316: \$? = $ac_status" >&5
7317   (exit $ac_status); }; }; then
7318   break
7319 else
7320   echo "$as_me: failed program was:" >&5
7321 cat conftest.$ac_ext >&5
7322 fi
7323 rm -f conftest.$ac_objext conftest.$ac_ext
7324                 done
7325                 echo "$as_me:7325: result: $CC_SHARED_OPTS" >&5
7326 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7327                 CFLAGS="$cf_save_CFLAGS"
7328         fi
7329
7330         cf_cv_shlib_version_infix=no
7331
7332         case $cf_cv_system_name in #(vi
7333         aix4.3-9*|aix[5-7]*) #(vi
7334                 if test "$GCC" = yes; then
7335                         CC_SHARED_OPTS=
7336                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7337                 else
7338                         # CC_SHARED_OPTS='-qpic=large -G'
7339                         # perhaps "-bM:SRE -bnoentry -bexpall"
7340                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7341                 fi
7342                 ;;
7343         beos*) #(vi
7344                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7345                 ;;
7346         cygwin*) #(vi
7347                 CC_SHARED_OPTS=
7348                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7349                 cf_cv_shlib_version=cygdll
7350                 cf_cv_shlib_version_infix=cygdll
7351                 cat >mk_shared_lib.sh <<-CF_EOF
7352                 #!/bin/sh
7353                 SHARED_LIB=\$1
7354                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7355                 shift
7356                 cat <<-EOF
7357                 Linking shared library
7358                 ** SHARED_LIB \$SHARED_LIB
7359                 ** IMPORT_LIB \$IMPORT_LIB
7360 EOF
7361                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7362 CF_EOF
7363                 chmod +x mk_shared_lib.sh
7364                 ;;
7365         darwin*) #(vi
7366                 EXTRA_CFLAGS="-no-cpp-precomp"
7367                 CC_SHARED_OPTS="-dynamic"
7368                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7369                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7370                 cf_cv_shlib_version_infix=yes
7371                 echo "$as_me:7371: checking if ld -search_paths_first works" >&5
7372 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7373 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7374   echo $ECHO_N "(cached) $ECHO_C" >&6
7375 else
7376
7377                         cf_save_LDFLAGS=$LDFLAGS
7378                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7379                         cat >conftest.$ac_ext <<_ACEOF
7380 #line 7380 "configure"
7381 #include "confdefs.h"
7382
7383 int
7384 main ()
7385 {
7386 int i;
7387   ;
7388   return 0;
7389 }
7390 _ACEOF
7391 rm -f conftest.$ac_objext conftest$ac_exeext
7392 if { (eval echo "$as_me:7392: \"$ac_link\"") >&5
7393   (eval $ac_link) 2>&5
7394   ac_status=$?
7395   echo "$as_me:7395: \$? = $ac_status" >&5
7396   (exit $ac_status); } &&
7397          { ac_try='test -s conftest$ac_exeext'
7398   { (eval echo "$as_me:7398: \"$ac_try\"") >&5
7399   (eval $ac_try) 2>&5
7400   ac_status=$?
7401   echo "$as_me:7401: \$? = $ac_status" >&5
7402   (exit $ac_status); }; }; then
7403   cf_cv_ldflags_search_paths_first=yes
7404 else
7405   echo "$as_me: failed program was:" >&5
7406 cat conftest.$ac_ext >&5
7407 cf_cv_ldflags_search_paths_first=no
7408 fi
7409 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7410                                 LDFLAGS=$cf_save_LDFLAGS
7411 fi
7412 echo "$as_me:7412: result: $cf_cv_ldflags_search_paths_first" >&5
7413 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7414                 if test $cf_cv_ldflags_search_paths_first = yes; then
7415                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7416                 fi
7417                 ;;
7418         hpux*) #(vi
7419                 # (tested with gcc 2.7.2 -- I don't have c89)
7420                 if test "$GCC" = yes; then
7421                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7422                 else
7423                         CC_SHARED_OPTS='+Z'
7424                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7425                 fi
7426                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7427                 # HP-UX shared libraries must be executable, and should be
7428                 # readonly to exploit a quirk in the memory manager.
7429                 INSTALL_LIB="-m 555"
7430                 ;;
7431         interix*)
7432                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7433                 if test "$cf_cv_shlib_version" = rel; then
7434                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
7435                 else
7436                         cf_shared_soname='`basename `'
7437                 fi
7438                 CC_SHARED_OPTS=
7439                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
7440                 ;;
7441         irix*) #(vi
7442                 if test "$cf_cv_enable_rpath" = yes ; then
7443                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7444                 fi
7445                 # tested with IRIX 5.2 and 'cc'.
7446                 if test "$GCC" != yes; then
7447                         CC_SHARED_OPTS='-KPIC'
7448                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7449                 else
7450                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7451                 fi
7452                 cf_cv_rm_so_locs=yes
7453                 ;;
7454         linux*|gnu*|k*bsd*-gnu) #(vi
7455                 if test "$DFT_LWR_MODEL" = "shared" ; then
7456                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7457                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7458                 fi
7459                 if test "$cf_cv_enable_rpath" = yes ; then
7460                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7461                 fi
7462
7463         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7464         if test "$cf_cv_shlib_version" = rel; then
7465                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7466         else
7467                 cf_cv_shared_soname='`basename $@`'
7468         fi
7469
7470                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7471                 ;;
7472         mingw*) #(vi
7473                 cf_cv_shlib_version=mingw
7474                 cf_cv_shlib_version_infix=mingw
7475                 CC_SHARED_OPTS=
7476                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7477                 #MK_SHARED_LIB='${CC} ${CFLAGS} -mdll -Wl,-soname,'$cf_cv_shared_soname',-stats -o $[@]'
7478                 #MK_SHARED_LIB='${DLLTOOL} --export-all-symbols --output-exp --output-lib $[@]'
7479                 cat >mk_shared_lib.sh <<-CF_EOF
7480                 #!/bin/sh
7481                 SHARED_LIB=\$1
7482                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
7483                 shift
7484                 cat <<-EOF
7485                 Linking shared library
7486                 ** SHARED_LIB \$SHARED_LIB
7487                 ** IMPORT_LIB \$IMPORT_LIB
7488 EOF
7489                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7490 CF_EOF
7491                 chmod +x mk_shared_lib.sh
7492                 ;;
7493         openbsd[2-9].*|mirbsd*) #(vi
7494                 if test "$DFT_LWR_MODEL" = "shared" ; then
7495                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7496                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7497                 fi
7498                 if test "$cf_cv_enable_rpath" = yes ; then
7499                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7500                 fi
7501                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7502
7503         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7504         if test "$cf_cv_shlib_version" = rel; then
7505                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7506         else
7507                 cf_cv_shared_soname='`basename $@`'
7508         fi
7509
7510                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7511                 ;;
7512         nto-qnx*|openbsd*|freebsd[12].*) #(vi
7513                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7514                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7515                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7516                 ;;
7517         dragonfly*|freebsd*) #(vi
7518                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7519                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7520                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7521                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
7522                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7523                 fi
7524
7525         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7526         if test "$cf_cv_shlib_version" = rel; then
7527                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7528         else
7529                 cf_cv_shared_soname='`basename $@`'
7530         fi
7531
7532                 MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
7533                 ;;
7534         netbsd*) #(vi
7535                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7536                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7537                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7538                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7539                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7540                         if test "$cf_cv_shlib_version" = auto; then
7541                         if test -f /usr/libexec/ld.elf_so; then
7542                                 cf_cv_shlib_version=abi
7543                         else
7544                                 cf_cv_shlib_version=rel
7545                         fi
7546                         fi
7547
7548         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7549         if test "$cf_cv_shlib_version" = rel; then
7550                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7551         else
7552                 cf_cv_shared_soname='`basename $@`'
7553         fi
7554
7555                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7556                 else
7557                         MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
7558                 fi
7559                 ;;
7560         osf*|mls+*) #(vi
7561                 # tested with OSF/1 V3.2 and 'cc'
7562                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7563                 # link with shared libs).
7564                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7565                 case $host_os in #(vi
7566                 osf4*)
7567                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7568                         ;;
7569                 esac
7570                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7571                 if test "$DFT_LWR_MODEL" = "shared" ; then
7572                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7573                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7574                 fi
7575                 cf_cv_rm_so_locs=yes
7576                 ;;
7577         sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
7578                 # tested with osr5.0.5
7579                 if test "$GCC" != yes; then
7580                         CC_SHARED_OPTS='-belf -KPIC'
7581                 fi
7582                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7583                 if test "$cf_cv_enable_rpath" = yes ; then
7584                         # only way is to set LD_RUN_PATH but no switch for it
7585                         RUN_PATH=$libdir
7586                 fi
7587                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7588                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7589                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7590                 ;;
7591         sunos4*) #(vi
7592                 # tested with SunOS 4.1.1 and gcc 2.7.0
7593                 if test "$GCC" != yes; then
7594                         CC_SHARED_OPTS='-KPIC'
7595                 fi
7596                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7597                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7598                 ;;
7599         solaris2*) #(vi
7600                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7601                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7602                 if test "$DFT_LWR_MODEL" = "shared" ; then
7603                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7604                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7605                 fi
7606                 if test "$cf_cv_enable_rpath" = yes ; then
7607                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7608                 fi
7609
7610         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7611         if test "$cf_cv_shlib_version" = rel; then
7612                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7613         else
7614                 cf_cv_shared_soname='`basename $@`'
7615         fi
7616
7617                 if test "$GCC" != yes; then
7618                         cf_save_CFLAGS="$CFLAGS"
7619                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7620                         do
7621                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7622                                 cat >conftest.$ac_ext <<_ACEOF
7623 #line 7623 "configure"
7624 #include "confdefs.h"
7625 #include <stdio.h>
7626 int
7627 main ()
7628 {
7629 printf("Hello\n");
7630   ;
7631   return 0;
7632 }
7633 _ACEOF
7634 rm -f conftest.$ac_objext
7635 if { (eval echo "$as_me:7635: \"$ac_compile\"") >&5
7636   (eval $ac_compile) 2>&5
7637   ac_status=$?
7638   echo "$as_me:7638: \$? = $ac_status" >&5
7639   (exit $ac_status); } &&
7640          { ac_try='test -s conftest.$ac_objext'
7641   { (eval echo "$as_me:7641: \"$ac_try\"") >&5
7642   (eval $ac_try) 2>&5
7643   ac_status=$?
7644   echo "$as_me:7644: \$? = $ac_status" >&5
7645   (exit $ac_status); }; }; then
7646   break
7647 else
7648   echo "$as_me: failed program was:" >&5
7649 cat conftest.$ac_ext >&5
7650 fi
7651 rm -f conftest.$ac_objext conftest.$ac_ext
7652                         done
7653                         CFLAGS="$cf_save_CFLAGS"
7654                         CC_SHARED_OPTS=$cf_shared_opts
7655                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7656                 else
7657                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7658                 fi
7659                 ;;
7660         sysv5uw7*|unix_sv*) #(vi
7661                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7662                 if test "$GCC" != yes; then
7663                         CC_SHARED_OPTS='-KPIC'
7664                 fi
7665                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7666                 ;;
7667         *)
7668                 CC_SHARED_OPTS='unknown'
7669                 MK_SHARED_LIB='echo unknown'
7670                 ;;
7671         esac
7672
7673         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7674         case "$cf_cv_shlib_version" in #(vi
7675         rel|abi)
7676                 case "$MK_SHARED_LIB" in #(vi
7677                 *'-o $@') #(vi
7678                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7679                         ;;
7680                 *)
7681                         { echo "$as_me:7681: WARNING: ignored --with-shlib-version" >&5
7682 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7683                         ;;
7684                 esac
7685                 ;;
7686         esac
7687
7688         # RPATH_LIST is a colon-separated list of directories
7689         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
7690         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
7691
7692         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
7693
7694 echo "${as_me:-configure}:7694: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
7695
7696         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
7697
7698 echo "${as_me:-configure}:7698: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
7699
7700 # The test/sample programs in the original tree link using rpath option.
7701 # Make it optional for packagers.
7702 if test -n "$LOCAL_LDFLAGS"
7703 then
7704         echo "$as_me:7704: checking if you want to link sample programs with rpath option" >&5
7705 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
7706
7707 # Check whether --enable-rpath-link or --disable-rpath-link was given.
7708 if test "${enable_rpath_link+set}" = set; then
7709   enableval="$enable_rpath_link"
7710   with_rpath_link=$enableval
7711 else
7712   with_rpath_link=yes
7713 fi;
7714         echo "$as_me:7714: result: $with_rpath_link" >&5
7715 echo "${ECHO_T}$with_rpath_link" >&6
7716         if test "$with_rpath_link" = no
7717         then
7718                 LOCAL_LDFLAGS=
7719                 LOCAL_LDFLAGS2=
7720         fi
7721 fi
7722
7723 ###############################################################################
7724
7725 ###   use option --enable-broken-linker to force on use of broken-linker support
7726 echo "$as_me:7726: checking if you want broken-linker support code" >&5
7727 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7728
7729 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7730 if test "${enable_broken_linker+set}" = set; then
7731   enableval="$enable_broken_linker"
7732   with_broken_linker=$enableval
7733 else
7734   with_broken_linker=${BROKEN_LINKER:-no}
7735 fi;
7736 echo "$as_me:7736: result: $with_broken_linker" >&5
7737 echo "${ECHO_T}$with_broken_linker" >&6
7738
7739 BROKEN_LINKER=0
7740 if test "$with_broken_linker" = yes ; then
7741         cat >>confdefs.h <<\EOF
7742 #define BROKEN_LINKER 1
7743 EOF
7744
7745         BROKEN_LINKER=1
7746 elif test "$DFT_LWR_MODEL" = shared ; then
7747         case $cf_cv_system_name in #(vi
7748         cygwin*)
7749                 cat >>confdefs.h <<\EOF
7750 #define BROKEN_LINKER 1
7751 EOF
7752
7753                 BROKEN_LINKER=1
7754                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7755
7756 echo "${as_me:-configure}:7756: testing cygwin linker is broken anyway ..." 1>&5
7757
7758                 ;;
7759         esac
7760 fi
7761
7762 # Check to define _XOPEN_SOURCE "automatically"
7763
7764 cf_XOPEN_SOURCE=500
7765 cf_POSIX_C_SOURCE=199506L
7766 cf_xopen_source=
7767
7768 case $host_os in #(vi
7769 aix[4-7]*) #(vi
7770         cf_xopen_source="-D_ALL_SOURCE"
7771         ;;
7772 cygwin) #(vi
7773         cf_XOPEN_SOURCE=600
7774         ;;
7775 darwin[0-8].*) #(vi
7776         cf_xopen_source="-D_APPLE_C_SOURCE"
7777         ;;
7778 darwin*) #(vi
7779         cf_xopen_source="-D_DARWIN_C_SOURCE"
7780         cf_XOPEN_SOURCE=
7781         ;;
7782 freebsd*|dragonfly*) #(vi
7783         # 5.x headers associate
7784         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7785         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7786         cf_POSIX_C_SOURCE=200112L
7787         cf_XOPEN_SOURCE=600
7788         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7789         ;;
7790 hpux11*) #(vi
7791         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7792         ;;
7793 hpux*) #(vi
7794         cf_xopen_source="-D_HPUX_SOURCE"
7795         ;;
7796 irix[56].*) #(vi
7797         cf_xopen_source="-D_SGI_SOURCE"
7798         cf_XOPEN_SOURCE=
7799         ;;
7800 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
7801
7802 echo "$as_me:7802: checking if we must define _GNU_SOURCE" >&5
7803 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7804 if test "${cf_cv_gnu_source+set}" = set; then
7805   echo $ECHO_N "(cached) $ECHO_C" >&6
7806 else
7807
7808 cat >conftest.$ac_ext <<_ACEOF
7809 #line 7809 "configure"
7810 #include "confdefs.h"
7811 #include <sys/types.h>
7812 int
7813 main ()
7814 {
7815
7816 #ifndef _XOPEN_SOURCE
7817 make an error
7818 #endif
7819   ;
7820   return 0;
7821 }
7822 _ACEOF
7823 rm -f conftest.$ac_objext
7824 if { (eval echo "$as_me:7824: \"$ac_compile\"") >&5
7825   (eval $ac_compile) 2>&5
7826   ac_status=$?
7827   echo "$as_me:7827: \$? = $ac_status" >&5
7828   (exit $ac_status); } &&
7829          { ac_try='test -s conftest.$ac_objext'
7830   { (eval echo "$as_me:7830: \"$ac_try\"") >&5
7831   (eval $ac_try) 2>&5
7832   ac_status=$?
7833   echo "$as_me:7833: \$? = $ac_status" >&5
7834   (exit $ac_status); }; }; then
7835   cf_cv_gnu_source=no
7836 else
7837   echo "$as_me: failed program was:" >&5
7838 cat conftest.$ac_ext >&5
7839 cf_save="$CPPFLAGS"
7840          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7841          cat >conftest.$ac_ext <<_ACEOF
7842 #line 7842 "configure"
7843 #include "confdefs.h"
7844 #include <sys/types.h>
7845 int
7846 main ()
7847 {
7848
7849 #ifdef _XOPEN_SOURCE
7850 make an error
7851 #endif
7852   ;
7853   return 0;
7854 }
7855 _ACEOF
7856 rm -f conftest.$ac_objext
7857 if { (eval echo "$as_me:7857: \"$ac_compile\"") >&5
7858   (eval $ac_compile) 2>&5
7859   ac_status=$?
7860   echo "$as_me:7860: \$? = $ac_status" >&5
7861   (exit $ac_status); } &&
7862          { ac_try='test -s conftest.$ac_objext'
7863   { (eval echo "$as_me:7863: \"$ac_try\"") >&5
7864   (eval $ac_try) 2>&5
7865   ac_status=$?
7866   echo "$as_me:7866: \$? = $ac_status" >&5
7867   (exit $ac_status); }; }; then
7868   cf_cv_gnu_source=no
7869 else
7870   echo "$as_me: failed program was:" >&5
7871 cat conftest.$ac_ext >&5
7872 cf_cv_gnu_source=yes
7873 fi
7874 rm -f conftest.$ac_objext conftest.$ac_ext
7875         CPPFLAGS="$cf_save"
7876
7877 fi
7878 rm -f conftest.$ac_objext conftest.$ac_ext
7879
7880 fi
7881 echo "$as_me:7881: result: $cf_cv_gnu_source" >&5
7882 echo "${ECHO_T}$cf_cv_gnu_source" >&6
7883 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7884
7885         ;;
7886 mirbsd*) #(vi
7887         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
7888         cf_XOPEN_SOURCE=
7889
7890 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
7891
7892 cf_save_CFLAGS="$CFLAGS"
7893 cf_save_CPPFLAGS="$CPPFLAGS"
7894
7895 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
7896         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7897                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7898
7899 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
7900         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7901                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7902
7903 echo "$as_me:7903: checking if we should define _POSIX_C_SOURCE" >&5
7904 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
7905 if test "${cf_cv_posix_c_source+set}" = set; then
7906   echo $ECHO_N "(cached) $ECHO_C" >&6
7907 else
7908
7909 echo "${as_me:-configure}:7909: testing if the symbol is already defined go no further ..." 1>&5
7910
7911         cat >conftest.$ac_ext <<_ACEOF
7912 #line 7912 "configure"
7913 #include "confdefs.h"
7914 #include <sys/types.h>
7915 int
7916 main ()
7917 {
7918
7919 #ifndef _POSIX_C_SOURCE
7920 make an error
7921 #endif
7922   ;
7923   return 0;
7924 }
7925 _ACEOF
7926 rm -f conftest.$ac_objext
7927 if { (eval echo "$as_me:7927: \"$ac_compile\"") >&5
7928   (eval $ac_compile) 2>&5
7929   ac_status=$?
7930   echo "$as_me:7930: \$? = $ac_status" >&5
7931   (exit $ac_status); } &&
7932          { ac_try='test -s conftest.$ac_objext'
7933   { (eval echo "$as_me:7933: \"$ac_try\"") >&5
7934   (eval $ac_try) 2>&5
7935   ac_status=$?
7936   echo "$as_me:7936: \$? = $ac_status" >&5
7937   (exit $ac_status); }; }; then
7938   cf_cv_posix_c_source=no
7939 else
7940   echo "$as_me: failed program was:" >&5
7941 cat conftest.$ac_ext >&5
7942 cf_want_posix_source=no
7943          case .$cf_POSIX_C_SOURCE in #(vi
7944          .[12]??*) #(vi
7945                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
7946                 ;;
7947          .2) #(vi
7948                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
7949                 cf_want_posix_source=yes
7950                 ;;
7951          .*)
7952                 cf_want_posix_source=yes
7953                 ;;
7954          esac
7955          if test "$cf_want_posix_source" = yes ; then
7956                 cat >conftest.$ac_ext <<_ACEOF
7957 #line 7957 "configure"
7958 #include "confdefs.h"
7959 #include <sys/types.h>
7960 int
7961 main ()
7962 {
7963
7964 #ifdef _POSIX_SOURCE
7965 make an error
7966 #endif
7967   ;
7968   return 0;
7969 }
7970 _ACEOF
7971 rm -f conftest.$ac_objext
7972 if { (eval echo "$as_me:7972: \"$ac_compile\"") >&5
7973   (eval $ac_compile) 2>&5
7974   ac_status=$?
7975   echo "$as_me:7975: \$? = $ac_status" >&5
7976   (exit $ac_status); } &&
7977          { ac_try='test -s conftest.$ac_objext'
7978   { (eval echo "$as_me:7978: \"$ac_try\"") >&5
7979   (eval $ac_try) 2>&5
7980   ac_status=$?
7981   echo "$as_me:7981: \$? = $ac_status" >&5
7982   (exit $ac_status); }; }; then
7983   :
7984 else
7985   echo "$as_me: failed program was:" >&5
7986 cat conftest.$ac_ext >&5
7987 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
7988 fi
7989 rm -f conftest.$ac_objext conftest.$ac_ext
7990          fi
7991
7992 echo "${as_me:-configure}:7992: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
7993
7994          CFLAGS="$cf_trim_CFLAGS"
7995          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
7996
7997 echo "${as_me:-configure}:7997: testing if the second compile does not leave our definition intact error ..." 1>&5
7998
7999          cat >conftest.$ac_ext <<_ACEOF
8000 #line 8000 "configure"
8001 #include "confdefs.h"
8002 #include <sys/types.h>
8003 int
8004 main ()
8005 {
8006
8007 #ifndef _POSIX_C_SOURCE
8008 make an error
8009 #endif
8010   ;
8011   return 0;
8012 }
8013 _ACEOF
8014 rm -f conftest.$ac_objext
8015 if { (eval echo "$as_me:8015: \"$ac_compile\"") >&5
8016   (eval $ac_compile) 2>&5
8017   ac_status=$?
8018   echo "$as_me:8018: \$? = $ac_status" >&5
8019   (exit $ac_status); } &&
8020          { ac_try='test -s conftest.$ac_objext'
8021   { (eval echo "$as_me:8021: \"$ac_try\"") >&5
8022   (eval $ac_try) 2>&5
8023   ac_status=$?
8024   echo "$as_me:8024: \$? = $ac_status" >&5
8025   (exit $ac_status); }; }; then
8026   :
8027 else
8028   echo "$as_me: failed program was:" >&5
8029 cat conftest.$ac_ext >&5
8030 cf_cv_posix_c_source=no
8031 fi
8032 rm -f conftest.$ac_objext conftest.$ac_ext
8033          CFLAGS="$cf_save_CFLAGS"
8034          CPPFLAGS="$cf_save_CPPFLAGS"
8035
8036 fi
8037 rm -f conftest.$ac_objext conftest.$ac_ext
8038
8039 fi
8040 echo "$as_me:8040: result: $cf_cv_posix_c_source" >&5
8041 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8042
8043 if test "$cf_cv_posix_c_source" != no ; then
8044         CFLAGS="$cf_trim_CFLAGS"
8045         CPPFLAGS="$cf_trim_CPPFLAGS"
8046
8047 cf_fix_cppflags=no
8048 cf_new_cflags=
8049 cf_new_cppflags=
8050 cf_new_extra_cppflags=
8051
8052 for cf_add_cflags in $cf_cv_posix_c_source
8053 do
8054 case $cf_fix_cppflags in
8055 no)
8056         case $cf_add_cflags in #(vi
8057         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8058                 case $cf_add_cflags in
8059                 -D*)
8060                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8061
8062                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8063                                 && test -z "${cf_tst_cflags}" \
8064                                 && cf_fix_cppflags=yes
8065
8066                         if test $cf_fix_cppflags = yes ; then
8067                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8068                                 continue
8069                         elif test "${cf_tst_cflags}" = "\"'" ; then
8070                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8071                                 continue
8072                         fi
8073                         ;;
8074                 esac
8075                 case "$CPPFLAGS" in
8076                 *$cf_add_cflags) #(vi
8077                         ;;
8078                 *) #(vi
8079                         case $cf_add_cflags in #(vi
8080                         -D*)
8081                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8082
8083 CPPFLAGS=`echo "$CPPFLAGS" | \
8084         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8085                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8086
8087                                 ;;
8088                         esac
8089                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8090                         ;;
8091                 esac
8092                 ;;
8093         *)
8094                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8095                 ;;
8096         esac
8097         ;;
8098 yes)
8099         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8100
8101         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8102
8103         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8104                 && test -z "${cf_tst_cflags}" \
8105                 && cf_fix_cppflags=no
8106         ;;
8107 esac
8108 done
8109
8110 if test -n "$cf_new_cflags" ; then
8111
8112         CFLAGS="$CFLAGS $cf_new_cflags"
8113 fi
8114
8115 if test -n "$cf_new_cppflags" ; then
8116
8117         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8118 fi
8119
8120 if test -n "$cf_new_extra_cppflags" ; then
8121
8122         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8123 fi
8124
8125 fi
8126
8127         ;;
8128 netbsd*) #(vi
8129         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
8130         ;;
8131 openbsd[4-9]*) #(vi
8132         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
8133         cf_xopen_source="-D_BSD_SOURCE"
8134         cf_XOPEN_SOURCE=600
8135         ;;
8136 openbsd*) #(vi
8137         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
8138         ;;
8139 osf[45]*) #(vi
8140         cf_xopen_source="-D_OSF_SOURCE"
8141         ;;
8142 nto-qnx*) #(vi
8143         cf_xopen_source="-D_QNX_SOURCE"
8144         ;;
8145 sco*) #(vi
8146         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
8147         ;;
8148 solaris2.*) #(vi
8149         cf_xopen_source="-D__EXTENSIONS__"
8150         ;;
8151 *)
8152
8153 echo "$as_me:8153: checking if we should define _XOPEN_SOURCE" >&5
8154 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8155 if test "${cf_cv_xopen_source+set}" = set; then
8156   echo $ECHO_N "(cached) $ECHO_C" >&6
8157 else
8158
8159         cat >conftest.$ac_ext <<_ACEOF
8160 #line 8160 "configure"
8161 #include "confdefs.h"
8162
8163 #include <stdlib.h>
8164 #include <string.h>
8165 #include <sys/types.h>
8166
8167 int
8168 main ()
8169 {
8170
8171 #ifndef _XOPEN_SOURCE
8172 make an error
8173 #endif
8174   ;
8175   return 0;
8176 }
8177 _ACEOF
8178 rm -f conftest.$ac_objext
8179 if { (eval echo "$as_me:8179: \"$ac_compile\"") >&5
8180   (eval $ac_compile) 2>&5
8181   ac_status=$?
8182   echo "$as_me:8182: \$? = $ac_status" >&5
8183   (exit $ac_status); } &&
8184          { ac_try='test -s conftest.$ac_objext'
8185   { (eval echo "$as_me:8185: \"$ac_try\"") >&5
8186   (eval $ac_try) 2>&5
8187   ac_status=$?
8188   echo "$as_me:8188: \$? = $ac_status" >&5
8189   (exit $ac_status); }; }; then
8190   cf_cv_xopen_source=no
8191 else
8192   echo "$as_me: failed program was:" >&5
8193 cat conftest.$ac_ext >&5
8194 cf_save="$CPPFLAGS"
8195          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8196          cat >conftest.$ac_ext <<_ACEOF
8197 #line 8197 "configure"
8198 #include "confdefs.h"
8199
8200 #include <stdlib.h>
8201 #include <string.h>
8202 #include <sys/types.h>
8203
8204 int
8205 main ()
8206 {
8207
8208 #ifdef _XOPEN_SOURCE
8209 make an error
8210 #endif
8211   ;
8212   return 0;
8213 }
8214 _ACEOF
8215 rm -f conftest.$ac_objext
8216 if { (eval echo "$as_me:8216: \"$ac_compile\"") >&5
8217   (eval $ac_compile) 2>&5
8218   ac_status=$?
8219   echo "$as_me:8219: \$? = $ac_status" >&5
8220   (exit $ac_status); } &&
8221          { ac_try='test -s conftest.$ac_objext'
8222   { (eval echo "$as_me:8222: \"$ac_try\"") >&5
8223   (eval $ac_try) 2>&5
8224   ac_status=$?
8225   echo "$as_me:8225: \$? = $ac_status" >&5
8226   (exit $ac_status); }; }; then
8227   cf_cv_xopen_source=no
8228 else
8229   echo "$as_me: failed program was:" >&5
8230 cat conftest.$ac_ext >&5
8231 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8232 fi
8233 rm -f conftest.$ac_objext conftest.$ac_ext
8234         CPPFLAGS="$cf_save"
8235
8236 fi
8237 rm -f conftest.$ac_objext conftest.$ac_ext
8238
8239 fi
8240 echo "$as_me:8240: result: $cf_cv_xopen_source" >&5
8241 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8242
8243 if test "$cf_cv_xopen_source" != no ; then
8244
8245 CFLAGS=`echo "$CFLAGS" | \
8246         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8247                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8248
8249 CPPFLAGS=`echo "$CPPFLAGS" | \
8250         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8251                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8252
8253         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8254
8255 cf_fix_cppflags=no
8256 cf_new_cflags=
8257 cf_new_cppflags=
8258 cf_new_extra_cppflags=
8259
8260 for cf_add_cflags in $cf_temp_xopen_source
8261 do
8262 case $cf_fix_cppflags in
8263 no)
8264         case $cf_add_cflags in #(vi
8265         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8266                 case $cf_add_cflags in
8267                 -D*)
8268                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8269
8270                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8271                                 && test -z "${cf_tst_cflags}" \
8272                                 && cf_fix_cppflags=yes
8273
8274                         if test $cf_fix_cppflags = yes ; then
8275                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8276                                 continue
8277                         elif test "${cf_tst_cflags}" = "\"'" ; then
8278                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8279                                 continue
8280                         fi
8281                         ;;
8282                 esac
8283                 case "$CPPFLAGS" in
8284                 *$cf_add_cflags) #(vi
8285                         ;;
8286                 *) #(vi
8287                         case $cf_add_cflags in #(vi
8288                         -D*)
8289                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8290
8291 CPPFLAGS=`echo "$CPPFLAGS" | \
8292         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8293                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8294
8295                                 ;;
8296                         esac
8297                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8298                         ;;
8299                 esac
8300                 ;;
8301         *)
8302                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8303                 ;;
8304         esac
8305         ;;
8306 yes)
8307         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8308
8309         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8310
8311         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8312                 && test -z "${cf_tst_cflags}" \
8313                 && cf_fix_cppflags=no
8314         ;;
8315 esac
8316 done
8317
8318 if test -n "$cf_new_cflags" ; then
8319
8320         CFLAGS="$CFLAGS $cf_new_cflags"
8321 fi
8322
8323 if test -n "$cf_new_cppflags" ; then
8324
8325         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8326 fi
8327
8328 if test -n "$cf_new_extra_cppflags" ; then
8329
8330         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8331 fi
8332
8333 fi
8334
8335 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8336
8337 cf_save_CFLAGS="$CFLAGS"
8338 cf_save_CPPFLAGS="$CPPFLAGS"
8339
8340 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8341         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8342                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8343
8344 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8345         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8346                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8347
8348 echo "$as_me:8348: checking if we should define _POSIX_C_SOURCE" >&5
8349 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8350 if test "${cf_cv_posix_c_source+set}" = set; then
8351   echo $ECHO_N "(cached) $ECHO_C" >&6
8352 else
8353
8354 echo "${as_me:-configure}:8354: testing if the symbol is already defined go no further ..." 1>&5
8355
8356         cat >conftest.$ac_ext <<_ACEOF
8357 #line 8357 "configure"
8358 #include "confdefs.h"
8359 #include <sys/types.h>
8360 int
8361 main ()
8362 {
8363
8364 #ifndef _POSIX_C_SOURCE
8365 make an error
8366 #endif
8367   ;
8368   return 0;
8369 }
8370 _ACEOF
8371 rm -f conftest.$ac_objext
8372 if { (eval echo "$as_me:8372: \"$ac_compile\"") >&5
8373   (eval $ac_compile) 2>&5
8374   ac_status=$?
8375   echo "$as_me:8375: \$? = $ac_status" >&5
8376   (exit $ac_status); } &&
8377          { ac_try='test -s conftest.$ac_objext'
8378   { (eval echo "$as_me:8378: \"$ac_try\"") >&5
8379   (eval $ac_try) 2>&5
8380   ac_status=$?
8381   echo "$as_me:8381: \$? = $ac_status" >&5
8382   (exit $ac_status); }; }; then
8383   cf_cv_posix_c_source=no
8384 else
8385   echo "$as_me: failed program was:" >&5
8386 cat conftest.$ac_ext >&5
8387 cf_want_posix_source=no
8388          case .$cf_POSIX_C_SOURCE in #(vi
8389          .[12]??*) #(vi
8390                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8391                 ;;
8392          .2) #(vi
8393                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8394                 cf_want_posix_source=yes
8395                 ;;
8396          .*)
8397                 cf_want_posix_source=yes
8398                 ;;
8399          esac
8400          if test "$cf_want_posix_source" = yes ; then
8401                 cat >conftest.$ac_ext <<_ACEOF
8402 #line 8402 "configure"
8403 #include "confdefs.h"
8404 #include <sys/types.h>
8405 int
8406 main ()
8407 {
8408
8409 #ifdef _POSIX_SOURCE
8410 make an error
8411 #endif
8412   ;
8413   return 0;
8414 }
8415 _ACEOF
8416 rm -f conftest.$ac_objext
8417 if { (eval echo "$as_me:8417: \"$ac_compile\"") >&5
8418   (eval $ac_compile) 2>&5
8419   ac_status=$?
8420   echo "$as_me:8420: \$? = $ac_status" >&5
8421   (exit $ac_status); } &&
8422          { ac_try='test -s conftest.$ac_objext'
8423   { (eval echo "$as_me:8423: \"$ac_try\"") >&5
8424   (eval $ac_try) 2>&5
8425   ac_status=$?
8426   echo "$as_me:8426: \$? = $ac_status" >&5
8427   (exit $ac_status); }; }; then
8428   :
8429 else
8430   echo "$as_me: failed program was:" >&5
8431 cat conftest.$ac_ext >&5
8432 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8433 fi
8434 rm -f conftest.$ac_objext conftest.$ac_ext
8435          fi
8436
8437 echo "${as_me:-configure}:8437: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8438
8439          CFLAGS="$cf_trim_CFLAGS"
8440          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8441
8442 echo "${as_me:-configure}:8442: testing if the second compile does not leave our definition intact error ..." 1>&5
8443
8444          cat >conftest.$ac_ext <<_ACEOF
8445 #line 8445 "configure"
8446 #include "confdefs.h"
8447 #include <sys/types.h>
8448 int
8449 main ()
8450 {
8451
8452 #ifndef _POSIX_C_SOURCE
8453 make an error
8454 #endif
8455   ;
8456   return 0;
8457 }
8458 _ACEOF
8459 rm -f conftest.$ac_objext
8460 if { (eval echo "$as_me:8460: \"$ac_compile\"") >&5
8461   (eval $ac_compile) 2>&5
8462   ac_status=$?
8463   echo "$as_me:8463: \$? = $ac_status" >&5
8464   (exit $ac_status); } &&
8465          { ac_try='test -s conftest.$ac_objext'
8466   { (eval echo "$as_me:8466: \"$ac_try\"") >&5
8467   (eval $ac_try) 2>&5
8468   ac_status=$?
8469   echo "$as_me:8469: \$? = $ac_status" >&5
8470   (exit $ac_status); }; }; then
8471   :
8472 else
8473   echo "$as_me: failed program was:" >&5
8474 cat conftest.$ac_ext >&5
8475 cf_cv_posix_c_source=no
8476 fi
8477 rm -f conftest.$ac_objext conftest.$ac_ext
8478          CFLAGS="$cf_save_CFLAGS"
8479          CPPFLAGS="$cf_save_CPPFLAGS"
8480
8481 fi
8482 rm -f conftest.$ac_objext conftest.$ac_ext
8483
8484 fi
8485 echo "$as_me:8485: result: $cf_cv_posix_c_source" >&5
8486 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8487
8488 if test "$cf_cv_posix_c_source" != no ; then
8489         CFLAGS="$cf_trim_CFLAGS"
8490         CPPFLAGS="$cf_trim_CPPFLAGS"
8491
8492 cf_fix_cppflags=no
8493 cf_new_cflags=
8494 cf_new_cppflags=
8495 cf_new_extra_cppflags=
8496
8497 for cf_add_cflags in $cf_cv_posix_c_source
8498 do
8499 case $cf_fix_cppflags in
8500 no)
8501         case $cf_add_cflags in #(vi
8502         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8503                 case $cf_add_cflags in
8504                 -D*)
8505                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8506
8507                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8508                                 && test -z "${cf_tst_cflags}" \
8509                                 && cf_fix_cppflags=yes
8510
8511                         if test $cf_fix_cppflags = yes ; then
8512                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8513                                 continue
8514                         elif test "${cf_tst_cflags}" = "\"'" ; then
8515                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8516                                 continue
8517                         fi
8518                         ;;
8519                 esac
8520                 case "$CPPFLAGS" in
8521                 *$cf_add_cflags) #(vi
8522                         ;;
8523                 *) #(vi
8524                         case $cf_add_cflags in #(vi
8525                         -D*)
8526                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8527
8528 CPPFLAGS=`echo "$CPPFLAGS" | \
8529         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8530                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8531
8532                                 ;;
8533                         esac
8534                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8535                         ;;
8536                 esac
8537                 ;;
8538         *)
8539                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8540                 ;;
8541         esac
8542         ;;
8543 yes)
8544         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8545
8546         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8547
8548         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8549                 && test -z "${cf_tst_cflags}" \
8550                 && cf_fix_cppflags=no
8551         ;;
8552 esac
8553 done
8554
8555 if test -n "$cf_new_cflags" ; then
8556
8557         CFLAGS="$CFLAGS $cf_new_cflags"
8558 fi
8559
8560 if test -n "$cf_new_cppflags" ; then
8561
8562         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8563 fi
8564
8565 if test -n "$cf_new_extra_cppflags" ; then
8566
8567         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8568 fi
8569
8570 fi
8571
8572         ;;
8573 esac
8574
8575 if test -n "$cf_xopen_source" ; then
8576
8577 cf_fix_cppflags=no
8578 cf_new_cflags=
8579 cf_new_cppflags=
8580 cf_new_extra_cppflags=
8581
8582 for cf_add_cflags in $cf_xopen_source
8583 do
8584 case $cf_fix_cppflags in
8585 no)
8586         case $cf_add_cflags in #(vi
8587         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8588                 case $cf_add_cflags in
8589                 -D*)
8590                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8591
8592                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8593                                 && test -z "${cf_tst_cflags}" \
8594                                 && cf_fix_cppflags=yes
8595
8596                         if test $cf_fix_cppflags = yes ; then
8597                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8598                                 continue
8599                         elif test "${cf_tst_cflags}" = "\"'" ; then
8600                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8601                                 continue
8602                         fi
8603                         ;;
8604                 esac
8605                 case "$CPPFLAGS" in
8606                 *$cf_add_cflags) #(vi
8607                         ;;
8608                 *) #(vi
8609                         case $cf_add_cflags in #(vi
8610                         -D*)
8611                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8612
8613 CPPFLAGS=`echo "$CPPFLAGS" | \
8614         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8615                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8616
8617                                 ;;
8618                         esac
8619                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8620                         ;;
8621                 esac
8622                 ;;
8623         *)
8624                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8625                 ;;
8626         esac
8627         ;;
8628 yes)
8629         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8630
8631         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8632
8633         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8634                 && test -z "${cf_tst_cflags}" \
8635                 && cf_fix_cppflags=no
8636         ;;
8637 esac
8638 done
8639
8640 if test -n "$cf_new_cflags" ; then
8641
8642         CFLAGS="$CFLAGS $cf_new_cflags"
8643 fi
8644
8645 if test -n "$cf_new_cppflags" ; then
8646
8647         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8648 fi
8649
8650 if test -n "$cf_new_extra_cppflags" ; then
8651
8652         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8653 fi
8654
8655 fi
8656
8657 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
8658         echo "$as_me:8658: checking if _XOPEN_SOURCE really is set" >&5
8659 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
8660         cat >conftest.$ac_ext <<_ACEOF
8661 #line 8661 "configure"
8662 #include "confdefs.h"
8663 #include <stdlib.h>
8664 int
8665 main ()
8666 {
8667
8668 #ifndef _XOPEN_SOURCE
8669 make an error
8670 #endif
8671   ;
8672   return 0;
8673 }
8674 _ACEOF
8675 rm -f conftest.$ac_objext
8676 if { (eval echo "$as_me:8676: \"$ac_compile\"") >&5
8677   (eval $ac_compile) 2>&5
8678   ac_status=$?
8679   echo "$as_me:8679: \$? = $ac_status" >&5
8680   (exit $ac_status); } &&
8681          { ac_try='test -s conftest.$ac_objext'
8682   { (eval echo "$as_me:8682: \"$ac_try\"") >&5
8683   (eval $ac_try) 2>&5
8684   ac_status=$?
8685   echo "$as_me:8685: \$? = $ac_status" >&5
8686   (exit $ac_status); }; }; then
8687   cf_XOPEN_SOURCE_set=yes
8688 else
8689   echo "$as_me: failed program was:" >&5
8690 cat conftest.$ac_ext >&5
8691 cf_XOPEN_SOURCE_set=no
8692 fi
8693 rm -f conftest.$ac_objext conftest.$ac_ext
8694         echo "$as_me:8694: result: $cf_XOPEN_SOURCE_set" >&5
8695 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
8696         if test $cf_XOPEN_SOURCE_set = yes
8697         then
8698                 cat >conftest.$ac_ext <<_ACEOF
8699 #line 8699 "configure"
8700 #include "confdefs.h"
8701 #include <stdlib.h>
8702 int
8703 main ()
8704 {
8705
8706 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
8707 make an error
8708 #endif
8709   ;
8710   return 0;
8711 }
8712 _ACEOF
8713 rm -f conftest.$ac_objext
8714 if { (eval echo "$as_me:8714: \"$ac_compile\"") >&5
8715   (eval $ac_compile) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); } &&
8719          { ac_try='test -s conftest.$ac_objext'
8720   { (eval echo "$as_me:8720: \"$ac_try\"") >&5
8721   (eval $ac_try) 2>&5
8722   ac_status=$?
8723   echo "$as_me:8723: \$? = $ac_status" >&5
8724   (exit $ac_status); }; }; then
8725   cf_XOPEN_SOURCE_set_ok=yes
8726 else
8727   echo "$as_me: failed program was:" >&5
8728 cat conftest.$ac_ext >&5
8729 cf_XOPEN_SOURCE_set_ok=no
8730 fi
8731 rm -f conftest.$ac_objext conftest.$ac_ext
8732                 if test $cf_XOPEN_SOURCE_set_ok = no
8733                 then
8734                         { echo "$as_me:8734: WARNING: _XOPEN_SOURCE is lower than requested" >&5
8735 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
8736                 fi
8737         else
8738
8739 echo "$as_me:8739: checking if we should define _XOPEN_SOURCE" >&5
8740 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8741 if test "${cf_cv_xopen_source+set}" = set; then
8742   echo $ECHO_N "(cached) $ECHO_C" >&6
8743 else
8744
8745         cat >conftest.$ac_ext <<_ACEOF
8746 #line 8746 "configure"
8747 #include "confdefs.h"
8748
8749 #include <stdlib.h>
8750 #include <string.h>
8751 #include <sys/types.h>
8752
8753 int
8754 main ()
8755 {
8756
8757 #ifndef _XOPEN_SOURCE
8758 make an error
8759 #endif
8760   ;
8761   return 0;
8762 }
8763 _ACEOF
8764 rm -f conftest.$ac_objext
8765 if { (eval echo "$as_me:8765: \"$ac_compile\"") >&5
8766   (eval $ac_compile) 2>&5
8767   ac_status=$?
8768   echo "$as_me:8768: \$? = $ac_status" >&5
8769   (exit $ac_status); } &&
8770          { ac_try='test -s conftest.$ac_objext'
8771   { (eval echo "$as_me:8771: \"$ac_try\"") >&5
8772   (eval $ac_try) 2>&5
8773   ac_status=$?
8774   echo "$as_me:8774: \$? = $ac_status" >&5
8775   (exit $ac_status); }; }; then
8776   cf_cv_xopen_source=no
8777 else
8778   echo "$as_me: failed program was:" >&5
8779 cat conftest.$ac_ext >&5
8780 cf_save="$CPPFLAGS"
8781          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8782          cat >conftest.$ac_ext <<_ACEOF
8783 #line 8783 "configure"
8784 #include "confdefs.h"
8785
8786 #include <stdlib.h>
8787 #include <string.h>
8788 #include <sys/types.h>
8789
8790 int
8791 main ()
8792 {
8793
8794 #ifdef _XOPEN_SOURCE
8795 make an error
8796 #endif
8797   ;
8798   return 0;
8799 }
8800 _ACEOF
8801 rm -f conftest.$ac_objext
8802 if { (eval echo "$as_me:8802: \"$ac_compile\"") >&5
8803   (eval $ac_compile) 2>&5
8804   ac_status=$?
8805   echo "$as_me:8805: \$? = $ac_status" >&5
8806   (exit $ac_status); } &&
8807          { ac_try='test -s conftest.$ac_objext'
8808   { (eval echo "$as_me:8808: \"$ac_try\"") >&5
8809   (eval $ac_try) 2>&5
8810   ac_status=$?
8811   echo "$as_me:8811: \$? = $ac_status" >&5
8812   (exit $ac_status); }; }; then
8813   cf_cv_xopen_source=no
8814 else
8815   echo "$as_me: failed program was:" >&5
8816 cat conftest.$ac_ext >&5
8817 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8818 fi
8819 rm -f conftest.$ac_objext conftest.$ac_ext
8820         CPPFLAGS="$cf_save"
8821
8822 fi
8823 rm -f conftest.$ac_objext conftest.$ac_ext
8824
8825 fi
8826 echo "$as_me:8826: result: $cf_cv_xopen_source" >&5
8827 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8828
8829 if test "$cf_cv_xopen_source" != no ; then
8830
8831 CFLAGS=`echo "$CFLAGS" | \
8832         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8833                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8834
8835 CPPFLAGS=`echo "$CPPFLAGS" | \
8836         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8837                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8838
8839         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8840
8841 cf_fix_cppflags=no
8842 cf_new_cflags=
8843 cf_new_cppflags=
8844 cf_new_extra_cppflags=
8845
8846 for cf_add_cflags in $cf_temp_xopen_source
8847 do
8848 case $cf_fix_cppflags in
8849 no)
8850         case $cf_add_cflags in #(vi
8851         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8852                 case $cf_add_cflags in
8853                 -D*)
8854                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8855
8856                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8857                                 && test -z "${cf_tst_cflags}" \
8858                                 && cf_fix_cppflags=yes
8859
8860                         if test $cf_fix_cppflags = yes ; then
8861                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8862                                 continue
8863                         elif test "${cf_tst_cflags}" = "\"'" ; then
8864                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8865                                 continue
8866                         fi
8867                         ;;
8868                 esac
8869                 case "$CPPFLAGS" in
8870                 *$cf_add_cflags) #(vi
8871                         ;;
8872                 *) #(vi
8873                         case $cf_add_cflags in #(vi
8874                         -D*)
8875                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8876
8877 CPPFLAGS=`echo "$CPPFLAGS" | \
8878         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8879                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8880
8881                                 ;;
8882                         esac
8883                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8884                         ;;
8885                 esac
8886                 ;;
8887         *)
8888                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8889                 ;;
8890         esac
8891         ;;
8892 yes)
8893         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8894
8895         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8896
8897         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8898                 && test -z "${cf_tst_cflags}" \
8899                 && cf_fix_cppflags=no
8900         ;;
8901 esac
8902 done
8903
8904 if test -n "$cf_new_cflags" ; then
8905
8906         CFLAGS="$CFLAGS $cf_new_cflags"
8907 fi
8908
8909 if test -n "$cf_new_cppflags" ; then
8910
8911         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8912 fi
8913
8914 if test -n "$cf_new_extra_cppflags" ; then
8915
8916         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8917 fi
8918
8919 fi
8920
8921         fi
8922 fi
8923
8924 # Check whether --enable-largefile or --disable-largefile was given.
8925 if test "${enable_largefile+set}" = set; then
8926   enableval="$enable_largefile"
8927
8928 fi;
8929 if test "$enable_largefile" != no; then
8930
8931   echo "$as_me:8931: checking for special C compiler options needed for large files" >&5
8932 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
8933 if test "${ac_cv_sys_largefile_CC+set}" = set; then
8934   echo $ECHO_N "(cached) $ECHO_C" >&6
8935 else
8936   ac_cv_sys_largefile_CC=no
8937      if test "$GCC" != yes; then
8938        ac_save_CC=$CC
8939        while :; do
8940          # IRIX 6.2 and later do not support large files by default,
8941          # so use the C compiler's -n32 option if that helps.
8942          cat >conftest.$ac_ext <<_ACEOF
8943 #line 8943 "configure"
8944 #include "confdefs.h"
8945 #include <sys/types.h>
8946  /* Check that off_t can represent 2**63 - 1 correctly.
8947     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8948     since some C++ compilers masquerading as C compilers
8949     incorrectly reject 9223372036854775807.  */
8950 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8951   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8952                        && LARGE_OFF_T % 2147483647 == 1)
8953                       ? 1 : -1];
8954 int
8955 main ()
8956 {
8957
8958   ;
8959   return 0;
8960 }
8961 _ACEOF
8962          rm -f conftest.$ac_objext
8963 if { (eval echo "$as_me:8963: \"$ac_compile\"") >&5
8964   (eval $ac_compile) 2>&5
8965   ac_status=$?
8966   echo "$as_me:8966: \$? = $ac_status" >&5
8967   (exit $ac_status); } &&
8968          { ac_try='test -s conftest.$ac_objext'
8969   { (eval echo "$as_me:8969: \"$ac_try\"") >&5
8970   (eval $ac_try) 2>&5
8971   ac_status=$?
8972   echo "$as_me:8972: \$? = $ac_status" >&5
8973   (exit $ac_status); }; }; then
8974   break
8975 else
8976   echo "$as_me: failed program was:" >&5
8977 cat conftest.$ac_ext >&5
8978 fi
8979 rm -f conftest.$ac_objext
8980          CC="$CC -n32"
8981          rm -f conftest.$ac_objext
8982 if { (eval echo "$as_me:8982: \"$ac_compile\"") >&5
8983   (eval $ac_compile) 2>&5
8984   ac_status=$?
8985   echo "$as_me:8985: \$? = $ac_status" >&5
8986   (exit $ac_status); } &&
8987          { ac_try='test -s conftest.$ac_objext'
8988   { (eval echo "$as_me:8988: \"$ac_try\"") >&5
8989   (eval $ac_try) 2>&5
8990   ac_status=$?
8991   echo "$as_me:8991: \$? = $ac_status" >&5
8992   (exit $ac_status); }; }; then
8993   ac_cv_sys_largefile_CC=' -n32'; break
8994 else
8995   echo "$as_me: failed program was:" >&5
8996 cat conftest.$ac_ext >&5
8997 fi
8998 rm -f conftest.$ac_objext
8999          break
9000        done
9001        CC=$ac_save_CC
9002        rm -f conftest.$ac_ext
9003     fi
9004 fi
9005 echo "$as_me:9005: result: $ac_cv_sys_largefile_CC" >&5
9006 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
9007   if test "$ac_cv_sys_largefile_CC" != no; then
9008     CC=$CC$ac_cv_sys_largefile_CC
9009   fi
9010
9011   echo "$as_me:9011: checking for _FILE_OFFSET_BITS value needed for large files" >&5
9012 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
9013 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
9014   echo $ECHO_N "(cached) $ECHO_C" >&6
9015 else
9016   while :; do
9017   ac_cv_sys_file_offset_bits=no
9018   cat >conftest.$ac_ext <<_ACEOF
9019 #line 9019 "configure"
9020 #include "confdefs.h"
9021 #include <sys/types.h>
9022  /* Check that off_t can represent 2**63 - 1 correctly.
9023     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9024     since some C++ compilers masquerading as C compilers
9025     incorrectly reject 9223372036854775807.  */
9026 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9027   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9028                        && LARGE_OFF_T % 2147483647 == 1)
9029                       ? 1 : -1];
9030 int
9031 main ()
9032 {
9033
9034   ;
9035   return 0;
9036 }
9037 _ACEOF
9038 rm -f conftest.$ac_objext
9039 if { (eval echo "$as_me:9039: \"$ac_compile\"") >&5
9040   (eval $ac_compile) 2>&5
9041   ac_status=$?
9042   echo "$as_me:9042: \$? = $ac_status" >&5
9043   (exit $ac_status); } &&
9044          { ac_try='test -s conftest.$ac_objext'
9045   { (eval echo "$as_me:9045: \"$ac_try\"") >&5
9046   (eval $ac_try) 2>&5
9047   ac_status=$?
9048   echo "$as_me:9048: \$? = $ac_status" >&5
9049   (exit $ac_status); }; }; then
9050   break
9051 else
9052   echo "$as_me: failed program was:" >&5
9053 cat conftest.$ac_ext >&5
9054 fi
9055 rm -f conftest.$ac_objext conftest.$ac_ext
9056   cat >conftest.$ac_ext <<_ACEOF
9057 #line 9057 "configure"
9058 #include "confdefs.h"
9059 #define _FILE_OFFSET_BITS 64
9060 #include <sys/types.h>
9061  /* Check that off_t can represent 2**63 - 1 correctly.
9062     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9063     since some C++ compilers masquerading as C compilers
9064     incorrectly reject 9223372036854775807.  */
9065 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9066   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9067                        && LARGE_OFF_T % 2147483647 == 1)
9068                       ? 1 : -1];
9069 int
9070 main ()
9071 {
9072
9073   ;
9074   return 0;
9075 }
9076 _ACEOF
9077 rm -f conftest.$ac_objext
9078 if { (eval echo "$as_me:9078: \"$ac_compile\"") >&5
9079   (eval $ac_compile) 2>&5
9080   ac_status=$?
9081   echo "$as_me:9081: \$? = $ac_status" >&5
9082   (exit $ac_status); } &&
9083          { ac_try='test -s conftest.$ac_objext'
9084   { (eval echo "$as_me:9084: \"$ac_try\"") >&5
9085   (eval $ac_try) 2>&5
9086   ac_status=$?
9087   echo "$as_me:9087: \$? = $ac_status" >&5
9088   (exit $ac_status); }; }; then
9089   ac_cv_sys_file_offset_bits=64; break
9090 else
9091   echo "$as_me: failed program was:" >&5
9092 cat conftest.$ac_ext >&5
9093 fi
9094 rm -f conftest.$ac_objext conftest.$ac_ext
9095   break
9096 done
9097 fi
9098 echo "$as_me:9098: result: $ac_cv_sys_file_offset_bits" >&5
9099 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
9100 if test "$ac_cv_sys_file_offset_bits" != no; then
9101
9102 cat >>confdefs.h <<EOF
9103 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
9104 EOF
9105
9106 fi
9107 rm -rf conftest*
9108   echo "$as_me:9108: checking for _LARGE_FILES value needed for large files" >&5
9109 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
9110 if test "${ac_cv_sys_large_files+set}" = set; then
9111   echo $ECHO_N "(cached) $ECHO_C" >&6
9112 else
9113   while :; do
9114   ac_cv_sys_large_files=no
9115   cat >conftest.$ac_ext <<_ACEOF
9116 #line 9116 "configure"
9117 #include "confdefs.h"
9118 #include <sys/types.h>
9119  /* Check that off_t can represent 2**63 - 1 correctly.
9120     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9121     since some C++ compilers masquerading as C compilers
9122     incorrectly reject 9223372036854775807.  */
9123 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9124   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9125                        && LARGE_OFF_T % 2147483647 == 1)
9126                       ? 1 : -1];
9127 int
9128 main ()
9129 {
9130
9131   ;
9132   return 0;
9133 }
9134 _ACEOF
9135 rm -f conftest.$ac_objext
9136 if { (eval echo "$as_me:9136: \"$ac_compile\"") >&5
9137   (eval $ac_compile) 2>&5
9138   ac_status=$?
9139   echo "$as_me:9139: \$? = $ac_status" >&5
9140   (exit $ac_status); } &&
9141          { ac_try='test -s conftest.$ac_objext'
9142   { (eval echo "$as_me:9142: \"$ac_try\"") >&5
9143   (eval $ac_try) 2>&5
9144   ac_status=$?
9145   echo "$as_me:9145: \$? = $ac_status" >&5
9146   (exit $ac_status); }; }; then
9147   break
9148 else
9149   echo "$as_me: failed program was:" >&5
9150 cat conftest.$ac_ext >&5
9151 fi
9152 rm -f conftest.$ac_objext conftest.$ac_ext
9153   cat >conftest.$ac_ext <<_ACEOF
9154 #line 9154 "configure"
9155 #include "confdefs.h"
9156 #define _LARGE_FILES 1
9157 #include <sys/types.h>
9158  /* Check that off_t can represent 2**63 - 1 correctly.
9159     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9160     since some C++ compilers masquerading as C compilers
9161     incorrectly reject 9223372036854775807.  */
9162 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9163   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9164                        && LARGE_OFF_T % 2147483647 == 1)
9165                       ? 1 : -1];
9166 int
9167 main ()
9168 {
9169
9170   ;
9171   return 0;
9172 }
9173 _ACEOF
9174 rm -f conftest.$ac_objext
9175 if { (eval echo "$as_me:9175: \"$ac_compile\"") >&5
9176   (eval $ac_compile) 2>&5
9177   ac_status=$?
9178   echo "$as_me:9178: \$? = $ac_status" >&5
9179   (exit $ac_status); } &&
9180          { ac_try='test -s conftest.$ac_objext'
9181   { (eval echo "$as_me:9181: \"$ac_try\"") >&5
9182   (eval $ac_try) 2>&5
9183   ac_status=$?
9184   echo "$as_me:9184: \$? = $ac_status" >&5
9185   (exit $ac_status); }; }; then
9186   ac_cv_sys_large_files=1; break
9187 else
9188   echo "$as_me: failed program was:" >&5
9189 cat conftest.$ac_ext >&5
9190 fi
9191 rm -f conftest.$ac_objext conftest.$ac_ext
9192   break
9193 done
9194 fi
9195 echo "$as_me:9195: result: $ac_cv_sys_large_files" >&5
9196 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
9197 if test "$ac_cv_sys_large_files" != no; then
9198
9199 cat >>confdefs.h <<EOF
9200 #define _LARGE_FILES $ac_cv_sys_large_files
9201 EOF
9202
9203 fi
9204 rm -rf conftest*
9205 fi
9206
9207     if test "$enable_largefile" != no ; then
9208         echo "$as_me:9208: checking for _LARGEFILE_SOURCE value needed for large files" >&5
9209 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
9210 if test "${ac_cv_sys_largefile_source+set}" = set; then
9211   echo $ECHO_N "(cached) $ECHO_C" >&6
9212 else
9213   while :; do
9214   ac_cv_sys_largefile_source=no
9215   cat >conftest.$ac_ext <<_ACEOF
9216 #line 9216 "configure"
9217 #include "confdefs.h"
9218 #include <stdio.h>
9219 int
9220 main ()
9221 {
9222 return !fseeko;
9223   ;
9224   return 0;
9225 }
9226 _ACEOF
9227 rm -f conftest.$ac_objext
9228 if { (eval echo "$as_me:9228: \"$ac_compile\"") >&5
9229   (eval $ac_compile) 2>&5
9230   ac_status=$?
9231   echo "$as_me:9231: \$? = $ac_status" >&5
9232   (exit $ac_status); } &&
9233          { ac_try='test -s conftest.$ac_objext'
9234   { (eval echo "$as_me:9234: \"$ac_try\"") >&5
9235   (eval $ac_try) 2>&5
9236   ac_status=$?
9237   echo "$as_me:9237: \$? = $ac_status" >&5
9238   (exit $ac_status); }; }; then
9239   break
9240 else
9241   echo "$as_me: failed program was:" >&5
9242 cat conftest.$ac_ext >&5
9243 fi
9244 rm -f conftest.$ac_objext conftest.$ac_ext
9245   cat >conftest.$ac_ext <<_ACEOF
9246 #line 9246 "configure"
9247 #include "confdefs.h"
9248 #define _LARGEFILE_SOURCE 1
9249 #include <stdio.h>
9250 int
9251 main ()
9252 {
9253 return !fseeko;
9254   ;
9255   return 0;
9256 }
9257 _ACEOF
9258 rm -f conftest.$ac_objext
9259 if { (eval echo "$as_me:9259: \"$ac_compile\"") >&5
9260   (eval $ac_compile) 2>&5
9261   ac_status=$?
9262   echo "$as_me:9262: \$? = $ac_status" >&5
9263   (exit $ac_status); } &&
9264          { ac_try='test -s conftest.$ac_objext'
9265   { (eval echo "$as_me:9265: \"$ac_try\"") >&5
9266   (eval $ac_try) 2>&5
9267   ac_status=$?
9268   echo "$as_me:9268: \$? = $ac_status" >&5
9269   (exit $ac_status); }; }; then
9270   ac_cv_sys_largefile_source=1; break
9271 else
9272   echo "$as_me: failed program was:" >&5
9273 cat conftest.$ac_ext >&5
9274 fi
9275 rm -f conftest.$ac_objext conftest.$ac_ext
9276   break
9277 done
9278 fi
9279 echo "$as_me:9279: result: $ac_cv_sys_largefile_source" >&5
9280 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
9281 if test "$ac_cv_sys_largefile_source" != no; then
9282
9283 cat >>confdefs.h <<EOF
9284 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
9285 EOF
9286
9287 fi
9288 rm -rf conftest*
9289
9290 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
9291 # in glibc 2.1.3, but that breaks too many other things.
9292 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
9293 echo "$as_me:9293: checking for fseeko" >&5
9294 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
9295 if test "${ac_cv_func_fseeko+set}" = set; then
9296   echo $ECHO_N "(cached) $ECHO_C" >&6
9297 else
9298   cat >conftest.$ac_ext <<_ACEOF
9299 #line 9299 "configure"
9300 #include "confdefs.h"
9301 #include <stdio.h>
9302 int
9303 main ()
9304 {
9305 return fseeko && fseeko (stdin, 0, 0);
9306   ;
9307   return 0;
9308 }
9309 _ACEOF
9310 rm -f conftest.$ac_objext conftest$ac_exeext
9311 if { (eval echo "$as_me:9311: \"$ac_link\"") >&5
9312   (eval $ac_link) 2>&5
9313   ac_status=$?
9314   echo "$as_me:9314: \$? = $ac_status" >&5
9315   (exit $ac_status); } &&
9316          { ac_try='test -s conftest$ac_exeext'
9317   { (eval echo "$as_me:9317: \"$ac_try\"") >&5
9318   (eval $ac_try) 2>&5
9319   ac_status=$?
9320   echo "$as_me:9320: \$? = $ac_status" >&5
9321   (exit $ac_status); }; }; then
9322   ac_cv_func_fseeko=yes
9323 else
9324   echo "$as_me: failed program was:" >&5
9325 cat conftest.$ac_ext >&5
9326 ac_cv_func_fseeko=no
9327 fi
9328 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9329 fi
9330 echo "$as_me:9330: result: $ac_cv_func_fseeko" >&5
9331 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
9332 if test $ac_cv_func_fseeko = yes; then
9333
9334 cat >>confdefs.h <<\EOF
9335 #define HAVE_FSEEKO 1
9336 EOF
9337
9338 fi
9339
9340         # Normally we would collect these definitions in the config.h,
9341         # but (like _XOPEN_SOURCE), some environments rely on having these
9342         # defined before any of the system headers are included.  Another
9343         # case comes up with C++, e.g., on AIX the compiler compiles the
9344         # header files by themselves before looking at the body files it is
9345         # told to compile.  For ncurses, those header files do not include
9346         # the config.h
9347         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
9348         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
9349         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
9350
9351         echo "$as_me:9351: checking whether to use struct dirent64" >&5
9352 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
9353 if test "${cf_cv_struct_dirent64+set}" = set; then
9354   echo $ECHO_N "(cached) $ECHO_C" >&6
9355 else
9356
9357                 cat >conftest.$ac_ext <<_ACEOF
9358 #line 9358 "configure"
9359 #include "confdefs.h"
9360
9361 #include <sys/types.h>
9362 #include <dirent.h>
9363
9364 int
9365 main ()
9366 {
9367
9368                 /* if transitional largefile support is setup, this is true */
9369                 extern struct dirent64 * readdir(DIR *);
9370                 struct dirent64 *x = readdir((DIR *)0);
9371                 struct dirent *y = readdir((DIR *)0);
9372                 int z = x - y;
9373
9374   ;
9375   return 0;
9376 }
9377 _ACEOF
9378 rm -f conftest.$ac_objext
9379 if { (eval echo "$as_me:9379: \"$ac_compile\"") >&5
9380   (eval $ac_compile) 2>&5
9381   ac_status=$?
9382   echo "$as_me:9382: \$? = $ac_status" >&5
9383   (exit $ac_status); } &&
9384          { ac_try='test -s conftest.$ac_objext'
9385   { (eval echo "$as_me:9385: \"$ac_try\"") >&5
9386   (eval $ac_try) 2>&5
9387   ac_status=$?
9388   echo "$as_me:9388: \$? = $ac_status" >&5
9389   (exit $ac_status); }; }; then
9390   cf_cv_struct_dirent64=yes
9391 else
9392   echo "$as_me: failed program was:" >&5
9393 cat conftest.$ac_ext >&5
9394 cf_cv_struct_dirent64=no
9395 fi
9396 rm -f conftest.$ac_objext conftest.$ac_ext
9397
9398 fi
9399 echo "$as_me:9399: result: $cf_cv_struct_dirent64" >&5
9400 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
9401         test "$cf_cv_struct_dirent64" = yes &&
9402 cat >>confdefs.h <<\EOF
9403 #define HAVE_STRUCT_DIRENT64 1
9404 EOF
9405
9406     fi
9407
9408 ### Enable compiling-in rcs id's
9409 echo "$as_me:9409: checking if RCS identifiers should be compiled-in" >&5
9410 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
9411
9412 # Check whether --with-rcs-ids or --without-rcs-ids was given.
9413 if test "${with_rcs_ids+set}" = set; then
9414   withval="$with_rcs_ids"
9415   with_rcs_ids=$withval
9416 else
9417   with_rcs_ids=no
9418 fi;
9419 echo "$as_me:9419: result: $with_rcs_ids" >&5
9420 echo "${ECHO_T}$with_rcs_ids" >&6
9421 test "$with_rcs_ids" = yes &&
9422 cat >>confdefs.h <<\EOF
9423 #define USE_RCS_IDS 1
9424 EOF
9425
9426 ###############################################################################
9427
9428 ### Note that some functions (such as const) are normally disabled anyway.
9429 echo "$as_me:9429: checking if you want to build with function extensions" >&5
9430 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
9431
9432 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
9433 if test "${enable_ext_funcs+set}" = set; then
9434   enableval="$enable_ext_funcs"
9435   with_ext_funcs=$enableval
9436 else
9437   with_ext_funcs=yes
9438 fi;
9439 echo "$as_me:9439: result: $with_ext_funcs" >&5
9440 echo "${ECHO_T}$with_ext_funcs" >&6
9441 if test "$with_ext_funcs" = yes ; then
9442         NCURSES_EXT_FUNCS=1
9443
9444 cat >>confdefs.h <<\EOF
9445 #define HAVE_USE_DEFAULT_COLORS 1
9446 EOF
9447
9448 cat >>confdefs.h <<\EOF
9449 #define NCURSES_EXT_FUNCS 1
9450 EOF
9451
9452 else
9453         NCURSES_EXT_FUNCS=0
9454 fi
9455
9456 ###   use option --enable-const to turn on use of const beyond that in XSI.
9457 echo "$as_me:9457: checking for extended use of const keyword" >&5
9458 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
9459
9460 # Check whether --enable-const or --disable-const was given.
9461 if test "${enable_const+set}" = set; then
9462   enableval="$enable_const"
9463   with_ext_const=$enableval
9464 else
9465   with_ext_const=no
9466 fi;
9467 echo "$as_me:9467: result: $with_ext_const" >&5
9468 echo "${ECHO_T}$with_ext_const" >&6
9469 NCURSES_CONST='/*nothing*/'
9470 if test "$with_ext_const" = yes ; then
9471         NCURSES_CONST=const
9472 fi
9473
9474 ###############################################################################
9475 # These options are relatively safe to experiment with.
9476
9477 echo "$as_me:9477: checking if you want all development code" >&5
9478 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
9479
9480 # Check whether --with-develop or --without-develop was given.
9481 if test "${with_develop+set}" = set; then
9482   withval="$with_develop"
9483   with_develop=$withval
9484 else
9485   with_develop=no
9486 fi;
9487 echo "$as_me:9487: result: $with_develop" >&5
9488 echo "${ECHO_T}$with_develop" >&6
9489
9490 ###############################################################################
9491 # These are just experimental, probably should not be in a package:
9492
9493 # This is still experimental (20080329), but should ultimately be moved to
9494 # the script-block --with-normal, etc.
9495
9496 echo "$as_me:9496: checking if you want to link with the pthread library" >&5
9497 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
9498
9499 # Check whether --with-pthread or --without-pthread was given.
9500 if test "${with_pthread+set}" = set; then
9501   withval="$with_pthread"
9502   with_pthread=$withval
9503 else
9504   with_pthread=no
9505 fi;
9506 echo "$as_me:9506: result: $with_pthread" >&5
9507 echo "${ECHO_T}$with_pthread" >&6
9508
9509 if test "$with_pthread" != no ; then
9510     echo "$as_me:9510: checking for pthread.h" >&5
9511 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
9512 if test "${ac_cv_header_pthread_h+set}" = set; then
9513   echo $ECHO_N "(cached) $ECHO_C" >&6
9514 else
9515   cat >conftest.$ac_ext <<_ACEOF
9516 #line 9516 "configure"
9517 #include "confdefs.h"
9518 #include <pthread.h>
9519 _ACEOF
9520 if { (eval echo "$as_me:9520: \"$ac_cpp conftest.$ac_ext\"") >&5
9521   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9522   ac_status=$?
9523   egrep -v '^ *\+' conftest.er1 >conftest.err
9524   rm -f conftest.er1
9525   cat conftest.err >&5
9526   echo "$as_me:9526: \$? = $ac_status" >&5
9527   (exit $ac_status); } >/dev/null; then
9528   if test -s conftest.err; then
9529     ac_cpp_err=$ac_c_preproc_warn_flag
9530   else
9531     ac_cpp_err=
9532   fi
9533 else
9534   ac_cpp_err=yes
9535 fi
9536 if test -z "$ac_cpp_err"; then
9537   ac_cv_header_pthread_h=yes
9538 else
9539   echo "$as_me: failed program was:" >&5
9540   cat conftest.$ac_ext >&5
9541   ac_cv_header_pthread_h=no
9542 fi
9543 rm -f conftest.err conftest.$ac_ext
9544 fi
9545 echo "$as_me:9545: result: $ac_cv_header_pthread_h" >&5
9546 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
9547 if test $ac_cv_header_pthread_h = yes; then
9548
9549 cat >>confdefs.h <<\EOF
9550 #define HAVE_PTHREADS_H 1
9551 EOF
9552
9553         for cf_lib_pthread in pthread c_r
9554         do
9555             echo "$as_me:9555: checking if we can link with the $cf_lib_pthread library" >&5
9556 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
9557             cf_save_LIBS="$LIBS"
9558             LIBS="-l$cf_lib_pthread $LIBS"
9559             cat >conftest.$ac_ext <<_ACEOF
9560 #line 9560 "configure"
9561 #include "confdefs.h"
9562
9563 #include <pthread.h>
9564
9565 int
9566 main ()
9567 {
9568
9569                 int rc = pthread_create(0,0,0,0);
9570                 int r2 = pthread_mutexattr_settype(0, 0);
9571
9572   ;
9573   return 0;
9574 }
9575 _ACEOF
9576 rm -f conftest.$ac_objext conftest$ac_exeext
9577 if { (eval echo "$as_me:9577: \"$ac_link\"") >&5
9578   (eval $ac_link) 2>&5
9579   ac_status=$?
9580   echo "$as_me:9580: \$? = $ac_status" >&5
9581   (exit $ac_status); } &&
9582          { ac_try='test -s conftest$ac_exeext'
9583   { (eval echo "$as_me:9583: \"$ac_try\"") >&5
9584   (eval $ac_try) 2>&5
9585   ac_status=$?
9586   echo "$as_me:9586: \$? = $ac_status" >&5
9587   (exit $ac_status); }; }; then
9588   with_pthread=yes
9589 else
9590   echo "$as_me: failed program was:" >&5
9591 cat conftest.$ac_ext >&5
9592 with_pthread=no
9593 fi
9594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9595             LIBS="$cf_save_LIBS"
9596             echo "$as_me:9596: result: $with_pthread" >&5
9597 echo "${ECHO_T}$with_pthread" >&6
9598             test "$with_pthread" = yes && break
9599         done
9600
9601         if test "$with_pthread" = yes ; then
9602             LIBS="-l$cf_lib_pthread $LIBS"
9603
9604 cat >>confdefs.h <<\EOF
9605 #define HAVE_LIBPTHREADS 1
9606 EOF
9607
9608         else
9609             { { echo "$as_me:9609: error: Cannot link with pthread library" >&5
9610 echo "$as_me: error: Cannot link with pthread library" >&2;}
9611    { (exit 1); exit 1; }; }
9612         fi
9613
9614 fi
9615
9616 fi
9617
9618 echo "$as_me:9618: checking if you want to use weak-symbols for pthreads" >&5
9619 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
9620
9621 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
9622 if test "${enable_weak_symbols+set}" = set; then
9623   enableval="$enable_weak_symbols"
9624   use_weak_symbols=$withval
9625 else
9626   use_weak_symbols=no
9627 fi;
9628 echo "$as_me:9628: result: $use_weak_symbols" >&5
9629 echo "${ECHO_T}$use_weak_symbols" >&6
9630 if test "$use_weak_symbols" = yes ; then
9631
9632 echo "$as_me:9632: checking if $CC supports weak symbols" >&5
9633 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9634 if test "${cf_cv_weak_symbols+set}" = set; then
9635   echo $ECHO_N "(cached) $ECHO_C" >&6
9636 else
9637
9638 cat >conftest.$ac_ext <<_ACEOF
9639 #line 9639 "configure"
9640 #include "confdefs.h"
9641
9642 #include <stdio.h>
9643 int
9644 main ()
9645 {
9646
9647 #if defined(__GNUC__)
9648 #  if defined __USE_ISOC99
9649 #    define _cat_pragma(exp)    _Pragma(#exp)
9650 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9651 #  else
9652 #    define _weak_pragma(exp)
9653 #  endif
9654 #  define _declare(name)        __extension__ extern __typeof__(name) name
9655 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9656 #endif
9657
9658 weak_symbol(fopen);
9659
9660   ;
9661   return 0;
9662 }
9663 _ACEOF
9664 rm -f conftest.$ac_objext
9665 if { (eval echo "$as_me:9665: \"$ac_compile\"") >&5
9666   (eval $ac_compile) 2>&5
9667   ac_status=$?
9668   echo "$as_me:9668: \$? = $ac_status" >&5
9669   (exit $ac_status); } &&
9670          { ac_try='test -s conftest.$ac_objext'
9671   { (eval echo "$as_me:9671: \"$ac_try\"") >&5
9672   (eval $ac_try) 2>&5
9673   ac_status=$?
9674   echo "$as_me:9674: \$? = $ac_status" >&5
9675   (exit $ac_status); }; }; then
9676   cf_cv_weak_symbols=yes
9677 else
9678   echo "$as_me: failed program was:" >&5
9679 cat conftest.$ac_ext >&5
9680 cf_cv_weak_symbols=no
9681 fi
9682 rm -f conftest.$ac_objext conftest.$ac_ext
9683
9684 fi
9685 echo "$as_me:9685: result: $cf_cv_weak_symbols" >&5
9686 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9687
9688 else
9689     cf_cv_weak_symbols=no
9690 fi
9691
9692 if test $cf_cv_weak_symbols = yes ; then
9693
9694 cat >>confdefs.h <<\EOF
9695 #define USE_WEAK_SYMBOLS 1
9696 EOF
9697
9698 fi
9699
9700 PTHREAD=
9701 if test "$with_pthread" = "yes" ; then
9702
9703 cat >>confdefs.h <<\EOF
9704 #define USE_PTHREADS 1
9705 EOF
9706
9707     enable_reentrant=yes
9708     if test $cf_cv_weak_symbols = yes ; then
9709         PTHREAD=-lpthread
9710     fi
9711 fi
9712
9713 # OpenSUSE is installing ncurses6, using reentrant option.
9714 echo "$as_me:9714: checking for _nc_TABSIZE" >&5
9715 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
9716 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
9717   echo $ECHO_N "(cached) $ECHO_C" >&6
9718 else
9719   cat >conftest.$ac_ext <<_ACEOF
9720 #line 9720 "configure"
9721 #include "confdefs.h"
9722 /* System header to define __stub macros and hopefully few prototypes,
9723     which can conflict with char _nc_TABSIZE (); below.  */
9724 #include <assert.h>
9725 /* Override any gcc2 internal prototype to avoid an error.  */
9726 #ifdef __cplusplus
9727 extern "C"
9728 #endif
9729 /* We use char because int might match the return type of a gcc2
9730    builtin and then its argument prototype would still apply.  */
9731 char _nc_TABSIZE ();
9732 char (*f) ();
9733
9734 int
9735 main ()
9736 {
9737 /* The GNU C library defines this for functions which it implements
9738     to always fail with ENOSYS.  Some functions are actually named
9739     something starting with __ and the normal name is an alias.  */
9740 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
9741 choke me
9742 #else
9743 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9744 #endif
9745
9746   ;
9747   return 0;
9748 }
9749 _ACEOF
9750 rm -f conftest.$ac_objext conftest$ac_exeext
9751 if { (eval echo "$as_me:9751: \"$ac_link\"") >&5
9752   (eval $ac_link) 2>&5
9753   ac_status=$?
9754   echo "$as_me:9754: \$? = $ac_status" >&5
9755   (exit $ac_status); } &&
9756          { ac_try='test -s conftest$ac_exeext'
9757   { (eval echo "$as_me:9757: \"$ac_try\"") >&5
9758   (eval $ac_try) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); }; }; then
9762   ac_cv_func__nc_TABSIZE=yes
9763 else
9764   echo "$as_me: failed program was:" >&5
9765 cat conftest.$ac_ext >&5
9766 ac_cv_func__nc_TABSIZE=no
9767 fi
9768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9769 fi
9770 echo "$as_me:9770: result: $ac_cv_func__nc_TABSIZE" >&5
9771 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
9772 if test $ac_cv_func__nc_TABSIZE = yes; then
9773   assume_reentrant=yes
9774 else
9775   assume_reentrant=no
9776 fi
9777
9778 # Reentrant code has to be opaque; there's little advantage to making ncurses
9779 # opaque outside of that, so there is no --enable-opaque option.  We can use
9780 # this option without --with-pthreads, but this will be always set for
9781 # pthreads.
9782 echo "$as_me:9782: checking if you want experimental reentrant code" >&5
9783 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9784
9785 # Check whether --enable-reentrant or --disable-reentrant was given.
9786 if test "${enable_reentrant+set}" = set; then
9787   enableval="$enable_reentrant"
9788   with_reentrant=$enableval
9789 else
9790   with_reentrant=$assume_reentrant
9791 fi;
9792 echo "$as_me:9792: result: $with_reentrant" >&5
9793 echo "${ECHO_T}$with_reentrant" >&6
9794 if test "$with_reentrant" = yes ; then
9795         cf_cv_enable_reentrant=1
9796         if test $cf_cv_weak_symbols = yes ; then
9797
9798 # remove pthread library from $LIBS
9799 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9800
9801         elif test "$assume_reentrant" = no ; then
9802                 LIB_SUFFIX="t${LIB_SUFFIX}"
9803         fi
9804
9805 cat >>confdefs.h <<\EOF
9806 #define USE_REENTRANT 1
9807 EOF
9808
9809 else
9810         cf_cv_enable_reentrant=0
9811 fi
9812
9813 ### Allow using a different wrap-prefix
9814 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9815         echo "$as_me:9815: checking for prefix used to wrap public variables" >&5
9816 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9817
9818 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9819 if test "${with_wrap_prefix+set}" = set; then
9820   withval="$with_wrap_prefix"
9821   NCURSES_WRAP_PREFIX=$withval
9822 else
9823   NCURSES_WRAP_PREFIX=_nc_
9824 fi;
9825         echo "$as_me:9825: result: $NCURSES_WRAP_PREFIX" >&5
9826 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9827 else
9828         NCURSES_WRAP_PREFIX=_nc_
9829 fi
9830
9831 cat >>confdefs.h <<EOF
9832 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9833 EOF
9834
9835 ###############################################################################
9836
9837 ###     use option --disable-echo to suppress full display compiling commands
9838
9839 echo "$as_me:9839: checking if you want to see long compiling messages" >&5
9840 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
9841
9842 # Check whether --enable-echo or --disable-echo was given.
9843 if test "${enable_echo+set}" = set; then
9844   enableval="$enable_echo"
9845   test "$enableval" != no && enableval=yes
9846   if test "$enableval" != "yes" ; then
9847
9848     ECHO_LT='--silent'
9849     ECHO_LD='@echo linking $@;'
9850     RULE_CC='@echo compiling $<'
9851     SHOW_CC='@echo compiling $@'
9852     ECHO_CC='@'
9853
9854   else
9855
9856     ECHO_LT=''
9857     ECHO_LD=''
9858     RULE_CC=''
9859     SHOW_CC=''
9860     ECHO_CC=''
9861
9862   fi
9863 else
9864   enableval=yes
9865
9866     ECHO_LT=''
9867     ECHO_LD=''
9868     RULE_CC=''
9869     SHOW_CC=''
9870     ECHO_CC=''
9871
9872 fi;
9873 echo "$as_me:9873: result: $enableval" >&5
9874 echo "${ECHO_T}$enableval" >&6
9875
9876 ###     use option --enable-warnings to turn on all gcc warnings
9877 echo "$as_me:9877: checking if you want to see compiler warnings" >&5
9878 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
9879
9880 # Check whether --enable-warnings or --disable-warnings was given.
9881 if test "${enable_warnings+set}" = set; then
9882   enableval="$enable_warnings"
9883   with_warnings=$enableval
9884 fi;
9885 echo "$as_me:9885: result: $with_warnings" >&5
9886 echo "${ECHO_T}$with_warnings" >&6
9887
9888 if test "x$with_warnings" = "xyes"; then
9889
9890         ADAFLAGS="$ADAFLAGS -gnatg"
9891
9892 INTEL_COMPILER=no
9893
9894 if test "$GCC" = yes ; then
9895         case $host_os in
9896         linux*|gnu*)
9897                 echo "$as_me:9897: checking if this is really Intel C compiler" >&5
9898 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
9899                 cf_save_CFLAGS="$CFLAGS"
9900                 CFLAGS="$CFLAGS -no-gcc"
9901                 cat >conftest.$ac_ext <<_ACEOF
9902 #line 9902 "configure"
9903 #include "confdefs.h"
9904
9905 int
9906 main ()
9907 {
9908
9909 #ifdef __INTEL_COMPILER
9910 #else
9911 make an error
9912 #endif
9913
9914   ;
9915   return 0;
9916 }
9917 _ACEOF
9918 rm -f conftest.$ac_objext
9919 if { (eval echo "$as_me:9919: \"$ac_compile\"") >&5
9920   (eval $ac_compile) 2>&5
9921   ac_status=$?
9922   echo "$as_me:9922: \$? = $ac_status" >&5
9923   (exit $ac_status); } &&
9924          { ac_try='test -s conftest.$ac_objext'
9925   { (eval echo "$as_me:9925: \"$ac_try\"") >&5
9926   (eval $ac_try) 2>&5
9927   ac_status=$?
9928   echo "$as_me:9928: \$? = $ac_status" >&5
9929   (exit $ac_status); }; }; then
9930   INTEL_COMPILER=yes
9931 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
9932
9933 else
9934   echo "$as_me: failed program was:" >&5
9935 cat conftest.$ac_ext >&5
9936 fi
9937 rm -f conftest.$ac_objext conftest.$ac_ext
9938                 CFLAGS="$cf_save_CFLAGS"
9939                 echo "$as_me:9939: result: $INTEL_COMPILER" >&5
9940 echo "${ECHO_T}$INTEL_COMPILER" >&6
9941                 ;;
9942         esac
9943 fi
9944
9945 CLANG_COMPILER=no
9946
9947 if test "$GCC" = yes ; then
9948         echo "$as_me:9948: checking if this is really Clang C compiler" >&5
9949 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
9950         cf_save_CFLAGS="$CFLAGS"
9951         CFLAGS="$CFLAGS -Qunused-arguments"
9952         cat >conftest.$ac_ext <<_ACEOF
9953 #line 9953 "configure"
9954 #include "confdefs.h"
9955
9956 int
9957 main ()
9958 {
9959
9960 #ifdef __clang__
9961 #else
9962 make an error
9963 #endif
9964
9965   ;
9966   return 0;
9967 }
9968 _ACEOF
9969 rm -f conftest.$ac_objext
9970 if { (eval echo "$as_me:9970: \"$ac_compile\"") >&5
9971   (eval $ac_compile) 2>&5
9972   ac_status=$?
9973   echo "$as_me:9973: \$? = $ac_status" >&5
9974   (exit $ac_status); } &&
9975          { ac_try='test -s conftest.$ac_objext'
9976   { (eval echo "$as_me:9976: \"$ac_try\"") >&5
9977   (eval $ac_try) 2>&5
9978   ac_status=$?
9979   echo "$as_me:9979: \$? = $ac_status" >&5
9980   (exit $ac_status); }; }; then
9981   CLANG_COMPILER=yes
9982 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
9983
9984 else
9985   echo "$as_me: failed program was:" >&5
9986 cat conftest.$ac_ext >&5
9987 fi
9988 rm -f conftest.$ac_objext conftest.$ac_ext
9989         CFLAGS="$cf_save_CFLAGS"
9990         echo "$as_me:9990: result: $CLANG_COMPILER" >&5
9991 echo "${ECHO_T}$CLANG_COMPILER" >&6
9992 fi
9993
9994 cat > conftest.$ac_ext <<EOF
9995 #line 9995 "${as_me:-configure}"
9996 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
9997 EOF
9998
9999 if test "$INTEL_COMPILER" = yes
10000 then
10001 # The "-wdXXX" options suppress warnings:
10002 # remark #1419: external declaration in primary source file
10003 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
10004 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
10005 # remark #193: zero used for undefined preprocessing identifier
10006 # remark #593: variable "curs_sb_left_arrow" was set but never used
10007 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
10008 # remark #869: parameter "tw" was never referenced
10009 # remark #981: operands are evaluated in unspecified order
10010 # warning #279: controlling expression is constant
10011
10012         { echo "$as_me:10012: checking for $CC warning options..." >&5
10013 echo "$as_me: checking for $CC warning options..." >&6;}
10014         cf_save_CFLAGS="$CFLAGS"
10015         EXTRA_CFLAGS="-Wall"
10016         for cf_opt in \
10017                 wd1419 \
10018                 wd1683 \
10019                 wd1684 \
10020                 wd193 \
10021                 wd593 \
10022                 wd279 \
10023                 wd810 \
10024                 wd869 \
10025                 wd981
10026         do
10027                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10028                 if { (eval echo "$as_me:10028: \"$ac_compile\"") >&5
10029   (eval $ac_compile) 2>&5
10030   ac_status=$?
10031   echo "$as_me:10031: \$? = $ac_status" >&5
10032   (exit $ac_status); }; then
10033                         test -n "$verbose" && echo "$as_me:10033: result: ... -$cf_opt" >&5
10034 echo "${ECHO_T}... -$cf_opt" >&6
10035                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10036                 fi
10037         done
10038         CFLAGS="$cf_save_CFLAGS"
10039
10040 elif test "$GCC" = yes
10041 then
10042         { echo "$as_me:10042: checking for $CC warning options..." >&5
10043 echo "$as_me: checking for $CC warning options..." >&6;}
10044         cf_save_CFLAGS="$CFLAGS"
10045         EXTRA_CFLAGS=
10046         cf_warn_CONST=""
10047         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
10048         for cf_opt in W Wall \
10049                 Wbad-function-cast \
10050                 Wcast-align \
10051                 Wcast-qual \
10052                 Winline \
10053                 Wmissing-declarations \
10054                 Wmissing-prototypes \
10055                 Wnested-externs \
10056                 Wpointer-arith \
10057                 Wshadow \
10058                 Wstrict-prototypes \
10059                 Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
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                         case $cf_opt in #(vi
10070                         Wcast-qual) #(vi
10071                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
10072                                 ;;
10073                         Winline) #(vi
10074                                 case $GCC_VERSION in
10075                                 [34].*)
10076                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10077
10078 echo "${as_me:-configure}:10078: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10079
10080                                         continue;;
10081                                 esac
10082                                 ;;
10083                         Wpointer-arith) #(vi
10084                                 case $GCC_VERSION in
10085                                 [12].*)
10086                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10087
10088 echo "${as_me:-configure}:10088: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10089
10090                                         continue;;
10091                                 esac
10092                                 ;;
10093                         esac
10094                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10095                 fi
10096         done
10097         CFLAGS="$cf_save_CFLAGS"
10098 fi
10099 rm -rf conftest*
10100
10101 fi
10102
10103 if test "$GCC" = yes
10104 then
10105 cat > conftest.i <<EOF
10106 #ifndef GCC_PRINTF
10107 #define GCC_PRINTF 0
10108 #endif
10109 #ifndef GCC_SCANF
10110 #define GCC_SCANF 0
10111 #endif
10112 #ifndef GCC_NORETURN
10113 #define GCC_NORETURN /* nothing */
10114 #endif
10115 #ifndef GCC_UNUSED
10116 #define GCC_UNUSED /* nothing */
10117 #endif
10118 EOF
10119 if test "$GCC" = yes
10120 then
10121         { echo "$as_me:10121: checking for $CC __attribute__ directives..." >&5
10122 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
10123 cat > conftest.$ac_ext <<EOF
10124 #line 10124 "${as_me:-configure}"
10125 #include "confdefs.h"
10126 #include "conftest.h"
10127 #include "conftest.i"
10128 #if     GCC_PRINTF
10129 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
10130 #else
10131 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
10132 #endif
10133 #if     GCC_SCANF
10134 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
10135 #else
10136 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
10137 #endif
10138 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
10139 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
10140 extern void foo(void) GCC_NORETURN;
10141 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
10142 EOF
10143         cf_printf_attribute=no
10144         cf_scanf_attribute=no
10145         for cf_attribute in scanf printf unused noreturn
10146         do
10147
10148 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10149
10150                 cf_directive="__attribute__(($cf_attribute))"
10151                 echo "checking for $CC $cf_directive" 1>&5
10152
10153                 case $cf_attribute in #(vi
10154                 printf) #(vi
10155                         cf_printf_attribute=yes
10156                         cat >conftest.h <<EOF
10157 #define GCC_$cf_ATTRIBUTE 1
10158 EOF
10159                         ;;
10160                 scanf) #(vi
10161                         cf_scanf_attribute=yes
10162                         cat >conftest.h <<EOF
10163 #define GCC_$cf_ATTRIBUTE 1
10164 EOF
10165                         ;;
10166                 *) #(vi
10167                         cat >conftest.h <<EOF
10168 #define GCC_$cf_ATTRIBUTE $cf_directive
10169 EOF
10170                         ;;
10171                 esac
10172
10173                 if { (eval echo "$as_me:10173: \"$ac_compile\"") >&5
10174   (eval $ac_compile) 2>&5
10175   ac_status=$?
10176   echo "$as_me:10176: \$? = $ac_status" >&5
10177   (exit $ac_status); }; then
10178                         test -n "$verbose" && echo "$as_me:10178: result: ... $cf_attribute" >&5
10179 echo "${ECHO_T}... $cf_attribute" >&6
10180                         cat conftest.h >>confdefs.h
10181                         case $cf_attribute in #(vi
10182                         noreturn) #(vi
10183
10184 cat >>confdefs.h <<EOF
10185 #define GCC_NORETURN $cf_directive
10186 EOF
10187
10188                                 ;;
10189                         printf) #(vi
10190                                 cf_value='/* nothing */'
10191                                 if test "$cf_printf_attribute" != no ; then
10192                                         cf_value='__attribute__((format(printf,fmt,var)))'
10193
10194 cat >>confdefs.h <<\EOF
10195 #define GCC_PRINTF 1
10196 EOF
10197
10198                                 fi
10199
10200 cat >>confdefs.h <<EOF
10201 #define GCC_PRINTFLIKE(fmt,var) $cf_value
10202 EOF
10203
10204                                 ;;
10205                         scanf) #(vi
10206                                 cf_value='/* nothing */'
10207                                 if test "$cf_scanf_attribute" != no ; then
10208                                         cf_value='__attribute__((format(scanf,fmt,var)))'
10209
10210 cat >>confdefs.h <<\EOF
10211 #define GCC_SCANF 1
10212 EOF
10213
10214                                 fi
10215
10216 cat >>confdefs.h <<EOF
10217 #define GCC_SCANFLIKE(fmt,var) $cf_value
10218 EOF
10219
10220                                 ;;
10221                         unused) #(vi
10222
10223 cat >>confdefs.h <<EOF
10224 #define GCC_UNUSED $cf_directive
10225 EOF
10226
10227                                 ;;
10228                         esac
10229                 fi
10230         done
10231 else
10232         fgrep define conftest.i >>confdefs.h
10233 fi
10234 rm -rf conftest*
10235 fi
10236
10237 ###     use option --enable-assertions to turn on generation of assertion code
10238 echo "$as_me:10238: checking if you want to enable runtime assertions" >&5
10239 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
10240
10241 # Check whether --enable-assertions or --disable-assertions was given.
10242 if test "${enable_assertions+set}" = set; then
10243   enableval="$enable_assertions"
10244   with_assertions=$enableval
10245 else
10246   with_assertions=no
10247 fi;
10248 echo "$as_me:10248: result: $with_assertions" >&5
10249 echo "${ECHO_T}$with_assertions" >&6
10250 if test -n "$GCC"
10251 then
10252         if test "$with_assertions" = no
10253         then
10254                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
10255         else
10256
10257         ADAFLAGS="$ADAFLAGS -gnata"
10258
10259         fi
10260 fi
10261
10262 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
10263
10264 cat >>confdefs.h <<\EOF
10265 #define HAVE_NC_ALLOC_H 1
10266 EOF
10267
10268 ###     use option --enable-expanded to generate certain macros as functions
10269
10270 # Check whether --enable-expanded or --disable-expanded was given.
10271 if test "${enable_expanded+set}" = set; then
10272   enableval="$enable_expanded"
10273   test "$enableval" = yes &&
10274 cat >>confdefs.h <<\EOF
10275 #define NCURSES_EXPANDED 1
10276 EOF
10277
10278 fi;
10279
10280 ###     use option --disable-macros to suppress macros in favor of functions
10281
10282 # Check whether --enable-macros or --disable-macros was given.
10283 if test "${enable_macros+set}" = set; then
10284   enableval="$enable_macros"
10285   test "$enableval" = no &&
10286 cat >>confdefs.h <<\EOF
10287 #define NCURSES_NOMACROS 1
10288 EOF
10289
10290 fi;
10291
10292 # Normally we only add trace() to the debug-library.  Allow this to be
10293 # extended to all models of the ncurses library:
10294 cf_all_traces=no
10295 case "$CFLAGS $CPPFLAGS" in
10296 *-DTRACE*)
10297         cf_all_traces=yes
10298         ;;
10299 esac
10300
10301 echo "$as_me:10301: checking whether to add trace feature to all models" >&5
10302 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
10303
10304 # Check whether --with-trace or --without-trace was given.
10305 if test "${with_trace+set}" = set; then
10306   withval="$with_trace"
10307   cf_with_trace=$withval
10308 else
10309   cf_with_trace=$cf_all_traces
10310 fi;
10311 echo "$as_me:10311: result: $cf_with_trace" >&5
10312 echo "${ECHO_T}$cf_with_trace" >&6
10313
10314 if test "$cf_with_trace" = yes ; then
10315         ADA_TRACE=TRUE
10316
10317 cf_fix_cppflags=no
10318 cf_new_cflags=
10319 cf_new_cppflags=
10320 cf_new_extra_cppflags=
10321
10322 for cf_add_cflags in -DTRACE
10323 do
10324 case $cf_fix_cppflags in
10325 no)
10326         case $cf_add_cflags in #(vi
10327         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10328                 case $cf_add_cflags in
10329                 -D*)
10330                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10331
10332                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10333                                 && test -z "${cf_tst_cflags}" \
10334                                 && cf_fix_cppflags=yes
10335
10336                         if test $cf_fix_cppflags = yes ; then
10337                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10338                                 continue
10339                         elif test "${cf_tst_cflags}" = "\"'" ; then
10340                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10341                                 continue
10342                         fi
10343                         ;;
10344                 esac
10345                 case "$CPPFLAGS" in
10346                 *$cf_add_cflags) #(vi
10347                         ;;
10348                 *) #(vi
10349                         case $cf_add_cflags in #(vi
10350                         -D*)
10351                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10352
10353 CPPFLAGS=`echo "$CPPFLAGS" | \
10354         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10355                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10356
10357                                 ;;
10358                         esac
10359                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10360                         ;;
10361                 esac
10362                 ;;
10363         *)
10364                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10365                 ;;
10366         esac
10367         ;;
10368 yes)
10369         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10370
10371         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10372
10373         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10374                 && test -z "${cf_tst_cflags}" \
10375                 && cf_fix_cppflags=no
10376         ;;
10377 esac
10378 done
10379
10380 if test -n "$cf_new_cflags" ; then
10381
10382         CFLAGS="$CFLAGS $cf_new_cflags"
10383 fi
10384
10385 if test -n "$cf_new_cppflags" ; then
10386
10387         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10388 fi
10389
10390 if test -n "$cf_new_extra_cppflags" ; then
10391
10392         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10393 fi
10394
10395 else
10396         ADA_TRACE=FALSE
10397 fi
10398
10399 ###     Checks for libraries.
10400 case $cf_cv_system_name in #(vi
10401 *mingw32*) #(vi
10402         ;;
10403 *)
10404 echo "$as_me:10404: checking for gettimeofday" >&5
10405 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
10406 if test "${ac_cv_func_gettimeofday+set}" = set; then
10407   echo $ECHO_N "(cached) $ECHO_C" >&6
10408 else
10409   cat >conftest.$ac_ext <<_ACEOF
10410 #line 10410 "configure"
10411 #include "confdefs.h"
10412 /* System header to define __stub macros and hopefully few prototypes,
10413     which can conflict with char gettimeofday (); below.  */
10414 #include <assert.h>
10415 /* Override any gcc2 internal prototype to avoid an error.  */
10416 #ifdef __cplusplus
10417 extern "C"
10418 #endif
10419 /* We use char because int might match the return type of a gcc2
10420    builtin and then its argument prototype would still apply.  */
10421 char gettimeofday ();
10422 char (*f) ();
10423
10424 int
10425 main ()
10426 {
10427 /* The GNU C library defines this for functions which it implements
10428     to always fail with ENOSYS.  Some functions are actually named
10429     something starting with __ and the normal name is an alias.  */
10430 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
10431 choke me
10432 #else
10433 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10434 #endif
10435
10436   ;
10437   return 0;
10438 }
10439 _ACEOF
10440 rm -f conftest.$ac_objext conftest$ac_exeext
10441 if { (eval echo "$as_me:10441: \"$ac_link\"") >&5
10442   (eval $ac_link) 2>&5
10443   ac_status=$?
10444   echo "$as_me:10444: \$? = $ac_status" >&5
10445   (exit $ac_status); } &&
10446          { ac_try='test -s conftest$ac_exeext'
10447   { (eval echo "$as_me:10447: \"$ac_try\"") >&5
10448   (eval $ac_try) 2>&5
10449   ac_status=$?
10450   echo "$as_me:10450: \$? = $ac_status" >&5
10451   (exit $ac_status); }; }; then
10452   ac_cv_func_gettimeofday=yes
10453 else
10454   echo "$as_me: failed program was:" >&5
10455 cat conftest.$ac_ext >&5
10456 ac_cv_func_gettimeofday=no
10457 fi
10458 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10459 fi
10460 echo "$as_me:10460: result: $ac_cv_func_gettimeofday" >&5
10461 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
10462 if test $ac_cv_func_gettimeofday = yes; then
10463   cat >>confdefs.h <<\EOF
10464 #define HAVE_GETTIMEOFDAY 1
10465 EOF
10466
10467 else
10468
10469 echo "$as_me:10469: checking for gettimeofday in -lbsd" >&5
10470 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
10471 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
10472   echo $ECHO_N "(cached) $ECHO_C" >&6
10473 else
10474   ac_check_lib_save_LIBS=$LIBS
10475 LIBS="-lbsd  $LIBS"
10476 cat >conftest.$ac_ext <<_ACEOF
10477 #line 10477 "configure"
10478 #include "confdefs.h"
10479
10480 /* Override any gcc2 internal prototype to avoid an error.  */
10481 #ifdef __cplusplus
10482 extern "C"
10483 #endif
10484 /* We use char because int might match the return type of a gcc2
10485    builtin and then its argument prototype would still apply.  */
10486 char gettimeofday ();
10487 int
10488 main ()
10489 {
10490 gettimeofday ();
10491   ;
10492   return 0;
10493 }
10494 _ACEOF
10495 rm -f conftest.$ac_objext conftest$ac_exeext
10496 if { (eval echo "$as_me:10496: \"$ac_link\"") >&5
10497   (eval $ac_link) 2>&5
10498   ac_status=$?
10499   echo "$as_me:10499: \$? = $ac_status" >&5
10500   (exit $ac_status); } &&
10501          { ac_try='test -s conftest$ac_exeext'
10502   { (eval echo "$as_me:10502: \"$ac_try\"") >&5
10503   (eval $ac_try) 2>&5
10504   ac_status=$?
10505   echo "$as_me:10505: \$? = $ac_status" >&5
10506   (exit $ac_status); }; }; then
10507   ac_cv_lib_bsd_gettimeofday=yes
10508 else
10509   echo "$as_me: failed program was:" >&5
10510 cat conftest.$ac_ext >&5
10511 ac_cv_lib_bsd_gettimeofday=no
10512 fi
10513 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10514 LIBS=$ac_check_lib_save_LIBS
10515 fi
10516 echo "$as_me:10516: result: $ac_cv_lib_bsd_gettimeofday" >&5
10517 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
10518 if test $ac_cv_lib_bsd_gettimeofday = yes; then
10519
10520 cat >>confdefs.h <<\EOF
10521 #define HAVE_GETTIMEOFDAY 1
10522 EOF
10523
10524         LIBS="$LIBS -lbsd"
10525 fi
10526
10527 fi
10528         ;;
10529 esac
10530
10531 ###     Checks for header files.
10532 echo "$as_me:10532: checking for ANSI C header files" >&5
10533 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10534 if test "${ac_cv_header_stdc+set}" = set; then
10535   echo $ECHO_N "(cached) $ECHO_C" >&6
10536 else
10537   cat >conftest.$ac_ext <<_ACEOF
10538 #line 10538 "configure"
10539 #include "confdefs.h"
10540 #include <stdlib.h>
10541 #include <stdarg.h>
10542 #include <string.h>
10543 #include <float.h>
10544
10545 _ACEOF
10546 if { (eval echo "$as_me:10546: \"$ac_cpp conftest.$ac_ext\"") >&5
10547   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10548   ac_status=$?
10549   egrep -v '^ *\+' conftest.er1 >conftest.err
10550   rm -f conftest.er1
10551   cat conftest.err >&5
10552   echo "$as_me:10552: \$? = $ac_status" >&5
10553   (exit $ac_status); } >/dev/null; then
10554   if test -s conftest.err; then
10555     ac_cpp_err=$ac_c_preproc_warn_flag
10556   else
10557     ac_cpp_err=
10558   fi
10559 else
10560   ac_cpp_err=yes
10561 fi
10562 if test -z "$ac_cpp_err"; then
10563   ac_cv_header_stdc=yes
10564 else
10565   echo "$as_me: failed program was:" >&5
10566   cat conftest.$ac_ext >&5
10567   ac_cv_header_stdc=no
10568 fi
10569 rm -f conftest.err conftest.$ac_ext
10570
10571 if test $ac_cv_header_stdc = yes; then
10572   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10573   cat >conftest.$ac_ext <<_ACEOF
10574 #line 10574 "configure"
10575 #include "confdefs.h"
10576 #include <string.h>
10577
10578 _ACEOF
10579 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10580   egrep "memchr" >/dev/null 2>&1; then
10581   :
10582 else
10583   ac_cv_header_stdc=no
10584 fi
10585 rm -rf conftest*
10586
10587 fi
10588
10589 if test $ac_cv_header_stdc = yes; then
10590   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10591   cat >conftest.$ac_ext <<_ACEOF
10592 #line 10592 "configure"
10593 #include "confdefs.h"
10594 #include <stdlib.h>
10595
10596 _ACEOF
10597 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10598   egrep "free" >/dev/null 2>&1; then
10599   :
10600 else
10601   ac_cv_header_stdc=no
10602 fi
10603 rm -rf conftest*
10604
10605 fi
10606
10607 if test $ac_cv_header_stdc = yes; then
10608   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10609   if test "$cross_compiling" = yes; then
10610   :
10611 else
10612   cat >conftest.$ac_ext <<_ACEOF
10613 #line 10613 "configure"
10614 #include "confdefs.h"
10615 #include <ctype.h>
10616 #if ((' ' & 0x0FF) == 0x020)
10617 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10618 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10619 #else
10620 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
10621                      || ('j' <= (c) && (c) <= 'r') \
10622                      || ('s' <= (c) && (c) <= 'z'))
10623 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10624 #endif
10625
10626 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10627 int
10628 main ()
10629 {
10630   int i;
10631   for (i = 0; i < 256; i++)
10632     if (XOR (islower (i), ISLOWER (i))
10633         || toupper (i) != TOUPPER (i))
10634       $ac_main_return(2);
10635   $ac_main_return (0);
10636 }
10637 _ACEOF
10638 rm -f conftest$ac_exeext
10639 if { (eval echo "$as_me:10639: \"$ac_link\"") >&5
10640   (eval $ac_link) 2>&5
10641   ac_status=$?
10642   echo "$as_me:10642: \$? = $ac_status" >&5
10643   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10644   { (eval echo "$as_me:10644: \"$ac_try\"") >&5
10645   (eval $ac_try) 2>&5
10646   ac_status=$?
10647   echo "$as_me:10647: \$? = $ac_status" >&5
10648   (exit $ac_status); }; }; then
10649   :
10650 else
10651   echo "$as_me: program exited with status $ac_status" >&5
10652 echo "$as_me: failed program was:" >&5
10653 cat conftest.$ac_ext >&5
10654 ac_cv_header_stdc=no
10655 fi
10656 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10657 fi
10658 fi
10659 fi
10660 echo "$as_me:10660: result: $ac_cv_header_stdc" >&5
10661 echo "${ECHO_T}$ac_cv_header_stdc" >&6
10662 if test $ac_cv_header_stdc = yes; then
10663
10664 cat >>confdefs.h <<\EOF
10665 #define STDC_HEADERS 1
10666 EOF
10667
10668 fi
10669
10670 ac_header_dirent=no
10671 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
10672   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
10673 echo "$as_me:10673: checking for $ac_hdr that defines DIR" >&5
10674 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
10675 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10676   echo $ECHO_N "(cached) $ECHO_C" >&6
10677 else
10678   cat >conftest.$ac_ext <<_ACEOF
10679 #line 10679 "configure"
10680 #include "confdefs.h"
10681 #include <sys/types.h>
10682 #include <$ac_hdr>
10683
10684 int
10685 main ()
10686 {
10687 if ((DIR *) 0)
10688 return 0;
10689   ;
10690   return 0;
10691 }
10692 _ACEOF
10693 rm -f conftest.$ac_objext
10694 if { (eval echo "$as_me:10694: \"$ac_compile\"") >&5
10695   (eval $ac_compile) 2>&5
10696   ac_status=$?
10697   echo "$as_me:10697: \$? = $ac_status" >&5
10698   (exit $ac_status); } &&
10699          { ac_try='test -s conftest.$ac_objext'
10700   { (eval echo "$as_me:10700: \"$ac_try\"") >&5
10701   (eval $ac_try) 2>&5
10702   ac_status=$?
10703   echo "$as_me:10703: \$? = $ac_status" >&5
10704   (exit $ac_status); }; }; then
10705   eval "$as_ac_Header=yes"
10706 else
10707   echo "$as_me: failed program was:" >&5
10708 cat conftest.$ac_ext >&5
10709 eval "$as_ac_Header=no"
10710 fi
10711 rm -f conftest.$ac_objext conftest.$ac_ext
10712 fi
10713 echo "$as_me:10713: result: `eval echo '${'$as_ac_Header'}'`" >&5
10714 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10715 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10716   cat >>confdefs.h <<EOF
10717 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
10718 EOF
10719
10720 ac_header_dirent=$ac_hdr; break
10721 fi
10722
10723 done
10724 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
10725 if test $ac_header_dirent = dirent.h; then
10726   echo "$as_me:10726: checking for opendir in -ldir" >&5
10727 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
10728 if test "${ac_cv_lib_dir_opendir+set}" = set; then
10729   echo $ECHO_N "(cached) $ECHO_C" >&6
10730 else
10731   ac_check_lib_save_LIBS=$LIBS
10732 LIBS="-ldir  $LIBS"
10733 cat >conftest.$ac_ext <<_ACEOF
10734 #line 10734 "configure"
10735 #include "confdefs.h"
10736
10737 /* Override any gcc2 internal prototype to avoid an error.  */
10738 #ifdef __cplusplus
10739 extern "C"
10740 #endif
10741 /* We use char because int might match the return type of a gcc2
10742    builtin and then its argument prototype would still apply.  */
10743 char opendir ();
10744 int
10745 main ()
10746 {
10747 opendir ();
10748   ;
10749   return 0;
10750 }
10751 _ACEOF
10752 rm -f conftest.$ac_objext conftest$ac_exeext
10753 if { (eval echo "$as_me:10753: \"$ac_link\"") >&5
10754   (eval $ac_link) 2>&5
10755   ac_status=$?
10756   echo "$as_me:10756: \$? = $ac_status" >&5
10757   (exit $ac_status); } &&
10758          { ac_try='test -s conftest$ac_exeext'
10759   { (eval echo "$as_me:10759: \"$ac_try\"") >&5
10760   (eval $ac_try) 2>&5
10761   ac_status=$?
10762   echo "$as_me:10762: \$? = $ac_status" >&5
10763   (exit $ac_status); }; }; then
10764   ac_cv_lib_dir_opendir=yes
10765 else
10766   echo "$as_me: failed program was:" >&5
10767 cat conftest.$ac_ext >&5
10768 ac_cv_lib_dir_opendir=no
10769 fi
10770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10771 LIBS=$ac_check_lib_save_LIBS
10772 fi
10773 echo "$as_me:10773: result: $ac_cv_lib_dir_opendir" >&5
10774 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
10775 if test $ac_cv_lib_dir_opendir = yes; then
10776   LIBS="$LIBS -ldir"
10777 fi
10778
10779 else
10780   echo "$as_me:10780: checking for opendir in -lx" >&5
10781 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
10782 if test "${ac_cv_lib_x_opendir+set}" = set; then
10783   echo $ECHO_N "(cached) $ECHO_C" >&6
10784 else
10785   ac_check_lib_save_LIBS=$LIBS
10786 LIBS="-lx  $LIBS"
10787 cat >conftest.$ac_ext <<_ACEOF
10788 #line 10788 "configure"
10789 #include "confdefs.h"
10790
10791 /* Override any gcc2 internal prototype to avoid an error.  */
10792 #ifdef __cplusplus
10793 extern "C"
10794 #endif
10795 /* We use char because int might match the return type of a gcc2
10796    builtin and then its argument prototype would still apply.  */
10797 char opendir ();
10798 int
10799 main ()
10800 {
10801 opendir ();
10802   ;
10803   return 0;
10804 }
10805 _ACEOF
10806 rm -f conftest.$ac_objext conftest$ac_exeext
10807 if { (eval echo "$as_me:10807: \"$ac_link\"") >&5
10808   (eval $ac_link) 2>&5
10809   ac_status=$?
10810   echo "$as_me:10810: \$? = $ac_status" >&5
10811   (exit $ac_status); } &&
10812          { ac_try='test -s conftest$ac_exeext'
10813   { (eval echo "$as_me:10813: \"$ac_try\"") >&5
10814   (eval $ac_try) 2>&5
10815   ac_status=$?
10816   echo "$as_me:10816: \$? = $ac_status" >&5
10817   (exit $ac_status); }; }; then
10818   ac_cv_lib_x_opendir=yes
10819 else
10820   echo "$as_me: failed program was:" >&5
10821 cat conftest.$ac_ext >&5
10822 ac_cv_lib_x_opendir=no
10823 fi
10824 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10825 LIBS=$ac_check_lib_save_LIBS
10826 fi
10827 echo "$as_me:10827: result: $ac_cv_lib_x_opendir" >&5
10828 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10829 if test $ac_cv_lib_x_opendir = yes; then
10830   LIBS="$LIBS -lx"
10831 fi
10832
10833 fi
10834
10835 echo "$as_me:10835: checking whether time.h and sys/time.h may both be included" >&5
10836 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10837 if test "${ac_cv_header_time+set}" = set; then
10838   echo $ECHO_N "(cached) $ECHO_C" >&6
10839 else
10840   cat >conftest.$ac_ext <<_ACEOF
10841 #line 10841 "configure"
10842 #include "confdefs.h"
10843 #include <sys/types.h>
10844 #include <sys/time.h>
10845 #include <time.h>
10846
10847 int
10848 main ()
10849 {
10850 if ((struct tm *) 0)
10851 return 0;
10852   ;
10853   return 0;
10854 }
10855 _ACEOF
10856 rm -f conftest.$ac_objext
10857 if { (eval echo "$as_me:10857: \"$ac_compile\"") >&5
10858   (eval $ac_compile) 2>&5
10859   ac_status=$?
10860   echo "$as_me:10860: \$? = $ac_status" >&5
10861   (exit $ac_status); } &&
10862          { ac_try='test -s conftest.$ac_objext'
10863   { (eval echo "$as_me:10863: \"$ac_try\"") >&5
10864   (eval $ac_try) 2>&5
10865   ac_status=$?
10866   echo "$as_me:10866: \$? = $ac_status" >&5
10867   (exit $ac_status); }; }; then
10868   ac_cv_header_time=yes
10869 else
10870   echo "$as_me: failed program was:" >&5
10871 cat conftest.$ac_ext >&5
10872 ac_cv_header_time=no
10873 fi
10874 rm -f conftest.$ac_objext conftest.$ac_ext
10875 fi
10876 echo "$as_me:10876: result: $ac_cv_header_time" >&5
10877 echo "${ECHO_T}$ac_cv_header_time" >&6
10878 if test $ac_cv_header_time = yes; then
10879
10880 cat >>confdefs.h <<\EOF
10881 #define TIME_WITH_SYS_TIME 1
10882 EOF
10883
10884 fi
10885
10886 ###     checks for compiler characteristics
10887 ac_ext=c
10888 ac_cpp='$CPP $CPPFLAGS'
10889 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10890 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10891 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10892 ac_main_return=return
10893
10894 echo "$as_me:10894: checking for an ANSI C-conforming const" >&5
10895 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
10896 if test "${ac_cv_c_const+set}" = set; then
10897   echo $ECHO_N "(cached) $ECHO_C" >&6
10898 else
10899   cat >conftest.$ac_ext <<_ACEOF
10900 #line 10900 "configure"
10901 #include "confdefs.h"
10902
10903 int
10904 main ()
10905 {
10906 /* FIXME: Include the comments suggested by Paul. */
10907 #ifndef __cplusplus
10908   /* Ultrix mips cc rejects this.  */
10909   typedef int charset[2];
10910   const charset x;
10911   /* SunOS 4.1.1 cc rejects this.  */
10912   char const *const *ccp;
10913   char **p;
10914   /* NEC SVR4.0.2 mips cc rejects this.  */
10915   struct point {int x, y;};
10916   static struct point const zero = {0,0};
10917   /* AIX XL C 1.02.0.0 rejects this.
10918      It does not let you subtract one const X* pointer from another in
10919      an arm of an if-expression whose if-part is not a constant
10920      expression */
10921   const char *g = "string";
10922   ccp = &g + (g ? g-g : 0);
10923   /* HPUX 7.0 cc rejects these. */
10924   ++ccp;
10925   p = (char**) ccp;
10926   ccp = (char const *const *) p;
10927   { /* SCO 3.2v4 cc rejects this.  */
10928     char *t;
10929     char const *s = 0 ? (char *) 0 : (char const *) 0;
10930
10931     *t++ = 0;
10932   }
10933   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10934     int x[] = {25, 17};
10935     const int *foo = &x[0];
10936     ++foo;
10937   }
10938   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10939     typedef const int *iptr;
10940     iptr p = 0;
10941     ++p;
10942   }
10943   { /* AIX XL C 1.02.0.0 rejects this saying
10944        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10945     struct s { int j; const int *ap[3]; };
10946     struct s *b; b->j = 5;
10947   }
10948   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10949     const int foo = 10;
10950   }
10951 #endif
10952
10953   ;
10954   return 0;
10955 }
10956 _ACEOF
10957 rm -f conftest.$ac_objext
10958 if { (eval echo "$as_me:10958: \"$ac_compile\"") >&5
10959   (eval $ac_compile) 2>&5
10960   ac_status=$?
10961   echo "$as_me:10961: \$? = $ac_status" >&5
10962   (exit $ac_status); } &&
10963          { ac_try='test -s conftest.$ac_objext'
10964   { (eval echo "$as_me:10964: \"$ac_try\"") >&5
10965   (eval $ac_try) 2>&5
10966   ac_status=$?
10967   echo "$as_me:10967: \$? = $ac_status" >&5
10968   (exit $ac_status); }; }; then
10969   ac_cv_c_const=yes
10970 else
10971   echo "$as_me: failed program was:" >&5
10972 cat conftest.$ac_ext >&5
10973 ac_cv_c_const=no
10974 fi
10975 rm -f conftest.$ac_objext conftest.$ac_ext
10976 fi
10977 echo "$as_me:10977: result: $ac_cv_c_const" >&5
10978 echo "${ECHO_T}$ac_cv_c_const" >&6
10979 if test $ac_cv_c_const = no; then
10980
10981 cat >>confdefs.h <<\EOF
10982 #define const
10983 EOF
10984
10985 fi
10986
10987 ###     Checks for external-data
10988
10989 echo "$as_me:10989: checking if data-only library module links" >&5
10990 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
10991 if test "${cf_cv_link_dataonly+set}" = set; then
10992   echo $ECHO_N "(cached) $ECHO_C" >&6
10993 else
10994
10995         rm -f conftest.a
10996         cat >conftest.$ac_ext <<EOF
10997 #line 10997 "configure"
10998 int     testdata[3] = { 123, 456, 789 };
10999 EOF
11000         if { (eval echo "$as_me:11000: \"$ac_compile\"") >&5
11001   (eval $ac_compile) 2>&5
11002   ac_status=$?
11003   echo "$as_me:11003: \$? = $ac_status" >&5
11004   (exit $ac_status); } ; then
11005                 mv conftest.o data.o && \
11006                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
11007         fi
11008         rm -f conftest.$ac_ext data.o
11009         cat >conftest.$ac_ext <<EOF
11010 #line 11010 "configure"
11011 int     testfunc()
11012 {
11013 #if defined(NeXT)
11014         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
11015 #else
11016         extern int testdata[3];
11017         return testdata[0] == 123
11018            &&  testdata[1] == 456
11019            &&  testdata[2] == 789;
11020 #endif
11021 }
11022 EOF
11023         if { (eval echo "$as_me:11023: \"$ac_compile\"") >&5
11024   (eval $ac_compile) 2>&5
11025   ac_status=$?
11026   echo "$as_me:11026: \$? = $ac_status" >&5
11027   (exit $ac_status); }; then
11028                 mv conftest.o func.o && \
11029                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
11030         fi
11031         rm -f conftest.$ac_ext func.o
11032         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
11033         cf_saveLIBS="$LIBS"
11034         LIBS="conftest.a $LIBS"
11035         if test "$cross_compiling" = yes; then
11036   cf_cv_link_dataonly=unknown
11037 else
11038   cat >conftest.$ac_ext <<_ACEOF
11039 #line 11039 "configure"
11040 #include "confdefs.h"
11041
11042         int main()
11043         {
11044                 extern int testfunc();
11045                 ${cf_cv_main_return:-return} (!testfunc());
11046         }
11047
11048 _ACEOF
11049 rm -f conftest$ac_exeext
11050 if { (eval echo "$as_me:11050: \"$ac_link\"") >&5
11051   (eval $ac_link) 2>&5
11052   ac_status=$?
11053   echo "$as_me:11053: \$? = $ac_status" >&5
11054   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11055   { (eval echo "$as_me:11055: \"$ac_try\"") >&5
11056   (eval $ac_try) 2>&5
11057   ac_status=$?
11058   echo "$as_me:11058: \$? = $ac_status" >&5
11059   (exit $ac_status); }; }; then
11060   cf_cv_link_dataonly=yes
11061 else
11062   echo "$as_me: program exited with status $ac_status" >&5
11063 echo "$as_me: failed program was:" >&5
11064 cat conftest.$ac_ext >&5
11065 cf_cv_link_dataonly=no
11066 fi
11067 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11068 fi
11069         LIBS="$cf_saveLIBS"
11070
11071 fi
11072
11073 echo "$as_me:11073: result: $cf_cv_link_dataonly" >&5
11074 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
11075
11076 if test "$cf_cv_link_dataonly" = no ; then
11077
11078 cat >>confdefs.h <<\EOF
11079 #define BROKEN_LINKER 1
11080 EOF
11081
11082         BROKEN_LINKER=1
11083 fi
11084
11085 ###     Checks for library functions.
11086
11087 echo "$as_me:11087: checking for working mkstemp" >&5
11088 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
11089 if test "${cf_cv_func_mkstemp+set}" = set; then
11090   echo $ECHO_N "(cached) $ECHO_C" >&6
11091 else
11092
11093 rm -rf conftest*
11094 if test "$cross_compiling" = yes; then
11095   cf_cv_func_mkstemp=maybe
11096 else
11097   cat >conftest.$ac_ext <<_ACEOF
11098 #line 11098 "configure"
11099 #include "confdefs.h"
11100
11101 #include <sys/types.h>
11102 #include <stdlib.h>
11103 #include <stdio.h>
11104 #include <string.h>
11105 #include <sys/stat.h>
11106 int main()
11107 {
11108         char *tmpl = "conftestXXXXXX";
11109         char name[2][80];
11110         int n;
11111         int result = 0;
11112         int fd;
11113         struct stat sb;
11114
11115         umask(077);
11116         for (n = 0; n < 2; ++n) {
11117                 strcpy(name[n], tmpl);
11118                 if ((fd = mkstemp(name[n])) >= 0) {
11119                         if (!strcmp(name[n], tmpl)
11120                          || stat(name[n], &sb) != 0
11121                          || (sb.st_mode & S_IFMT) != S_IFREG
11122                          || (sb.st_mode & 077) != 0) {
11123                                 result = 1;
11124                         }
11125                         close(fd);
11126                 }
11127         }
11128         if (result == 0
11129          && !strcmp(name[0], name[1]))
11130                 result = 1;
11131         ${cf_cv_main_return:-return}(result);
11132 }
11133
11134 _ACEOF
11135 rm -f conftest$ac_exeext
11136 if { (eval echo "$as_me:11136: \"$ac_link\"") >&5
11137   (eval $ac_link) 2>&5
11138   ac_status=$?
11139   echo "$as_me:11139: \$? = $ac_status" >&5
11140   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11141   { (eval echo "$as_me:11141: \"$ac_try\"") >&5
11142   (eval $ac_try) 2>&5
11143   ac_status=$?
11144   echo "$as_me:11144: \$? = $ac_status" >&5
11145   (exit $ac_status); }; }; then
11146   cf_cv_func_mkstemp=yes
11147
11148 else
11149   echo "$as_me: program exited with status $ac_status" >&5
11150 echo "$as_me: failed program was:" >&5
11151 cat conftest.$ac_ext >&5
11152 cf_cv_func_mkstemp=no
11153
11154 fi
11155 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11156 fi
11157
11158 fi
11159 echo "$as_me:11159: result: $cf_cv_func_mkstemp" >&5
11160 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
11161 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
11162         echo "$as_me:11162: checking for mkstemp" >&5
11163 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
11164 if test "${ac_cv_func_mkstemp+set}" = set; then
11165   echo $ECHO_N "(cached) $ECHO_C" >&6
11166 else
11167   cat >conftest.$ac_ext <<_ACEOF
11168 #line 11168 "configure"
11169 #include "confdefs.h"
11170 /* System header to define __stub macros and hopefully few prototypes,
11171     which can conflict with char mkstemp (); below.  */
11172 #include <assert.h>
11173 /* Override any gcc2 internal prototype to avoid an error.  */
11174 #ifdef __cplusplus
11175 extern "C"
11176 #endif
11177 /* We use char because int might match the return type of a gcc2
11178    builtin and then its argument prototype would still apply.  */
11179 char mkstemp ();
11180 char (*f) ();
11181
11182 int
11183 main ()
11184 {
11185 /* The GNU C library defines this for functions which it implements
11186     to always fail with ENOSYS.  Some functions are actually named
11187     something starting with __ and the normal name is an alias.  */
11188 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
11189 choke me
11190 #else
11191 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11192 #endif
11193
11194   ;
11195   return 0;
11196 }
11197 _ACEOF
11198 rm -f conftest.$ac_objext conftest$ac_exeext
11199 if { (eval echo "$as_me:11199: \"$ac_link\"") >&5
11200   (eval $ac_link) 2>&5
11201   ac_status=$?
11202   echo "$as_me:11202: \$? = $ac_status" >&5
11203   (exit $ac_status); } &&
11204          { ac_try='test -s conftest$ac_exeext'
11205   { (eval echo "$as_me:11205: \"$ac_try\"") >&5
11206   (eval $ac_try) 2>&5
11207   ac_status=$?
11208   echo "$as_me:11208: \$? = $ac_status" >&5
11209   (exit $ac_status); }; }; then
11210   ac_cv_func_mkstemp=yes
11211 else
11212   echo "$as_me: failed program was:" >&5
11213 cat conftest.$ac_ext >&5
11214 ac_cv_func_mkstemp=no
11215 fi
11216 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11217 fi
11218 echo "$as_me:11218: result: $ac_cv_func_mkstemp" >&5
11219 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
11220
11221 fi
11222 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
11223
11224 cat >>confdefs.h <<\EOF
11225 #define HAVE_MKSTEMP 1
11226 EOF
11227
11228 fi
11229
11230 echo "$as_me:11230: checking return type of signal handlers" >&5
11231 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
11232 if test "${ac_cv_type_signal+set}" = set; then
11233   echo $ECHO_N "(cached) $ECHO_C" >&6
11234 else
11235   cat >conftest.$ac_ext <<_ACEOF
11236 #line 11236 "configure"
11237 #include "confdefs.h"
11238 #include <sys/types.h>
11239 #include <signal.h>
11240 #ifdef signal
11241 # undef signal
11242 #endif
11243 #ifdef __cplusplus
11244 extern "C" void (*signal (int, void (*)(int)))(int);
11245 #else
11246 void (*signal ()) ();
11247 #endif
11248
11249 int
11250 main ()
11251 {
11252 int i;
11253   ;
11254   return 0;
11255 }
11256 _ACEOF
11257 rm -f conftest.$ac_objext
11258 if { (eval echo "$as_me:11258: \"$ac_compile\"") >&5
11259   (eval $ac_compile) 2>&5
11260   ac_status=$?
11261   echo "$as_me:11261: \$? = $ac_status" >&5
11262   (exit $ac_status); } &&
11263          { ac_try='test -s conftest.$ac_objext'
11264   { (eval echo "$as_me:11264: \"$ac_try\"") >&5
11265   (eval $ac_try) 2>&5
11266   ac_status=$?
11267   echo "$as_me:11267: \$? = $ac_status" >&5
11268   (exit $ac_status); }; }; then
11269   ac_cv_type_signal=void
11270 else
11271   echo "$as_me: failed program was:" >&5
11272 cat conftest.$ac_ext >&5
11273 ac_cv_type_signal=int
11274 fi
11275 rm -f conftest.$ac_objext conftest.$ac_ext
11276 fi
11277 echo "$as_me:11277: result: $ac_cv_type_signal" >&5
11278 echo "${ECHO_T}$ac_cv_type_signal" >&6
11279
11280 cat >>confdefs.h <<EOF
11281 #define RETSIGTYPE $ac_cv_type_signal
11282 EOF
11283
11284 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
11285         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11286         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11287 fi
11288
11289 cf_with_ada=yes
11290 if test "$cf_with_ada" != "no" ; then
11291
11292 cf_ada_make=gnatmake
11293 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
11294 set dummy $cf_ada_make; ac_word=$2
11295 echo "$as_me:11295: checking for $ac_word" >&5
11296 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11297 if test "${ac_cv_prog_gnat_exists+set}" = set; then
11298   echo $ECHO_N "(cached) $ECHO_C" >&6
11299 else
11300   if test -n "$gnat_exists"; then
11301   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
11302 else
11303   ac_save_IFS=$IFS; IFS=$ac_path_separator
11304 ac_dummy="$PATH"
11305 for ac_dir in $ac_dummy; do
11306   IFS=$ac_save_IFS
11307   test -z "$ac_dir" && ac_dir=.
11308   $as_executable_p "$ac_dir/$ac_word" || continue
11309 ac_cv_prog_gnat_exists="yes"
11310 echo "$as_me:11310: found $ac_dir/$ac_word" >&5
11311 break
11312 done
11313
11314   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
11315 fi
11316 fi
11317 gnat_exists=$ac_cv_prog_gnat_exists
11318 if test -n "$gnat_exists"; then
11319   echo "$as_me:11319: result: $gnat_exists" >&5
11320 echo "${ECHO_T}$gnat_exists" >&6
11321 else
11322   echo "$as_me:11322: result: no" >&5
11323 echo "${ECHO_T}no" >&6
11324 fi
11325
11326 if test "$ac_cv_prog_gnat_exists" = no; then
11327    cf_ada_make=
11328    cf_cv_prog_gnat_correct=no
11329 else
11330
11331 echo "$as_me:11331: checking for gnat version" >&5
11332 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
11333 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
11334         grep '[0-9].[0-9][0-9]*' |\
11335     sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
11336 echo "$as_me:11336: result: $cf_gnat_version" >&5
11337 echo "${ECHO_T}$cf_gnat_version" >&6
11338
11339 case $cf_gnat_version in #(vi
11340 3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9]) #(vi
11341         cf_cv_prog_gnat_correct=yes
11342         ;;
11343 *)
11344         { echo "$as_me:11344: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
11345 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
11346         cf_cv_prog_gnat_correct=no
11347         ;;
11348 esac
11349
11350    # Extract the first word of "m4", so it can be a program name with args.
11351 set dummy m4; ac_word=$2
11352 echo "$as_me:11352: checking for $ac_word" >&5
11353 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11354 if test "${ac_cv_prog_M4_exists+set}" = set; then
11355   echo $ECHO_N "(cached) $ECHO_C" >&6
11356 else
11357   if test -n "$M4_exists"; then
11358   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
11359 else
11360   ac_save_IFS=$IFS; IFS=$ac_path_separator
11361 ac_dummy="$PATH"
11362 for ac_dir in $ac_dummy; do
11363   IFS=$ac_save_IFS
11364   test -z "$ac_dir" && ac_dir=.
11365   $as_executable_p "$ac_dir/$ac_word" || continue
11366 ac_cv_prog_M4_exists="yes"
11367 echo "$as_me:11367: found $ac_dir/$ac_word" >&5
11368 break
11369 done
11370
11371   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
11372 fi
11373 fi
11374 M4_exists=$ac_cv_prog_M4_exists
11375 if test -n "$M4_exists"; then
11376   echo "$as_me:11376: result: $M4_exists" >&5
11377 echo "${ECHO_T}$M4_exists" >&6
11378 else
11379   echo "$as_me:11379: result: no" >&5
11380 echo "${ECHO_T}no" >&6
11381 fi
11382
11383    if test "$ac_cv_prog_M4_exists" = no; then
11384       cf_cv_prog_gnat_correct=no
11385       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
11386    fi
11387    if test "$cf_cv_prog_gnat_correct" = yes; then
11388       echo "$as_me:11388: checking if GNAT works" >&5
11389 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
11390
11391 rm -rf conftest* *~conftest*
11392 cat >>conftest.ads <<CF_EOF
11393 procedure conftest;
11394 CF_EOF
11395 cat >>conftest.adb <<CF_EOF
11396 with Text_IO;
11397 with GNAT.OS_Lib;
11398 procedure conftest is
11399 begin
11400    Text_IO.Put ("Hello World");
11401    Text_IO.New_Line;
11402    GNAT.OS_Lib.OS_Exit (0);
11403 end conftest;
11404 CF_EOF
11405 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11406    if ( ./conftest 1>&5 2>&1 ) ; then
11407       cf_cv_prog_gnat_correct=yes
11408    else
11409       cf_cv_prog_gnat_correct=no
11410    fi
11411 else
11412    cf_cv_prog_gnat_correct=no
11413 fi
11414 rm -rf conftest* *~conftest*
11415
11416       echo "$as_me:11416: result: $cf_cv_prog_gnat_correct" >&5
11417 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
11418    fi
11419 fi
11420
11421         if test "$cf_cv_prog_gnat_correct" = yes; then
11422
11423         echo "$as_me:11423: checking optimization options for ADAFLAGS" >&5
11424 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
11425         case "$CFLAGS" in
11426         *-g*)
11427
11428         ADAFLAGS="$ADAFLAGS -g"
11429
11430                 ;;
11431         esac
11432         case "$CFLAGS" in
11433         *-O*)
11434                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
11435
11436         ADAFLAGS="$ADAFLAGS $cf_O_flag"
11437
11438                 ;;
11439         esac
11440         echo "$as_me:11440: result: $ADAFLAGS" >&5
11441 echo "${ECHO_T}$ADAFLAGS" >&6
11442
11443 echo "$as_me:11443: checking if GNAT supports generics" >&5
11444 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
11445 case $cf_gnat_version in #(vi
11446 3.[1-9]*|[4-9].*) #(vi
11447         cf_gnat_generics=yes
11448         ;;
11449 *)
11450         cf_gnat_generics=no
11451         ;;
11452 esac
11453 echo "$as_me:11453: result: $cf_gnat_generics" >&5
11454 echo "${ECHO_T}$cf_gnat_generics" >&6
11455
11456 if test "$cf_gnat_generics" = yes
11457 then
11458         cf_compile_generics=generics
11459         cf_generic_objects="\${GENOBJS}"
11460 else
11461         cf_compile_generics=
11462         cf_generic_objects=
11463 fi
11464
11465 echo "$as_me:11465: checking if GNAT supports SIGINT" >&5
11466 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
11467 if test "${cf_cv_gnat_sigint+set}" = set; then
11468   echo $ECHO_N "(cached) $ECHO_C" >&6
11469 else
11470
11471 rm -rf conftest* *~conftest*
11472 cat >>conftest.ads <<CF_EOF
11473 with Ada.Interrupts.Names;
11474
11475 package ConfTest is
11476
11477    pragma Warnings (Off);  --  the next pragma exists since 3.11p
11478    pragma Unreserve_All_Interrupts;
11479    pragma Warnings (On);
11480
11481    protected Process is
11482       procedure Stop;
11483       function Continue return Boolean;
11484       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
11485    private
11486       Done : Boolean := False;
11487    end Process;
11488
11489 end ConfTest;
11490 CF_EOF
11491 cat >>conftest.adb <<CF_EOF
11492 package body ConfTest is
11493    protected body Process is
11494       procedure Stop is
11495       begin
11496          Done := True;
11497       end Stop;
11498       function Continue return Boolean is
11499       begin
11500          return not Done;
11501       end Continue;
11502    end Process;
11503 end ConfTest;
11504 CF_EOF
11505 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11506       cf_cv_gnat_sigint=yes
11507 else
11508    cf_cv_gnat_sigint=no
11509 fi
11510 rm -rf conftest* *~conftest*
11511
11512 fi
11513 echo "$as_me:11513: result: $cf_cv_gnat_sigint" >&5
11514 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
11515
11516 if test $cf_cv_gnat_sigint = yes ; then
11517         USE_GNAT_SIGINT=""
11518 else
11519         USE_GNAT_SIGINT="#"
11520 fi
11521
11522 echo "$as_me:11522: checking if GNAT pragma Unreferenced works" >&5
11523 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
11524 if test "${cf_cv_pragma_unreferenced+set}" = set; then
11525   echo $ECHO_N "(cached) $ECHO_C" >&6
11526 else
11527
11528 rm -rf conftest* *~conftest*
11529 cat >>conftest.ads <<CF_EOF
11530 procedure conftest;
11531 CF_EOF
11532 cat >>conftest.adb <<CF_EOF
11533 with Text_IO;
11534 with GNAT.OS_Lib;
11535 procedure conftest is
11536    test : Integer;
11537    pragma Unreferenced (test);
11538 begin
11539    test := 1;
11540    Text_IO.Put ("Hello World");
11541    Text_IO.New_Line;
11542    GNAT.OS_Lib.OS_Exit (0);
11543 end conftest;
11544 CF_EOF
11545 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11546       cf_cv_pragma_unreferenced=yes
11547 else
11548    cf_cv_pragma_unreferenced=no
11549 fi
11550 rm -rf conftest* *~conftest*
11551
11552 fi
11553 echo "$as_me:11553: result: $cf_cv_pragma_unreferenced" >&5
11554 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
11555
11556 # if the pragma is supported, use it (needed in the Trace code).
11557 if test $cf_cv_pragma_unreferenced = yes ; then
11558         PRAGMA_UNREF=TRUE
11559 else
11560         PRAGMA_UNREF=FALSE
11561 fi
11562
11563 cf_gnat_libraries=no
11564 cf_gnat_projects=no
11565
11566 echo "$as_me:11566: checking if GNAT supports project files" >&5
11567 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
11568 case $cf_gnat_version in #(vi
11569 3.[0-9]*) #(vi
11570         ;;
11571 *)
11572         case $cf_cv_system_name in #(vi
11573         cygwin*) #(vi
11574                 ;;
11575         *)
11576                 mkdir conftest.src conftest.bin conftest.lib
11577                 cd conftest.src
11578                 rm -rf conftest* *~conftest*
11579                 cat >>library.gpr <<CF_EOF
11580 project Library is
11581   Kind := External ("LIB_KIND");
11582   for Library_Name use "ConfTest";
11583   for Object_Dir use ".";
11584   for Library_ALI_Dir use External("LIBRARY_DIR");
11585   for Library_Version use External ("SONAME");
11586   for Library_Kind use Kind;
11587   for Library_Dir use External("BUILD_DIR");
11588   Source_Dir := External ("SOURCE_DIR");
11589   for Source_Dirs use (Source_Dir);
11590   package Compiler is
11591      for Default_Switches ("Ada") use
11592        ("-g",
11593         "-O2",
11594         "-gnatafno",
11595         "-gnatVa",   -- All validity checks
11596         "-gnatwa");  -- Activate all optional errors
11597   end Compiler;
11598 end Library;
11599 CF_EOF
11600                 cat >>confpackage.ads <<CF_EOF
11601 package ConfPackage is
11602    procedure conftest;
11603 end ConfPackage;
11604 CF_EOF
11605                 cat >>confpackage.adb <<CF_EOF
11606 with Text_IO;
11607 package body ConfPackage is
11608    procedure conftest is
11609    begin
11610       Text_IO.Put ("Hello World");
11611       Text_IO.New_Line;
11612    end conftest;
11613 end ConfPackage;
11614 CF_EOF
11615                 if ( $cf_ada_make $ADAFLAGS \
11616                                 -Plibrary.gpr \
11617                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
11618                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
11619                                 -XSOURCE_DIR=`pwd` \
11620                                 -XSONAME=libConfTest.so.1 \
11621                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
11622                         cf_gnat_projects=yes
11623                 fi
11624                 cd ..
11625                 if test -f conftest.lib/confpackage.ali
11626                 then
11627                         cf_gnat_libraries=yes
11628                 fi
11629                 rm -rf conftest* *~conftest*
11630                 ;;
11631         esac
11632         ;;
11633 esac
11634 echo "$as_me:11634: result: $cf_gnat_projects" >&5
11635 echo "${ECHO_T}$cf_gnat_projects" >&6
11636
11637 if test $cf_gnat_projects = yes
11638 then
11639         echo "$as_me:11639: checking if GNAT supports libraries" >&5
11640 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
11641         echo "$as_me:11641: result: $cf_gnat_libraries" >&5
11642 echo "${ECHO_T}$cf_gnat_libraries" >&6
11643 fi
11644
11645 if test "$cf_gnat_projects" = yes
11646 then
11647         USE_OLD_MAKERULES="#"
11648         USE_GNAT_PROJECTS=""
11649 else
11650         USE_OLD_MAKERULES=""
11651         USE_GNAT_PROJECTS="#"
11652 fi
11653
11654 if test "$cf_gnat_libraries" = yes
11655 then
11656         USE_GNAT_LIBRARIES=""
11657 else
11658         USE_GNAT_LIBRARIES="#"
11659 fi
11660
11661 echo "$as_me:11661: checking for ada-compiler" >&5
11662 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
11663
11664 # Check whether --with-ada-compiler or --without-ada-compiler was given.
11665 if test "${with_ada_compiler+set}" = set; then
11666   withval="$with_ada_compiler"
11667   cf_ada_compiler=$withval
11668 else
11669   cf_ada_compiler=gnatmake
11670 fi;
11671
11672 echo "$as_me:11672: result: $cf_ada_compiler" >&5
11673 echo "${ECHO_T}$cf_ada_compiler" >&6
11674
11675                 cf_ada_package=terminal_interface
11676
11677 echo "$as_me:11677: checking for ada-include" >&5
11678 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
11679
11680 # Check whether --with-ada-include or --without-ada-include was given.
11681 if test "${with_ada_include+set}" = set; then
11682   withval="$with_ada_include"
11683
11684 else
11685   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
11686 fi; if test -n "$prefix/share/ada/adainclude" ; then
11687
11688 if test "x$prefix" != xNONE; then
11689   cf_path_syntax="$prefix"
11690 else
11691   cf_path_syntax="$ac_default_prefix"
11692 fi
11693
11694 case ".$withval" in #(vi
11695 .\$\(*\)*|.\'*\'*) #(vi
11696   ;;
11697 ..|./*|.\\*) #(vi
11698   ;;
11699 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11700   ;;
11701 .\${*prefix}*|.\${*dir}*) #(vi
11702   eval withval="$withval"
11703   case ".$withval" in #(vi
11704   .NONE/*)
11705     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11706     ;;
11707   esac
11708   ;; #(vi
11709 .no|.NONE/*)
11710   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11711   ;;
11712 *)
11713   { { echo "$as_me:11713: error: expected a pathname, not \"$withval\"" >&5
11714 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11715    { (exit 1); exit 1; }; }
11716   ;;
11717 esac
11718
11719 fi
11720 eval ADA_INCLUDE="$withval"
11721
11722 echo "$as_me:11722: result: $ADA_INCLUDE" >&5
11723 echo "${ECHO_T}$ADA_INCLUDE" >&6
11724
11725 echo "$as_me:11725: checking for ada-objects" >&5
11726 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
11727
11728 # Check whether --with-ada-objects or --without-ada-objects was given.
11729 if test "${with_ada_objects+set}" = set; then
11730   withval="$with_ada_objects"
11731
11732 else
11733   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
11734 fi; if test -n "$prefix/lib/ada/adalib" ; then
11735
11736 if test "x$prefix" != xNONE; then
11737   cf_path_syntax="$prefix"
11738 else
11739   cf_path_syntax="$ac_default_prefix"
11740 fi
11741
11742 case ".$withval" in #(vi
11743 .\$\(*\)*|.\'*\'*) #(vi
11744   ;;
11745 ..|./*|.\\*) #(vi
11746   ;;
11747 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11748   ;;
11749 .\${*prefix}*|.\${*dir}*) #(vi
11750   eval withval="$withval"
11751   case ".$withval" in #(vi
11752   .NONE/*)
11753     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11754     ;;
11755   esac
11756   ;; #(vi
11757 .no|.NONE/*)
11758   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11759   ;;
11760 *)
11761   { { echo "$as_me:11761: error: expected a pathname, not \"$withval\"" >&5
11762 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11763    { (exit 1); exit 1; }; }
11764   ;;
11765 esac
11766
11767 fi
11768 eval ADA_OBJECTS="$withval"
11769
11770 echo "$as_me:11770: result: $ADA_OBJECTS" >&5
11771 echo "${ECHO_T}$ADA_OBJECTS" >&6
11772
11773 echo "$as_me:11773: checking if an Ada95 shared-library should be built" >&5
11774 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
11775
11776 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
11777 if test "${with_ada_sharedlib+set}" = set; then
11778   withval="$with_ada_sharedlib"
11779   with_ada_sharedlib=$withval
11780 else
11781   with_ada_sharedlib=no
11782 fi;
11783 echo "$as_me:11783: result: $with_ada_sharedlib" >&5
11784 echo "${ECHO_T}$with_ada_sharedlib" >&6
11785
11786 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
11787 MAKE_ADA_SHAREDLIB="#"
11788
11789 if test "x$with_ada_sharedlib" != xno
11790 then
11791         MAKE_ADA_SHAREDLIB=
11792         if test "x$with_ada_sharedlib" != xyes
11793         then
11794                 ADA_SHAREDLIB="$with_ada_sharedlib"
11795         fi
11796 fi
11797
11798         else
11799                 { { echo "$as_me:11799: error: No usable Ada compiler found" >&5
11800 echo "$as_me: error: No usable Ada compiler found" >&2;}
11801    { (exit 1); exit 1; }; }
11802         fi
11803 else
11804         { { echo "$as_me:11804: error: The Ada compiler is needed for this package" >&5
11805 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
11806    { (exit 1); exit 1; }; }
11807 fi
11808
11809 ################################################################################
11810
11811 # not needed
11812 TINFO_LDFLAGS2=
11813
11814 TINFO_LIBS=
11815
11816 ### Construct the list of include-directories to be generated
11817
11818 CPPFLAGS="$CPPFLAGS -I. -I../include"
11819 if test "$srcdir" != "."; then
11820         CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
11821 fi
11822 if test "$GCC" != yes; then
11823         CPPFLAGS="$CPPFLAGS -I\${includedir}"
11824 elif test "$includedir" != "/usr/include"; then
11825         if test "$includedir" = '${prefix}/include' ; then
11826                 if test $prefix != /usr ; then
11827                         CPPFLAGS="$CPPFLAGS -I\${includedir}"
11828                 fi
11829         else
11830                 CPPFLAGS="$CPPFLAGS -I\${includedir}"
11831         fi
11832 fi
11833
11834 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
11835 if test "$srcdir" != "."; then
11836         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
11837 fi
11838 if test "$GCC" != yes; then
11839         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11840 elif test "$includedir" != "/usr/include"; then
11841         if test "$includedir" = '${prefix}/include' ; then
11842                 if test $prefix != /usr ; then
11843                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11844                 fi
11845         else
11846                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11847         fi
11848 fi
11849
11850 ### Build up pieces for makefile rules
11851 echo "$as_me:11851: checking default library suffix" >&5
11852 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
11853
11854         case $DFT_LWR_MODEL in
11855         libtool) DFT_ARG_SUFFIX=''   ;;
11856         normal)  DFT_ARG_SUFFIX=''   ;;
11857         debug)   DFT_ARG_SUFFIX='_g' ;;
11858         profile) DFT_ARG_SUFFIX='_p' ;;
11859         shared)  DFT_ARG_SUFFIX=''   ;;
11860         esac
11861         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
11862 echo "$as_me:11862: result: $DFT_ARG_SUFFIX" >&5
11863 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
11864
11865 echo "$as_me:11865: checking default library-dependency suffix" >&5
11866 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
11867
11868         case $DFT_LWR_MODEL in #(vi
11869         libtool) #(vi
11870                 DFT_LIB_SUFFIX='.la'
11871                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11872                 ;;
11873         normal) #(vi
11874                 DFT_LIB_SUFFIX='.a'
11875                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11876                 ;;
11877         debug) #(vi
11878                 DFT_LIB_SUFFIX='_g.a'
11879                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11880                 ;;
11881         profile) #(vi
11882                 DFT_LIB_SUFFIX='_p.a'
11883                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11884                 ;;
11885         shared) #(vi
11886                 case $cf_cv_system_name in
11887                 aix[5-7]*) #(vi
11888                         DFT_LIB_SUFFIX='.a'
11889                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11890                         ;;
11891                 cygwin*|mingw*) #(vi
11892                         DFT_LIB_SUFFIX='.dll'
11893                         DFT_DEP_SUFFIX='.dll.a'
11894                         ;;
11895                 darwin*) #(vi
11896                         DFT_LIB_SUFFIX='.dylib'
11897                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11898                         ;;
11899                 hpux*) #(vi
11900                         case $target in
11901                         ia64*) #(vi
11902                                 DFT_LIB_SUFFIX='.so'
11903                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11904                                 ;;
11905                         *) #(vi
11906                                 DFT_LIB_SUFFIX='.sl'
11907                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11908                                 ;;
11909                         esac
11910                         ;;
11911                 *)      DFT_LIB_SUFFIX='.so'
11912                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11913                         ;;
11914                 esac
11915         esac
11916         test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
11917         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
11918 echo "$as_me:11918: result: $DFT_DEP_SUFFIX" >&5
11919 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
11920
11921 echo "$as_me:11921: checking default object directory" >&5
11922 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
11923
11924         case $DFT_LWR_MODEL in
11925         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
11926         normal)  DFT_OBJ_SUBDIR='objects' ;;
11927         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
11928         profile) DFT_OBJ_SUBDIR='obj_p' ;;
11929         shared)
11930                 case $cf_cv_system_name in #(vi
11931                 cygwin) #(vi
11932                         DFT_OBJ_SUBDIR='objects' ;;
11933                 *)
11934                         DFT_OBJ_SUBDIR='obj_s' ;;
11935                 esac
11936         esac
11937 echo "$as_me:11937: result: $DFT_OBJ_SUBDIR" >&5
11938 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
11939
11940 ### Set up low-level terminfo dependencies for makefiles.
11941
11942 if test "$DFT_LWR_MODEL" = shared ; then
11943         case $cf_cv_system_name in #(vi
11944         cygwin*)
11945                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
11946                 ;;
11947         esac
11948 fi
11949
11950 ### Construct the list of subdirectories for which we'll customize makefiles
11951 ### with the appropriate compile-rules.
11952
11953 SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
11954
11955 cat >>confdefs.h <<EOF
11956 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
11957 EOF
11958
11959 ### Now that we're done running tests, add the compiler-warnings, if any
11960
11961 cf_fix_cppflags=no
11962 cf_new_cflags=
11963 cf_new_cppflags=
11964 cf_new_extra_cppflags=
11965
11966 for cf_add_cflags in $EXTRA_CFLAGS
11967 do
11968 case $cf_fix_cppflags in
11969 no)
11970         case $cf_add_cflags in #(vi
11971         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11972                 case $cf_add_cflags in
11973                 -D*)
11974                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11975
11976                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11977                                 && test -z "${cf_tst_cflags}" \
11978                                 && cf_fix_cppflags=yes
11979
11980                         if test $cf_fix_cppflags = yes ; then
11981                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11982                                 continue
11983                         elif test "${cf_tst_cflags}" = "\"'" ; then
11984                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11985                                 continue
11986                         fi
11987                         ;;
11988                 esac
11989                 case "$CPPFLAGS" in
11990                 *$cf_add_cflags) #(vi
11991                         ;;
11992                 *) #(vi
11993                         case $cf_add_cflags in #(vi
11994                         -D*)
11995                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11996
11997 CPPFLAGS=`echo "$CPPFLAGS" | \
11998         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11999                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12000
12001                                 ;;
12002                         esac
12003                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12004                         ;;
12005                 esac
12006                 ;;
12007         *)
12008                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12009                 ;;
12010         esac
12011         ;;
12012 yes)
12013         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12014
12015         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12016
12017         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12018                 && test -z "${cf_tst_cflags}" \
12019                 && cf_fix_cppflags=no
12020         ;;
12021 esac
12022 done
12023
12024 if test -n "$cf_new_cflags" ; then
12025
12026         CFLAGS="$CFLAGS $cf_new_cflags"
12027 fi
12028
12029 if test -n "$cf_new_cppflags" ; then
12030
12031         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12032 fi
12033
12034 if test -n "$cf_new_extra_cppflags" ; then
12035
12036         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12037 fi
12038
12039 ################################################################################
12040
12041 if test x"$enable_pc_files" = xyes ; then \
12042 SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
12043 MAKE_PC_FILES=
12044 else
12045 MAKE_PC_FILES="#"
12046 fi
12047
12048 ################################################################################
12049
12050 TEST_ARG2=
12051
12052 TEST_LIBS2=
12053
12054 NCURSES_SHLIB2="sh -c"
12055
12056 ADA_SUBDIRS="include gen src doc"
12057 if test "x$cf_with_tests" != "xno" ; then
12058         ADA_SUBDIRS="$ADA_SUBDIRS samples"
12059 fi
12060 for cf_dir in $ADA_SUBDIRS
12061 do
12062         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
12063 done
12064
12065 NCURSES_TREE="#"
12066
12067 EXTERNAL_TREE=
12068
12069 # match layout used by make-tar.sh
12070 ADAHTML_DIR=../doc/ada
12071
12072 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
12073 ac_config_commands="$ac_config_commands default"
12074 cat >confcache <<\_ACEOF
12075 # This file is a shell script that caches the results of configure
12076 # tests run on this system so they can be shared between configure
12077 # scripts and configure runs, see configure's option --config-cache.
12078 # It is not useful on other systems.  If it contains results you don't
12079 # want to keep, you may remove or edit it.
12080 #
12081 # config.status only pays attention to the cache file if you give it
12082 # the --recheck option to rerun configure.
12083 #
12084 # `ac_cv_env_foo' variables (set or unset) will be overriden when
12085 # loading this file, other *unset* `ac_cv_foo' will be assigned the
12086 # following values.
12087
12088 _ACEOF
12089
12090 # The following way of writing the cache mishandles newlines in values,
12091 # but we know of no workaround that is simple, portable, and efficient.
12092 # So, don't put newlines in cache variables' values.
12093 # Ultrix sh set writes to stderr and can't be redirected directly,
12094 # and sets the high bit in the cache file unless we assign to the vars.
12095 {
12096   (set) 2>&1 |
12097     case `(ac_space=' '; set | grep ac_space) 2>&1` in
12098     *ac_space=\ *)
12099       # `set' does not quote correctly, so add quotes (double-quote
12100       # substitution turns \\\\ into \\, and sed turns \\ into \).
12101       sed -n \
12102         "s/'/'\\\\''/g;
12103           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
12104       ;;
12105     *)
12106       # `set' quotes correctly as required by POSIX, so do not add quotes.
12107       sed -n \
12108         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
12109       ;;
12110     esac;
12111 } |
12112   sed '
12113      t clear
12114      : clear
12115      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
12116      t end
12117      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
12118      : end' >>confcache
12119 if cmp -s $cache_file confcache; then :; else
12120   if test -w $cache_file; then
12121     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
12122     cat confcache >$cache_file
12123   else
12124     echo "not updating unwritable cache $cache_file"
12125   fi
12126 fi
12127 rm -f confcache
12128
12129 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12130 # Let make expand exec_prefix.
12131 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12132
12133 # VPATH may cause trouble with some makes, so we remove $(srcdir),
12134 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
12135 # trailing colons and then remove the whole line if VPATH becomes empty
12136 # (actually we leave an empty line to preserve line numbers).
12137 if test "x$srcdir" = x.; then
12138   ac_vpsub='/^[         ]*VPATH[        ]*=/{
12139 s/:*\$(srcdir):*/:/;
12140 s/:*\${srcdir}:*/:/;
12141 s/:*@srcdir@:*/:/;
12142 s/^\([^=]*=[    ]*\):*/\1/;
12143 s/:*$//;
12144 s/^[^=]*=[      ]*$//;
12145 }'
12146 fi
12147
12148 DEFS=-DHAVE_CONFIG_H
12149
12150 : ${CONFIG_STATUS=./config.status}
12151 ac_clean_files_save=$ac_clean_files
12152 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
12153 { echo "$as_me:12153: creating $CONFIG_STATUS" >&5
12154 echo "$as_me: creating $CONFIG_STATUS" >&6;}
12155 cat >$CONFIG_STATUS <<_ACEOF
12156 #! $SHELL
12157 # Generated automatically by configure.
12158 # Run this file to recreate the current configuration.
12159 # Compiler output produced by configure, useful for debugging
12160 # configure, is in config.log if it exists.
12161
12162 debug=false
12163 SHELL=\${CONFIG_SHELL-$SHELL}
12164 ac_cs_invocation="\$0 \$@"
12165
12166 _ACEOF
12167
12168 cat >>$CONFIG_STATUS <<\_ACEOF
12169 # Be Bourne compatible
12170 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
12171   emulate sh
12172   NULLCMD=:
12173 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
12174   set -o posix
12175 fi
12176
12177 # Name of the executable.
12178 as_me=`echo "$0" |sed 's,.*[\\/],,'`
12179
12180 if expr a : '\(a\)' >/dev/null 2>&1; then
12181   as_expr=expr
12182 else
12183   as_expr=false
12184 fi
12185
12186 rm -f conf$$ conf$$.exe conf$$.file
12187 echo >conf$$.file
12188 if ln -s conf$$.file conf$$ 2>/dev/null; then
12189   # We could just check for DJGPP; but this test a) works b) is more generic
12190   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
12191   if test -f conf$$.exe; then
12192     # Don't use ln at all; we don't have any links
12193     as_ln_s='cp -p'
12194   else
12195     as_ln_s='ln -s'
12196   fi
12197 elif ln conf$$.file conf$$ 2>/dev/null; then
12198   as_ln_s=ln
12199 else
12200   as_ln_s='cp -p'
12201 fi
12202 rm -f conf$$ conf$$.exe conf$$.file
12203
12204 as_executable_p="test -f"
12205
12206 # Support unset when possible.
12207 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
12208   as_unset=unset
12209 else
12210   as_unset=false
12211 fi
12212
12213 # NLS nuisances.
12214 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
12215 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
12216 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
12217 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
12218 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
12219 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
12220 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
12221 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
12222
12223 # IFS
12224 # We need space, tab and new line, in precisely that order.
12225 as_nl='
12226 '
12227 IFS="   $as_nl"
12228
12229 # CDPATH.
12230 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
12231
12232 exec 6>&1
12233
12234 _ACEOF
12235
12236 # Files that config.status was made for.
12237 if test -n "$ac_config_files"; then
12238   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
12239 fi
12240
12241 if test -n "$ac_config_headers"; then
12242   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
12243 fi
12244
12245 if test -n "$ac_config_links"; then
12246   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
12247 fi
12248
12249 if test -n "$ac_config_commands"; then
12250   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
12251 fi
12252
12253 cat >>$CONFIG_STATUS <<\EOF
12254
12255 ac_cs_usage="\
12256 \`$as_me' instantiates files from templates according to the
12257 current configuration.
12258
12259 Usage: $0 [OPTIONS] [FILE]...
12260
12261   -h, --help       print this help, then exit
12262   -V, --version    print version number, then exit
12263   -d, --debug      don't remove temporary files
12264       --recheck    update $as_me by reconfiguring in the same conditions
12265   --file=FILE[:TEMPLATE]
12266                    instantiate the configuration file FILE
12267   --header=FILE[:TEMPLATE]
12268                    instantiate the configuration header FILE
12269
12270 Configuration files:
12271 $config_files
12272
12273 Configuration headers:
12274 $config_headers
12275
12276 Configuration commands:
12277 $config_commands
12278
12279 Report bugs to <dickey@invisible-island.net>."
12280 EOF
12281
12282 cat >>$CONFIG_STATUS <<EOF
12283 ac_cs_version="\\
12284 config.status
12285 configured by $0, generated by GNU Autoconf 2.52.20121002,
12286   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
12287
12288 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
12289 Free Software Foundation, Inc.
12290 This config.status script is free software; the Free Software Foundation
12291 gives unlimited permission to copy, distribute and modify it."
12292 srcdir=$srcdir
12293 INSTALL="$INSTALL"
12294 EOF
12295
12296 cat >>$CONFIG_STATUS <<\EOF
12297 # If no file are specified by the user, then we need to provide default
12298 # value.  By we need to know if files were specified by the user.
12299 ac_need_defaults=:
12300 while test $# != 0
12301 do
12302   case $1 in
12303   --*=*)
12304     ac_option=`expr "x$1" : 'x\([^=]*\)='`
12305     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
12306     shift
12307     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
12308     shift
12309     ;;
12310   -*);;
12311   *) # This is not an option, so the user has probably given explicit
12312      # arguments.
12313      ac_need_defaults=false;;
12314   esac
12315
12316   case $1 in
12317   # Handling of the options.
12318 EOF
12319 cat >>$CONFIG_STATUS <<EOF
12320   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12321     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
12322     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
12323 EOF
12324 cat >>$CONFIG_STATUS <<\EOF
12325   --version | --vers* | -V )
12326     echo "$ac_cs_version"; exit 0 ;;
12327   --he | --h)
12328     # Conflict between --help and --header
12329     { { echo "$as_me:12329: error: ambiguous option: $1
12330 Try \`$0 --help' for more information." >&5
12331 echo "$as_me: error: ambiguous option: $1
12332 Try \`$0 --help' for more information." >&2;}
12333    { (exit 1); exit 1; }; };;
12334   --help | --hel | -h )
12335     echo "$ac_cs_usage"; exit 0 ;;
12336   --debug | --d* | -d )
12337     debug=: ;;
12338   --file | --fil | --fi | --f )
12339     shift
12340     CONFIG_FILES="$CONFIG_FILES $1"
12341     ac_need_defaults=false;;
12342   --header | --heade | --head | --hea )
12343     shift
12344     CONFIG_HEADERS="$CONFIG_HEADERS $1"
12345     ac_need_defaults=false;;
12346
12347   # This is an error.
12348   -*) { { echo "$as_me:12348: error: unrecognized option: $1
12349 Try \`$0 --help' for more information." >&5
12350 echo "$as_me: error: unrecognized option: $1
12351 Try \`$0 --help' for more information." >&2;}
12352    { (exit 1); exit 1; }; } ;;
12353
12354   *) ac_config_targets="$ac_config_targets $1" ;;
12355
12356   esac
12357   shift
12358 done
12359
12360 exec 5>>config.log
12361 cat >&5 << _ACEOF
12362
12363 ## ----------------------- ##
12364 ## Running config.status.  ##
12365 ## ----------------------- ##
12366
12367 This file was extended by $as_me 2.52.20121002, executed with
12368   CONFIG_FILES    = $CONFIG_FILES
12369   CONFIG_HEADERS  = $CONFIG_HEADERS
12370   CONFIG_LINKS    = $CONFIG_LINKS
12371   CONFIG_COMMANDS = $CONFIG_COMMANDS
12372   > $ac_cs_invocation
12373 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12374
12375 _ACEOF
12376 EOF
12377
12378 cat >>$CONFIG_STATUS <<EOF
12379 #
12380 # INIT-COMMANDS section.
12381 #
12382
12383 ### Special initialization commands, used to pass information from the
12384 ### configuration-run into config.status
12385
12386 AWK="$AWK"
12387 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
12388 DFT_LWR_MODEL="$DFT_LWR_MODEL"
12389 LIB_NAME="$LIB_NAME"
12390 LIB_PREFIX="$LIB_PREFIX"
12391 LIB_SUFFIX="$LIB_SUFFIX"
12392 LN_S="$LN_S"
12393 NCURSES_MAJOR="$NCURSES_MAJOR"
12394 NCURSES_MINOR="$NCURSES_MINOR"
12395 NCURSES_PATCH="$NCURSES_PATCH"
12396 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
12397 cf_cv_abi_version="$cf_cv_abi_version"
12398 cf_cv_rel_version="$cf_cv_rel_version"
12399 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
12400 cf_cv_shared_soname='$cf_cv_shared_soname'
12401 cf_cv_shlib_version="$cf_cv_shlib_version"
12402 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
12403 cf_cv_system_name="$cf_cv_system_name"
12404 host="$host"
12405 target="$target"
12406
12407 EOF
12408
12409 cat >>$CONFIG_STATUS <<\EOF
12410 for ac_config_target in $ac_config_targets
12411 do
12412   case "$ac_config_target" in
12413   # Handling of arguments.
12414   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
12415   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
12416   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
12417   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
12418   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
12419   *) { { echo "$as_me:12419: error: invalid argument: $ac_config_target" >&5
12420 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
12421    { (exit 1); exit 1; }; };;
12422   esac
12423 done
12424
12425 # If the user did not use the arguments to specify the items to instantiate,
12426 # then the envvar interface is used.  Set only those that are not.
12427 # We use the long form for the default assignment because of an extremely
12428 # bizarre bug on SunOS 4.1.3.
12429 if $ac_need_defaults; then
12430   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
12431   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
12432   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
12433 fi
12434
12435 # Create a temporary directory, and hook for its removal unless debugging.
12436 $debug ||
12437 {
12438   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
12439   trap '{ (exit 1); exit 1; }' 1 2 13 15
12440 }
12441
12442 # Create a (secure) tmp directory for tmp files.
12443 : ${TMPDIR=/tmp}
12444 {
12445   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
12446   test -n "$tmp" && test -d "$tmp"
12447 }  ||
12448 {
12449   tmp=$TMPDIR/cs$$-$RANDOM
12450   (umask 077 && mkdir $tmp)
12451 } ||
12452 {
12453    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
12454    { (exit 1); exit 1; }
12455 }
12456
12457 EOF
12458
12459 cat >>$CONFIG_STATUS <<EOF
12460
12461 #
12462 # CONFIG_FILES section.
12463 #
12464
12465 # No need to generate the scripts if there are no CONFIG_FILES.
12466 # This happens for instance when ./config.status config.h
12467 if test -n "\$CONFIG_FILES"; then
12468   # Protect against being on the right side of a sed subst in config.status.
12469   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
12470    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
12471 s,@SHELL@,$SHELL,;t t
12472 s,@exec_prefix@,$exec_prefix,;t t
12473 s,@prefix@,$prefix,;t t
12474 s,@program_transform_name@,$program_transform_name,;t t
12475 s,@bindir@,$bindir,;t t
12476 s,@sbindir@,$sbindir,;t t
12477 s,@libexecdir@,$libexecdir,;t t
12478 s,@datarootdir@,$datarootdir,;t t
12479 s,@datadir@,$datadir,;t t
12480 s,@sysconfdir@,$sysconfdir,;t t
12481 s,@sharedstatedir@,$sharedstatedir,;t t
12482 s,@localstatedir@,$localstatedir,;t t
12483 s,@libdir@,$libdir,;t t
12484 s,@includedir@,$includedir,;t t
12485 s,@oldincludedir@,$oldincludedir,;t t
12486 s,@infodir@,$infodir,;t t
12487 s,@mandir@,$mandir,;t t
12488 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
12489 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
12490 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
12491 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
12492 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
12493 s,@build_alias@,$build_alias,;t t
12494 s,@host_alias@,$host_alias,;t t
12495 s,@target_alias@,$target_alias,;t t
12496 s,@ECHO_C@,$ECHO_C,;t t
12497 s,@ECHO_N@,$ECHO_N,;t t
12498 s,@ECHO_T@,$ECHO_T,;t t
12499 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
12500 s,@DEFS@,$DEFS,;t t
12501 s,@LIBS@,$LIBS,;t t
12502 s,@top_builddir@,$top_builddir,;t t
12503 s,@build@,$build,;t t
12504 s,@build_cpu@,$build_cpu,;t t
12505 s,@build_vendor@,$build_vendor,;t t
12506 s,@build_os@,$build_os,;t t
12507 s,@host@,$host,;t t
12508 s,@host_cpu@,$host_cpu,;t t
12509 s,@host_vendor@,$host_vendor,;t t
12510 s,@host_os@,$host_os,;t t
12511 s,@target@,$target,;t t
12512 s,@target_cpu@,$target_cpu,;t t
12513 s,@target_vendor@,$target_vendor,;t t
12514 s,@target_os@,$target_os,;t t
12515 s,@CC@,$CC,;t t
12516 s,@CFLAGS@,$CFLAGS,;t t
12517 s,@LDFLAGS@,$LDFLAGS,;t t
12518 s,@CPPFLAGS@,$CPPFLAGS,;t t
12519 s,@ac_ct_CC@,$ac_ct_CC,;t t
12520 s,@EXEEXT@,$EXEEXT,;t t
12521 s,@OBJEXT@,$OBJEXT,;t t
12522 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
12523 s,@CPP@,$CPP,;t t
12524 s,@AWK@,$AWK,;t t
12525 s,@EGREP@,$EGREP,;t t
12526 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
12527 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
12528 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
12529 s,@LN_S@,$LN_S,;t t
12530 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
12531 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
12532 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
12533 s,@SET_MAKE@,$SET_MAKE,;t t
12534 s,@CTAGS@,$CTAGS,;t t
12535 s,@ETAGS@,$ETAGS,;t t
12536 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
12537 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
12538 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
12539 s,@RANLIB@,$RANLIB,;t t
12540 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
12541 s,@LD@,$LD,;t t
12542 s,@ac_ct_LD@,$ac_ct_LD,;t t
12543 s,@AR@,$AR,;t t
12544 s,@ac_ct_AR@,$ac_ct_AR,;t t
12545 s,@ARFLAGS@,$ARFLAGS,;t t
12546 s,@DESTDIR@,$DESTDIR,;t t
12547 s,@BUILD_CC@,$BUILD_CC,;t t
12548 s,@BUILD_CPP@,$BUILD_CPP,;t t
12549 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
12550 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
12551 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
12552 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
12553 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
12554 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
12555 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
12556 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
12557 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
12558 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
12559 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
12560 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
12561 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
12562 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
12563 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
12564 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
12565 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
12566 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
12567 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
12568 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
12569 s,@CC_G_OPT@,$CC_G_OPT,;t t
12570 s,@LD_MODEL@,$LD_MODEL,;t t
12571 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
12572 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
12573 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
12574 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
12575 s,@LINK_PROGS@,$LINK_PROGS,;t t
12576 s,@LINK_TESTS@,$LINK_TESTS,;t t
12577 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
12578 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
12579 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
12580 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
12581 s,@RPATH_LIST@,$RPATH_LIST,;t t
12582 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
12583 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
12584 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
12585 s,@PTHREAD@,$PTHREAD,;t t
12586 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
12587 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
12588 s,@ECHO_LT@,$ECHO_LT,;t t
12589 s,@ECHO_LD@,$ECHO_LD,;t t
12590 s,@RULE_CC@,$RULE_CC,;t t
12591 s,@SHOW_CC@,$SHOW_CC,;t t
12592 s,@ECHO_CC@,$ECHO_CC,;t t
12593 s,@ADAFLAGS@,$ADAFLAGS,;t t
12594 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
12595 s,@ADA_TRACE@,$ADA_TRACE,;t t
12596 s,@gnat_exists@,$gnat_exists,;t t
12597 s,@M4_exists@,$M4_exists,;t t
12598 s,@cf_ada_make@,$cf_ada_make,;t t
12599 s,@cf_compile_generics@,$cf_compile_generics,;t t
12600 s,@cf_generic_objects@,$cf_generic_objects,;t t
12601 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
12602 s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
12603 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
12604 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
12605 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
12606 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
12607 s,@cf_ada_package@,$cf_ada_package,;t t
12608 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
12609 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
12610 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
12611 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
12612 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
12613 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
12614 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
12615 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
12616 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
12617 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
12618 s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
12619 s,@cross_compiling@,$cross_compiling,;t t
12620 s,@TEST_ARG2@,$TEST_ARG2,;t t
12621 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
12622 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
12623 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
12624 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
12625 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
12626 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
12627 CEOF
12628
12629 EOF
12630
12631   cat >>$CONFIG_STATUS <<\EOF
12632   # Split the substitutions into bite-sized pieces for seds with
12633   # small command number limits, like on Digital OSF/1 and HP-UX.
12634   ac_max_sed_lines=48
12635   ac_sed_frag=1 # Number of current file.
12636   ac_beg=1 # First line for current file.
12637   ac_end=$ac_max_sed_lines # Line after last line for current file.
12638   ac_more_lines=:
12639   ac_sed_cmds=
12640   while $ac_more_lines; do
12641     if test $ac_beg -gt 1; then
12642       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12643     else
12644       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12645     fi
12646     if test ! -s $tmp/subs.frag; then
12647       ac_more_lines=false
12648     else
12649       # The purpose of the label and of the branching condition is to
12650       # speed up the sed processing (if there are no `@' at all, there
12651       # is no need to browse any of the substitutions).
12652       # These are the two extra sed commands mentioned above.
12653       (echo ':t
12654   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
12655       if test -z "$ac_sed_cmds"; then
12656         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
12657       else
12658         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
12659       fi
12660       ac_sed_frag=`expr $ac_sed_frag + 1`
12661       ac_beg=$ac_end
12662       ac_end=`expr $ac_end + $ac_max_sed_lines`
12663     fi
12664   done
12665   if test -z "$ac_sed_cmds"; then
12666     ac_sed_cmds=cat
12667   fi
12668 fi # test -n "$CONFIG_FILES"
12669
12670 EOF
12671 cat >>$CONFIG_STATUS <<\EOF
12672 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12673   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12674   case $ac_file in
12675   - | *:- | *:-:* ) # input from stdin
12676         cat >$tmp/stdin
12677         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12678         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12679   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12680         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12681   * )   ac_file_in=$ac_file.in ;;
12682   esac
12683
12684   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12685   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12686          X"$ac_file" : 'X\(//\)[^/]' \| \
12687          X"$ac_file" : 'X\(//\)$' \| \
12688          X"$ac_file" : 'X\(/\)' \| \
12689          .     : '\(.\)' 2>/dev/null ||
12690 echo X"$ac_file" |
12691     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12692           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12693           /^X\(\/\/\)$/{ s//\1/; q; }
12694           /^X\(\/\).*/{ s//\1/; q; }
12695           s/.*/./; q'`
12696   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12697     { case "$ac_dir" in
12698   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12699   *)                      as_incr_dir=.;;
12700 esac
12701 as_dummy="$ac_dir"
12702 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12703   case $as_mkdir_dir in
12704     # Skip DOS drivespec
12705     ?:) as_incr_dir=$as_mkdir_dir ;;
12706     *)
12707       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12708       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12709     ;;
12710   esac
12711 done; }
12712
12713     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
12714     # A "../" for each directory in $ac_dir_suffix.
12715     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
12716   else
12717     ac_dir_suffix= ac_dots=
12718   fi
12719
12720   case $srcdir in
12721   .)  ac_srcdir=.
12722       if test -z "$ac_dots"; then
12723          ac_top_srcdir=.
12724       else
12725          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
12726       fi ;;
12727   [\\/]* | ?:[\\/]* )
12728       ac_srcdir=$srcdir$ac_dir_suffix;
12729       ac_top_srcdir=$srcdir ;;
12730   *) # Relative path.
12731     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
12732     ac_top_srcdir=$ac_dots$srcdir ;;
12733   esac
12734
12735   case $INSTALL in
12736   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
12737   *) ac_INSTALL=$ac_dots$INSTALL ;;
12738   esac
12739
12740   if test x"$ac_file" != x-; then
12741     { echo "$as_me:12741: creating $ac_file" >&5
12742 echo "$as_me: creating $ac_file" >&6;}
12743     rm -f "$ac_file"
12744   fi
12745   # Let's still pretend it is `configure' which instantiates (i.e., don't
12746   # use $as_me), people would be surprised to read:
12747   #    /* config.h.  Generated automatically by config.status.  */
12748   configure_input="Generated automatically from `echo $ac_file_in |
12749                                                  sed 's,.*/,,'` by configure."
12750
12751   # First look for the input files in the build tree, otherwise in the
12752   # src tree.
12753   ac_file_inputs=`IFS=:
12754     for f in $ac_file_in; do
12755       case $f in
12756       -) echo $tmp/stdin ;;
12757       [\\/$]*)
12758          # Absolute (can't be DOS-style, as IFS=:)
12759          test -f "$f" || { { echo "$as_me:12759: error: cannot find input file: $f" >&5
12760 echo "$as_me: error: cannot find input file: $f" >&2;}
12761    { (exit 1); exit 1; }; }
12762          echo $f;;
12763       *) # Relative
12764          if test -f "$f"; then
12765            # Build tree
12766            echo $f
12767          elif test -f "$srcdir/$f"; then
12768            # Source tree
12769            echo $srcdir/$f
12770          else
12771            # /dev/null tree
12772            { { echo "$as_me:12772: error: cannot find input file: $f" >&5
12773 echo "$as_me: error: cannot find input file: $f" >&2;}
12774    { (exit 1); exit 1; }; }
12775          fi;;
12776       esac
12777     done` || { (exit 1); exit 1; }
12778 EOF
12779 cat >>$CONFIG_STATUS <<\EOF
12780   ac_warn_datarootdir=no
12781   if test x"$ac_file" != x-; then
12782     for ac_item in $ac_file_inputs
12783     do
12784       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
12785       if test -n "$ac_seen"; then
12786         ac_used=`grep '@datarootdir@' $ac_item`
12787         if test -z "$ac_used"; then
12788           { echo "$as_me:12788: WARNING: datarootdir was used implicitly but not set:
12789 $ac_seen" >&5
12790 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
12791 $ac_seen" >&2;}
12792           ac_warn_datarootdir=yes
12793         fi
12794       fi
12795       ac_seen=`grep '${datarootdir}' $ac_item`
12796       if test -n "$ac_seen"; then
12797         { echo "$as_me:12797: WARNING: datarootdir was used explicitly but not set:
12798 $ac_seen" >&5
12799 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
12800 $ac_seen" >&2;}
12801         ac_warn_datarootdir=yes
12802       fi
12803     done
12804   fi
12805
12806 if test "x$ac_warn_datarootdir" = xyes; then
12807   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
12808 fi
12809
12810 EOF
12811 cat >>$CONFIG_STATUS <<EOF
12812   sed "$ac_vpsub
12813 $extrasub
12814 EOF
12815 cat >>$CONFIG_STATUS <<\EOF
12816 :t
12817 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
12818 s,@configure_input@,$configure_input,;t t
12819 s,@srcdir@,$ac_srcdir,;t t
12820 s,@top_srcdir@,$ac_top_srcdir,;t t
12821 s,@INSTALL@,$ac_INSTALL,;t t
12822 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
12823   rm -f $tmp/stdin
12824   if test x"$ac_file" != x-; then
12825     cp $tmp/out $ac_file
12826
12827     for ac_name in prefix exec_prefix datarootdir
12828     do
12829         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
12830         if test -n "$ac_seen"; then
12831             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
12832             if test -z "$ac_init"; then
12833               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
12834               { echo "$as_me:12834: WARNING: Variable $ac_name is used but was not set:
12835 $ac_seen" >&5
12836 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
12837 $ac_seen" >&2;}
12838             fi
12839         fi
12840     done
12841     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
12842     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
12843     if test -s $tmp/out; then
12844       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
12845       { echo "$as_me:12845: WARNING: Some variables may not be substituted:
12846 $ac_seen" >&5
12847 echo "$as_me: WARNING: Some variables may not be substituted:
12848 $ac_seen" >&2;}
12849     fi
12850   else
12851     cat $tmp/out
12852   fi
12853   rm -f $tmp/out
12854
12855 done
12856 EOF
12857 cat >>$CONFIG_STATUS <<\EOF
12858
12859 #
12860 # CONFIG_HEADER section.
12861 #
12862
12863 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12864 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12865 #
12866 # ac_d sets the value in "#define NAME VALUE" lines.
12867 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12868 ac_dB='[        ].*$,\1#\2'
12869 ac_dC=' '
12870 ac_dD=',;t'
12871 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12872 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12873 ac_iB='\([      ]\),\1#\2define\3'
12874 ac_iC=' '
12875 ac_iD='\4,;t'
12876 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12877 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12878 ac_uB='$,\1#\2define\3'
12879 ac_uC=' '
12880 ac_uD=',;t'
12881
12882 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
12883   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12884   case $ac_file in
12885   - | *:- | *:-:* ) # input from stdin
12886         cat >$tmp/stdin
12887         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12888         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12889   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12890         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12891   * )   ac_file_in=$ac_file.in ;;
12892   esac
12893
12894   test x"$ac_file" != x- && { echo "$as_me:12894: creating $ac_file" >&5
12895 echo "$as_me: creating $ac_file" >&6;}
12896
12897   # First look for the input files in the build tree, otherwise in the
12898   # src tree.
12899   ac_file_inputs=`IFS=:
12900     for f in $ac_file_in; do
12901       case $f in
12902       -) echo $tmp/stdin ;;
12903       [\\/$]*)
12904          # Absolute (can't be DOS-style, as IFS=:)
12905          test -f "$f" || { { echo "$as_me:12905: error: cannot find input file: $f" >&5
12906 echo "$as_me: error: cannot find input file: $f" >&2;}
12907    { (exit 1); exit 1; }; }
12908          echo $f;;
12909       *) # Relative
12910          if test -f "$f"; then
12911            # Build tree
12912            echo $f
12913          elif test -f "$srcdir/$f"; then
12914            # Source tree
12915            echo $srcdir/$f
12916          else
12917            # /dev/null tree
12918            { { echo "$as_me:12918: error: cannot find input file: $f" >&5
12919 echo "$as_me: error: cannot find input file: $f" >&2;}
12920    { (exit 1); exit 1; }; }
12921          fi;;
12922       esac
12923     done` || { (exit 1); exit 1; }
12924   # Remove the trailing spaces.
12925   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
12926
12927 EOF
12928
12929 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
12930 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
12931 # be either 'cat' or 'sort'.
12932 cat confdefs.h | uniq >conftest.vals
12933
12934 # Break up conftest.vals because some shells have a limit on
12935 # the size of here documents, and old seds have small limits too.
12936
12937 rm -f conftest.tail
12938 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
12939 while grep . conftest.vals >/dev/null
12940 do
12941   # Write chunks of a limited-size here document to conftest.frag.
12942   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
12943   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
12944   echo 'CEOF' >> $CONFIG_STATUS
12945   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12946   rm -f conftest.vals
12947   mv conftest.tail conftest.vals
12948 done
12949 rm -f conftest.vals
12950
12951 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
12952 # marker @DEFS@.
12953 echo '  cat >> conftest.edit <<CEOF
12954 /@DEFS@/r conftest.frag
12955 /@DEFS@/d
12956 CEOF
12957 sed -f conftest.edit $tmp/in > $tmp/out
12958 rm -f $tmp/in
12959 mv $tmp/out $tmp/in
12960 rm -f conftest.edit conftest.frag
12961 ' >> $CONFIG_STATUS
12962
12963 cat >>$CONFIG_STATUS <<\EOF
12964   # Let's still pretend it is `configure' which instantiates (i.e., don't
12965   # use $as_me), people would be surprised to read:
12966   #    /* config.h.  Generated automatically by config.status.  */
12967   if test x"$ac_file" = x-; then
12968     echo "/* Generated automatically by configure.  */" >$tmp/config.h
12969   else
12970     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
12971   fi
12972   cat $tmp/in >>$tmp/config.h
12973   rm -f $tmp/in
12974   if test x"$ac_file" != x-; then
12975     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
12976       { echo "$as_me:12976: $ac_file is unchanged" >&5
12977 echo "$as_me: $ac_file is unchanged" >&6;}
12978     else
12979       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12980          X"$ac_file" : 'X\(//\)[^/]' \| \
12981          X"$ac_file" : 'X\(//\)$' \| \
12982          X"$ac_file" : 'X\(/\)' \| \
12983          .     : '\(.\)' 2>/dev/null ||
12984 echo X"$ac_file" |
12985     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12986           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12987           /^X\(\/\/\)$/{ s//\1/; q; }
12988           /^X\(\/\).*/{ s//\1/; q; }
12989           s/.*/./; q'`
12990       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12991         { case "$ac_dir" in
12992   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12993   *)                      as_incr_dir=.;;
12994 esac
12995 as_dummy="$ac_dir"
12996 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12997   case $as_mkdir_dir in
12998     # Skip DOS drivespec
12999     ?:) as_incr_dir=$as_mkdir_dir ;;
13000     *)
13001       as_incr_dir=$as_incr_dir/$as_mkdir_dir
13002       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
13003     ;;
13004   esac
13005 done; }
13006
13007       fi
13008       rm -f $ac_file
13009       mv $tmp/config.h $ac_file
13010     fi
13011   else
13012     cat $tmp/config.h
13013     rm -f $tmp/config.h
13014   fi
13015 done
13016 EOF
13017 cat >>$CONFIG_STATUS <<\EOF
13018 #
13019 # CONFIG_COMMANDS section.
13020 #
13021 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
13022   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
13023   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
13024
13025   case $ac_dest in
13026     default )
13027 if test -z "$USE_OLD_MAKERULES" ; then
13028         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
13029 fi
13030  ;;
13031   esac
13032 done
13033 EOF
13034
13035 cat >>$CONFIG_STATUS <<\EOF
13036
13037 { (exit 0); exit 0; }
13038 EOF
13039 chmod +x $CONFIG_STATUS
13040 ac_clean_files=$ac_clean_files_save
13041
13042 # configure is writing to config.log, and then calls config.status.
13043 # config.status does its own redirection, appending to config.log.
13044 # Unfortunately, on DOS this fails, as config.log is still kept open
13045 # by configure, so config.status won't be able to write to it; its
13046 # output is simply discarded.  So we exec the FD to /dev/null,
13047 # effectively closing config.log, so it can be properly (re)opened and
13048 # appended to by config.status.  When coming back to configure, we
13049 # need to make the FD available again.
13050 if test "$no_create" != yes; then
13051   ac_cs_success=:
13052   exec 5>/dev/null
13053   $SHELL $CONFIG_STATUS || ac_cs_success=false
13054   exec 5>>config.log
13055   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
13056   # would make configure fail if this is the last instruction.
13057   $ac_cs_success || { (exit 1); exit 1; }
13058 fi
13059 ${MAKE:-make} preinstall