]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 5.9 - patch 20120331
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.40 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20120310.
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 datadir='${prefix}/share'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${prefix}/info'
146 mandir='${prefix}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -disable-* | --disable-*)
198     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
199     # Reject names that are not valid shell variable names.
200     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
201       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
202    { (exit 1); exit 1; }; }
203     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
204     eval "enable_$ac_feature=no" ;;
205
206   -enable-* | --enable-*)
207     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
208     # Reject names that are not valid shell variable names.
209     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
210       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
211    { (exit 1); exit 1; }; }
212     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
213     case $ac_option in
214       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
215       *) ac_optarg=yes ;;
216     esac
217     eval "enable_$ac_feature='$ac_optarg'" ;;
218
219   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
220   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
221   | --exec | --exe | --ex)
222     ac_prev=exec_prefix ;;
223   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
224   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
225   | --exec=* | --exe=* | --ex=*)
226     exec_prefix=$ac_optarg ;;
227
228   -gas | --gas | --ga | --g)
229     # Obsolete; use --with-gas.
230     with_gas=yes ;;
231
232   -help | --help | --hel | --he | -h)
233     ac_init_help=long ;;
234   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
235     ac_init_help=recursive ;;
236   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
237     ac_init_help=short ;;
238
239   -host | --host | --hos | --ho)
240     ac_prev=host_alias ;;
241   -host=* | --host=* | --hos=* | --ho=*)
242     host_alias=$ac_optarg ;;
243
244   -includedir | --includedir | --includedi | --included | --include \
245   | --includ | --inclu | --incl | --inc)
246     ac_prev=includedir ;;
247   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
248   | --includ=* | --inclu=* | --incl=* | --inc=*)
249     includedir=$ac_optarg ;;
250
251   -infodir | --infodir | --infodi | --infod | --info | --inf)
252     ac_prev=infodir ;;
253   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
254     infodir=$ac_optarg ;;
255
256   -libdir | --libdir | --libdi | --libd)
257     ac_prev=libdir ;;
258   -libdir=* | --libdir=* | --libdi=* | --libd=*)
259     libdir=$ac_optarg ;;
260
261   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
262   | --libexe | --libex | --libe)
263     ac_prev=libexecdir ;;
264   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
265   | --libexe=* | --libex=* | --libe=*)
266     libexecdir=$ac_optarg ;;
267
268   -localstatedir | --localstatedir | --localstatedi | --localstated \
269   | --localstate | --localstat | --localsta | --localst \
270   | --locals | --local | --loca | --loc | --lo)
271     ac_prev=localstatedir ;;
272   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
273   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
274   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
275     localstatedir=$ac_optarg ;;
276
277   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
278     ac_prev=mandir ;;
279   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
280     mandir=$ac_optarg ;;
281
282   -nfp | --nfp | --nf)
283     # Obsolete; use --without-fp.
284     with_fp=no ;;
285
286   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
287   | --no-cr | --no-c)
288     no_create=yes ;;
289
290   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
291   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
292     no_recursion=yes ;;
293
294   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
295   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
296   | --oldin | --oldi | --old | --ol | --o)
297     ac_prev=oldincludedir ;;
298   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
299   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
300   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
301     oldincludedir=$ac_optarg ;;
302
303   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
304     ac_prev=prefix ;;
305   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
306     prefix=$ac_optarg ;;
307
308   -program-prefix | --program-prefix | --program-prefi | --program-pref \
309   | --program-pre | --program-pr | --program-p)
310     ac_prev=program_prefix ;;
311   -program-prefix=* | --program-prefix=* | --program-prefi=* \
312   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
313     program_prefix=$ac_optarg ;;
314
315   -program-suffix | --program-suffix | --program-suffi | --program-suff \
316   | --program-suf | --program-su | --program-s)
317     ac_prev=program_suffix ;;
318   -program-suffix=* | --program-suffix=* | --program-suffi=* \
319   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
320     program_suffix=$ac_optarg ;;
321
322   -program-transform-name | --program-transform-name \
323   | --program-transform-nam | --program-transform-na \
324   | --program-transform-n | --program-transform- \
325   | --program-transform | --program-transfor \
326   | --program-transfo | --program-transf \
327   | --program-trans | --program-tran \
328   | --progr-tra | --program-tr | --program-t)
329     ac_prev=program_transform_name ;;
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     program_transform_name=$ac_optarg ;;
338
339   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
340   | -silent | --silent | --silen | --sile | --sil)
341     silent=yes ;;
342
343   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
344     ac_prev=sbindir ;;
345   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
346   | --sbi=* | --sb=*)
347     sbindir=$ac_optarg ;;
348
349   -sharedstatedir | --sharedstatedir | --sharedstatedi \
350   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
351   | --sharedst | --shareds | --shared | --share | --shar \
352   | --sha | --sh)
353     ac_prev=sharedstatedir ;;
354   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
355   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
356   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
357   | --sha=* | --sh=*)
358     sharedstatedir=$ac_optarg ;;
359
360   -site | --site | --sit)
361     ac_prev=site ;;
362   -site=* | --site=* | --sit=*)
363     site=$ac_optarg ;;
364
365   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
366     ac_prev=srcdir ;;
367   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
368     srcdir=$ac_optarg ;;
369
370   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
371   | --syscon | --sysco | --sysc | --sys | --sy)
372     ac_prev=sysconfdir ;;
373   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
374   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
375     sysconfdir=$ac_optarg ;;
376
377   -target | --target | --targe | --targ | --tar | --ta | --t)
378     ac_prev=target_alias ;;
379   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
380     target_alias=$ac_optarg ;;
381
382   -v | -verbose | --verbose | --verbos | --verbo | --verb)
383     verbose=yes ;;
384
385   -version | --version | --versio | --versi | --vers | -V)
386     ac_init_version=: ;;
387
388   -with-* | --with-*)
389     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
390     # Reject names that are not valid shell variable names.
391     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
392       { echo "$as_me: error: invalid package name: $ac_package" >&2
393    { (exit 1); exit 1; }; }
394     ac_package=`echo $ac_package| sed 's/-/_/g'`
395     case $ac_option in
396       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
397       *) ac_optarg=yes ;;
398     esac
399     eval "with_$ac_package='$ac_optarg'" ;;
400
401   -without-* | --without-*)
402     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
403     # Reject names that are not valid shell variable names.
404     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
405       { echo "$as_me: error: invalid package name: $ac_package" >&2
406    { (exit 1); exit 1; }; }
407     ac_package=`echo $ac_package | sed 's/-/_/g'`
408     eval "with_$ac_package=no" ;;
409
410   --x)
411     # Obsolete; use --with-x.
412     with_x=yes ;;
413
414   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
415   | --x-incl | --x-inc | --x-in | --x-i)
416     ac_prev=x_includes ;;
417   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
418   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
419     x_includes=$ac_optarg ;;
420
421   -x-libraries | --x-libraries | --x-librarie | --x-librari \
422   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
423     ac_prev=x_libraries ;;
424   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
425   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
426     x_libraries=$ac_optarg ;;
427
428   -*) { echo "$as_me: error: unrecognized option: $ac_option
429 Try \`$0 --help' for more information." >&2
430    { (exit 1); exit 1; }; }
431     ;;
432
433   *=*)
434     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
435     # Reject names that are not valid shell variable names.
436     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
437       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
438    { (exit 1); exit 1; }; }
439     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
440     eval "$ac_envvar='$ac_optarg'"
441     export $ac_envvar ;;
442
443   *)
444     # FIXME: should be removed in autoconf 3.0.
445     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
446     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
447       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
448     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
449     ;;
450
451   esac
452 done
453
454 if test -n "$ac_prev"; then
455   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
456   { echo "$as_me: error: missing argument to $ac_option" >&2
457    { (exit 1); exit 1; }; }
458 fi
459
460 # Be sure to have absolute paths.
461 for ac_var in exec_prefix prefix
462 do
463   eval ac_val=$`echo $ac_var`
464   case $ac_val in
465     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
466     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
467    { (exit 1); exit 1; }; };;
468   esac
469 done
470
471 # Be sure to have absolute paths.
472 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
473               localstatedir libdir includedir oldincludedir infodir mandir
474 do
475   eval ac_val=$`echo $ac_var`
476   case $ac_val in
477     [\\/$]* | ?:[\\/]* ) ;;
478     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
479    { (exit 1); exit 1; }; };;
480   esac
481 done
482
483 # There might be people who depend on the old broken behavior: `$host'
484 # used to hold the argument of --host etc.
485 build=$build_alias
486 host=$host_alias
487 target=$target_alias
488
489 # FIXME: should be removed in autoconf 3.0.
490 if test "x$host_alias" != x; then
491   if test "x$build_alias" = x; then
492     cross_compiling=maybe
493     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
494     If a cross compiler is detected then cross compile mode will be used." >&2
495   elif test "x$build_alias" != "x$host_alias"; then
496     cross_compiling=yes
497   fi
498 fi
499
500 ac_tool_prefix=
501 test -n "$host_alias" && ac_tool_prefix=$host_alias-
502
503 test "$silent" = yes && exec 6>/dev/null
504
505 # Find the source files, if location was not specified.
506 if test -z "$srcdir"; then
507   ac_srcdir_defaulted=yes
508   # Try the directory containing this script, then its parent.
509   ac_prog=$0
510   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
511   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
512   srcdir=$ac_confdir
513   if test ! -r $srcdir/$ac_unique_file; then
514     srcdir=..
515   fi
516 else
517   ac_srcdir_defaulted=no
518 fi
519 if test ! -r $srcdir/$ac_unique_file; then
520   if test "$ac_srcdir_defaulted" = yes; then
521     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
522    { (exit 1); exit 1; }; }
523   else
524     { echo "$as_me: error: cannot find sources in $srcdir" >&2
525    { (exit 1); exit 1; }; }
526   fi
527 fi
528 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
529 ac_env_build_alias_set=${build_alias+set}
530 ac_env_build_alias_value=$build_alias
531 ac_cv_env_build_alias_set=${build_alias+set}
532 ac_cv_env_build_alias_value=$build_alias
533 ac_env_host_alias_set=${host_alias+set}
534 ac_env_host_alias_value=$host_alias
535 ac_cv_env_host_alias_set=${host_alias+set}
536 ac_cv_env_host_alias_value=$host_alias
537 ac_env_target_alias_set=${target_alias+set}
538 ac_env_target_alias_value=$target_alias
539 ac_cv_env_target_alias_set=${target_alias+set}
540 ac_cv_env_target_alias_value=$target_alias
541 ac_env_CC_set=${CC+set}
542 ac_env_CC_value=$CC
543 ac_cv_env_CC_set=${CC+set}
544 ac_cv_env_CC_value=$CC
545 ac_env_CFLAGS_set=${CFLAGS+set}
546 ac_env_CFLAGS_value=$CFLAGS
547 ac_cv_env_CFLAGS_set=${CFLAGS+set}
548 ac_cv_env_CFLAGS_value=$CFLAGS
549 ac_env_LDFLAGS_set=${LDFLAGS+set}
550 ac_env_LDFLAGS_value=$LDFLAGS
551 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
552 ac_cv_env_LDFLAGS_value=$LDFLAGS
553 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
554 ac_env_CPPFLAGS_value=$CPPFLAGS
555 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
556 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
557 ac_env_CPP_set=${CPP+set}
558 ac_env_CPP_value=$CPP
559 ac_cv_env_CPP_set=${CPP+set}
560 ac_cv_env_CPP_value=$CPP
561
562 #
563 # Report the --help message.
564 #
565 if test "$ac_init_help" = "long"; then
566   # Omit some internal or obsolete options to make the list less imposing.
567   # This message is too long to be a string in the A/UX 3.1 sh.
568   cat <<EOF
569 \`configure' configures this package to adapt to many kinds of systems.
570
571 Usage: $0 [OPTION]... [VAR=VALUE]...
572
573 To assign environment variables (e.g., CC, CFLAGS...), specify them as
574 VAR=VALUE.  See below for descriptions of some of the useful variables.
575
576 Defaults for the options are specified in brackets.
577
578 Configuration:
579   -h, --help              display this help and exit
580       --help=short        display options specific to this package
581       --help=recursive    display the short help of all the included packages
582   -V, --version           display version information and exit
583   -q, --quiet, --silent   do not print \`checking...' messages
584       --cache-file=FILE   cache test results in FILE [disabled]
585   -C, --config-cache      alias for \`--cache-file=config.cache'
586   -n, --no-create         do not create output files
587       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
588
589 EOF
590
591   cat <<EOF
592 Installation directories:
593   --prefix=PREFIX         install architecture-independent files in PREFIX
594                           [$ac_default_prefix]
595   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
596                           [PREFIX]
597
598 By default, \`make install' will install all the files in
599 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
600 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
601 for instance \`--prefix=\$HOME'.
602
603 For better control, use the options below.
604
605 Fine tuning of the installation directories:
606   --bindir=DIR            user executables [EPREFIX/bin]
607   --sbindir=DIR           system admin executables [EPREFIX/sbin]
608   --libexecdir=DIR        program executables [EPREFIX/libexec]
609   --datadir=DIR           read-only architecture-independent data [PREFIX/share]
610   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
611   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
612   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
613   --libdir=DIR            object code libraries [EPREFIX/lib]
614   --includedir=DIR        C header files [PREFIX/include]
615   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
616   --infodir=DIR           info documentation [PREFIX/info]
617   --mandir=DIR            man documentation [PREFIX/man]
618 EOF
619
620   cat <<\EOF
621
622 Program names:
623   --program-prefix=PREFIX            prepend PREFIX to installed program names
624   --program-suffix=SUFFIX            append SUFFIX to installed program names
625   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
626
627 System types:
628   --build=BUILD           configure for building on BUILD [guessed]
629   --host=HOST       build programs to run on HOST [BUILD]
630   --target=TARGET   configure for building compilers for TARGET [HOST]
631 EOF
632 fi
633
634 if test -n "$ac_init_help"; then
635
636   cat <<\EOF
637
638 Optional Packages:
639   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
640   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
641
642 Optional Features:
643   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
644   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
645
646   --with-system-type=XXX  test: override derived host system-type
647   --with-pkg-config{=path} enable/disable use of pkg-config
648   --with-pkg-config-libdir=XXX use given directory for installing pc-files
649   --enable-pc-files       generate and install .pc files for pkg-config
650   --without-tests         suppress build with test-programs
651   --enable-mixed-case     tic should assume mixed-case filenames
652   --with-install-prefix   prefixes actual install-location ($DESTDIR)
653 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
654   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
655   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
656   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
657   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
658   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
659   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
660 Options to Specify the Libraries Built/Used:
661   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
662   --enable-widec          compile with wide-char/UTF-8 code
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-lib-prefix       override library-prefix
665   --with-shlib-version=X  Specify rel or abi version for shared libs
666   --enable-rpath-link     link sample programs with rpath option
667 Fine-Tuning Your Configuration:
668   --enable-broken_linker  compile with broken-linker support code
669   --disable-largefile     omit support for large files
670   --with-rcs-ids          compile-in RCS identifiers
671 Extensions:
672   --disable-ext-funcs     disable function-extensions
673   --enable-const          compile with extra/non-standard const
674 Development Code:
675   --without-develop       disable development options
676 Experimental Code:
677   --with-pthread          use POSIX thread library
678   --enable-weak-symbols   enable weak-symbols for pthreads
679   --enable-reentrant      compile with experimental reentrant code
680   --with-wrap-prefix=XXX  override prefix used for public variables
681 Testing/development Options:
682   --disable-echo          display "compiling" commands
683   --enable-warnings       build: turn on GCC compiler warnings
684   --enable-assertions     test: turn on generation of assertion code
685   --enable-expanded       test: generate functions for certain macros
686   --disable-macros        test: use functions rather than macros
687   --with-trace            test: add trace() function to all models of ncurses
688 Ada95 Binding Options:
689   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
690   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
691   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
692   --with-ada-sharedlib=XX build Ada95 shared-library
693
694 Some influential environment variables:
695   CC          C compiler command
696   CFLAGS      C compiler flags
697   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
698               nonstandard directory <lib dir>
699   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
700               headers in a nonstandard directory <include dir>
701   CPP         C preprocessor
702
703 Use these variables to override the choices made by `configure' or to help
704 it to find libraries and programs with nonstandard names/locations.
705
706 EOF
707 fi
708
709 if test "$ac_init_help" = "recursive"; then
710   # If there are subdirs, report their specific --help.
711   ac_popdir=`pwd`
712   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
713     cd $ac_subdir
714     # A "../" for each directory in /$ac_subdir.
715     ac_dots=`echo $ac_subdir |
716              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
717
718     case $srcdir in
719     .) # No --srcdir option.  We are building in place.
720       ac_sub_srcdir=$srcdir ;;
721     [\\/]* | ?:[\\/]* ) # Absolute path.
722       ac_sub_srcdir=$srcdir/$ac_subdir ;;
723     *) # Relative path.
724       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
725     esac
726
727     # Check for guested configure; otherwise get Cygnus style configure.
728     if test -f $ac_sub_srcdir/configure.gnu; then
729       echo
730       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
731     elif test -f $ac_sub_srcdir/configure; then
732       echo
733       $SHELL $ac_sub_srcdir/configure  --help=recursive
734     elif test -f $ac_sub_srcdir/configure.ac ||
735            test -f $ac_sub_srcdir/configure.in; then
736       echo
737       $ac_configure --help
738     else
739       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
740     fi
741     cd $ac_popdir
742   done
743 fi
744
745 test -n "$ac_init_help" && exit 0
746 if $ac_init_version; then
747   cat <<\EOF
748
749 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
750 Free Software Foundation, Inc.
751 This configure script is free software; the Free Software Foundation
752 gives unlimited permission to copy, distribute and modify it.
753 EOF
754   exit 0
755 fi
756 exec 5>config.log
757 cat >&5 <<EOF
758 This file contains any messages produced by compilers while
759 running configure, to aid debugging if configure makes a mistake.
760
761 It was created by $as_me, which was
762 generated by GNU Autoconf 2.52.20120310.  Invocation command line was
763
764   $ $0 $@
765
766 EOF
767 {
768 cat <<_ASUNAME
769 ## ---------- ##
770 ## Platform.  ##
771 ## ---------- ##
772
773 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
774 uname -m = `(uname -m) 2>/dev/null || echo unknown`
775 uname -r = `(uname -r) 2>/dev/null || echo unknown`
776 uname -s = `(uname -s) 2>/dev/null || echo unknown`
777 uname -v = `(uname -v) 2>/dev/null || echo unknown`
778
779 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
780 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
781
782 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
783 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
784 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
785 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
786 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
787 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
788 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
789
790 PATH = $PATH
791
792 _ASUNAME
793 } >&5
794
795 cat >&5 <<EOF
796 ## ------------ ##
797 ## Core tests.  ##
798 ## ------------ ##
799
800 EOF
801
802 # Keep a trace of the command line.
803 # Strip out --no-create and --no-recursion so they do not pile up.
804 # Also quote any args containing shell meta-characters.
805 ac_configure_args=
806 ac_sep=
807 for ac_arg
808 do
809   case $ac_arg in
810   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
811   | --no-cr | --no-c) ;;
812   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
813   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
814   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
815     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
816     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
817     ac_sep=" " ;;
818   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
819      ac_sep=" " ;;
820   esac
821   # Get rid of the leading space.
822 done
823
824 # When interrupted or exit'd, cleanup temporary files, and complete
825 # config.log.  We remove comments because anyway the quotes in there
826 # would cause problems or look ugly.
827 trap 'exit_status=$?
828   # Save into config.log some information that might help in debugging.
829   echo >&5
830   echo "## ----------------- ##" >&5
831   echo "## Cache variables.  ##" >&5
832   echo "## ----------------- ##" >&5
833   echo >&5
834   # The following way of writing the cache mishandles newlines in values,
835 {
836   (set) 2>&1 |
837     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
838     *ac_space=\ *)
839       sed -n \
840         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
841           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
842       ;;
843     *)
844       sed -n \
845         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
846       ;;
847     esac;
848 } >&5
849   sed "/^$/d" confdefs.h >conftest.log
850   if test -s conftest.log; then
851     echo >&5
852     echo "## ------------ ##" >&5
853     echo "## confdefs.h.  ##" >&5
854     echo "## ------------ ##" >&5
855     echo >&5
856     cat conftest.log >&5
857   fi
858   (echo; echo) >&5
859   test "$ac_signal" != 0 &&
860     echo "$as_me: caught signal $ac_signal" >&5
861   echo "$as_me: exit $exit_status" >&5
862   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
863     exit $exit_status
864      ' 0
865 for ac_signal in 1 2 13 15; do
866   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
867 done
868 ac_signal=0
869
870 # confdefs.h avoids OS command line length limits that DEFS can exceed.
871 rm -rf conftest* confdefs.h
872 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
873 echo >confdefs.h
874
875 # Let the site file select an alternate cache file if it wants to.
876 # Prefer explicitly selected file to automatically selected ones.
877 if test -z "$CONFIG_SITE"; then
878   if test "x$prefix" != xNONE; then
879     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
880   else
881     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
882   fi
883 fi
884 for ac_site_file in $CONFIG_SITE; do
885   if test -r "$ac_site_file"; then
886     { echo "$as_me:886: loading site script $ac_site_file" >&5
887 echo "$as_me: loading site script $ac_site_file" >&6;}
888     cat "$ac_site_file" >&5
889     . "$ac_site_file"
890   fi
891 done
892
893 if test -r "$cache_file"; then
894   # Some versions of bash will fail to source /dev/null (special
895   # files actually), so we avoid doing that.
896   if test -f "$cache_file"; then
897     { echo "$as_me:897: loading cache $cache_file" >&5
898 echo "$as_me: loading cache $cache_file" >&6;}
899     case $cache_file in
900       [\\/]* | ?:[\\/]* ) . $cache_file;;
901       *)                      . ./$cache_file;;
902     esac
903   fi
904 else
905   { echo "$as_me:905: creating cache $cache_file" >&5
906 echo "$as_me: creating cache $cache_file" >&6;}
907   >$cache_file
908 fi
909
910 # Check that the precious variables saved in the cache have kept the same
911 # value.
912 ac_cache_corrupted=false
913 for ac_var in `(set) 2>&1 |
914                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
915   eval ac_old_set=\$ac_cv_env_${ac_var}_set
916   eval ac_new_set=\$ac_env_${ac_var}_set
917   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
918   eval ac_new_val="\$ac_env_${ac_var}_value"
919   case $ac_old_set,$ac_new_set in
920     set,)
921       { echo "$as_me:921: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
922 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
923       ac_cache_corrupted=: ;;
924     ,set)
925       { echo "$as_me:925: error: \`$ac_var' was not set in the previous run" >&5
926 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
927       ac_cache_corrupted=: ;;
928     ,);;
929     *)
930       if test "x$ac_old_val" != "x$ac_new_val"; then
931         { echo "$as_me:931: error: \`$ac_var' has changed since the previous run:" >&5
932 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
933         { echo "$as_me:933:   former value:  $ac_old_val" >&5
934 echo "$as_me:   former value:  $ac_old_val" >&2;}
935         { echo "$as_me:935:   current value: $ac_new_val" >&5
936 echo "$as_me:   current value: $ac_new_val" >&2;}
937         ac_cache_corrupted=:
938       fi;;
939   esac
940   # Pass precious variables to config.status.  It doesn't matter if
941   # we pass some twice (in addition to the command line arguments).
942   if test "$ac_new_set" = set; then
943     case $ac_new_val in
944     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
945       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
946       ac_configure_args="$ac_configure_args '$ac_arg'"
947       ;;
948     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
949        ;;
950     esac
951   fi
952 done
953 if $ac_cache_corrupted; then
954   { echo "$as_me:954: error: changes in the environment can compromise the build" >&5
955 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
956   { { echo "$as_me:956: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
957 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
958    { (exit 1); exit 1; }; }
959 fi
960
961 ac_ext=c
962 ac_cpp='$CPP $CPPFLAGS'
963 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
964 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
965 ac_compiler_gnu=$ac_cv_c_compiler_gnu
966 ac_main_return=return
967
968 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
969   *c*,-n*) ECHO_N= ECHO_C='
970 ' ECHO_T='      ' ;;
971   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
972   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
973 esac
974 echo "#! $SHELL" >conftest.sh
975 echo  "exit 0"   >>conftest.sh
976 chmod +x conftest.sh
977 if { (echo "$as_me:977: PATH=\".;.\"; conftest.sh") >&5
978   (PATH=".;."; conftest.sh) 2>&5
979   ac_status=$?
980   echo "$as_me:980: \$? = $ac_status" >&5
981   (exit $ac_status); }; then
982   ac_path_separator=';'
983 else
984   ac_path_separator=:
985 fi
986 PATH_SEPARATOR="$ac_path_separator"
987 rm -f conftest.sh
988
989 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
990
991 top_builddir=`pwd`
992
993 ac_aux_dir=
994 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
995   if test -f $ac_dir/install-sh; then
996     ac_aux_dir=$ac_dir
997     ac_install_sh="$ac_aux_dir/install-sh -c"
998     break
999   elif test -f $ac_dir/install.sh; then
1000     ac_aux_dir=$ac_dir
1001     ac_install_sh="$ac_aux_dir/install.sh -c"
1002     break
1003   elif test -f $ac_dir/shtool; then
1004     ac_aux_dir=$ac_dir
1005     ac_install_sh="$ac_aux_dir/shtool install -c"
1006     break
1007   fi
1008 done
1009 if test -z "$ac_aux_dir"; then
1010   { { echo "$as_me:1010: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1011 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1012    { (exit 1); exit 1; }; }
1013 fi
1014 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1015 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1016 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1017
1018 # Make sure we can run config.sub.
1019 $ac_config_sub sun4 >/dev/null 2>&1 ||
1020   { { echo "$as_me:1020: error: cannot run $ac_config_sub" >&5
1021 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1022    { (exit 1); exit 1; }; }
1023
1024 echo "$as_me:1024: checking build system type" >&5
1025 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1026 if test "${ac_cv_build+set}" = set; then
1027   echo $ECHO_N "(cached) $ECHO_C" >&6
1028 else
1029   ac_cv_build_alias=$build_alias
1030 test -z "$ac_cv_build_alias" &&
1031   ac_cv_build_alias=`$ac_config_guess`
1032 test -z "$ac_cv_build_alias" &&
1033   { { echo "$as_me:1033: error: cannot guess build type; you must specify one" >&5
1034 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1035    { (exit 1); exit 1; }; }
1036 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1037   { { echo "$as_me:1037: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1038 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1039    { (exit 1); exit 1; }; }
1040
1041 fi
1042 echo "$as_me:1042: result: $ac_cv_build" >&5
1043 echo "${ECHO_T}$ac_cv_build" >&6
1044 build=$ac_cv_build
1045 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1046 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1047 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1048
1049 echo "$as_me:1049: checking host system type" >&5
1050 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1051 if test "${ac_cv_host+set}" = set; then
1052   echo $ECHO_N "(cached) $ECHO_C" >&6
1053 else
1054   ac_cv_host_alias=$host_alias
1055 test -z "$ac_cv_host_alias" &&
1056   ac_cv_host_alias=$ac_cv_build_alias
1057 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1058   { { echo "$as_me:1058: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1059 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1060    { (exit 1); exit 1; }; }
1061
1062 fi
1063 echo "$as_me:1063: result: $ac_cv_host" >&5
1064 echo "${ECHO_T}$ac_cv_host" >&6
1065 host=$ac_cv_host
1066 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1067 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1068 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1069
1070 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1071         echo "$as_me:1071: checking target system type" >&5
1072 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1073 if test "${ac_cv_target+set}" = set; then
1074   echo $ECHO_N "(cached) $ECHO_C" >&6
1075 else
1076   ac_cv_target_alias=$target_alias
1077 test "x$ac_cv_target_alias" = "x" &&
1078   ac_cv_target_alias=$ac_cv_host_alias
1079 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1080   { { echo "$as_me:1080: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1081 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1082    { (exit 1); exit 1; }; }
1083
1084 fi
1085 echo "$as_me:1085: result: $ac_cv_target" >&5
1086 echo "${ECHO_T}$ac_cv_target" >&6
1087 target=$ac_cv_target
1088 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1089 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1090 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1091
1092 # The aliases save the names the user supplied, while $host etc.
1093 # will get canonicalized.
1094 test -n "$target_alias" &&
1095   test "$program_prefix$program_suffix$program_transform_name" = \
1096     NONENONEs,x,x, &&
1097   program_prefix=${target_alias}-
1098         system_name="$host_os"
1099 else
1100         system_name="`(uname -s -r) 2>/dev/null`"
1101         if test -z "$system_name" ; then
1102                 system_name="`(hostname) 2>/dev/null`"
1103         fi
1104 fi
1105 test -n "$system_name" && cat >>confdefs.h <<EOF
1106 #define SYSTEM_NAME "$system_name"
1107 EOF
1108
1109 if test "${cf_cv_system_name+set}" = set; then
1110   echo $ECHO_N "(cached) $ECHO_C" >&6
1111 else
1112   cf_cv_system_name="$system_name"
1113 fi
1114
1115 test -z "$system_name" && system_name="$cf_cv_system_name"
1116 test -n "$cf_cv_system_name" && echo "$as_me:1116: result: Configuring for $cf_cv_system_name" >&5
1117 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1118
1119 if test ".$system_name" != ".$cf_cv_system_name" ; then
1120         echo "$as_me:1120: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1121 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1122         { { echo "$as_me:1122: error: \"Please remove config.cache and try again.\"" >&5
1123 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1124    { (exit 1); exit 1; }; }
1125 fi
1126
1127 # Check whether --with-system-type or --without-system-type was given.
1128 if test "${with_system_type+set}" = set; then
1129   withval="$with_system_type"
1130   { echo "$as_me:1130: WARNING: overriding system type to $withval" >&5
1131 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1132  cf_cv_system_name=$withval
1133 fi;
1134
1135 ###     Save the given $CFLAGS to allow user-override.
1136 cf_user_CFLAGS="$CFLAGS"
1137
1138 ###     Default install-location
1139
1140 echo "$as_me:1140: checking for prefix" >&5
1141 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1142 if test "x$prefix" = "xNONE" ; then
1143         case "$cf_cv_system_name" in
1144                 # non-vendor systems don't have a conflict
1145         openbsd*|freebsd*|mirbsd*|linux*|cygwin*|k*bsd*-gnu)
1146                 prefix=/usr
1147                 ;;
1148         *)      prefix=$ac_default_prefix
1149                 ;;
1150         esac
1151 fi
1152 echo "$as_me:1152: result: $prefix" >&5
1153 echo "${ECHO_T}$prefix" >&6
1154
1155 if test "x$prefix" = "xNONE" ; then
1156 echo "$as_me:1156: checking for default include-directory" >&5
1157 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1158 test -n "$verbose" && echo 1>&6
1159 for cf_symbol in \
1160         $includedir \
1161         $includedir/ncurses \
1162         $prefix/include \
1163         $prefix/include/ncurses \
1164         /usr/local/include \
1165         /usr/local/include/ncurses \
1166         /usr/include \
1167         /usr/include/ncurses
1168 do
1169         cf_dir=`eval echo $cf_symbol`
1170         if test -f $cf_dir/curses.h ; then
1171         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1172                 includedir="$cf_symbol"
1173                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1174                 break
1175         fi
1176         fi
1177         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1178 done
1179 echo "$as_me:1179: result: $includedir" >&5
1180 echo "${ECHO_T}$includedir" >&6
1181 fi
1182
1183 ###     Checks for programs.
1184 ac_ext=c
1185 ac_cpp='$CPP $CPPFLAGS'
1186 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1187 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1188 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1189 ac_main_return=return
1190 if test -n "$ac_tool_prefix"; then
1191   for ac_prog in gnatgcc gcc cc
1192   do
1193     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1194 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1195 echo "$as_me:1195: checking for $ac_word" >&5
1196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1197 if test "${ac_cv_prog_CC+set}" = set; then
1198   echo $ECHO_N "(cached) $ECHO_C" >&6
1199 else
1200   if test -n "$CC"; then
1201   ac_cv_prog_CC="$CC" # Let the user override the test.
1202 else
1203   ac_save_IFS=$IFS; IFS=$ac_path_separator
1204 ac_dummy="$PATH"
1205 for ac_dir in $ac_dummy; do
1206   IFS=$ac_save_IFS
1207   test -z "$ac_dir" && ac_dir=.
1208   $as_executable_p "$ac_dir/$ac_word" || continue
1209 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1210 echo "$as_me:1210: found $ac_dir/$ac_word" >&5
1211 break
1212 done
1213
1214 fi
1215 fi
1216 CC=$ac_cv_prog_CC
1217 if test -n "$CC"; then
1218   echo "$as_me:1218: result: $CC" >&5
1219 echo "${ECHO_T}$CC" >&6
1220 else
1221   echo "$as_me:1221: result: no" >&5
1222 echo "${ECHO_T}no" >&6
1223 fi
1224
1225     test -n "$CC" && break
1226   done
1227 fi
1228 if test -z "$CC"; then
1229   ac_ct_CC=$CC
1230   for ac_prog in gnatgcc gcc cc
1231 do
1232   # Extract the first word of "$ac_prog", so it can be a program name with args.
1233 set dummy $ac_prog; ac_word=$2
1234 echo "$as_me:1234: checking for $ac_word" >&5
1235 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1236 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1237   echo $ECHO_N "(cached) $ECHO_C" >&6
1238 else
1239   if test -n "$ac_ct_CC"; then
1240   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1241 else
1242   ac_save_IFS=$IFS; IFS=$ac_path_separator
1243 ac_dummy="$PATH"
1244 for ac_dir in $ac_dummy; do
1245   IFS=$ac_save_IFS
1246   test -z "$ac_dir" && ac_dir=.
1247   $as_executable_p "$ac_dir/$ac_word" || continue
1248 ac_cv_prog_ac_ct_CC="$ac_prog"
1249 echo "$as_me:1249: found $ac_dir/$ac_word" >&5
1250 break
1251 done
1252
1253 fi
1254 fi
1255 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1256 if test -n "$ac_ct_CC"; then
1257   echo "$as_me:1257: result: $ac_ct_CC" >&5
1258 echo "${ECHO_T}$ac_ct_CC" >&6
1259 else
1260   echo "$as_me:1260: result: no" >&5
1261 echo "${ECHO_T}no" >&6
1262 fi
1263
1264   test -n "$ac_ct_CC" && break
1265 done
1266
1267   CC=$ac_ct_CC
1268 fi
1269
1270 test -z "$CC" && { { echo "$as_me:1270: error: no acceptable cc found in \$PATH" >&5
1271 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1272    { (exit 1); exit 1; }; }
1273
1274 # Provide some information about the compiler.
1275 echo "$as_me:1275:" \
1276      "checking for C compiler version" >&5
1277 ac_compiler=`set X $ac_compile; echo $2`
1278 { (eval echo "$as_me:1278: \"$ac_compiler --version </dev/null >&5\"") >&5
1279   (eval $ac_compiler --version </dev/null >&5) 2>&5
1280   ac_status=$?
1281   echo "$as_me:1281: \$? = $ac_status" >&5
1282   (exit $ac_status); }
1283 { (eval echo "$as_me:1283: \"$ac_compiler -v </dev/null >&5\"") >&5
1284   (eval $ac_compiler -v </dev/null >&5) 2>&5
1285   ac_status=$?
1286   echo "$as_me:1286: \$? = $ac_status" >&5
1287   (exit $ac_status); }
1288 { (eval echo "$as_me:1288: \"$ac_compiler -V </dev/null >&5\"") >&5
1289   (eval $ac_compiler -V </dev/null >&5) 2>&5
1290   ac_status=$?
1291   echo "$as_me:1291: \$? = $ac_status" >&5
1292   (exit $ac_status); }
1293
1294 cat >conftest.$ac_ext <<_ACEOF
1295 #line 1295 "configure"
1296 #include "confdefs.h"
1297
1298 int
1299 main ()
1300 {
1301
1302   ;
1303   return 0;
1304 }
1305 _ACEOF
1306 ac_clean_files_save=$ac_clean_files
1307 ac_clean_files="$ac_clean_files a.out a.exe"
1308 # Try to create an executable without -o first, disregard a.out.
1309 # It will help us diagnose broken compilers, and finding out an intuition
1310 # of exeext.
1311 echo "$as_me:1311: checking for C compiler default output" >&5
1312 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1313 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1314 if { (eval echo "$as_me:1314: \"$ac_link_default\"") >&5
1315   (eval $ac_link_default) 2>&5
1316   ac_status=$?
1317   echo "$as_me:1317: \$? = $ac_status" >&5
1318   (exit $ac_status); }; then
1319   # Find the output, starting from the most likely.  This scheme is
1320 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1321 # resort.
1322 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1323                 ls a.out conftest 2>/dev/null;
1324                 ls a.* conftest.* 2>/dev/null`; do
1325   case $ac_file in
1326     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1327     a.out ) # We found the default executable, but exeext='' is most
1328             # certainly right.
1329             break;;
1330     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1331           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1332           export ac_cv_exeext
1333           break;;
1334     * ) break;;
1335   esac
1336 done
1337 else
1338   echo "$as_me: failed program was:" >&5
1339 cat conftest.$ac_ext >&5
1340 { { echo "$as_me:1340: error: C compiler cannot create executables" >&5
1341 echo "$as_me: error: C compiler cannot create executables" >&2;}
1342    { (exit 77); exit 77; }; }
1343 fi
1344
1345 ac_exeext=$ac_cv_exeext
1346 echo "$as_me:1346: result: $ac_file" >&5
1347 echo "${ECHO_T}$ac_file" >&6
1348
1349 # Check the compiler produces executables we can run.  If not, either
1350 # the compiler is broken, or we cross compile.
1351 echo "$as_me:1351: checking whether the C compiler works" >&5
1352 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1353 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1354 # If not cross compiling, check that we can run a simple program.
1355 if test "$cross_compiling" != yes; then
1356   if { ac_try='./$ac_file'
1357   { (eval echo "$as_me:1357: \"$ac_try\"") >&5
1358   (eval $ac_try) 2>&5
1359   ac_status=$?
1360   echo "$as_me:1360: \$? = $ac_status" >&5
1361   (exit $ac_status); }; }; then
1362     cross_compiling=no
1363   else
1364     if test "$cross_compiling" = maybe; then
1365         cross_compiling=yes
1366     else
1367         { { echo "$as_me:1367: error: cannot run C compiled programs.
1368 If you meant to cross compile, use \`--host'." >&5
1369 echo "$as_me: error: cannot run C compiled programs.
1370 If you meant to cross compile, use \`--host'." >&2;}
1371    { (exit 1); exit 1; }; }
1372     fi
1373   fi
1374 fi
1375 echo "$as_me:1375: result: yes" >&5
1376 echo "${ECHO_T}yes" >&6
1377
1378 rm -f a.out a.exe conftest$ac_cv_exeext
1379 ac_clean_files=$ac_clean_files_save
1380 # Check the compiler produces executables we can run.  If not, either
1381 # the compiler is broken, or we cross compile.
1382 echo "$as_me:1382: checking whether we are cross compiling" >&5
1383 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1384 echo "$as_me:1384: result: $cross_compiling" >&5
1385 echo "${ECHO_T}$cross_compiling" >&6
1386
1387 echo "$as_me:1387: checking for executable suffix" >&5
1388 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1389 if { (eval echo "$as_me:1389: \"$ac_link\"") >&5
1390   (eval $ac_link) 2>&5
1391   ac_status=$?
1392   echo "$as_me:1392: \$? = $ac_status" >&5
1393   (exit $ac_status); }; then
1394   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1395 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1396 # work properly (i.e., refer to `conftest.exe'), while it won't with
1397 # `rm'.
1398 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1399   case $ac_file in
1400     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1401     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1402           export ac_cv_exeext
1403           break;;
1404     * ) break;;
1405   esac
1406 done
1407 else
1408   { { echo "$as_me:1408: error: cannot compute EXEEXT: cannot compile and link" >&5
1409 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1410    { (exit 1); exit 1; }; }
1411 fi
1412
1413 rm -f conftest$ac_cv_exeext
1414 echo "$as_me:1414: result: $ac_cv_exeext" >&5
1415 echo "${ECHO_T}$ac_cv_exeext" >&6
1416
1417 rm -f conftest.$ac_ext
1418 EXEEXT=$ac_cv_exeext
1419 ac_exeext=$EXEEXT
1420 echo "$as_me:1420: checking for object suffix" >&5
1421 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1422 if test "${ac_cv_objext+set}" = set; then
1423   echo $ECHO_N "(cached) $ECHO_C" >&6
1424 else
1425   cat >conftest.$ac_ext <<_ACEOF
1426 #line 1426 "configure"
1427 #include "confdefs.h"
1428
1429 int
1430 main ()
1431 {
1432
1433   ;
1434   return 0;
1435 }
1436 _ACEOF
1437 rm -f conftest.o conftest.obj
1438 if { (eval echo "$as_me:1438: \"$ac_compile\"") >&5
1439   (eval $ac_compile) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }; then
1443   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1444   case $ac_file in
1445     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1446     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1447        break;;
1448   esac
1449 done
1450 else
1451   echo "$as_me: failed program was:" >&5
1452 cat conftest.$ac_ext >&5
1453 { { echo "$as_me:1453: error: cannot compute OBJEXT: cannot compile" >&5
1454 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1455    { (exit 1); exit 1; }; }
1456 fi
1457
1458 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1459 fi
1460 echo "$as_me:1460: result: $ac_cv_objext" >&5
1461 echo "${ECHO_T}$ac_cv_objext" >&6
1462 OBJEXT=$ac_cv_objext
1463 ac_objext=$OBJEXT
1464 echo "$as_me:1464: checking whether we are using the GNU C compiler" >&5
1465 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1466 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1467   echo $ECHO_N "(cached) $ECHO_C" >&6
1468 else
1469   cat >conftest.$ac_ext <<_ACEOF
1470 #line 1470 "configure"
1471 #include "confdefs.h"
1472
1473 int
1474 main ()
1475 {
1476 #ifndef __GNUC__
1477        choke me
1478 #endif
1479
1480   ;
1481   return 0;
1482 }
1483 _ACEOF
1484 rm -f conftest.$ac_objext
1485 if { (eval echo "$as_me:1485: \"$ac_compile\"") >&5
1486   (eval $ac_compile) 2>&5
1487   ac_status=$?
1488   echo "$as_me:1488: \$? = $ac_status" >&5
1489   (exit $ac_status); } &&
1490          { ac_try='test -s conftest.$ac_objext'
1491   { (eval echo "$as_me:1491: \"$ac_try\"") >&5
1492   (eval $ac_try) 2>&5
1493   ac_status=$?
1494   echo "$as_me:1494: \$? = $ac_status" >&5
1495   (exit $ac_status); }; }; then
1496   ac_compiler_gnu=yes
1497 else
1498   echo "$as_me: failed program was:" >&5
1499 cat conftest.$ac_ext >&5
1500 ac_compiler_gnu=no
1501 fi
1502 rm -f conftest.$ac_objext conftest.$ac_ext
1503 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1504
1505 fi
1506 echo "$as_me:1506: result: $ac_cv_c_compiler_gnu" >&5
1507 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1508 GCC=`test $ac_compiler_gnu = yes && echo yes`
1509 ac_test_CFLAGS=${CFLAGS+set}
1510 ac_save_CFLAGS=$CFLAGS
1511 CFLAGS="-g"
1512 echo "$as_me:1512: checking whether $CC accepts -g" >&5
1513 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1514 if test "${ac_cv_prog_cc_g+set}" = set; then
1515   echo $ECHO_N "(cached) $ECHO_C" >&6
1516 else
1517   cat >conftest.$ac_ext <<_ACEOF
1518 #line 1518 "configure"
1519 #include "confdefs.h"
1520
1521 int
1522 main ()
1523 {
1524
1525   ;
1526   return 0;
1527 }
1528 _ACEOF
1529 rm -f conftest.$ac_objext
1530 if { (eval echo "$as_me:1530: \"$ac_compile\"") >&5
1531   (eval $ac_compile) 2>&5
1532   ac_status=$?
1533   echo "$as_me:1533: \$? = $ac_status" >&5
1534   (exit $ac_status); } &&
1535          { ac_try='test -s conftest.$ac_objext'
1536   { (eval echo "$as_me:1536: \"$ac_try\"") >&5
1537   (eval $ac_try) 2>&5
1538   ac_status=$?
1539   echo "$as_me:1539: \$? = $ac_status" >&5
1540   (exit $ac_status); }; }; then
1541   ac_cv_prog_cc_g=yes
1542 else
1543   echo "$as_me: failed program was:" >&5
1544 cat conftest.$ac_ext >&5
1545 ac_cv_prog_cc_g=no
1546 fi
1547 rm -f conftest.$ac_objext conftest.$ac_ext
1548 fi
1549 echo "$as_me:1549: result: $ac_cv_prog_cc_g" >&5
1550 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1551 if test "$ac_test_CFLAGS" = set; then
1552   CFLAGS=$ac_save_CFLAGS
1553 elif test $ac_cv_prog_cc_g = yes; then
1554   if test "$GCC" = yes; then
1555     CFLAGS="-g -O2"
1556   else
1557     CFLAGS="-g"
1558   fi
1559 else
1560   if test "$GCC" = yes; then
1561     CFLAGS="-O2"
1562   else
1563     CFLAGS=
1564   fi
1565 fi
1566 # Some people use a C++ compiler to compile C.  Since we use `exit',
1567 # in C++ we need to declare it.  In case someone uses the same compiler
1568 # for both compiling C and C++ we need to have the C++ compiler decide
1569 # the declaration of exit, since it's the most demanding environment.
1570 cat >conftest.$ac_ext <<_ACEOF
1571 #ifndef __cplusplus
1572   choke me
1573 #endif
1574 _ACEOF
1575 rm -f conftest.$ac_objext
1576 if { (eval echo "$as_me:1576: \"$ac_compile\"") >&5
1577   (eval $ac_compile) 2>&5
1578   ac_status=$?
1579   echo "$as_me:1579: \$? = $ac_status" >&5
1580   (exit $ac_status); } &&
1581          { ac_try='test -s conftest.$ac_objext'
1582   { (eval echo "$as_me:1582: \"$ac_try\"") >&5
1583   (eval $ac_try) 2>&5
1584   ac_status=$?
1585   echo "$as_me:1585: \$? = $ac_status" >&5
1586   (exit $ac_status); }; }; then
1587   for ac_declaration in \
1588    ''\
1589    '#include <stdlib.h>' \
1590    'extern "C" void std::exit (int) throw (); using std::exit;' \
1591    'extern "C" void std::exit (int); using std::exit;' \
1592    'extern "C" void exit (int) throw ();' \
1593    'extern "C" void exit (int);' \
1594    'void exit (int);'
1595 do
1596   cat >conftest.$ac_ext <<_ACEOF
1597 #line 1597 "configure"
1598 #include "confdefs.h"
1599 #include <stdlib.h>
1600 $ac_declaration
1601 int
1602 main ()
1603 {
1604 exit (42);
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.$ac_objext
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit $ac_status); } &&
1615          { ac_try='test -s conftest.$ac_objext'
1616   { (eval echo "$as_me:1616: \"$ac_try\"") >&5
1617   (eval $ac_try) 2>&5
1618   ac_status=$?
1619   echo "$as_me:1619: \$? = $ac_status" >&5
1620   (exit $ac_status); }; }; then
1621   :
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat conftest.$ac_ext >&5
1625 continue
1626 fi
1627 rm -f conftest.$ac_objext conftest.$ac_ext
1628   cat >conftest.$ac_ext <<_ACEOF
1629 #line 1629 "configure"
1630 #include "confdefs.h"
1631 $ac_declaration
1632 int
1633 main ()
1634 {
1635 exit (42);
1636   ;
1637   return 0;
1638 }
1639 _ACEOF
1640 rm -f conftest.$ac_objext
1641 if { (eval echo "$as_me:1641: \"$ac_compile\"") >&5
1642   (eval $ac_compile) 2>&5
1643   ac_status=$?
1644   echo "$as_me:1644: \$? = $ac_status" >&5
1645   (exit $ac_status); } &&
1646          { ac_try='test -s conftest.$ac_objext'
1647   { (eval echo "$as_me:1647: \"$ac_try\"") >&5
1648   (eval $ac_try) 2>&5
1649   ac_status=$?
1650   echo "$as_me:1650: \$? = $ac_status" >&5
1651   (exit $ac_status); }; }; then
1652   break
1653 else
1654   echo "$as_me: failed program was:" >&5
1655 cat conftest.$ac_ext >&5
1656 fi
1657 rm -f conftest.$ac_objext conftest.$ac_ext
1658 done
1659 rm -rf conftest*
1660 if test -n "$ac_declaration"; then
1661   echo '#ifdef __cplusplus' >>confdefs.h
1662   echo $ac_declaration      >>confdefs.h
1663   echo '#endif'             >>confdefs.h
1664 fi
1665
1666 else
1667   echo "$as_me: failed program was:" >&5
1668 cat conftest.$ac_ext >&5
1669 fi
1670 rm -f conftest.$ac_objext conftest.$ac_ext
1671 ac_ext=c
1672 ac_cpp='$CPP $CPPFLAGS'
1673 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1674 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1675 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1676 ac_main_return=return
1677
1678 GCC_VERSION=none
1679 if test "$GCC" = yes ; then
1680         echo "$as_me:1680: checking version of $CC" >&5
1681 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1682         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1683         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1684         echo "$as_me:1684: result: $GCC_VERSION" >&5
1685 echo "${ECHO_T}$GCC_VERSION" >&6
1686 fi
1687
1688 ac_ext=c
1689 ac_cpp='$CPP $CPPFLAGS'
1690 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1691 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1692 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1693 ac_main_return=return
1694 echo "$as_me:1694: checking how to run the C preprocessor" >&5
1695 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1696 # On Suns, sometimes $CPP names a directory.
1697 if test -n "$CPP" && test -d "$CPP"; then
1698   CPP=
1699 fi
1700 if test -z "$CPP"; then
1701   if test "${ac_cv_prog_CPP+set}" = set; then
1702   echo $ECHO_N "(cached) $ECHO_C" >&6
1703 else
1704       # Double quotes because CPP needs to be expanded
1705     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1706     do
1707       ac_preproc_ok=false
1708 for ac_c_preproc_warn_flag in '' yes
1709 do
1710   # Use a header file that comes with gcc, so configuring glibc
1711   # with a fresh cross-compiler works.
1712   # On the NeXT, cc -E runs the code through the compiler's parser,
1713   # not just through cpp. "Syntax error" is here to catch this case.
1714   cat >conftest.$ac_ext <<_ACEOF
1715 #line 1715 "configure"
1716 #include "confdefs.h"
1717 #include <assert.h>
1718                      Syntax error
1719 _ACEOF
1720 if { (eval echo "$as_me:1720: \"$ac_cpp conftest.$ac_ext\"") >&5
1721   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1722   ac_status=$?
1723   egrep -v '^ *\+' conftest.er1 >conftest.err
1724   rm -f conftest.er1
1725   cat conftest.err >&5
1726   echo "$as_me:1726: \$? = $ac_status" >&5
1727   (exit $ac_status); } >/dev/null; then
1728   if test -s conftest.err; then
1729     ac_cpp_err=$ac_c_preproc_warn_flag
1730   else
1731     ac_cpp_err=
1732   fi
1733 else
1734   ac_cpp_err=yes
1735 fi
1736 if test -z "$ac_cpp_err"; then
1737   :
1738 else
1739   echo "$as_me: failed program was:" >&5
1740   cat conftest.$ac_ext >&5
1741   # Broken: fails on valid input.
1742 continue
1743 fi
1744 rm -f conftest.err conftest.$ac_ext
1745
1746   # OK, works on sane cases.  Now check whether non-existent headers
1747   # can be detected and how.
1748   cat >conftest.$ac_ext <<_ACEOF
1749 #line 1749 "configure"
1750 #include "confdefs.h"
1751 #include <ac_nonexistent.h>
1752 _ACEOF
1753 if { (eval echo "$as_me:1753: \"$ac_cpp conftest.$ac_ext\"") >&5
1754   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1755   ac_status=$?
1756   egrep -v '^ *\+' conftest.er1 >conftest.err
1757   rm -f conftest.er1
1758   cat conftest.err >&5
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit $ac_status); } >/dev/null; then
1761   if test -s conftest.err; then
1762     ac_cpp_err=$ac_c_preproc_warn_flag
1763   else
1764     ac_cpp_err=
1765   fi
1766 else
1767   ac_cpp_err=yes
1768 fi
1769 if test -z "$ac_cpp_err"; then
1770   # Broken: success on invalid input.
1771 continue
1772 else
1773   echo "$as_me: failed program was:" >&5
1774   cat conftest.$ac_ext >&5
1775   # Passes both tests.
1776 ac_preproc_ok=:
1777 break
1778 fi
1779 rm -f conftest.err conftest.$ac_ext
1780
1781 done
1782 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1783 rm -f conftest.err conftest.$ac_ext
1784 if $ac_preproc_ok; then
1785   break
1786 fi
1787
1788     done
1789     ac_cv_prog_CPP=$CPP
1790
1791 fi
1792   CPP=$ac_cv_prog_CPP
1793 else
1794   ac_cv_prog_CPP=$CPP
1795 fi
1796 echo "$as_me:1796: result: $CPP" >&5
1797 echo "${ECHO_T}$CPP" >&6
1798 ac_preproc_ok=false
1799 for ac_c_preproc_warn_flag in '' yes
1800 do
1801   # Use a header file that comes with gcc, so configuring glibc
1802   # with a fresh cross-compiler works.
1803   # On the NeXT, cc -E runs the code through the compiler's parser,
1804   # not just through cpp. "Syntax error" is here to catch this case.
1805   cat >conftest.$ac_ext <<_ACEOF
1806 #line 1806 "configure"
1807 #include "confdefs.h"
1808 #include <assert.h>
1809                      Syntax error
1810 _ACEOF
1811 if { (eval echo "$as_me:1811: \"$ac_cpp conftest.$ac_ext\"") >&5
1812   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1813   ac_status=$?
1814   egrep -v '^ *\+' conftest.er1 >conftest.err
1815   rm -f conftest.er1
1816   cat conftest.err >&5
1817   echo "$as_me:1817: \$? = $ac_status" >&5
1818   (exit $ac_status); } >/dev/null; then
1819   if test -s conftest.err; then
1820     ac_cpp_err=$ac_c_preproc_warn_flag
1821   else
1822     ac_cpp_err=
1823   fi
1824 else
1825   ac_cpp_err=yes
1826 fi
1827 if test -z "$ac_cpp_err"; then
1828   :
1829 else
1830   echo "$as_me: failed program was:" >&5
1831   cat conftest.$ac_ext >&5
1832   # Broken: fails on valid input.
1833 continue
1834 fi
1835 rm -f conftest.err conftest.$ac_ext
1836
1837   # OK, works on sane cases.  Now check whether non-existent headers
1838   # can be detected and how.
1839   cat >conftest.$ac_ext <<_ACEOF
1840 #line 1840 "configure"
1841 #include "confdefs.h"
1842 #include <ac_nonexistent.h>
1843 _ACEOF
1844 if { (eval echo "$as_me:1844: \"$ac_cpp conftest.$ac_ext\"") >&5
1845   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1846   ac_status=$?
1847   egrep -v '^ *\+' conftest.er1 >conftest.err
1848   rm -f conftest.er1
1849   cat conftest.err >&5
1850   echo "$as_me:1850: \$? = $ac_status" >&5
1851   (exit $ac_status); } >/dev/null; then
1852   if test -s conftest.err; then
1853     ac_cpp_err=$ac_c_preproc_warn_flag
1854   else
1855     ac_cpp_err=
1856   fi
1857 else
1858   ac_cpp_err=yes
1859 fi
1860 if test -z "$ac_cpp_err"; then
1861   # Broken: success on invalid input.
1862 continue
1863 else
1864   echo "$as_me: failed program was:" >&5
1865   cat conftest.$ac_ext >&5
1866   # Passes both tests.
1867 ac_preproc_ok=:
1868 break
1869 fi
1870 rm -f conftest.err conftest.$ac_ext
1871
1872 done
1873 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1874 rm -f conftest.err conftest.$ac_ext
1875 if $ac_preproc_ok; then
1876   :
1877 else
1878   { { echo "$as_me:1878: error: C preprocessor \"$CPP\" fails sanity check" >&5
1879 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
1880    { (exit 1); exit 1; }; }
1881 fi
1882
1883 ac_ext=c
1884 ac_cpp='$CPP $CPPFLAGS'
1885 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1886 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1887 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1888 ac_main_return=return
1889
1890 if test $ac_cv_c_compiler_gnu = yes; then
1891     echo "$as_me:1891: checking whether $CC needs -traditional" >&5
1892 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
1893 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
1894   echo $ECHO_N "(cached) $ECHO_C" >&6
1895 else
1896     ac_pattern="Autoconf.*'x'"
1897   cat >conftest.$ac_ext <<_ACEOF
1898 #line 1898 "configure"
1899 #include "confdefs.h"
1900 #include <sgtty.h>
1901 int Autoconf = TIOCGETP;
1902 _ACEOF
1903 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1904   egrep "$ac_pattern" >/dev/null 2>&1; then
1905   ac_cv_prog_gcc_traditional=yes
1906 else
1907   ac_cv_prog_gcc_traditional=no
1908 fi
1909 rm -rf conftest*
1910
1911   if test $ac_cv_prog_gcc_traditional = no; then
1912     cat >conftest.$ac_ext <<_ACEOF
1913 #line 1913 "configure"
1914 #include "confdefs.h"
1915 #include <termio.h>
1916 int Autoconf = TCGETA;
1917 _ACEOF
1918 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1919   egrep "$ac_pattern" >/dev/null 2>&1; then
1920   ac_cv_prog_gcc_traditional=yes
1921 fi
1922 rm -rf conftest*
1923
1924   fi
1925 fi
1926 echo "$as_me:1926: result: $ac_cv_prog_gcc_traditional" >&5
1927 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
1928   if test $ac_cv_prog_gcc_traditional = yes; then
1929     CC="$CC -traditional"
1930   fi
1931 fi
1932
1933 echo "$as_me:1933: checking whether $CC understands -c and -o together" >&5
1934 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
1935 if test "${cf_cv_prog_CC_c_o+set}" = set; then
1936   echo $ECHO_N "(cached) $ECHO_C" >&6
1937 else
1938
1939 cat > conftest.$ac_ext <<CF_EOF
1940 #include <stdio.h>
1941 int main()
1942 {
1943         ${cf_cv_main_return:-return}(0);
1944 }
1945 CF_EOF
1946 # We do the test twice because some compilers refuse to overwrite an
1947 # existing .o file with -o, though they will create one.
1948 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
1949 if { (eval echo "$as_me:1949: \"$ac_try\"") >&5
1950   (eval $ac_try) 2>&5
1951   ac_status=$?
1952   echo "$as_me:1952: \$? = $ac_status" >&5
1953   (exit $ac_status); } &&
1954   test -f conftest2.$ac_objext && { (eval echo "$as_me:1954: \"$ac_try\"") >&5
1955   (eval $ac_try) 2>&5
1956   ac_status=$?
1957   echo "$as_me:1957: \$? = $ac_status" >&5
1958   (exit $ac_status); };
1959 then
1960   eval cf_cv_prog_CC_c_o=yes
1961 else
1962   eval cf_cv_prog_CC_c_o=no
1963 fi
1964 rm -rf conftest*
1965
1966 fi
1967 if test $cf_cv_prog_CC_c_o = yes; then
1968   echo "$as_me:1968: result: yes" >&5
1969 echo "${ECHO_T}yes" >&6
1970 else
1971   echo "$as_me:1971: result: no" >&5
1972 echo "${ECHO_T}no" >&6
1973 fi
1974
1975 echo "$as_me:1975: checking for POSIXized ISC" >&5
1976 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6
1977 if test -d /etc/conf/kconfig.d &&
1978    grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
1979 then
1980   echo "$as_me:1980: result: yes" >&5
1981 echo "${ECHO_T}yes" >&6
1982   ISC=yes # If later tests want to check for ISC.
1983
1984 cat >>confdefs.h <<\EOF
1985 #define _POSIX_SOURCE 1
1986 EOF
1987
1988   if test "$GCC" = yes; then
1989     CC="$CC -posix"
1990   else
1991     CC="$CC -Xp"
1992   fi
1993 else
1994   echo "$as_me:1994: result: no" >&5
1995 echo "${ECHO_T}no" >&6
1996   ISC=
1997 fi
1998
1999 # This should have been defined by AC_PROG_CC
2000 : ${CC:=cc}
2001
2002 # Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
2003 # into CC.  This will not help with broken scripts that wrap the compiler with
2004 # options, but eliminates a more common category of user confusion.
2005 echo "$as_me:2005: checking \$CC variable" >&5
2006 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2007 case "$CC" in #(vi
2008 *[\ \   ]-[IUD]*)
2009         echo "$as_me:2009: result: broken" >&5
2010 echo "${ECHO_T}broken" >&6
2011         { echo "$as_me:2011: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2012 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2013         # humor him...
2014         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
2015         CC=`echo "$CC" | sed -e 's/[    ].*//'`
2016
2017 cf_fix_cppflags=no
2018 cf_new_cflags=
2019 cf_new_cppflags=
2020 cf_new_extra_cppflags=
2021
2022 for cf_add_cflags in $cf_flags
2023 do
2024 case $cf_fix_cppflags in
2025 no)
2026         case $cf_add_cflags in #(vi
2027         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2028                 case $cf_add_cflags in
2029                 -D*)
2030                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2031
2032                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2033                                 && test -z "${cf_tst_cflags}" \
2034                                 && cf_fix_cppflags=yes
2035
2036                         if test $cf_fix_cppflags = yes ; then
2037                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2038                                 continue
2039                         elif test "${cf_tst_cflags}" = "\"'" ; then
2040                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2041                                 continue
2042                         fi
2043                         ;;
2044                 esac
2045                 case "$CPPFLAGS" in
2046                 *$cf_add_cflags) #(vi
2047                         ;;
2048                 *) #(vi
2049                         case $cf_add_cflags in #(vi
2050                         -D*)
2051                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2052
2053 CPPFLAGS=`echo "$CPPFLAGS" | \
2054         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2055                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2056
2057                                 ;;
2058                         esac
2059                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2060                         ;;
2061                 esac
2062                 ;;
2063         *)
2064                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2065                 ;;
2066         esac
2067         ;;
2068 yes)
2069         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2070
2071         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2072
2073         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2074                 && test -z "${cf_tst_cflags}" \
2075                 && cf_fix_cppflags=no
2076         ;;
2077 esac
2078 done
2079
2080 if test -n "$cf_new_cflags" ; then
2081
2082         CFLAGS="$CFLAGS $cf_new_cflags"
2083 fi
2084
2085 if test -n "$cf_new_cppflags" ; then
2086
2087         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2088 fi
2089
2090 if test -n "$cf_new_extra_cppflags" ; then
2091
2092         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2093 fi
2094
2095         ;;
2096 *)
2097         echo "$as_me:2097: result: ok" >&5
2098 echo "${ECHO_T}ok" >&6
2099         ;;
2100 esac
2101
2102 echo "$as_me:2102: checking for ${CC:-cc} option to accept ANSI C" >&5
2103 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
2104 if test "${cf_cv_ansi_cc+set}" = set; then
2105   echo $ECHO_N "(cached) $ECHO_C" >&6
2106 else
2107
2108 cf_cv_ansi_cc=no
2109 cf_save_CFLAGS="$CFLAGS"
2110 cf_save_CPPFLAGS="$CPPFLAGS"
2111 # Don't try gcc -ansi; that turns off useful extensions and
2112 # breaks some systems' header files.
2113 # AIX                   -qlanglvl=ansi
2114 # Ultrix and OSF/1      -std1
2115 # HP-UX                 -Aa -D_HPUX_SOURCE
2116 # SVR4                  -Xc
2117 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2118 for cf_arg in "-DCC_HAS_PROTOS" \
2119         "" \
2120         -qlanglvl=ansi \
2121         -std1 \
2122         -Ae \
2123         "-Aa -D_HPUX_SOURCE" \
2124         -Xc
2125 do
2126
2127 cf_fix_cppflags=no
2128 cf_new_cflags=
2129 cf_new_cppflags=
2130 cf_new_extra_cppflags=
2131
2132 for cf_add_cflags in $cf_arg
2133 do
2134 case $cf_fix_cppflags in
2135 no)
2136         case $cf_add_cflags in #(vi
2137         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2138                 case $cf_add_cflags in
2139                 -D*)
2140                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2141
2142                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2143                                 && test -z "${cf_tst_cflags}" \
2144                                 && cf_fix_cppflags=yes
2145
2146                         if test $cf_fix_cppflags = yes ; then
2147                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2148                                 continue
2149                         elif test "${cf_tst_cflags}" = "\"'" ; then
2150                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2151                                 continue
2152                         fi
2153                         ;;
2154                 esac
2155                 case "$CPPFLAGS" in
2156                 *$cf_add_cflags) #(vi
2157                         ;;
2158                 *) #(vi
2159                         case $cf_add_cflags in #(vi
2160                         -D*)
2161                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2162
2163 CPPFLAGS=`echo "$CPPFLAGS" | \
2164         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2165                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2166
2167                                 ;;
2168                         esac
2169                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2170                         ;;
2171                 esac
2172                 ;;
2173         *)
2174                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2175                 ;;
2176         esac
2177         ;;
2178 yes)
2179         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2180
2181         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2182
2183         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2184                 && test -z "${cf_tst_cflags}" \
2185                 && cf_fix_cppflags=no
2186         ;;
2187 esac
2188 done
2189
2190 if test -n "$cf_new_cflags" ; then
2191
2192         CFLAGS="$CFLAGS $cf_new_cflags"
2193 fi
2194
2195 if test -n "$cf_new_cppflags" ; then
2196
2197         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2198 fi
2199
2200 if test -n "$cf_new_extra_cppflags" ; then
2201
2202         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2203 fi
2204
2205         cat >conftest.$ac_ext <<_ACEOF
2206 #line 2206 "configure"
2207 #include "confdefs.h"
2208
2209 #ifndef CC_HAS_PROTOS
2210 #if !defined(__STDC__) || (__STDC__ != 1)
2211 choke me
2212 #endif
2213 #endif
2214
2215 int
2216 main ()
2217 {
2218
2219         int test (int i, double x);
2220         struct s1 {int (*f) (int a);};
2221         struct s2 {int (*f) (double a);};
2222   ;
2223   return 0;
2224 }
2225 _ACEOF
2226 rm -f conftest.$ac_objext
2227 if { (eval echo "$as_me:2227: \"$ac_compile\"") >&5
2228   (eval $ac_compile) 2>&5
2229   ac_status=$?
2230   echo "$as_me:2230: \$? = $ac_status" >&5
2231   (exit $ac_status); } &&
2232          { ac_try='test -s conftest.$ac_objext'
2233   { (eval echo "$as_me:2233: \"$ac_try\"") >&5
2234   (eval $ac_try) 2>&5
2235   ac_status=$?
2236   echo "$as_me:2236: \$? = $ac_status" >&5
2237   (exit $ac_status); }; }; then
2238   cf_cv_ansi_cc="$cf_arg"; break
2239 else
2240   echo "$as_me: failed program was:" >&5
2241 cat conftest.$ac_ext >&5
2242 fi
2243 rm -f conftest.$ac_objext conftest.$ac_ext
2244 done
2245 CFLAGS="$cf_save_CFLAGS"
2246 CPPFLAGS="$cf_save_CPPFLAGS"
2247
2248 fi
2249 echo "$as_me:2249: result: $cf_cv_ansi_cc" >&5
2250 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2251
2252 if test "$cf_cv_ansi_cc" != "no"; then
2253 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2254
2255 cf_fix_cppflags=no
2256 cf_new_cflags=
2257 cf_new_cppflags=
2258 cf_new_extra_cppflags=
2259
2260 for cf_add_cflags in $cf_cv_ansi_cc
2261 do
2262 case $cf_fix_cppflags in
2263 no)
2264         case $cf_add_cflags in #(vi
2265         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2266                 case $cf_add_cflags in
2267                 -D*)
2268                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2269
2270                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2271                                 && test -z "${cf_tst_cflags}" \
2272                                 && cf_fix_cppflags=yes
2273
2274                         if test $cf_fix_cppflags = yes ; then
2275                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2276                                 continue
2277                         elif test "${cf_tst_cflags}" = "\"'" ; then
2278                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2279                                 continue
2280                         fi
2281                         ;;
2282                 esac
2283                 case "$CPPFLAGS" in
2284                 *$cf_add_cflags) #(vi
2285                         ;;
2286                 *) #(vi
2287                         case $cf_add_cflags in #(vi
2288                         -D*)
2289                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2290
2291 CPPFLAGS=`echo "$CPPFLAGS" | \
2292         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2293                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2294
2295                                 ;;
2296                         esac
2297                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2298                         ;;
2299                 esac
2300                 ;;
2301         *)
2302                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2303                 ;;
2304         esac
2305         ;;
2306 yes)
2307         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2308
2309         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2310
2311         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2312                 && test -z "${cf_tst_cflags}" \
2313                 && cf_fix_cppflags=no
2314         ;;
2315 esac
2316 done
2317
2318 if test -n "$cf_new_cflags" ; then
2319
2320         CFLAGS="$CFLAGS $cf_new_cflags"
2321 fi
2322
2323 if test -n "$cf_new_cppflags" ; then
2324
2325         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2326 fi
2327
2328 if test -n "$cf_new_extra_cppflags" ; then
2329
2330         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2331 fi
2332
2333 else
2334         cat >>confdefs.h <<\EOF
2335 #define CC_HAS_PROTOS 1
2336 EOF
2337
2338 fi
2339 fi
2340
2341 if test "$cf_cv_ansi_cc" = "no"; then
2342         { { echo "$as_me:2342: error: Your compiler does not appear to recognize prototypes.
2343 You have the following choices:
2344         a. adjust your compiler options
2345         b. get an up-to-date compiler
2346         c. use a wrapper such as unproto" >&5
2347 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2348 You have the following choices:
2349         a. adjust your compiler options
2350         b. get an up-to-date compiler
2351         c. use a wrapper such as unproto" >&2;}
2352    { (exit 1); exit 1; }; }
2353 fi
2354
2355 case $cf_cv_system_name in
2356 os2*)
2357     CFLAGS="$CFLAGS -Zmt"
2358     CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
2359     CXXFLAGS="$CXXFLAGS -Zmt"
2360     # autoconf's macro sets -Zexe and suffix both, which conflict:w
2361     LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
2362     ac_cv_exeext=.exe
2363     ;;
2364 esac
2365
2366 PROG_EXT="$EXEEXT"
2367
2368 test -n "$PROG_EXT" && cat >>confdefs.h <<EOF
2369 #define PROG_EXT "$PROG_EXT"
2370 EOF
2371
2372 test "$program_prefix" != NONE &&
2373   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2374 # Use a double $ so make ignores it.
2375 test "$program_suffix" != NONE &&
2376   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2377 # Double any \ or $.  echo might interpret backslashes.
2378 # By default was `s,x,x', remove it if useless.
2379 cat <<\_ACEOF >conftest.sed
2380 s/[\\$]/&&/g;s/;s,x,x,$//
2381 _ACEOF
2382 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2383 rm conftest.sed
2384
2385 for ac_prog in mawk gawk nawk awk
2386 do
2387   # Extract the first word of "$ac_prog", so it can be a program name with args.
2388 set dummy $ac_prog; ac_word=$2
2389 echo "$as_me:2389: checking for $ac_word" >&5
2390 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2391 if test "${ac_cv_prog_AWK+set}" = set; then
2392   echo $ECHO_N "(cached) $ECHO_C" >&6
2393 else
2394   if test -n "$AWK"; then
2395   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2396 else
2397   ac_save_IFS=$IFS; IFS=$ac_path_separator
2398 ac_dummy="$PATH"
2399 for ac_dir in $ac_dummy; do
2400   IFS=$ac_save_IFS
2401   test -z "$ac_dir" && ac_dir=.
2402   $as_executable_p "$ac_dir/$ac_word" || continue
2403 ac_cv_prog_AWK="$ac_prog"
2404 echo "$as_me:2404: found $ac_dir/$ac_word" >&5
2405 break
2406 done
2407
2408 fi
2409 fi
2410 AWK=$ac_cv_prog_AWK
2411 if test -n "$AWK"; then
2412   echo "$as_me:2412: result: $AWK" >&5
2413 echo "${ECHO_T}$AWK" >&6
2414 else
2415   echo "$as_me:2415: result: no" >&5
2416 echo "${ECHO_T}no" >&6
2417 fi
2418
2419   test -n "$AWK" && break
2420 done
2421
2422 test -z "$AWK" && { { echo "$as_me:2422: error: No awk program found" >&5
2423 echo "$as_me: error: No awk program found" >&2;}
2424    { (exit 1); exit 1; }; }
2425
2426 echo "$as_me:2426: checking for egrep" >&5
2427 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2428 if test "${ac_cv_prog_egrep+set}" = set; then
2429   echo $ECHO_N "(cached) $ECHO_C" >&6
2430 else
2431   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2432     then ac_cv_prog_egrep='grep -E'
2433     else ac_cv_prog_egrep='egrep'
2434     fi
2435 fi
2436 echo "$as_me:2436: result: $ac_cv_prog_egrep" >&5
2437 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2438  EGREP=$ac_cv_prog_egrep
2439
2440 test -z "$EGREP" && { { echo "$as_me:2440: error: No egrep program found" >&5
2441 echo "$as_me: error: No egrep program found" >&2;}
2442    { (exit 1); exit 1; }; }
2443
2444 # Find a good install program.  We prefer a C program (faster),
2445 # so one script is as good as another.  But avoid the broken or
2446 # incompatible versions:
2447 # SysV /etc/install, /usr/sbin/install
2448 # SunOS /usr/etc/install
2449 # IRIX /sbin/install
2450 # AIX /bin/install
2451 # AmigaOS /C/install, which installs bootblocks on floppy discs
2452 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2453 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2454 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2455 # ./install, which can be erroneously created by make from ./install.sh.
2456 echo "$as_me:2456: checking for a BSD compatible install" >&5
2457 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2458 if test -z "$INSTALL"; then
2459 if test "${ac_cv_path_install+set}" = set; then
2460   echo $ECHO_N "(cached) $ECHO_C" >&6
2461 else
2462     ac_save_IFS=$IFS; IFS=$ac_path_separator
2463   for ac_dir in $PATH; do
2464     IFS=$ac_save_IFS
2465     # Account for people who put trailing slashes in PATH elements.
2466     case $ac_dir/ in
2467     / | ./ | .// | /cC/* \
2468     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2469     | /usr/ucb/* ) ;;
2470     *)
2471       # OSF1 and SCO ODT 3.0 have their own names for install.
2472       # Don't use installbsd from OSF since it installs stuff as root
2473       # by default.
2474       for ac_prog in ginstall scoinst install; do
2475         if $as_executable_p "$ac_dir/$ac_prog"; then
2476           if test $ac_prog = install &&
2477             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2478             # AIX install.  It has an incompatible calling convention.
2479             :
2480           elif test $ac_prog = install &&
2481             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2482             # program-specific install script used by HP pwplus--don't use.
2483             :
2484           else
2485             ac_cv_path_install="$ac_dir/$ac_prog -c"
2486             break 2
2487           fi
2488         fi
2489       done
2490       ;;
2491     esac
2492   done
2493
2494 fi
2495   if test "${ac_cv_path_install+set}" = set; then
2496     INSTALL=$ac_cv_path_install
2497   else
2498     # As a last resort, use the slow shell script.  We don't cache a
2499     # path for INSTALL within a source directory, because that will
2500     # break other packages using the cache if that directory is
2501     # removed, or if the path is relative.
2502     INSTALL=$ac_install_sh
2503   fi
2504 fi
2505 echo "$as_me:2505: result: $INSTALL" >&5
2506 echo "${ECHO_T}$INSTALL" >&6
2507
2508 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2509 # It thinks the first close brace ends the variable substitution.
2510 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2511
2512 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2513
2514 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2515
2516 echo "$as_me:2516: checking whether ln -s works" >&5
2517 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2518 LN_S=$as_ln_s
2519 if test "$LN_S" = "ln -s"; then
2520   echo "$as_me:2520: result: yes" >&5
2521 echo "${ECHO_T}yes" >&6
2522 else
2523   echo "$as_me:2523: result: no, using $LN_S" >&5
2524 echo "${ECHO_T}no, using $LN_S" >&6
2525 fi
2526
2527 echo "$as_me:2527: checking if $LN_S -f options work" >&5
2528 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2529
2530 rm -f conf$$.src conf$$dst
2531 echo >conf$$.dst
2532 echo first >conf$$.src
2533 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2534         cf_prog_ln_sf=yes
2535 else
2536         cf_prog_ln_sf=no
2537 fi
2538 rm -f conf$$.dst conf$$src
2539 echo "$as_me:2539: result: $cf_prog_ln_sf" >&5
2540 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2541
2542 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2543
2544 echo "$as_me:2544: checking for long file names" >&5
2545 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2546 if test "${ac_cv_sys_long_file_names+set}" = set; then
2547   echo $ECHO_N "(cached) $ECHO_C" >&6
2548 else
2549   ac_cv_sys_long_file_names=yes
2550 # Test for long file names in all the places we know might matter:
2551 #      .                the current directory, where building will happen
2552 #      $prefix/lib      where we will be installing things
2553 #      $exec_prefix/lib likewise
2554 # eval it to expand exec_prefix.
2555 #      $TMPDIR          if set, where it might want to write temporary files
2556 # if $TMPDIR is not set:
2557 #      /tmp             where it might want to write temporary files
2558 #      /var/tmp         likewise
2559 #      /usr/tmp         likewise
2560 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2561   ac_tmpdirs=$TMPDIR
2562 else
2563   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2564 fi
2565 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2566   test -d $ac_dir || continue
2567   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2568   ac_xdir=$ac_dir/cf$$
2569   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2570   ac_tf1=$ac_xdir/conftest9012345
2571   ac_tf2=$ac_xdir/conftest9012346
2572   (echo 1 >$ac_tf1) 2>/dev/null
2573   (echo 2 >$ac_tf2) 2>/dev/null
2574   ac_val=`cat $ac_tf1 2>/dev/null`
2575   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2576     ac_cv_sys_long_file_names=no
2577     rm -rf $ac_xdir 2>/dev/null
2578     break
2579   fi
2580   rm -rf $ac_xdir 2>/dev/null
2581 done
2582 fi
2583 echo "$as_me:2583: result: $ac_cv_sys_long_file_names" >&5
2584 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2585 if test $ac_cv_sys_long_file_names = yes; then
2586
2587 cat >>confdefs.h <<\EOF
2588 #define HAVE_LONG_FILE_NAMES 1
2589 EOF
2590
2591 fi
2592
2593 # if we find pkg-config, check if we should install the ".pc" files.
2594
2595 echo "$as_me:2595: checking if you want to use pkg-config" >&5
2596 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2597
2598 # Check whether --with-pkg-config or --without-pkg-config was given.
2599 if test "${with_pkg_config+set}" = set; then
2600   withval="$with_pkg_config"
2601   cf_pkg_config=$withval
2602 else
2603   cf_pkg_config=yes
2604 fi;
2605 echo "$as_me:2605: result: $cf_pkg_config" >&5
2606 echo "${ECHO_T}$cf_pkg_config" >&6
2607
2608 case $cf_pkg_config in #(vi
2609 no) #(vi
2610         PKG_CONFIG=none
2611         ;;
2612 yes) #(vi
2613
2614 if test -n "$ac_tool_prefix"; then
2615   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2616 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2617 echo "$as_me:2617: checking for $ac_word" >&5
2618 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2619 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2620   echo $ECHO_N "(cached) $ECHO_C" >&6
2621 else
2622   case $PKG_CONFIG in
2623   [\\/]* | ?:[\\/]*)
2624   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2625   ;;
2626   *)
2627   ac_save_IFS=$IFS; IFS=$ac_path_separator
2628 ac_dummy="$PATH"
2629 for ac_dir in $ac_dummy; do
2630   IFS=$ac_save_IFS
2631   test -z "$ac_dir" && ac_dir=.
2632   if $as_executable_p "$ac_dir/$ac_word"; then
2633    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2634    echo "$as_me:2634: found $ac_dir/$ac_word" >&5
2635    break
2636 fi
2637 done
2638
2639   ;;
2640 esac
2641 fi
2642 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2643
2644 if test -n "$PKG_CONFIG"; then
2645   echo "$as_me:2645: result: $PKG_CONFIG" >&5
2646 echo "${ECHO_T}$PKG_CONFIG" >&6
2647 else
2648   echo "$as_me:2648: result: no" >&5
2649 echo "${ECHO_T}no" >&6
2650 fi
2651
2652 fi
2653 if test -z "$ac_cv_path_PKG_CONFIG"; then
2654   ac_pt_PKG_CONFIG=$PKG_CONFIG
2655   # Extract the first word of "pkg-config", so it can be a program name with args.
2656 set dummy pkg-config; ac_word=$2
2657 echo "$as_me:2657: checking for $ac_word" >&5
2658 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2659 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2660   echo $ECHO_N "(cached) $ECHO_C" >&6
2661 else
2662   case $ac_pt_PKG_CONFIG in
2663   [\\/]* | ?:[\\/]*)
2664   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2665   ;;
2666   *)
2667   ac_save_IFS=$IFS; IFS=$ac_path_separator
2668 ac_dummy="$PATH"
2669 for ac_dir in $ac_dummy; do
2670   IFS=$ac_save_IFS
2671   test -z "$ac_dir" && ac_dir=.
2672   if $as_executable_p "$ac_dir/$ac_word"; then
2673    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2674    echo "$as_me:2674: found $ac_dir/$ac_word" >&5
2675    break
2676 fi
2677 done
2678
2679   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2680   ;;
2681 esac
2682 fi
2683 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2684
2685 if test -n "$ac_pt_PKG_CONFIG"; then
2686   echo "$as_me:2686: result: $ac_pt_PKG_CONFIG" >&5
2687 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2688 else
2689   echo "$as_me:2689: result: no" >&5
2690 echo "${ECHO_T}no" >&6
2691 fi
2692
2693   PKG_CONFIG=$ac_pt_PKG_CONFIG
2694 else
2695   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2696 fi
2697
2698         ;;
2699 *)
2700         PKG_CONFIG=$withval
2701         ;;
2702 esac
2703
2704 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2705 if test "$PKG_CONFIG" != none ; then
2706
2707 if test "x$prefix" != xNONE; then
2708   cf_path_syntax="$prefix"
2709 else
2710   cf_path_syntax="$ac_default_prefix"
2711 fi
2712
2713 case ".$PKG_CONFIG" in #(vi
2714 .\$\(*\)*|.\'*\'*) #(vi
2715   ;;
2716 ..|./*|.\\*) #(vi
2717   ;;
2718 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2719   ;;
2720 .\${*prefix}*) #(vi
2721   eval PKG_CONFIG="$PKG_CONFIG"
2722   case ".$PKG_CONFIG" in #(vi
2723   .NONE/*)
2724     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2725     ;;
2726   esac
2727   ;; #(vi
2728 .no|.NONE/*)
2729   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2730   ;;
2731 *)
2732   { { echo "$as_me:2732: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2733 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2734    { (exit 1); exit 1; }; }
2735   ;;
2736 esac
2737
2738 fi
2739
2740 if test "$PKG_CONFIG" != none ; then
2741         echo "$as_me:2741: checking for $PKG_CONFIG library directory" >&5
2742 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2743
2744 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2745 if test "${with_pkg_config_libdir+set}" = set; then
2746   withval="$with_pkg_config_libdir"
2747   PKG_CONFIG_LIBDIR=$withval
2748 else
2749   PKG_CONFIG_LIBDIR=yes
2750 fi;
2751
2752         case x$PKG_CONFIG_LIBDIR in #(vi
2753         x/*) #(vi
2754                 ;;
2755         xyes) #(vi
2756                 # look for the library directory using the same prefix as the executable
2757                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2758                 case x`(arch) 2>/dev/null` in #(vi
2759                 *64) #(vi
2760                         for cf_config in $cf_path/share $cf_path/lib64 $cf_path/lib32 $cf_path/lib
2761                         do
2762                                 if test -d $cf_config/pkgconfig
2763                                 then
2764                                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2765                                         break
2766                                 fi
2767                         done
2768                         ;;
2769                 *)
2770                         PKG_CONFIG_LIBDIR=$cf_path/lib/pkgconfig
2771                         ;;
2772                 esac
2773                 ;;
2774         *)
2775                 ;;
2776         esac
2777
2778         echo "$as_me:2778: result: $PKG_CONFIG_LIBDIR" >&5
2779 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2780 fi
2781
2782 if test "$PKG_CONFIG" != none ; then
2783         if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
2784                 echo "$as_me:2784: checking if we should install .pc files for $PKG_CONFIG" >&5
2785 echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6
2786
2787 # Check whether --enable-pc-files or --disable-pc-files was given.
2788 if test "${enable_pc_files+set}" = set; then
2789   enableval="$enable_pc_files"
2790   enable_pc_files=$enableval
2791 else
2792   enable_pc_files=no
2793 fi;
2794                 echo "$as_me:2794: result: $enable_pc_files" >&5
2795 echo "${ECHO_T}$enable_pc_files" >&6
2796         elif test -z "$PKG_CONFIG_LIBDIR" || test "$PKG_CONFIG_LIBDIR" != no; then
2797                 enable_pc_files=no
2798                 { echo "$as_me:2798: WARNING: did not find $PKG_CONFIG library" >&5
2799 echo "$as_me: WARNING: did not find $PKG_CONFIG library" >&2;}
2800         fi
2801 else
2802         enable_pc_files=no
2803 fi
2804
2805 echo "$as_me:2805: checking if you want to build test-programs" >&5
2806 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2807
2808 # Check whether --with-tests or --without-tests was given.
2809 if test "${with_tests+set}" = set; then
2810   withval="$with_tests"
2811   cf_with_tests=$withval
2812 else
2813   cf_with_tests=yes
2814 fi;
2815 echo "$as_me:2815: result: $cf_with_tests" >&5
2816 echo "${ECHO_T}$cf_with_tests" >&6
2817
2818 echo "$as_me:2818: checking if we should assume mixed-case filenames" >&5
2819 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2820
2821 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2822 if test "${enable_mixed_case+set}" = set; then
2823   enableval="$enable_mixed_case"
2824   enable_mixedcase=$enableval
2825 else
2826   enable_mixedcase=auto
2827 fi;
2828 echo "$as_me:2828: result: $enable_mixedcase" >&5
2829 echo "${ECHO_T}$enable_mixedcase" >&6
2830 if test "$enable_mixedcase" = "auto" ; then
2831
2832 echo "$as_me:2832: checking if filesystem supports mixed-case filenames" >&5
2833 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2834 if test "${cf_cv_mixedcase+set}" = set; then
2835   echo $ECHO_N "(cached) $ECHO_C" >&6
2836 else
2837
2838 if test "$cross_compiling" = yes ; then
2839         case $target_alias in #(vi
2840         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2841                 cf_cv_mixedcase=no
2842                 ;;
2843         *)
2844                 cf_cv_mixedcase=yes
2845                 ;;
2846         esac
2847 else
2848         rm -f conftest CONFTEST
2849         echo test >conftest
2850         if test -f CONFTEST ; then
2851                 cf_cv_mixedcase=no
2852         else
2853                 cf_cv_mixedcase=yes
2854         fi
2855         rm -f conftest CONFTEST
2856 fi
2857
2858 fi
2859 echo "$as_me:2859: result: $cf_cv_mixedcase" >&5
2860 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2861 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2862 #define MIXEDCASE_FILENAMES 1
2863 EOF
2864
2865 else
2866     cf_cv_mixedcase=$enable_mixedcase
2867     if test "$enable_mixedcase" = "yes" ; then
2868         cat >>confdefs.h <<\EOF
2869 #define MIXEDCASE_FILENAMES 1
2870 EOF
2871
2872     fi
2873 fi
2874
2875 # do this after mixed-case option (tags/TAGS is not as important as tic).
2876 echo "$as_me:2876: checking whether ${MAKE-make} sets \${MAKE}" >&5
2877 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2878 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2879 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2880   echo $ECHO_N "(cached) $ECHO_C" >&6
2881 else
2882   cat >conftest.make <<\EOF
2883 all:
2884         @echo 'ac_maketemp="${MAKE}"'
2885 EOF
2886 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2887 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2888 if test -n "$ac_maketemp"; then
2889   eval ac_cv_prog_make_${ac_make}_set=yes
2890 else
2891   eval ac_cv_prog_make_${ac_make}_set=no
2892 fi
2893 rm -f conftest.make
2894 fi
2895 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2896   echo "$as_me:2896: result: yes" >&5
2897 echo "${ECHO_T}yes" >&6
2898   SET_MAKE=
2899 else
2900   echo "$as_me:2900: result: no" >&5
2901 echo "${ECHO_T}no" >&6
2902   SET_MAKE="MAKE=${MAKE-make}"
2903 fi
2904
2905 for ac_prog in exctags ctags
2906 do
2907   # Extract the first word of "$ac_prog", so it can be a program name with args.
2908 set dummy $ac_prog; ac_word=$2
2909 echo "$as_me:2909: checking for $ac_word" >&5
2910 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2911 if test "${ac_cv_prog_CTAGS+set}" = set; then
2912   echo $ECHO_N "(cached) $ECHO_C" >&6
2913 else
2914   if test -n "$CTAGS"; then
2915   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2916 else
2917   ac_save_IFS=$IFS; IFS=$ac_path_separator
2918 ac_dummy="$PATH"
2919 for ac_dir in $ac_dummy; do
2920   IFS=$ac_save_IFS
2921   test -z "$ac_dir" && ac_dir=.
2922   $as_executable_p "$ac_dir/$ac_word" || continue
2923 ac_cv_prog_CTAGS="$ac_prog"
2924 echo "$as_me:2924: found $ac_dir/$ac_word" >&5
2925 break
2926 done
2927
2928 fi
2929 fi
2930 CTAGS=$ac_cv_prog_CTAGS
2931 if test -n "$CTAGS"; then
2932   echo "$as_me:2932: result: $CTAGS" >&5
2933 echo "${ECHO_T}$CTAGS" >&6
2934 else
2935   echo "$as_me:2935: result: no" >&5
2936 echo "${ECHO_T}no" >&6
2937 fi
2938
2939   test -n "$CTAGS" && break
2940 done
2941
2942 for ac_prog in exetags etags
2943 do
2944   # Extract the first word of "$ac_prog", so it can be a program name with args.
2945 set dummy $ac_prog; ac_word=$2
2946 echo "$as_me:2946: checking for $ac_word" >&5
2947 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2948 if test "${ac_cv_prog_ETAGS+set}" = set; then
2949   echo $ECHO_N "(cached) $ECHO_C" >&6
2950 else
2951   if test -n "$ETAGS"; then
2952   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2953 else
2954   ac_save_IFS=$IFS; IFS=$ac_path_separator
2955 ac_dummy="$PATH"
2956 for ac_dir in $ac_dummy; do
2957   IFS=$ac_save_IFS
2958   test -z "$ac_dir" && ac_dir=.
2959   $as_executable_p "$ac_dir/$ac_word" || continue
2960 ac_cv_prog_ETAGS="$ac_prog"
2961 echo "$as_me:2961: found $ac_dir/$ac_word" >&5
2962 break
2963 done
2964
2965 fi
2966 fi
2967 ETAGS=$ac_cv_prog_ETAGS
2968 if test -n "$ETAGS"; then
2969   echo "$as_me:2969: result: $ETAGS" >&5
2970 echo "${ECHO_T}$ETAGS" >&6
2971 else
2972   echo "$as_me:2972: result: no" >&5
2973 echo "${ECHO_T}no" >&6
2974 fi
2975
2976   test -n "$ETAGS" && break
2977 done
2978
2979 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2980 set dummy ${CTAGS:-ctags}; ac_word=$2
2981 echo "$as_me:2981: checking for $ac_word" >&5
2982 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2983 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2984   echo $ECHO_N "(cached) $ECHO_C" >&6
2985 else
2986   if test -n "$MAKE_LOWER_TAGS"; then
2987   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2988 else
2989   ac_save_IFS=$IFS; IFS=$ac_path_separator
2990 ac_dummy="$PATH"
2991 for ac_dir in $ac_dummy; do
2992   IFS=$ac_save_IFS
2993   test -z "$ac_dir" && ac_dir=.
2994   $as_executable_p "$ac_dir/$ac_word" || continue
2995 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2996 echo "$as_me:2996: found $ac_dir/$ac_word" >&5
2997 break
2998 done
2999
3000   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3001 fi
3002 fi
3003 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3004 if test -n "$MAKE_LOWER_TAGS"; then
3005   echo "$as_me:3005: result: $MAKE_LOWER_TAGS" >&5
3006 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3007 else
3008   echo "$as_me:3008: result: no" >&5
3009 echo "${ECHO_T}no" >&6
3010 fi
3011
3012 if test "$cf_cv_mixedcase" = yes ; then
3013         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3014 set dummy ${ETAGS:-etags}; ac_word=$2
3015 echo "$as_me:3015: checking for $ac_word" >&5
3016 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3017 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3018   echo $ECHO_N "(cached) $ECHO_C" >&6
3019 else
3020   if test -n "$MAKE_UPPER_TAGS"; then
3021   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3022 else
3023   ac_save_IFS=$IFS; IFS=$ac_path_separator
3024 ac_dummy="$PATH"
3025 for ac_dir in $ac_dummy; do
3026   IFS=$ac_save_IFS
3027   test -z "$ac_dir" && ac_dir=.
3028   $as_executable_p "$ac_dir/$ac_word" || continue
3029 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3030 echo "$as_me:3030: found $ac_dir/$ac_word" >&5
3031 break
3032 done
3033
3034   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3035 fi
3036 fi
3037 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3038 if test -n "$MAKE_UPPER_TAGS"; then
3039   echo "$as_me:3039: result: $MAKE_UPPER_TAGS" >&5
3040 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3041 else
3042   echo "$as_me:3042: result: no" >&5
3043 echo "${ECHO_T}no" >&6
3044 fi
3045
3046 else
3047         MAKE_UPPER_TAGS=no
3048 fi
3049
3050 if test "$MAKE_UPPER_TAGS" = yes ; then
3051         MAKE_UPPER_TAGS=
3052 else
3053         MAKE_UPPER_TAGS="#"
3054 fi
3055
3056 if test "$MAKE_LOWER_TAGS" = yes ; then
3057         MAKE_LOWER_TAGS=
3058 else
3059         MAKE_LOWER_TAGS="#"
3060 fi
3061
3062 echo "$as_me:3062: checking for makeflags variable" >&5
3063 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3064 if test "${cf_cv_makeflags+set}" = set; then
3065   echo $ECHO_N "(cached) $ECHO_C" >&6
3066 else
3067
3068         cf_cv_makeflags=''
3069         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3070         do
3071                 cat >cf_makeflags.tmp <<CF_EOF
3072 SHELL = /bin/sh
3073 all :
3074         @ echo '.$cf_option'
3075 CF_EOF
3076                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3077                 case "$cf_result" in
3078                 .*k)
3079                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3080                         case "$cf_result" in
3081                         .*CC=*) cf_cv_makeflags=
3082                                 ;;
3083                         *)      cf_cv_makeflags=$cf_option
3084                                 ;;
3085                         esac
3086                         break
3087                         ;;
3088                 .-)     ;;
3089                 *)      echo "given option \"$cf_option\", no match \"$cf_result\""
3090                         ;;
3091                 esac
3092         done
3093         rm -f cf_makeflags.tmp
3094
3095 fi
3096 echo "$as_me:3096: result: $cf_cv_makeflags" >&5
3097 echo "${ECHO_T}$cf_cv_makeflags" >&6
3098
3099 if test -n "$ac_tool_prefix"; then
3100   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3101 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3102 echo "$as_me:3102: checking for $ac_word" >&5
3103 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3104 if test "${ac_cv_prog_RANLIB+set}" = set; then
3105   echo $ECHO_N "(cached) $ECHO_C" >&6
3106 else
3107   if test -n "$RANLIB"; then
3108   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3109 else
3110   ac_save_IFS=$IFS; IFS=$ac_path_separator
3111 ac_dummy="$PATH"
3112 for ac_dir in $ac_dummy; do
3113   IFS=$ac_save_IFS
3114   test -z "$ac_dir" && ac_dir=.
3115   $as_executable_p "$ac_dir/$ac_word" || continue
3116 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3117 echo "$as_me:3117: found $ac_dir/$ac_word" >&5
3118 break
3119 done
3120
3121 fi
3122 fi
3123 RANLIB=$ac_cv_prog_RANLIB
3124 if test -n "$RANLIB"; then
3125   echo "$as_me:3125: result: $RANLIB" >&5
3126 echo "${ECHO_T}$RANLIB" >&6
3127 else
3128   echo "$as_me:3128: result: no" >&5
3129 echo "${ECHO_T}no" >&6
3130 fi
3131
3132 fi
3133 if test -z "$ac_cv_prog_RANLIB"; then
3134   ac_ct_RANLIB=$RANLIB
3135   # Extract the first word of "ranlib", so it can be a program name with args.
3136 set dummy ranlib; ac_word=$2
3137 echo "$as_me:3137: checking for $ac_word" >&5
3138 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3139 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3140   echo $ECHO_N "(cached) $ECHO_C" >&6
3141 else
3142   if test -n "$ac_ct_RANLIB"; then
3143   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3144 else
3145   ac_save_IFS=$IFS; IFS=$ac_path_separator
3146 ac_dummy="$PATH"
3147 for ac_dir in $ac_dummy; do
3148   IFS=$ac_save_IFS
3149   test -z "$ac_dir" && ac_dir=.
3150   $as_executable_p "$ac_dir/$ac_word" || continue
3151 ac_cv_prog_ac_ct_RANLIB="ranlib"
3152 echo "$as_me:3152: found $ac_dir/$ac_word" >&5
3153 break
3154 done
3155
3156   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3157 fi
3158 fi
3159 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3160 if test -n "$ac_ct_RANLIB"; then
3161   echo "$as_me:3161: result: $ac_ct_RANLIB" >&5
3162 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3163 else
3164   echo "$as_me:3164: result: no" >&5
3165 echo "${ECHO_T}no" >&6
3166 fi
3167
3168   RANLIB=$ac_ct_RANLIB
3169 else
3170   RANLIB="$ac_cv_prog_RANLIB"
3171 fi
3172
3173 if test -n "$ac_tool_prefix"; then
3174   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3175 set dummy ${ac_tool_prefix}ld; ac_word=$2
3176 echo "$as_me:3176: checking for $ac_word" >&5
3177 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3178 if test "${ac_cv_prog_LD+set}" = set; then
3179   echo $ECHO_N "(cached) $ECHO_C" >&6
3180 else
3181   if test -n "$LD"; then
3182   ac_cv_prog_LD="$LD" # Let the user override the test.
3183 else
3184   ac_save_IFS=$IFS; IFS=$ac_path_separator
3185 ac_dummy="$PATH"
3186 for ac_dir in $ac_dummy; do
3187   IFS=$ac_save_IFS
3188   test -z "$ac_dir" && ac_dir=.
3189   $as_executable_p "$ac_dir/$ac_word" || continue
3190 ac_cv_prog_LD="${ac_tool_prefix}ld"
3191 echo "$as_me:3191: found $ac_dir/$ac_word" >&5
3192 break
3193 done
3194
3195 fi
3196 fi
3197 LD=$ac_cv_prog_LD
3198 if test -n "$LD"; then
3199   echo "$as_me:3199: result: $LD" >&5
3200 echo "${ECHO_T}$LD" >&6
3201 else
3202   echo "$as_me:3202: result: no" >&5
3203 echo "${ECHO_T}no" >&6
3204 fi
3205
3206 fi
3207 if test -z "$ac_cv_prog_LD"; then
3208   ac_ct_LD=$LD
3209   # Extract the first word of "ld", so it can be a program name with args.
3210 set dummy ld; ac_word=$2
3211 echo "$as_me:3211: checking for $ac_word" >&5
3212 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3213 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3214   echo $ECHO_N "(cached) $ECHO_C" >&6
3215 else
3216   if test -n "$ac_ct_LD"; then
3217   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3218 else
3219   ac_save_IFS=$IFS; IFS=$ac_path_separator
3220 ac_dummy="$PATH"
3221 for ac_dir in $ac_dummy; do
3222   IFS=$ac_save_IFS
3223   test -z "$ac_dir" && ac_dir=.
3224   $as_executable_p "$ac_dir/$ac_word" || continue
3225 ac_cv_prog_ac_ct_LD="ld"
3226 echo "$as_me:3226: found $ac_dir/$ac_word" >&5
3227 break
3228 done
3229
3230   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3231 fi
3232 fi
3233 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3234 if test -n "$ac_ct_LD"; then
3235   echo "$as_me:3235: result: $ac_ct_LD" >&5
3236 echo "${ECHO_T}$ac_ct_LD" >&6
3237 else
3238   echo "$as_me:3238: result: no" >&5
3239 echo "${ECHO_T}no" >&6
3240 fi
3241
3242   LD=$ac_ct_LD
3243 else
3244   LD="$ac_cv_prog_LD"
3245 fi
3246
3247 if test -n "$ac_tool_prefix"; then
3248   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3249 set dummy ${ac_tool_prefix}ar; ac_word=$2
3250 echo "$as_me:3250: checking for $ac_word" >&5
3251 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3252 if test "${ac_cv_prog_AR+set}" = set; then
3253   echo $ECHO_N "(cached) $ECHO_C" >&6
3254 else
3255   if test -n "$AR"; then
3256   ac_cv_prog_AR="$AR" # Let the user override the test.
3257 else
3258   ac_save_IFS=$IFS; IFS=$ac_path_separator
3259 ac_dummy="$PATH"
3260 for ac_dir in $ac_dummy; do
3261   IFS=$ac_save_IFS
3262   test -z "$ac_dir" && ac_dir=.
3263   $as_executable_p "$ac_dir/$ac_word" || continue
3264 ac_cv_prog_AR="${ac_tool_prefix}ar"
3265 echo "$as_me:3265: found $ac_dir/$ac_word" >&5
3266 break
3267 done
3268
3269 fi
3270 fi
3271 AR=$ac_cv_prog_AR
3272 if test -n "$AR"; then
3273   echo "$as_me:3273: result: $AR" >&5
3274 echo "${ECHO_T}$AR" >&6
3275 else
3276   echo "$as_me:3276: result: no" >&5
3277 echo "${ECHO_T}no" >&6
3278 fi
3279
3280 fi
3281 if test -z "$ac_cv_prog_AR"; then
3282   ac_ct_AR=$AR
3283   # Extract the first word of "ar", so it can be a program name with args.
3284 set dummy ar; ac_word=$2
3285 echo "$as_me:3285: checking for $ac_word" >&5
3286 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3287 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3288   echo $ECHO_N "(cached) $ECHO_C" >&6
3289 else
3290   if test -n "$ac_ct_AR"; then
3291   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3292 else
3293   ac_save_IFS=$IFS; IFS=$ac_path_separator
3294 ac_dummy="$PATH"
3295 for ac_dir in $ac_dummy; do
3296   IFS=$ac_save_IFS
3297   test -z "$ac_dir" && ac_dir=.
3298   $as_executable_p "$ac_dir/$ac_word" || continue
3299 ac_cv_prog_ac_ct_AR="ar"
3300 echo "$as_me:3300: found $ac_dir/$ac_word" >&5
3301 break
3302 done
3303
3304   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3305 fi
3306 fi
3307 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3308 if test -n "$ac_ct_AR"; then
3309   echo "$as_me:3309: result: $ac_ct_AR" >&5
3310 echo "${ECHO_T}$ac_ct_AR" >&6
3311 else
3312   echo "$as_me:3312: result: no" >&5
3313 echo "${ECHO_T}no" >&6
3314 fi
3315
3316   AR=$ac_ct_AR
3317 else
3318   AR="$ac_cv_prog_AR"
3319 fi
3320
3321 if test -n "$ac_tool_prefix"; then
3322   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3323 set dummy ${ac_tool_prefix}ar; ac_word=$2
3324 echo "$as_me:3324: checking for $ac_word" >&5
3325 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3326 if test "${ac_cv_prog_AR+set}" = set; then
3327   echo $ECHO_N "(cached) $ECHO_C" >&6
3328 else
3329   if test -n "$AR"; then
3330   ac_cv_prog_AR="$AR" # Let the user override the test.
3331 else
3332   ac_save_IFS=$IFS; IFS=$ac_path_separator
3333 ac_dummy="$PATH"
3334 for ac_dir in $ac_dummy; do
3335   IFS=$ac_save_IFS
3336   test -z "$ac_dir" && ac_dir=.
3337   $as_executable_p "$ac_dir/$ac_word" || continue
3338 ac_cv_prog_AR="${ac_tool_prefix}ar"
3339 echo "$as_me:3339: found $ac_dir/$ac_word" >&5
3340 break
3341 done
3342
3343 fi
3344 fi
3345 AR=$ac_cv_prog_AR
3346 if test -n "$AR"; then
3347   echo "$as_me:3347: result: $AR" >&5
3348 echo "${ECHO_T}$AR" >&6
3349 else
3350   echo "$as_me:3350: result: no" >&5
3351 echo "${ECHO_T}no" >&6
3352 fi
3353
3354 fi
3355 if test -z "$ac_cv_prog_AR"; then
3356   ac_ct_AR=$AR
3357   # Extract the first word of "ar", so it can be a program name with args.
3358 set dummy ar; ac_word=$2
3359 echo "$as_me:3359: checking for $ac_word" >&5
3360 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3361 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3362   echo $ECHO_N "(cached) $ECHO_C" >&6
3363 else
3364   if test -n "$ac_ct_AR"; then
3365   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3366 else
3367   ac_save_IFS=$IFS; IFS=$ac_path_separator
3368 ac_dummy="$PATH"
3369 for ac_dir in $ac_dummy; do
3370   IFS=$ac_save_IFS
3371   test -z "$ac_dir" && ac_dir=.
3372   $as_executable_p "$ac_dir/$ac_word" || continue
3373 ac_cv_prog_ac_ct_AR="ar"
3374 echo "$as_me:3374: found $ac_dir/$ac_word" >&5
3375 break
3376 done
3377
3378   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3379 fi
3380 fi
3381 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3382 if test -n "$ac_ct_AR"; then
3383   echo "$as_me:3383: result: $ac_ct_AR" >&5
3384 echo "${ECHO_T}$ac_ct_AR" >&6
3385 else
3386   echo "$as_me:3386: result: no" >&5
3387 echo "${ECHO_T}no" >&6
3388 fi
3389
3390   AR=$ac_ct_AR
3391 else
3392   AR="$ac_cv_prog_AR"
3393 fi
3394
3395 echo "$as_me:3395: checking for options to update archives" >&5
3396 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3397 if test "${cf_cv_ar_flags+set}" = set; then
3398   echo $ECHO_N "(cached) $ECHO_C" >&6
3399 else
3400
3401         cf_cv_ar_flags=unknown
3402         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3403         do
3404
3405                 # check if $ARFLAGS already contains this choice
3406                 if test "x$ARFLAGS" != "x" ; then
3407                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3408                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3409                                 cf_cv_ar_flags=
3410                                 break
3411                         fi
3412                 fi
3413
3414                 rm -f conftest.$ac_cv_objext
3415                 rm -f conftest.a
3416
3417                 cat >conftest.$ac_ext <<EOF
3418 #line 3418 "configure"
3419 int     testdata[3] = { 123, 456, 789 };
3420 EOF
3421                 if { (eval echo "$as_me:3421: \"$ac_compile\"") >&5
3422   (eval $ac_compile) 2>&5
3423   ac_status=$?
3424   echo "$as_me:3424: \$? = $ac_status" >&5
3425   (exit $ac_status); } ; then
3426                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3427                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3428                         if test -f conftest.a ; then
3429                                 cf_cv_ar_flags=$cf_ar_flags
3430                                 break
3431                         fi
3432                 else
3433                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3434
3435 echo "${as_me:-configure}:3435: testing cannot compile test-program ..." 1>&5
3436
3437                         break
3438                 fi
3439         done
3440         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3441
3442 fi
3443 echo "$as_me:3443: result: $cf_cv_ar_flags" >&5
3444 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3445
3446 if test -n "$ARFLAGS" ; then
3447         if test -n "$cf_cv_ar_flags" ; then
3448                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3449         fi
3450 else
3451         ARFLAGS=$cf_cv_ar_flags
3452 fi
3453
3454 echo "$as_me:3454: checking if you have specified an install-prefix" >&5
3455 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3456
3457 # Check whether --with-install-prefix or --without-install-prefix was given.
3458 if test "${with_install_prefix+set}" = set; then
3459   withval="$with_install_prefix"
3460   case "$withval" in #(vi
3461         yes|no) #(vi
3462                 ;;
3463         *)      DESTDIR="$withval"
3464                 ;;
3465         esac
3466 fi;
3467 echo "$as_me:3467: result: $DESTDIR" >&5
3468 echo "${ECHO_T}$DESTDIR" >&6
3469
3470 ###############################################################################
3471
3472 # If we're cross-compiling, allow the user to override the tools and their
3473 # options.  The configure script is oriented toward identifying the host
3474 # compiler, etc., but we need a build compiler to generate parts of the source.
3475
3476 if test "$cross_compiling" = yes ; then
3477
3478         # defaults that we might want to override
3479         : ${BUILD_CFLAGS:=''}
3480         : ${BUILD_CPPFLAGS:=''}
3481         : ${BUILD_LDFLAGS:=''}
3482         : ${BUILD_LIBS:=''}
3483         : ${BUILD_EXEEXT:='$x'}
3484         : ${BUILD_OBJEXT:='o'}
3485
3486 # Check whether --with-build-cc or --without-build-cc was given.
3487 if test "${with_build_cc+set}" = set; then
3488   withval="$with_build_cc"
3489   BUILD_CC="$withval"
3490 else
3491   for ac_prog in gcc cc cl
3492 do
3493   # Extract the first word of "$ac_prog", so it can be a program name with args.
3494 set dummy $ac_prog; ac_word=$2
3495 echo "$as_me:3495: checking for $ac_word" >&5
3496 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3497 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3498   echo $ECHO_N "(cached) $ECHO_C" >&6
3499 else
3500   if test -n "$BUILD_CC"; then
3501   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3502 else
3503   ac_save_IFS=$IFS; IFS=$ac_path_separator
3504 ac_dummy="$PATH"
3505 for ac_dir in $ac_dummy; do
3506   IFS=$ac_save_IFS
3507   test -z "$ac_dir" && ac_dir=.
3508   $as_executable_p "$ac_dir/$ac_word" || continue
3509 ac_cv_prog_BUILD_CC="$ac_prog"
3510 echo "$as_me:3510: found $ac_dir/$ac_word" >&5
3511 break
3512 done
3513
3514 fi
3515 fi
3516 BUILD_CC=$ac_cv_prog_BUILD_CC
3517 if test -n "$BUILD_CC"; then
3518   echo "$as_me:3518: result: $BUILD_CC" >&5
3519 echo "${ECHO_T}$BUILD_CC" >&6
3520 else
3521   echo "$as_me:3521: result: no" >&5
3522 echo "${ECHO_T}no" >&6
3523 fi
3524
3525   test -n "$BUILD_CC" && break
3526 done
3527
3528 fi;
3529         echo "$as_me:3529: checking for native build C compiler" >&5
3530 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3531         echo "$as_me:3531: result: $BUILD_CC" >&5
3532 echo "${ECHO_T}$BUILD_CC" >&6
3533
3534         echo "$as_me:3534: checking for native build C preprocessor" >&5
3535 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3536
3537 # Check whether --with-build-cpp or --without-build-cpp was given.
3538 if test "${with_build_cpp+set}" = set; then
3539   withval="$with_build_cpp"
3540   BUILD_CPP="$withval"
3541 else
3542   BUILD_CPP='${BUILD_CC} -E'
3543 fi;
3544         echo "$as_me:3544: result: $BUILD_CPP" >&5
3545 echo "${ECHO_T}$BUILD_CPP" >&6
3546
3547         echo "$as_me:3547: checking for native build C flags" >&5
3548 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3549
3550 # Check whether --with-build-cflags or --without-build-cflags was given.
3551 if test "${with_build_cflags+set}" = set; then
3552   withval="$with_build_cflags"
3553   BUILD_CFLAGS="$withval"
3554 fi;
3555         echo "$as_me:3555: result: $BUILD_CFLAGS" >&5
3556 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3557
3558         echo "$as_me:3558: checking for native build C preprocessor-flags" >&5
3559 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3560
3561 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3562 if test "${with_build_cppflags+set}" = set; then
3563   withval="$with_build_cppflags"
3564   BUILD_CPPFLAGS="$withval"
3565 fi;
3566         echo "$as_me:3566: result: $BUILD_CPPFLAGS" >&5
3567 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3568
3569         echo "$as_me:3569: checking for native build linker-flags" >&5
3570 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3571
3572 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3573 if test "${with_build_ldflags+set}" = set; then
3574   withval="$with_build_ldflags"
3575   BUILD_LDFLAGS="$withval"
3576 fi;
3577         echo "$as_me:3577: result: $BUILD_LDFLAGS" >&5
3578 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3579
3580         echo "$as_me:3580: checking for native build linker-libraries" >&5
3581 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3582
3583 # Check whether --with-build-libs or --without-build-libs was given.
3584 if test "${with_build_libs+set}" = set; then
3585   withval="$with_build_libs"
3586   BUILD_LIBS="$withval"
3587 fi;
3588         echo "$as_me:3588: result: $BUILD_LIBS" >&5
3589 echo "${ECHO_T}$BUILD_LIBS" >&6
3590
3591         # this assumes we're on Unix.
3592         BUILD_EXEEXT=
3593         BUILD_OBJEXT=o
3594
3595         : ${BUILD_CC:='${CC}'}
3596
3597         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3598                 { { echo "$as_me:3598: error: Cross-build requires two compilers.
3599 Use --with-build-cc to specify the native compiler." >&5
3600 echo "$as_me: error: Cross-build requires two compilers.
3601 Use --with-build-cc to specify the native compiler." >&2;}
3602    { (exit 1); exit 1; }; }
3603         fi
3604
3605 else
3606         : ${BUILD_CC:='${CC}'}
3607         : ${BUILD_CPP:='${CPP}'}
3608         : ${BUILD_CFLAGS:='${CFLAGS}'}
3609         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3610         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3611         : ${BUILD_LIBS:='${LIBS}'}
3612         : ${BUILD_EXEEXT:='$x'}
3613         : ${BUILD_OBJEXT:='o'}
3614 fi
3615
3616 ###############################################################################
3617
3618 ### Options to allow the user to specify the set of libraries which are used.
3619 ### Use "--without-normal --with-shared" to allow the default model to be
3620 ### shared, for example.
3621 cf_list_models=""
3622
3623 echo "$as_me:3623: checking if you want to build shared C-objects" >&5
3624 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3625
3626 # Check whether --with-shared or --without-shared was given.
3627 if test "${with_shared+set}" = set; then
3628   withval="$with_shared"
3629   with_shared=$withval
3630 else
3631   with_shared=no
3632 fi;
3633 echo "$as_me:3633: result: $with_shared" >&5
3634 echo "${ECHO_T}$with_shared" >&6
3635 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3636
3637 echo "$as_me:3637: checking for specified models" >&5
3638 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3639 test -z "$cf_list_models" && cf_list_models=normal
3640 echo "$as_me:3640: result: $cf_list_models" >&5
3641 echo "${ECHO_T}$cf_list_models" >&6
3642
3643 ### Use the first model as the default, and save its suffix for use in building
3644 ### up test-applications.
3645 echo "$as_me:3645: checking for default model" >&5
3646 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3647 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3648 echo "$as_me:3648: result: $DFT_LWR_MODEL" >&5
3649 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3650
3651 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3652
3653 echo "$as_me:3653: checking for specific curses-directory" >&5
3654 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3655
3656 # Check whether --with-curses-dir or --without-curses-dir was given.
3657 if test "${with_curses_dir+set}" = set; then
3658   withval="$with_curses_dir"
3659   cf_cv_curses_dir=$withval
3660 else
3661   cf_cv_curses_dir=no
3662 fi;
3663 echo "$as_me:3663: result: $cf_cv_curses_dir" >&5
3664 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3665
3666 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3667 then
3668
3669 if test "x$prefix" != xNONE; then
3670   cf_path_syntax="$prefix"
3671 else
3672   cf_path_syntax="$ac_default_prefix"
3673 fi
3674
3675 case ".$withval" in #(vi
3676 .\$\(*\)*|.\'*\'*) #(vi
3677   ;;
3678 ..|./*|.\\*) #(vi
3679   ;;
3680 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
3681   ;;
3682 .\${*prefix}*) #(vi
3683   eval withval="$withval"
3684   case ".$withval" in #(vi
3685   .NONE/*)
3686     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3687     ;;
3688   esac
3689   ;; #(vi
3690 .no|.NONE/*)
3691   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3692   ;;
3693 *)
3694   { { echo "$as_me:3694: error: expected a pathname, not \"$withval\"" >&5
3695 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3696    { (exit 1); exit 1; }; }
3697   ;;
3698 esac
3699
3700         if test -d "$cf_cv_curses_dir"
3701         then
3702
3703 if test -n "$cf_cv_curses_dir/include" ; then
3704   for cf_add_incdir in $cf_cv_curses_dir/include
3705   do
3706         while test $cf_add_incdir != /usr/include
3707         do
3708           if test -d $cf_add_incdir
3709           then
3710                 cf_have_incdir=no
3711                 if test -n "$CFLAGS$CPPFLAGS" ; then
3712                   # a loop is needed to ensure we can add subdirs of existing dirs
3713                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3714                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3715                           cf_have_incdir=yes; break
3716                         fi
3717                   done
3718                 fi
3719
3720                 if test "$cf_have_incdir" = no ; then
3721                   if test "$cf_add_incdir" = /usr/local/include ; then
3722                         if test "$GCC" = yes
3723                         then
3724                           cf_save_CPPFLAGS=$CPPFLAGS
3725                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3726                           cat >conftest.$ac_ext <<_ACEOF
3727 #line 3727 "configure"
3728 #include "confdefs.h"
3729 #include <stdio.h>
3730 int
3731 main ()
3732 {
3733 printf("Hello")
3734   ;
3735   return 0;
3736 }
3737 _ACEOF
3738 rm -f conftest.$ac_objext
3739 if { (eval echo "$as_me:3739: \"$ac_compile\"") >&5
3740   (eval $ac_compile) 2>&5
3741   ac_status=$?
3742   echo "$as_me:3742: \$? = $ac_status" >&5
3743   (exit $ac_status); } &&
3744          { ac_try='test -s conftest.$ac_objext'
3745   { (eval echo "$as_me:3745: \"$ac_try\"") >&5
3746   (eval $ac_try) 2>&5
3747   ac_status=$?
3748   echo "$as_me:3748: \$? = $ac_status" >&5
3749   (exit $ac_status); }; }; then
3750   :
3751 else
3752   echo "$as_me: failed program was:" >&5
3753 cat conftest.$ac_ext >&5
3754 cf_have_incdir=yes
3755 fi
3756 rm -f conftest.$ac_objext conftest.$ac_ext
3757                           CPPFLAGS=$cf_save_CPPFLAGS
3758                         fi
3759                   fi
3760                 fi
3761
3762                 if test "$cf_have_incdir" = no ; then
3763                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3764
3765 echo "${as_me:-configure}:3765: testing adding $cf_add_incdir to include-path ..." 1>&5
3766
3767                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3768
3769                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3770                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3771                   cf_add_incdir="$cf_top_incdir"
3772                 else
3773                   break
3774                 fi
3775           fi
3776         done
3777   done
3778 fi
3779
3780 if test -n "$cf_cv_curses_dir/lib" ; then
3781   for cf_add_libdir in $cf_cv_curses_dir/lib
3782   do
3783     if test $cf_add_libdir = /usr/lib ; then
3784       :
3785     elif test -d $cf_add_libdir
3786     then
3787       cf_have_libdir=no
3788       if test -n "$LDFLAGS$LIBS" ; then
3789         # a loop is needed to ensure we can add subdirs of existing dirs
3790         for cf_test_libdir in $LDFLAGS $LIBS ; do
3791           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3792             cf_have_libdir=yes; break
3793           fi
3794         done
3795       fi
3796       if test "$cf_have_libdir" = no ; then
3797         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3798
3799 echo "${as_me:-configure}:3799: testing adding $cf_add_libdir to library-path ..." 1>&5
3800
3801         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3802       fi
3803     fi
3804   done
3805 fi
3806
3807         fi
3808 fi
3809
3810 echo "$as_me:3810: checking if you want wide-character code" >&5
3811 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3812
3813 # Check whether --enable-widec or --disable-widec was given.
3814 if test "${enable_widec+set}" = set; then
3815   enableval="$enable_widec"
3816   with_widec=$enableval
3817 else
3818   with_widec=no
3819 fi;
3820 echo "$as_me:3820: result: $with_widec" >&5
3821 echo "${ECHO_T}$with_widec" >&6
3822 if test "$with_widec" = yes ; then
3823
3824 echo "$as_me:3824: checking for multibyte character support" >&5
3825 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3826 if test "${cf_cv_utf8_lib+set}" = set; then
3827   echo $ECHO_N "(cached) $ECHO_C" >&6
3828 else
3829
3830         cf_save_LIBS="$LIBS"
3831         cat >conftest.$ac_ext <<_ACEOF
3832 #line 3832 "configure"
3833 #include "confdefs.h"
3834
3835 #include <stdlib.h>
3836 int
3837 main ()
3838 {
3839 putwc(0,0);
3840   ;
3841   return 0;
3842 }
3843 _ACEOF
3844 rm -f conftest.$ac_objext conftest$ac_exeext
3845 if { (eval echo "$as_me:3845: \"$ac_link\"") >&5
3846   (eval $ac_link) 2>&5
3847   ac_status=$?
3848   echo "$as_me:3848: \$? = $ac_status" >&5
3849   (exit $ac_status); } &&
3850          { ac_try='test -s conftest$ac_exeext'
3851   { (eval echo "$as_me:3851: \"$ac_try\"") >&5
3852   (eval $ac_try) 2>&5
3853   ac_status=$?
3854   echo "$as_me:3854: \$? = $ac_status" >&5
3855   (exit $ac_status); }; }; then
3856   cf_cv_utf8_lib=yes
3857 else
3858   echo "$as_me: failed program was:" >&5
3859 cat conftest.$ac_ext >&5
3860
3861 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3862 # will be set on completion of the AC_TRY_LINK below.
3863 cf_cv_header_path_utf8=
3864 cf_cv_library_path_utf8=
3865
3866 echo "${as_me:-configure}:3866: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3867
3868 cf_save_LIBS="$LIBS"
3869
3870 cat >conftest.$ac_ext <<_ACEOF
3871 #line 3871 "configure"
3872 #include "confdefs.h"
3873
3874 #include <libutf8.h>
3875 int
3876 main ()
3877 {
3878 putwc(0,0);
3879   ;
3880   return 0;
3881 }
3882 _ACEOF
3883 rm -f conftest.$ac_objext conftest$ac_exeext
3884 if { (eval echo "$as_me:3884: \"$ac_link\"") >&5
3885   (eval $ac_link) 2>&5
3886   ac_status=$?
3887   echo "$as_me:3887: \$? = $ac_status" >&5
3888   (exit $ac_status); } &&
3889          { ac_try='test -s conftest$ac_exeext'
3890   { (eval echo "$as_me:3890: \"$ac_try\"") >&5
3891   (eval $ac_try) 2>&5
3892   ac_status=$?
3893   echo "$as_me:3893: \$? = $ac_status" >&5
3894   (exit $ac_status); }; }; then
3895
3896         cf_cv_find_linkage_utf8=yes
3897         cf_cv_header_path_utf8=/usr/include
3898         cf_cv_library_path_utf8=/usr/lib
3899
3900 else
3901   echo "$as_me: failed program was:" >&5
3902 cat conftest.$ac_ext >&5
3903
3904 LIBS="-lutf8  $cf_save_LIBS"
3905
3906 cat >conftest.$ac_ext <<_ACEOF
3907 #line 3907 "configure"
3908 #include "confdefs.h"
3909
3910 #include <libutf8.h>
3911 int
3912 main ()
3913 {
3914 putwc(0,0);
3915   ;
3916   return 0;
3917 }
3918 _ACEOF
3919 rm -f conftest.$ac_objext conftest$ac_exeext
3920 if { (eval echo "$as_me:3920: \"$ac_link\"") >&5
3921   (eval $ac_link) 2>&5
3922   ac_status=$?
3923   echo "$as_me:3923: \$? = $ac_status" >&5
3924   (exit $ac_status); } &&
3925          { ac_try='test -s conftest$ac_exeext'
3926   { (eval echo "$as_me:3926: \"$ac_try\"") >&5
3927   (eval $ac_try) 2>&5
3928   ac_status=$?
3929   echo "$as_me:3929: \$? = $ac_status" >&5
3930   (exit $ac_status); }; }; then
3931
3932         cf_cv_find_linkage_utf8=yes
3933         cf_cv_header_path_utf8=/usr/include
3934         cf_cv_library_path_utf8=/usr/lib
3935         cf_cv_library_file_utf8="-lutf8"
3936
3937 else
3938   echo "$as_me: failed program was:" >&5
3939 cat conftest.$ac_ext >&5
3940
3941         cf_cv_find_linkage_utf8=no
3942         LIBS="$cf_save_LIBS"
3943
3944     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
3945
3946 echo "${as_me:-configure}:3946: testing find linkage for utf8 library ..." 1>&5
3947
3948 echo "${as_me:-configure}:3948: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3949
3950     cf_save_CPPFLAGS="$CPPFLAGS"
3951     cf_test_CPPFLAGS="$CPPFLAGS"
3952
3953 cf_search=
3954
3955 # collect the current set of include-directories from compiler flags
3956 cf_header_path_list=""
3957 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3958         for cf_header_path in $CPPFLAGS $CFLAGS
3959         do
3960                 case $cf_header_path in #(vi
3961                 -I*)
3962                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3963
3964 test "$cf_header_path" != "NONE" && \
3965 test -d "$cf_header_path" && \
3966  {
3967         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3968         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3969         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
3970         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
3971         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
3972         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
3973 }
3974
3975                         cf_header_path_list="$cf_header_path_list $cf_search"
3976                         ;;
3977                 esac
3978         done
3979 fi
3980
3981 # add the variations for the package we are looking for
3982
3983 cf_search=
3984
3985 test "/usr" != "$prefix" && \
3986 test -d "/usr" && \
3987 (test $prefix = NONE || test "/usr" != "$prefix") && {
3988         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
3989         test -d /usr/include &&          cf_search="$cf_search /usr/include"
3990         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
3991         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
3992         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
3993         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
3994 }
3995
3996 test "$prefix" != "NONE" && \
3997 test -d "$prefix" && \
3998  {
3999         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4000         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4001         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
4002         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
4003         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
4004         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
4005 }
4006
4007 test "/usr/local" != "$prefix" && \
4008 test -d "/usr/local" && \
4009 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4010         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4011         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4012         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
4013         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
4014         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
4015         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
4016 }
4017
4018 test "/opt" != "$prefix" && \
4019 test -d "/opt" && \
4020 (test $prefix = NONE || test "/opt" != "$prefix") && {
4021         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4022         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4023         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
4024         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
4025         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
4026         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
4027 }
4028
4029 test "$HOME" != "$prefix" && \
4030 test -d "$HOME" && \
4031 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4032         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4033         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4034         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
4035         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
4036         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
4037         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
4038 }
4039
4040 test "$includedir" != NONE && \
4041 test "$includedir" != "/usr/include" && \
4042 test -d "$includedir" && {
4043         test -d $includedir &&    cf_search="$cf_search $includedir"
4044         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
4045 }
4046
4047 test "$oldincludedir" != NONE && \
4048 test "$oldincludedir" != "/usr/include" && \
4049 test -d "$oldincludedir" && {
4050         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4051         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
4052 }
4053
4054 cf_search="$cf_search $cf_header_path_list"
4055
4056     for cf_cv_header_path_utf8 in $cf_search
4057     do
4058       if test -d $cf_cv_header_path_utf8 ; then
4059         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
4060
4061 echo "${as_me:-configure}:4061: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
4062
4063         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
4064         cat >conftest.$ac_ext <<_ACEOF
4065 #line 4065 "configure"
4066 #include "confdefs.h"
4067
4068 #include <libutf8.h>
4069 int
4070 main ()
4071 {
4072 putwc(0,0);
4073   ;
4074   return 0;
4075 }
4076 _ACEOF
4077 rm -f conftest.$ac_objext
4078 if { (eval echo "$as_me:4078: \"$ac_compile\"") >&5
4079   (eval $ac_compile) 2>&5
4080   ac_status=$?
4081   echo "$as_me:4081: \$? = $ac_status" >&5
4082   (exit $ac_status); } &&
4083          { ac_try='test -s conftest.$ac_objext'
4084   { (eval echo "$as_me:4084: \"$ac_try\"") >&5
4085   (eval $ac_try) 2>&5
4086   ac_status=$?
4087   echo "$as_me:4087: \$? = $ac_status" >&5
4088   (exit $ac_status); }; }; then
4089
4090             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
4091
4092 echo "${as_me:-configure}:4092: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
4093
4094             cf_cv_find_linkage_utf8=maybe
4095             cf_test_CPPFLAGS="$CPPFLAGS"
4096             break
4097 else
4098   echo "$as_me: failed program was:" >&5
4099 cat conftest.$ac_ext >&5
4100
4101             CPPFLAGS="$cf_save_CPPFLAGS"
4102
4103 fi
4104 rm -f conftest.$ac_objext conftest.$ac_ext
4105       fi
4106     done
4107
4108     if test "$cf_cv_find_linkage_utf8" = maybe ; then
4109
4110 echo "${as_me:-configure}:4110: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
4111
4112       cf_save_LIBS="$LIBS"
4113       cf_save_LDFLAGS="$LDFLAGS"
4114
4115       if test "$cf_cv_find_linkage_utf8" != yes ; then
4116
4117 cf_search=
4118 cf_library_path_list=""
4119 if test -n "${LDFLAGS}${LIBS}" ; then
4120         for cf_library_path in $LDFLAGS $LIBS
4121         do
4122                 case $cf_library_path in #(vi
4123                 -L*)
4124                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
4125
4126 test "$cf_library_path" != "NONE" && \
4127 test -d "$cf_library_path" && \
4128  {
4129         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
4130         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
4131         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
4132         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
4133         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
4134         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
4135 }
4136
4137                         cf_library_path_list="$cf_library_path_list $cf_search"
4138                         ;;
4139                 esac
4140         done
4141 fi
4142
4143 cf_search=
4144
4145 test "/usr" != "$prefix" && \
4146 test -d "/usr" && \
4147 (test $prefix = NONE || test "/usr" != "$prefix") && {
4148         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
4149         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
4150         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
4151         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
4152         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
4153         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
4154 }
4155
4156 test "$prefix" != "NONE" && \
4157 test -d "$prefix" && \
4158  {
4159         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
4160         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4161         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
4162         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
4163         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
4164         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
4165 }
4166
4167 test "/usr/local" != "$prefix" && \
4168 test -d "/usr/local" && \
4169 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4170         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
4171         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
4172         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
4173         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
4174         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
4175         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
4176 }
4177
4178 test "/opt" != "$prefix" && \
4179 test -d "/opt" && \
4180 (test $prefix = NONE || test "/opt" != "$prefix") && {
4181         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
4182         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
4183         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
4184         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
4185         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
4186         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
4187 }
4188
4189 test "$HOME" != "$prefix" && \
4190 test -d "$HOME" && \
4191 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4192         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
4193         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
4194         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
4195         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
4196         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
4197         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
4198 }
4199
4200 cf_search="$cf_library_path_list $cf_search"
4201
4202         for cf_cv_library_path_utf8 in $cf_search
4203         do
4204           if test -d $cf_cv_library_path_utf8 ; then
4205             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
4206
4207 echo "${as_me:-configure}:4207: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
4208
4209             CPPFLAGS="$cf_test_CPPFLAGS"
4210             LIBS="-lutf8  $cf_save_LIBS"
4211             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
4212             cat >conftest.$ac_ext <<_ACEOF
4213 #line 4213 "configure"
4214 #include "confdefs.h"
4215
4216 #include <libutf8.h>
4217 int
4218 main ()
4219 {
4220 putwc(0,0);
4221   ;
4222   return 0;
4223 }
4224 _ACEOF
4225 rm -f conftest.$ac_objext conftest$ac_exeext
4226 if { (eval echo "$as_me:4226: \"$ac_link\"") >&5
4227   (eval $ac_link) 2>&5
4228   ac_status=$?
4229   echo "$as_me:4229: \$? = $ac_status" >&5
4230   (exit $ac_status); } &&
4231          { ac_try='test -s conftest$ac_exeext'
4232   { (eval echo "$as_me:4232: \"$ac_try\"") >&5
4233   (eval $ac_try) 2>&5
4234   ac_status=$?
4235   echo "$as_me:4235: \$? = $ac_status" >&5
4236   (exit $ac_status); }; }; then
4237
4238                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4239
4240 echo "${as_me:-configure}:4240: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4241
4242                 cf_cv_find_linkage_utf8=yes
4243                 cf_cv_library_file_utf8="-lutf8"
4244                 break
4245 else
4246   echo "$as_me: failed program was:" >&5
4247 cat conftest.$ac_ext >&5
4248
4249                 CPPFLAGS="$cf_save_CPPFLAGS"
4250                 LIBS="$cf_save_LIBS"
4251                 LDFLAGS="$cf_save_LDFLAGS"
4252
4253 fi
4254 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4255           fi
4256         done
4257         CPPFLAGS="$cf_save_CPPFLAGS"
4258         LDFLAGS="$cf_save_LDFLAGS"
4259       fi
4260
4261     else
4262       cf_cv_find_linkage_utf8=no
4263     fi
4264
4265 fi
4266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4267
4268 fi
4269 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4270
4271 LIBS="$cf_save_LIBS"
4272
4273 if test "$cf_cv_find_linkage_utf8" = yes ; then
4274 cf_cv_utf8_lib=add-on
4275 else
4276 cf_cv_utf8_lib=no
4277 fi
4278
4279 fi
4280 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4281 fi
4282 echo "$as_me:4282: result: $cf_cv_utf8_lib" >&5
4283 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4284
4285 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4286 # ncurses/ncursesw:
4287 if test "$cf_cv_utf8_lib" = "add-on" ; then
4288         cat >>confdefs.h <<\EOF
4289 #define HAVE_LIBUTF8_H 1
4290 EOF
4291
4292 if test -n "$cf_cv_header_path_utf8" ; then
4293   for cf_add_incdir in $cf_cv_header_path_utf8
4294   do
4295         while test $cf_add_incdir != /usr/include
4296         do
4297           if test -d $cf_add_incdir
4298           then
4299                 cf_have_incdir=no
4300                 if test -n "$CFLAGS$CPPFLAGS" ; then
4301                   # a loop is needed to ensure we can add subdirs of existing dirs
4302                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4303                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4304                           cf_have_incdir=yes; break
4305                         fi
4306                   done
4307                 fi
4308
4309                 if test "$cf_have_incdir" = no ; then
4310                   if test "$cf_add_incdir" = /usr/local/include ; then
4311                         if test "$GCC" = yes
4312                         then
4313                           cf_save_CPPFLAGS=$CPPFLAGS
4314                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4315                           cat >conftest.$ac_ext <<_ACEOF
4316 #line 4316 "configure"
4317 #include "confdefs.h"
4318 #include <stdio.h>
4319 int
4320 main ()
4321 {
4322 printf("Hello")
4323   ;
4324   return 0;
4325 }
4326 _ACEOF
4327 rm -f conftest.$ac_objext
4328 if { (eval echo "$as_me:4328: \"$ac_compile\"") >&5
4329   (eval $ac_compile) 2>&5
4330   ac_status=$?
4331   echo "$as_me:4331: \$? = $ac_status" >&5
4332   (exit $ac_status); } &&
4333          { ac_try='test -s conftest.$ac_objext'
4334   { (eval echo "$as_me:4334: \"$ac_try\"") >&5
4335   (eval $ac_try) 2>&5
4336   ac_status=$?
4337   echo "$as_me:4337: \$? = $ac_status" >&5
4338   (exit $ac_status); }; }; then
4339   :
4340 else
4341   echo "$as_me: failed program was:" >&5
4342 cat conftest.$ac_ext >&5
4343 cf_have_incdir=yes
4344 fi
4345 rm -f conftest.$ac_objext conftest.$ac_ext
4346                           CPPFLAGS=$cf_save_CPPFLAGS
4347                         fi
4348                   fi
4349                 fi
4350
4351                 if test "$cf_have_incdir" = no ; then
4352                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4353
4354 echo "${as_me:-configure}:4354: testing adding $cf_add_incdir to include-path ..." 1>&5
4355
4356                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4357
4358                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4359                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4360                   cf_add_incdir="$cf_top_incdir"
4361                 else
4362                   break
4363                 fi
4364           fi
4365         done
4366   done
4367 fi
4368
4369 if test -n "$cf_cv_library_path_utf8" ; then
4370   for cf_add_libdir in $cf_cv_library_path_utf8
4371   do
4372     if test $cf_add_libdir = /usr/lib ; then
4373       :
4374     elif test -d $cf_add_libdir
4375     then
4376       cf_have_libdir=no
4377       if test -n "$LDFLAGS$LIBS" ; then
4378         # a loop is needed to ensure we can add subdirs of existing dirs
4379         for cf_test_libdir in $LDFLAGS $LIBS ; do
4380           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4381             cf_have_libdir=yes; break
4382           fi
4383         done
4384       fi
4385       if test "$cf_have_libdir" = no ; then
4386         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4387
4388 echo "${as_me:-configure}:4388: testing adding $cf_add_libdir to library-path ..." 1>&5
4389
4390         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4391       fi
4392     fi
4393   done
4394 fi
4395
4396         LIBS="$cf_cv_library_file_utf8 $LIBS"
4397 fi
4398
4399 cf_ncuconfig_root=ncursesw
4400
4401 echo "Looking for ${cf_ncuconfig_root}-config"
4402
4403 if test -n "$ac_tool_prefix"; then
4404   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4405   do
4406     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4407 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4408 echo "$as_me:4408: checking for $ac_word" >&5
4409 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4410 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4411   echo $ECHO_N "(cached) $ECHO_C" >&6
4412 else
4413   if test -n "$NCURSES_CONFIG"; then
4414   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4415 else
4416   ac_save_IFS=$IFS; IFS=$ac_path_separator
4417 ac_dummy="$PATH"
4418 for ac_dir in $ac_dummy; do
4419   IFS=$ac_save_IFS
4420   test -z "$ac_dir" && ac_dir=.
4421   $as_executable_p "$ac_dir/$ac_word" || continue
4422 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4423 echo "$as_me:4423: found $ac_dir/$ac_word" >&5
4424 break
4425 done
4426
4427 fi
4428 fi
4429 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4430 if test -n "$NCURSES_CONFIG"; then
4431   echo "$as_me:4431: result: $NCURSES_CONFIG" >&5
4432 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4433 else
4434   echo "$as_me:4434: result: no" >&5
4435 echo "${ECHO_T}no" >&6
4436 fi
4437
4438     test -n "$NCURSES_CONFIG" && break
4439   done
4440 fi
4441 if test -z "$NCURSES_CONFIG"; then
4442   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4443   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4444 do
4445   # Extract the first word of "$ac_prog", so it can be a program name with args.
4446 set dummy $ac_prog; ac_word=$2
4447 echo "$as_me:4447: checking for $ac_word" >&5
4448 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4449 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4450   echo $ECHO_N "(cached) $ECHO_C" >&6
4451 else
4452   if test -n "$ac_ct_NCURSES_CONFIG"; then
4453   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4454 else
4455   ac_save_IFS=$IFS; IFS=$ac_path_separator
4456 ac_dummy="$PATH"
4457 for ac_dir in $ac_dummy; do
4458   IFS=$ac_save_IFS
4459   test -z "$ac_dir" && ac_dir=.
4460   $as_executable_p "$ac_dir/$ac_word" || continue
4461 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4462 echo "$as_me:4462: found $ac_dir/$ac_word" >&5
4463 break
4464 done
4465
4466 fi
4467 fi
4468 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4469 if test -n "$ac_ct_NCURSES_CONFIG"; then
4470   echo "$as_me:4470: result: $ac_ct_NCURSES_CONFIG" >&5
4471 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4472 else
4473   echo "$as_me:4473: result: no" >&5
4474 echo "${ECHO_T}no" >&6
4475 fi
4476
4477   test -n "$ac_ct_NCURSES_CONFIG" && break
4478 done
4479 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4480
4481   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4482 fi
4483
4484 if test "$NCURSES_CONFIG" != none ; then
4485
4486 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4487 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
4488
4489 # even with config script, some packages use no-override for curses.h
4490
4491 echo "$as_me:4491: checking if we have identified curses headers" >&5
4492 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4493 if test "${cf_cv_ncurses_header+set}" = set; then
4494   echo $ECHO_N "(cached) $ECHO_C" >&6
4495 else
4496
4497 cf_cv_ncurses_header=none
4498 for cf_header in  \
4499     ncursesw/ncurses.h \
4500         ncursesw/curses.h \
4501         ncurses.h \
4502         curses.h
4503 do
4504 cat >conftest.$ac_ext <<_ACEOF
4505 #line 4505 "configure"
4506 #include "confdefs.h"
4507 #include <${cf_header}>
4508 int
4509 main ()
4510 {
4511 initscr(); tgoto("?", 0,0)
4512   ;
4513   return 0;
4514 }
4515 _ACEOF
4516 rm -f conftest.$ac_objext
4517 if { (eval echo "$as_me:4517: \"$ac_compile\"") >&5
4518   (eval $ac_compile) 2>&5
4519   ac_status=$?
4520   echo "$as_me:4520: \$? = $ac_status" >&5
4521   (exit $ac_status); } &&
4522          { ac_try='test -s conftest.$ac_objext'
4523   { (eval echo "$as_me:4523: \"$ac_try\"") >&5
4524   (eval $ac_try) 2>&5
4525   ac_status=$?
4526   echo "$as_me:4526: \$? = $ac_status" >&5
4527   (exit $ac_status); }; }; then
4528   cf_cv_ncurses_header=$cf_header; break
4529 else
4530   echo "$as_me: failed program was:" >&5
4531 cat conftest.$ac_ext >&5
4532 fi
4533 rm -f conftest.$ac_objext conftest.$ac_ext
4534 done
4535
4536 fi
4537 echo "$as_me:4537: result: $cf_cv_ncurses_header" >&5
4538 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4539
4540 if test "$cf_cv_ncurses_header" = none ; then
4541         { { echo "$as_me:4541: error: No curses header-files found" >&5
4542 echo "$as_me: error: No curses header-files found" >&2;}
4543    { (exit 1); exit 1; }; }
4544 fi
4545
4546 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4547
4548 for ac_header in $cf_cv_ncurses_header
4549 do
4550 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4551 echo "$as_me:4551: checking for $ac_header" >&5
4552 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4553 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4554   echo $ECHO_N "(cached) $ECHO_C" >&6
4555 else
4556   cat >conftest.$ac_ext <<_ACEOF
4557 #line 4557 "configure"
4558 #include "confdefs.h"
4559 #include <$ac_header>
4560 _ACEOF
4561 if { (eval echo "$as_me:4561: \"$ac_cpp conftest.$ac_ext\"") >&5
4562   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4563   ac_status=$?
4564   egrep -v '^ *\+' conftest.er1 >conftest.err
4565   rm -f conftest.er1
4566   cat conftest.err >&5
4567   echo "$as_me:4567: \$? = $ac_status" >&5
4568   (exit $ac_status); } >/dev/null; then
4569   if test -s conftest.err; then
4570     ac_cpp_err=$ac_c_preproc_warn_flag
4571   else
4572     ac_cpp_err=
4573   fi
4574 else
4575   ac_cpp_err=yes
4576 fi
4577 if test -z "$ac_cpp_err"; then
4578   eval "$as_ac_Header=yes"
4579 else
4580   echo "$as_me: failed program was:" >&5
4581   cat conftest.$ac_ext >&5
4582   eval "$as_ac_Header=no"
4583 fi
4584 rm -f conftest.err conftest.$ac_ext
4585 fi
4586 echo "$as_me:4586: result: `eval echo '${'$as_ac_Header'}'`" >&5
4587 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4588 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4589   cat >>confdefs.h <<EOF
4590 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4591 EOF
4592
4593 fi
4594 done
4595
4596 cat >>confdefs.h <<\EOF
4597 #define NCURSES 1
4598 EOF
4599
4600 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4601
4602 cat >>confdefs.h <<EOF
4603 #define $cf_nculib_ROOT 1
4604 EOF
4605
4606 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4607
4608 else
4609
4610 cf_ncuhdr_root=ncursesw
4611
4612 test -n "$cf_cv_curses_dir" && \
4613 test "$cf_cv_curses_dir" != "no" && { \
4614
4615 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4616   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4617   do
4618         while test $cf_add_incdir != /usr/include
4619         do
4620           if test -d $cf_add_incdir
4621           then
4622                 cf_have_incdir=no
4623                 if test -n "$CFLAGS$CPPFLAGS" ; then
4624                   # a loop is needed to ensure we can add subdirs of existing dirs
4625                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4626                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4627                           cf_have_incdir=yes; break
4628                         fi
4629                   done
4630                 fi
4631
4632                 if test "$cf_have_incdir" = no ; then
4633                   if test "$cf_add_incdir" = /usr/local/include ; then
4634                         if test "$GCC" = yes
4635                         then
4636                           cf_save_CPPFLAGS=$CPPFLAGS
4637                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4638                           cat >conftest.$ac_ext <<_ACEOF
4639 #line 4639 "configure"
4640 #include "confdefs.h"
4641 #include <stdio.h>
4642 int
4643 main ()
4644 {
4645 printf("Hello")
4646   ;
4647   return 0;
4648 }
4649 _ACEOF
4650 rm -f conftest.$ac_objext
4651 if { (eval echo "$as_me:4651: \"$ac_compile\"") >&5
4652   (eval $ac_compile) 2>&5
4653   ac_status=$?
4654   echo "$as_me:4654: \$? = $ac_status" >&5
4655   (exit $ac_status); } &&
4656          { ac_try='test -s conftest.$ac_objext'
4657   { (eval echo "$as_me:4657: \"$ac_try\"") >&5
4658   (eval $ac_try) 2>&5
4659   ac_status=$?
4660   echo "$as_me:4660: \$? = $ac_status" >&5
4661   (exit $ac_status); }; }; then
4662   :
4663 else
4664   echo "$as_me: failed program was:" >&5
4665 cat conftest.$ac_ext >&5
4666 cf_have_incdir=yes
4667 fi
4668 rm -f conftest.$ac_objext conftest.$ac_ext
4669                           CPPFLAGS=$cf_save_CPPFLAGS
4670                         fi
4671                   fi
4672                 fi
4673
4674                 if test "$cf_have_incdir" = no ; then
4675                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4676
4677 echo "${as_me:-configure}:4677: testing adding $cf_add_incdir to include-path ..." 1>&5
4678
4679                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4680
4681                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4682                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4683                   cf_add_incdir="$cf_top_incdir"
4684                 else
4685                   break
4686                 fi
4687           fi
4688         done
4689   done
4690 fi
4691
4692 }
4693
4694 echo "$as_me:4694: checking for $cf_ncuhdr_root header in include-path" >&5
4695 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4696 if test "${cf_cv_ncurses_h+set}" = set; then
4697   echo $ECHO_N "(cached) $ECHO_C" >&6
4698 else
4699
4700         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4701         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4702         for cf_header in $cf_header_list
4703         do
4704
4705         cat >conftest.$ac_ext <<_ACEOF
4706 #line 4706 "configure"
4707 #include "confdefs.h"
4708
4709 #define _XOPEN_SOURCE_EXTENDED
4710 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4711 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4712
4713 #include <$cf_header>
4714 int
4715 main ()
4716 {
4717
4718 #ifdef NCURSES_VERSION
4719
4720 #ifndef WACS_BSSB
4721         make an error
4722 #endif
4723
4724 printf("%s\n", NCURSES_VERSION);
4725 #else
4726 #ifdef __NCURSES_H
4727 printf("old\n");
4728 #else
4729         make an error
4730 #endif
4731 #endif
4732
4733   ;
4734   return 0;
4735 }
4736 _ACEOF
4737 rm -f conftest.$ac_objext
4738 if { (eval echo "$as_me:4738: \"$ac_compile\"") >&5
4739   (eval $ac_compile) 2>&5
4740   ac_status=$?
4741   echo "$as_me:4741: \$? = $ac_status" >&5
4742   (exit $ac_status); } &&
4743          { ac_try='test -s conftest.$ac_objext'
4744   { (eval echo "$as_me:4744: \"$ac_try\"") >&5
4745   (eval $ac_try) 2>&5
4746   ac_status=$?
4747   echo "$as_me:4747: \$? = $ac_status" >&5
4748   (exit $ac_status); }; }; then
4749   cf_cv_ncurses_h=$cf_header
4750
4751 else
4752   echo "$as_me: failed program was:" >&5
4753 cat conftest.$ac_ext >&5
4754 cf_cv_ncurses_h=no
4755 fi
4756 rm -f conftest.$ac_objext conftest.$ac_ext
4757
4758                 test "$cf_cv_ncurses_h" != no && break
4759         done
4760
4761 fi
4762 echo "$as_me:4762: result: $cf_cv_ncurses_h" >&5
4763 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4764
4765 if test "$cf_cv_ncurses_h" != no ; then
4766         cf_cv_ncurses_header=$cf_cv_ncurses_h
4767 else
4768
4769 echo "$as_me:4769: checking for $cf_ncuhdr_root include-path" >&5
4770 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4771 if test "${cf_cv_ncurses_h2+set}" = set; then
4772   echo $ECHO_N "(cached) $ECHO_C" >&6
4773 else
4774
4775         test -n "$verbose" && echo
4776
4777 cf_search=
4778
4779 # collect the current set of include-directories from compiler flags
4780 cf_header_path_list=""
4781 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4782         for cf_header_path in $CPPFLAGS $CFLAGS
4783         do
4784                 case $cf_header_path in #(vi
4785                 -I*)
4786                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4787
4788 test "$cf_header_path" != "NONE" && \
4789 test -d "$cf_header_path" && \
4790  {
4791         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4792         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4793         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4794         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4795         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4796         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"
4797 }
4798
4799                         cf_header_path_list="$cf_header_path_list $cf_search"
4800                         ;;
4801                 esac
4802         done
4803 fi
4804
4805 # add the variations for the package we are looking for
4806
4807 cf_search=
4808
4809 test "/usr" != "$prefix" && \
4810 test -d "/usr" && \
4811 (test $prefix = NONE || test "/usr" != "$prefix") && {
4812         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4813         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4814         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
4815         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
4816         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
4817         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4818 }
4819
4820 test "$prefix" != "NONE" && \
4821 test -d "$prefix" && \
4822  {
4823         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4824         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4825         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4826         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4827         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4828         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4829 }
4830
4831 test "/usr/local" != "$prefix" && \
4832 test -d "/usr/local" && \
4833 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4834         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4835         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4836         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
4837         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
4838         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
4839         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4840 }
4841
4842 test "/opt" != "$prefix" && \
4843 test -d "/opt" && \
4844 (test $prefix = NONE || test "/opt" != "$prefix") && {
4845         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4846         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4847         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
4848         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
4849         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
4850         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4851 }
4852
4853 test "$HOME" != "$prefix" && \
4854 test -d "$HOME" && \
4855 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4856         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4857         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4858         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
4859         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
4860         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
4861         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4862 }
4863
4864 test "$includedir" != NONE && \
4865 test "$includedir" != "/usr/include" && \
4866 test -d "$includedir" && {
4867         test -d $includedir &&    cf_search="$cf_search $includedir"
4868         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4869 }
4870
4871 test "$oldincludedir" != NONE && \
4872 test "$oldincludedir" != "/usr/include" && \
4873 test -d "$oldincludedir" && {
4874         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4875         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4876 }
4877
4878 cf_search="$cf_search $cf_header_path_list"
4879
4880         test -n "$verbose" && echo search path $cf_search
4881         cf_save2_CPPFLAGS="$CPPFLAGS"
4882         for cf_incdir in $cf_search
4883         do
4884
4885 if test -n "$cf_incdir" ; then
4886   for cf_add_incdir in $cf_incdir
4887   do
4888         while test $cf_add_incdir != /usr/include
4889         do
4890           if test -d $cf_add_incdir
4891           then
4892                 cf_have_incdir=no
4893                 if test -n "$CFLAGS$CPPFLAGS" ; then
4894                   # a loop is needed to ensure we can add subdirs of existing dirs
4895                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4896                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4897                           cf_have_incdir=yes; break
4898                         fi
4899                   done
4900                 fi
4901
4902                 if test "$cf_have_incdir" = no ; then
4903                   if test "$cf_add_incdir" = /usr/local/include ; then
4904                         if test "$GCC" = yes
4905                         then
4906                           cf_save_CPPFLAGS=$CPPFLAGS
4907                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4908                           cat >conftest.$ac_ext <<_ACEOF
4909 #line 4909 "configure"
4910 #include "confdefs.h"
4911 #include <stdio.h>
4912 int
4913 main ()
4914 {
4915 printf("Hello")
4916   ;
4917   return 0;
4918 }
4919 _ACEOF
4920 rm -f conftest.$ac_objext
4921 if { (eval echo "$as_me:4921: \"$ac_compile\"") >&5
4922   (eval $ac_compile) 2>&5
4923   ac_status=$?
4924   echo "$as_me:4924: \$? = $ac_status" >&5
4925   (exit $ac_status); } &&
4926          { ac_try='test -s conftest.$ac_objext'
4927   { (eval echo "$as_me:4927: \"$ac_try\"") >&5
4928   (eval $ac_try) 2>&5
4929   ac_status=$?
4930   echo "$as_me:4930: \$? = $ac_status" >&5
4931   (exit $ac_status); }; }; then
4932   :
4933 else
4934   echo "$as_me: failed program was:" >&5
4935 cat conftest.$ac_ext >&5
4936 cf_have_incdir=yes
4937 fi
4938 rm -f conftest.$ac_objext conftest.$ac_ext
4939                           CPPFLAGS=$cf_save_CPPFLAGS
4940                         fi
4941                   fi
4942                 fi
4943
4944                 if test "$cf_have_incdir" = no ; then
4945                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4946
4947 echo "${as_me:-configure}:4947: testing adding $cf_add_incdir to include-path ..." 1>&5
4948
4949                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4950
4951                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4952                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4953                   cf_add_incdir="$cf_top_incdir"
4954                 else
4955                   break
4956                 fi
4957           fi
4958         done
4959   done
4960 fi
4961
4962                 for cf_header in \
4963                         ncurses.h \
4964                         curses.h
4965                 do
4966
4967         cat >conftest.$ac_ext <<_ACEOF
4968 #line 4968 "configure"
4969 #include "confdefs.h"
4970
4971 #include <$cf_header>
4972 int
4973 main ()
4974 {
4975
4976 #ifdef NCURSES_VERSION
4977
4978 printf("%s\n", NCURSES_VERSION);
4979 #else
4980 #ifdef __NCURSES_H
4981 printf("old\n");
4982 #else
4983         make an error
4984 #endif
4985 #endif
4986
4987   ;
4988   return 0;
4989 }
4990 _ACEOF
4991 rm -f conftest.$ac_objext
4992 if { (eval echo "$as_me:4992: \"$ac_compile\"") >&5
4993   (eval $ac_compile) 2>&5
4994   ac_status=$?
4995   echo "$as_me:4995: \$? = $ac_status" >&5
4996   (exit $ac_status); } &&
4997          { ac_try='test -s conftest.$ac_objext'
4998   { (eval echo "$as_me:4998: \"$ac_try\"") >&5
4999   (eval $ac_try) 2>&5
5000   ac_status=$?
5001   echo "$as_me:5001: \$? = $ac_status" >&5
5002   (exit $ac_status); }; }; then
5003   cf_cv_ncurses_h2=$cf_header
5004
5005 else
5006   echo "$as_me: failed program was:" >&5
5007 cat conftest.$ac_ext >&5
5008 cf_cv_ncurses_h2=no
5009 fi
5010 rm -f conftest.$ac_objext conftest.$ac_ext
5011
5012                         if test "$cf_cv_ncurses_h2" != no ; then
5013                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5014                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5015                                 break
5016                         fi
5017                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5018                 done
5019                 CPPFLAGS="$cf_save2_CPPFLAGS"
5020                 test "$cf_cv_ncurses_h2" != no && break
5021         done
5022         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5022: error: not found" >&5
5023 echo "$as_me: error: not found" >&2;}
5024    { (exit 1); exit 1; }; }
5025
5026 fi
5027 echo "$as_me:5027: result: $cf_cv_ncurses_h2" >&5
5028 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5029
5030         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5031         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5032         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5033                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5034         fi
5035
5036 if test -n "$cf_1st_incdir" ; then
5037   for cf_add_incdir in $cf_1st_incdir
5038   do
5039         while test $cf_add_incdir != /usr/include
5040         do
5041           if test -d $cf_add_incdir
5042           then
5043                 cf_have_incdir=no
5044                 if test -n "$CFLAGS$CPPFLAGS" ; then
5045                   # a loop is needed to ensure we can add subdirs of existing dirs
5046                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5047                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5048                           cf_have_incdir=yes; break
5049                         fi
5050                   done
5051                 fi
5052
5053                 if test "$cf_have_incdir" = no ; then
5054                   if test "$cf_add_incdir" = /usr/local/include ; then
5055                         if test "$GCC" = yes
5056                         then
5057                           cf_save_CPPFLAGS=$CPPFLAGS
5058                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5059                           cat >conftest.$ac_ext <<_ACEOF
5060 #line 5060 "configure"
5061 #include "confdefs.h"
5062 #include <stdio.h>
5063 int
5064 main ()
5065 {
5066 printf("Hello")
5067   ;
5068   return 0;
5069 }
5070 _ACEOF
5071 rm -f conftest.$ac_objext
5072 if { (eval echo "$as_me:5072: \"$ac_compile\"") >&5
5073   (eval $ac_compile) 2>&5
5074   ac_status=$?
5075   echo "$as_me:5075: \$? = $ac_status" >&5
5076   (exit $ac_status); } &&
5077          { ac_try='test -s conftest.$ac_objext'
5078   { (eval echo "$as_me:5078: \"$ac_try\"") >&5
5079   (eval $ac_try) 2>&5
5080   ac_status=$?
5081   echo "$as_me:5081: \$? = $ac_status" >&5
5082   (exit $ac_status); }; }; then
5083   :
5084 else
5085   echo "$as_me: failed program was:" >&5
5086 cat conftest.$ac_ext >&5
5087 cf_have_incdir=yes
5088 fi
5089 rm -f conftest.$ac_objext conftest.$ac_ext
5090                           CPPFLAGS=$cf_save_CPPFLAGS
5091                         fi
5092                   fi
5093                 fi
5094
5095                 if test "$cf_have_incdir" = no ; then
5096                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5097
5098 echo "${as_me:-configure}:5098: testing adding $cf_add_incdir to include-path ..." 1>&5
5099
5100                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5101
5102                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5103                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5104                   cf_add_incdir="$cf_top_incdir"
5105                 else
5106                   break
5107                 fi
5108           fi
5109         done
5110   done
5111 fi
5112
5113 fi
5114
5115 # Set definitions to allow ifdef'ing for ncurses.h
5116
5117 case $cf_cv_ncurses_header in # (vi
5118 *ncurses.h)
5119         cat >>confdefs.h <<\EOF
5120 #define HAVE_NCURSES_H 1
5121 EOF
5122
5123         ;;
5124 esac
5125
5126 case $cf_cv_ncurses_header in # (vi
5127 ncurses/curses.h|ncurses/ncurses.h)
5128         cat >>confdefs.h <<\EOF
5129 #define HAVE_NCURSES_NCURSES_H 1
5130 EOF
5131
5132         ;;
5133 ncursesw/curses.h|ncursesw/ncurses.h)
5134         cat >>confdefs.h <<\EOF
5135 #define HAVE_NCURSESW_NCURSES_H 1
5136 EOF
5137
5138         ;;
5139 esac
5140
5141 echo "$as_me:5141: checking for terminfo header" >&5
5142 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5143 if test "${cf_cv_term_header+set}" = set; then
5144   echo $ECHO_N "(cached) $ECHO_C" >&6
5145 else
5146
5147 case ${cf_cv_ncurses_header} in #(vi
5148 */ncurses.h|*/ncursesw.h) #(vi
5149         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5150         ;;
5151 *)
5152         cf_term_header=term.h
5153         ;;
5154 esac
5155
5156 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5157 do
5158 cat >conftest.$ac_ext <<_ACEOF
5159 #line 5159 "configure"
5160 #include "confdefs.h"
5161 #include <stdio.h>
5162 #include <${cf_cv_ncurses_header:-curses.h}>
5163 #include <$cf_test>
5164
5165 int
5166 main ()
5167 {
5168 int x = auto_left_margin
5169   ;
5170   return 0;
5171 }
5172 _ACEOF
5173 rm -f conftest.$ac_objext
5174 if { (eval echo "$as_me:5174: \"$ac_compile\"") >&5
5175   (eval $ac_compile) 2>&5
5176   ac_status=$?
5177   echo "$as_me:5177: \$? = $ac_status" >&5
5178   (exit $ac_status); } &&
5179          { ac_try='test -s conftest.$ac_objext'
5180   { (eval echo "$as_me:5180: \"$ac_try\"") >&5
5181   (eval $ac_try) 2>&5
5182   ac_status=$?
5183   echo "$as_me:5183: \$? = $ac_status" >&5
5184   (exit $ac_status); }; }; then
5185
5186         cf_cv_term_header="$cf_test"
5187 else
5188   echo "$as_me: failed program was:" >&5
5189 cat conftest.$ac_ext >&5
5190
5191         cf_cv_term_header=unknown
5192
5193 fi
5194 rm -f conftest.$ac_objext conftest.$ac_ext
5195         test "$cf_cv_term_header" != unknown && break
5196 done
5197
5198 fi
5199 echo "$as_me:5199: result: $cf_cv_term_header" >&5
5200 echo "${ECHO_T}$cf_cv_term_header" >&6
5201
5202 # Set definitions to allow ifdef'ing to accommodate subdirectories
5203
5204 case $cf_cv_term_header in # (vi
5205 *term.h)
5206         cat >>confdefs.h <<\EOF
5207 #define HAVE_TERM_H 1
5208 EOF
5209
5210         ;;
5211 esac
5212
5213 case $cf_cv_term_header in # (vi
5214 ncurses/term.h) #(vi
5215         cat >>confdefs.h <<\EOF
5216 #define HAVE_NCURSES_TERM_H 1
5217 EOF
5218
5219         ;;
5220 ncursesw/term.h)
5221         cat >>confdefs.h <<\EOF
5222 #define HAVE_NCURSESW_TERM_H 1
5223 EOF
5224
5225         ;;
5226 esac
5227
5228 # some applications need this, but should check for NCURSES_VERSION
5229 cat >>confdefs.h <<\EOF
5230 #define NCURSES 1
5231 EOF
5232
5233 echo "$as_me:5233: checking for ncurses version" >&5
5234 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5235 if test "${cf_cv_ncurses_version+set}" = set; then
5236   echo $ECHO_N "(cached) $ECHO_C" >&6
5237 else
5238
5239         cf_cv_ncurses_version=no
5240         cf_tempfile=out$$
5241         rm -f $cf_tempfile
5242         if test "$cross_compiling" = yes; then
5243
5244         # This will not work if the preprocessor splits the line after the
5245         # Autoconf token.  The 'unproto' program does that.
5246         cat > conftest.$ac_ext <<EOF
5247 #include <${cf_cv_ncurses_header:-curses.h}>
5248 #undef Autoconf
5249 #ifdef NCURSES_VERSION
5250 Autoconf NCURSES_VERSION
5251 #else
5252 #ifdef __NCURSES_H
5253 Autoconf "old"
5254 #endif
5255 ;
5256 #endif
5257 EOF
5258         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5259         { (eval echo "$as_me:5259: \"$cf_try\"") >&5
5260   (eval $cf_try) 2>&5
5261   ac_status=$?
5262   echo "$as_me:5262: \$? = $ac_status" >&5
5263   (exit $ac_status); }
5264         if test -f conftest.out ; then
5265                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5266                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5267                 rm -f conftest.out
5268         fi
5269
5270 else
5271   cat >conftest.$ac_ext <<_ACEOF
5272 #line 5272 "configure"
5273 #include "confdefs.h"
5274
5275 #include <${cf_cv_ncurses_header:-curses.h}>
5276 #include <stdio.h>
5277 int main()
5278 {
5279         FILE *fp = fopen("$cf_tempfile", "w");
5280 #ifdef NCURSES_VERSION
5281 # ifdef NCURSES_VERSION_PATCH
5282         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5283 # else
5284         fprintf(fp, "%s\n", NCURSES_VERSION);
5285 # endif
5286 #else
5287 # ifdef __NCURSES_H
5288         fprintf(fp, "old\n");
5289 # else
5290         make an error
5291 # endif
5292 #endif
5293         ${cf_cv_main_return:-return}(0);
5294 }
5295 _ACEOF
5296 rm -f conftest$ac_exeext
5297 if { (eval echo "$as_me:5297: \"$ac_link\"") >&5
5298   (eval $ac_link) 2>&5
5299   ac_status=$?
5300   echo "$as_me:5300: \$? = $ac_status" >&5
5301   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5302   { (eval echo "$as_me:5302: \"$ac_try\"") >&5
5303   (eval $ac_try) 2>&5
5304   ac_status=$?
5305   echo "$as_me:5305: \$? = $ac_status" >&5
5306   (exit $ac_status); }; }; then
5307
5308         cf_cv_ncurses_version=`cat $cf_tempfile`
5309 else
5310   echo "$as_me: program exited with status $ac_status" >&5
5311 echo "$as_me: failed program was:" >&5
5312 cat conftest.$ac_ext >&5
5313 fi
5314 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5315 fi
5316         rm -f $cf_tempfile
5317
5318 fi
5319 echo "$as_me:5319: result: $cf_cv_ncurses_version" >&5
5320 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5321 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5322 #define NCURSES 1
5323 EOF
5324
5325 cf_nculib_root=ncursesw
5326         # This works, except for the special case where we find gpm, but
5327         # ncurses is in a nonstandard location via $LIBS, and we really want
5328         # to link gpm.
5329 cf_ncurses_LIBS=""
5330 cf_ncurses_SAVE="$LIBS"
5331 echo "$as_me:5331: checking for Gpm_Open in -lgpm" >&5
5332 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5333 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5334   echo $ECHO_N "(cached) $ECHO_C" >&6
5335 else
5336   ac_check_lib_save_LIBS=$LIBS
5337 LIBS="-lgpm  $LIBS"
5338 cat >conftest.$ac_ext <<_ACEOF
5339 #line 5339 "configure"
5340 #include "confdefs.h"
5341
5342 /* Override any gcc2 internal prototype to avoid an error.  */
5343 #ifdef __cplusplus
5344 extern "C"
5345 #endif
5346 /* We use char because int might match the return type of a gcc2
5347    builtin and then its argument prototype would still apply.  */
5348 char Gpm_Open ();
5349 int
5350 main ()
5351 {
5352 Gpm_Open ();
5353   ;
5354   return 0;
5355 }
5356 _ACEOF
5357 rm -f conftest.$ac_objext conftest$ac_exeext
5358 if { (eval echo "$as_me:5358: \"$ac_link\"") >&5
5359   (eval $ac_link) 2>&5
5360   ac_status=$?
5361   echo "$as_me:5361: \$? = $ac_status" >&5
5362   (exit $ac_status); } &&
5363          { ac_try='test -s conftest$ac_exeext'
5364   { (eval echo "$as_me:5364: \"$ac_try\"") >&5
5365   (eval $ac_try) 2>&5
5366   ac_status=$?
5367   echo "$as_me:5367: \$? = $ac_status" >&5
5368   (exit $ac_status); }; }; then
5369   ac_cv_lib_gpm_Gpm_Open=yes
5370 else
5371   echo "$as_me: failed program was:" >&5
5372 cat conftest.$ac_ext >&5
5373 ac_cv_lib_gpm_Gpm_Open=no
5374 fi
5375 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5376 LIBS=$ac_check_lib_save_LIBS
5377 fi
5378 echo "$as_me:5378: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5379 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5380 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5381   echo "$as_me:5381: checking for initscr in -lgpm" >&5
5382 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5383 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5384   echo $ECHO_N "(cached) $ECHO_C" >&6
5385 else
5386   ac_check_lib_save_LIBS=$LIBS
5387 LIBS="-lgpm  $LIBS"
5388 cat >conftest.$ac_ext <<_ACEOF
5389 #line 5389 "configure"
5390 #include "confdefs.h"
5391
5392 /* Override any gcc2 internal prototype to avoid an error.  */
5393 #ifdef __cplusplus
5394 extern "C"
5395 #endif
5396 /* We use char because int might match the return type of a gcc2
5397    builtin and then its argument prototype would still apply.  */
5398 char initscr ();
5399 int
5400 main ()
5401 {
5402 initscr ();
5403   ;
5404   return 0;
5405 }
5406 _ACEOF
5407 rm -f conftest.$ac_objext conftest$ac_exeext
5408 if { (eval echo "$as_me:5408: \"$ac_link\"") >&5
5409   (eval $ac_link) 2>&5
5410   ac_status=$?
5411   echo "$as_me:5411: \$? = $ac_status" >&5
5412   (exit $ac_status); } &&
5413          { ac_try='test -s conftest$ac_exeext'
5414   { (eval echo "$as_me:5414: \"$ac_try\"") >&5
5415   (eval $ac_try) 2>&5
5416   ac_status=$?
5417   echo "$as_me:5417: \$? = $ac_status" >&5
5418   (exit $ac_status); }; }; then
5419   ac_cv_lib_gpm_initscr=yes
5420 else
5421   echo "$as_me: failed program was:" >&5
5422 cat conftest.$ac_ext >&5
5423 ac_cv_lib_gpm_initscr=no
5424 fi
5425 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5426 LIBS=$ac_check_lib_save_LIBS
5427 fi
5428 echo "$as_me:5428: result: $ac_cv_lib_gpm_initscr" >&5
5429 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5430 if test $ac_cv_lib_gpm_initscr = yes; then
5431   LIBS="$cf_ncurses_SAVE"
5432 else
5433   cf_ncurses_LIBS="-lgpm"
5434 fi
5435
5436 fi
5437
5438 case $host_os in #(vi
5439 freebsd*)
5440         # This is only necessary if you are linking against an obsolete
5441         # version of ncurses (but it should do no harm, since it's static).
5442         if test "$cf_nculib_root" = ncurses ; then
5443                 echo "$as_me:5443: checking for tgoto in -lmytinfo" >&5
5444 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5445 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5446   echo $ECHO_N "(cached) $ECHO_C" >&6
5447 else
5448   ac_check_lib_save_LIBS=$LIBS
5449 LIBS="-lmytinfo  $LIBS"
5450 cat >conftest.$ac_ext <<_ACEOF
5451 #line 5451 "configure"
5452 #include "confdefs.h"
5453
5454 /* Override any gcc2 internal prototype to avoid an error.  */
5455 #ifdef __cplusplus
5456 extern "C"
5457 #endif
5458 /* We use char because int might match the return type of a gcc2
5459    builtin and then its argument prototype would still apply.  */
5460 char tgoto ();
5461 int
5462 main ()
5463 {
5464 tgoto ();
5465   ;
5466   return 0;
5467 }
5468 _ACEOF
5469 rm -f conftest.$ac_objext conftest$ac_exeext
5470 if { (eval echo "$as_me:5470: \"$ac_link\"") >&5
5471   (eval $ac_link) 2>&5
5472   ac_status=$?
5473   echo "$as_me:5473: \$? = $ac_status" >&5
5474   (exit $ac_status); } &&
5475          { ac_try='test -s conftest$ac_exeext'
5476   { (eval echo "$as_me:5476: \"$ac_try\"") >&5
5477   (eval $ac_try) 2>&5
5478   ac_status=$?
5479   echo "$as_me:5479: \$? = $ac_status" >&5
5480   (exit $ac_status); }; }; then
5481   ac_cv_lib_mytinfo_tgoto=yes
5482 else
5483   echo "$as_me: failed program was:" >&5
5484 cat conftest.$ac_ext >&5
5485 ac_cv_lib_mytinfo_tgoto=no
5486 fi
5487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5488 LIBS=$ac_check_lib_save_LIBS
5489 fi
5490 echo "$as_me:5490: result: $ac_cv_lib_mytinfo_tgoto" >&5
5491 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5492 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5493   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5494 fi
5495
5496         fi
5497         ;;
5498 esac
5499
5500 LIBS="$cf_ncurses_LIBS $LIBS"
5501
5502 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5503 then
5504         LIBS="-l$cf_nculib_root $LIBS"
5505 else
5506
5507         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5508         cf_libdir=""
5509         echo "$as_me:5509: checking for initscr" >&5
5510 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5511 if test "${ac_cv_func_initscr+set}" = set; then
5512   echo $ECHO_N "(cached) $ECHO_C" >&6
5513 else
5514   cat >conftest.$ac_ext <<_ACEOF
5515 #line 5515 "configure"
5516 #include "confdefs.h"
5517 /* System header to define __stub macros and hopefully few prototypes,
5518     which can conflict with char initscr (); below.  */
5519 #include <assert.h>
5520 /* Override any gcc2 internal prototype to avoid an error.  */
5521 #ifdef __cplusplus
5522 extern "C"
5523 #endif
5524 /* We use char because int might match the return type of a gcc2
5525    builtin and then its argument prototype would still apply.  */
5526 char initscr ();
5527 char (*f) ();
5528
5529 int
5530 main ()
5531 {
5532 /* The GNU C library defines this for functions which it implements
5533     to always fail with ENOSYS.  Some functions are actually named
5534     something starting with __ and the normal name is an alias.  */
5535 #if defined (__stub_initscr) || defined (__stub___initscr)
5536 choke me
5537 #else
5538 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5539 #endif
5540
5541   ;
5542   return 0;
5543 }
5544 _ACEOF
5545 rm -f conftest.$ac_objext conftest$ac_exeext
5546 if { (eval echo "$as_me:5546: \"$ac_link\"") >&5
5547   (eval $ac_link) 2>&5
5548   ac_status=$?
5549   echo "$as_me:5549: \$? = $ac_status" >&5
5550   (exit $ac_status); } &&
5551          { ac_try='test -s conftest$ac_exeext'
5552   { (eval echo "$as_me:5552: \"$ac_try\"") >&5
5553   (eval $ac_try) 2>&5
5554   ac_status=$?
5555   echo "$as_me:5555: \$? = $ac_status" >&5
5556   (exit $ac_status); }; }; then
5557   ac_cv_func_initscr=yes
5558 else
5559   echo "$as_me: failed program was:" >&5
5560 cat conftest.$ac_ext >&5
5561 ac_cv_func_initscr=no
5562 fi
5563 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5564 fi
5565 echo "$as_me:5565: result: $ac_cv_func_initscr" >&5
5566 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5567 if test $ac_cv_func_initscr = yes; then
5568   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5569 else
5570
5571                 cf_save_LIBS="$LIBS"
5572                 echo "$as_me:5572: checking for initscr in -l$cf_nculib_root" >&5
5573 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5574                 LIBS="-l$cf_nculib_root $LIBS"
5575                 cat >conftest.$ac_ext <<_ACEOF
5576 #line 5576 "configure"
5577 #include "confdefs.h"
5578 #include <${cf_cv_ncurses_header:-curses.h}>
5579 int
5580 main ()
5581 {
5582 initscr()
5583   ;
5584   return 0;
5585 }
5586 _ACEOF
5587 rm -f conftest.$ac_objext conftest$ac_exeext
5588 if { (eval echo "$as_me:5588: \"$ac_link\"") >&5
5589   (eval $ac_link) 2>&5
5590   ac_status=$?
5591   echo "$as_me:5591: \$? = $ac_status" >&5
5592   (exit $ac_status); } &&
5593          { ac_try='test -s conftest$ac_exeext'
5594   { (eval echo "$as_me:5594: \"$ac_try\"") >&5
5595   (eval $ac_try) 2>&5
5596   ac_status=$?
5597   echo "$as_me:5597: \$? = $ac_status" >&5
5598   (exit $ac_status); }; }; then
5599   echo "$as_me:5599: result: yes" >&5
5600 echo "${ECHO_T}yes" >&6
5601                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5602
5603 else
5604   echo "$as_me: failed program was:" >&5
5605 cat conftest.$ac_ext >&5
5606 echo "$as_me:5606: result: no" >&5
5607 echo "${ECHO_T}no" >&6
5608
5609 cf_search=
5610 cf_library_path_list=""
5611 if test -n "${LDFLAGS}${LIBS}" ; then
5612         for cf_library_path in $LDFLAGS $LIBS
5613         do
5614                 case $cf_library_path in #(vi
5615                 -L*)
5616                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5617
5618 test "$cf_library_path" != "NONE" && \
5619 test -d "$cf_library_path" && \
5620  {
5621         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5622         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5623         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5624         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5625         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5626         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"
5627 }
5628
5629                         cf_library_path_list="$cf_library_path_list $cf_search"
5630                         ;;
5631                 esac
5632         done
5633 fi
5634
5635 cf_search=
5636
5637 test "/usr" != "$prefix" && \
5638 test -d "/usr" && \
5639 (test $prefix = NONE || test "/usr" != "$prefix") && {
5640         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
5641         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
5642         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
5643         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
5644         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
5645         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
5646 }
5647
5648 test "$prefix" != "NONE" && \
5649 test -d "$prefix" && \
5650  {
5651         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5652         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5653         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5654         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5655         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5656         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5657 }
5658
5659 test "/usr/local" != "$prefix" && \
5660 test -d "/usr/local" && \
5661 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
5662         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
5663         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
5664         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
5665         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
5666         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
5667         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
5668 }
5669
5670 test "/opt" != "$prefix" && \
5671 test -d "/opt" && \
5672 (test $prefix = NONE || test "/opt" != "$prefix") && {
5673         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
5674         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
5675         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
5676         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
5677         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
5678         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
5679 }
5680
5681 test "$HOME" != "$prefix" && \
5682 test -d "$HOME" && \
5683 (test $prefix = NONE || test "$HOME" != "$prefix") && {
5684         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
5685         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
5686         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
5687         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
5688         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
5689         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
5690 }
5691
5692 cf_search="$cf_library_path_list $cf_search"
5693
5694                         for cf_libdir in $cf_search
5695                         do
5696                                 echo "$as_me:5696: checking for -l$cf_nculib_root in $cf_libdir" >&5
5697 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5698                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5699                                 cat >conftest.$ac_ext <<_ACEOF
5700 #line 5700 "configure"
5701 #include "confdefs.h"
5702 #include <${cf_cv_ncurses_header:-curses.h}>
5703 int
5704 main ()
5705 {
5706 initscr()
5707   ;
5708   return 0;
5709 }
5710 _ACEOF
5711 rm -f conftest.$ac_objext conftest$ac_exeext
5712 if { (eval echo "$as_me:5712: \"$ac_link\"") >&5
5713   (eval $ac_link) 2>&5
5714   ac_status=$?
5715   echo "$as_me:5715: \$? = $ac_status" >&5
5716   (exit $ac_status); } &&
5717          { ac_try='test -s conftest$ac_exeext'
5718   { (eval echo "$as_me:5718: \"$ac_try\"") >&5
5719   (eval $ac_try) 2>&5
5720   ac_status=$?
5721   echo "$as_me:5721: \$? = $ac_status" >&5
5722   (exit $ac_status); }; }; then
5723   echo "$as_me:5723: result: yes" >&5
5724 echo "${ECHO_T}yes" >&6
5725                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5726                                          break
5727 else
5728   echo "$as_me: failed program was:" >&5
5729 cat conftest.$ac_ext >&5
5730 echo "$as_me:5730: result: no" >&5
5731 echo "${ECHO_T}no" >&6
5732                                          LIBS="$cf_save_LIBS"
5733 fi
5734 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5735                         done
5736
5737 fi
5738 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5739
5740 fi
5741
5742 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5743
5744 if test $cf_found_library = no ; then
5745         { { echo "$as_me:5745: error: Cannot link $cf_nculib_root library" >&5
5746 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5747    { (exit 1); exit 1; }; }
5748 fi
5749
5750 fi
5751
5752 if test -n "$cf_ncurses_LIBS" ; then
5753         echo "$as_me:5753: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5754 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5755         cf_ncurses_SAVE="$LIBS"
5756         for p in $cf_ncurses_LIBS ; do
5757                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5758                 if test "$q" != "$LIBS" ; then
5759                         LIBS="$q"
5760                 fi
5761         done
5762         cat >conftest.$ac_ext <<_ACEOF
5763 #line 5763 "configure"
5764 #include "confdefs.h"
5765 #include <${cf_cv_ncurses_header:-curses.h}>
5766 int
5767 main ()
5768 {
5769 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5770   ;
5771   return 0;
5772 }
5773 _ACEOF
5774 rm -f conftest.$ac_objext conftest$ac_exeext
5775 if { (eval echo "$as_me:5775: \"$ac_link\"") >&5
5776   (eval $ac_link) 2>&5
5777   ac_status=$?
5778   echo "$as_me:5778: \$? = $ac_status" >&5
5779   (exit $ac_status); } &&
5780          { ac_try='test -s conftest$ac_exeext'
5781   { (eval echo "$as_me:5781: \"$ac_try\"") >&5
5782   (eval $ac_try) 2>&5
5783   ac_status=$?
5784   echo "$as_me:5784: \$? = $ac_status" >&5
5785   (exit $ac_status); }; }; then
5786   echo "$as_me:5786: result: yes" >&5
5787 echo "${ECHO_T}yes" >&6
5788 else
5789   echo "$as_me: failed program was:" >&5
5790 cat conftest.$ac_ext >&5
5791 echo "$as_me:5791: result: no" >&5
5792 echo "${ECHO_T}no" >&6
5793                  LIBS="$cf_ncurses_SAVE"
5794 fi
5795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5796 fi
5797
5798 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5799
5800 cat >>confdefs.h <<EOF
5801 #define $cf_nculib_ROOT 1
5802 EOF
5803
5804 fi
5805
5806 else
5807
5808 cf_ncuconfig_root=ncurses
5809
5810 echo "Looking for ${cf_ncuconfig_root}-config"
5811
5812 if test -n "$ac_tool_prefix"; then
5813   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5814   do
5815     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5816 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5817 echo "$as_me:5817: checking for $ac_word" >&5
5818 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5819 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5820   echo $ECHO_N "(cached) $ECHO_C" >&6
5821 else
5822   if test -n "$NCURSES_CONFIG"; then
5823   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5824 else
5825   ac_save_IFS=$IFS; IFS=$ac_path_separator
5826 ac_dummy="$PATH"
5827 for ac_dir in $ac_dummy; do
5828   IFS=$ac_save_IFS
5829   test -z "$ac_dir" && ac_dir=.
5830   $as_executable_p "$ac_dir/$ac_word" || continue
5831 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5832 echo "$as_me:5832: found $ac_dir/$ac_word" >&5
5833 break
5834 done
5835
5836 fi
5837 fi
5838 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5839 if test -n "$NCURSES_CONFIG"; then
5840   echo "$as_me:5840: result: $NCURSES_CONFIG" >&5
5841 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5842 else
5843   echo "$as_me:5843: result: no" >&5
5844 echo "${ECHO_T}no" >&6
5845 fi
5846
5847     test -n "$NCURSES_CONFIG" && break
5848   done
5849 fi
5850 if test -z "$NCURSES_CONFIG"; then
5851   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5852   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5853 do
5854   # Extract the first word of "$ac_prog", so it can be a program name with args.
5855 set dummy $ac_prog; ac_word=$2
5856 echo "$as_me:5856: checking for $ac_word" >&5
5857 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5858 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5859   echo $ECHO_N "(cached) $ECHO_C" >&6
5860 else
5861   if test -n "$ac_ct_NCURSES_CONFIG"; then
5862   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5863 else
5864   ac_save_IFS=$IFS; IFS=$ac_path_separator
5865 ac_dummy="$PATH"
5866 for ac_dir in $ac_dummy; do
5867   IFS=$ac_save_IFS
5868   test -z "$ac_dir" && ac_dir=.
5869   $as_executable_p "$ac_dir/$ac_word" || continue
5870 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5871 echo "$as_me:5871: found $ac_dir/$ac_word" >&5
5872 break
5873 done
5874
5875 fi
5876 fi
5877 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5878 if test -n "$ac_ct_NCURSES_CONFIG"; then
5879   echo "$as_me:5879: result: $ac_ct_NCURSES_CONFIG" >&5
5880 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5881 else
5882   echo "$as_me:5882: result: no" >&5
5883 echo "${ECHO_T}no" >&6
5884 fi
5885
5886   test -n "$ac_ct_NCURSES_CONFIG" && break
5887 done
5888 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5889
5890   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5891 fi
5892
5893 if test "$NCURSES_CONFIG" != none ; then
5894
5895 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5896 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5897
5898 # even with config script, some packages use no-override for curses.h
5899
5900 echo "$as_me:5900: checking if we have identified curses headers" >&5
5901 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5902 if test "${cf_cv_ncurses_header+set}" = set; then
5903   echo $ECHO_N "(cached) $ECHO_C" >&6
5904 else
5905
5906 cf_cv_ncurses_header=none
5907 for cf_header in  \
5908     ncurses/ncurses.h \
5909         ncurses/curses.h \
5910         ncurses.h \
5911         curses.h
5912 do
5913 cat >conftest.$ac_ext <<_ACEOF
5914 #line 5914 "configure"
5915 #include "confdefs.h"
5916 #include <${cf_header}>
5917 int
5918 main ()
5919 {
5920 initscr(); tgoto("?", 0,0)
5921   ;
5922   return 0;
5923 }
5924 _ACEOF
5925 rm -f conftest.$ac_objext
5926 if { (eval echo "$as_me:5926: \"$ac_compile\"") >&5
5927   (eval $ac_compile) 2>&5
5928   ac_status=$?
5929   echo "$as_me:5929: \$? = $ac_status" >&5
5930   (exit $ac_status); } &&
5931          { ac_try='test -s conftest.$ac_objext'
5932   { (eval echo "$as_me:5932: \"$ac_try\"") >&5
5933   (eval $ac_try) 2>&5
5934   ac_status=$?
5935   echo "$as_me:5935: \$? = $ac_status" >&5
5936   (exit $ac_status); }; }; then
5937   cf_cv_ncurses_header=$cf_header; break
5938 else
5939   echo "$as_me: failed program was:" >&5
5940 cat conftest.$ac_ext >&5
5941 fi
5942 rm -f conftest.$ac_objext conftest.$ac_ext
5943 done
5944
5945 fi
5946 echo "$as_me:5946: result: $cf_cv_ncurses_header" >&5
5947 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5948
5949 if test "$cf_cv_ncurses_header" = none ; then
5950         { { echo "$as_me:5950: error: No curses header-files found" >&5
5951 echo "$as_me: error: No curses header-files found" >&2;}
5952    { (exit 1); exit 1; }; }
5953 fi
5954
5955 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5956
5957 for ac_header in $cf_cv_ncurses_header
5958 do
5959 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5960 echo "$as_me:5960: checking for $ac_header" >&5
5961 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5962 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5963   echo $ECHO_N "(cached) $ECHO_C" >&6
5964 else
5965   cat >conftest.$ac_ext <<_ACEOF
5966 #line 5966 "configure"
5967 #include "confdefs.h"
5968 #include <$ac_header>
5969 _ACEOF
5970 if { (eval echo "$as_me:5970: \"$ac_cpp conftest.$ac_ext\"") >&5
5971   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5972   ac_status=$?
5973   egrep -v '^ *\+' conftest.er1 >conftest.err
5974   rm -f conftest.er1
5975   cat conftest.err >&5
5976   echo "$as_me:5976: \$? = $ac_status" >&5
5977   (exit $ac_status); } >/dev/null; then
5978   if test -s conftest.err; then
5979     ac_cpp_err=$ac_c_preproc_warn_flag
5980   else
5981     ac_cpp_err=
5982   fi
5983 else
5984   ac_cpp_err=yes
5985 fi
5986 if test -z "$ac_cpp_err"; then
5987   eval "$as_ac_Header=yes"
5988 else
5989   echo "$as_me: failed program was:" >&5
5990   cat conftest.$ac_ext >&5
5991   eval "$as_ac_Header=no"
5992 fi
5993 rm -f conftest.err conftest.$ac_ext
5994 fi
5995 echo "$as_me:5995: result: `eval echo '${'$as_ac_Header'}'`" >&5
5996 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5997 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5998   cat >>confdefs.h <<EOF
5999 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6000 EOF
6001
6002 fi
6003 done
6004
6005 cat >>confdefs.h <<\EOF
6006 #define NCURSES 1
6007 EOF
6008
6009 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6010
6011 cat >>confdefs.h <<EOF
6012 #define $cf_nculib_ROOT 1
6013 EOF
6014
6015 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6016
6017 else
6018
6019 cf_ncuhdr_root=ncurses
6020
6021 test -n "$cf_cv_curses_dir" && \
6022 test "$cf_cv_curses_dir" != "no" && { \
6023
6024 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6025   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6026   do
6027         while test $cf_add_incdir != /usr/include
6028         do
6029           if test -d $cf_add_incdir
6030           then
6031                 cf_have_incdir=no
6032                 if test -n "$CFLAGS$CPPFLAGS" ; then
6033                   # a loop is needed to ensure we can add subdirs of existing dirs
6034                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6035                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6036                           cf_have_incdir=yes; break
6037                         fi
6038                   done
6039                 fi
6040
6041                 if test "$cf_have_incdir" = no ; then
6042                   if test "$cf_add_incdir" = /usr/local/include ; then
6043                         if test "$GCC" = yes
6044                         then
6045                           cf_save_CPPFLAGS=$CPPFLAGS
6046                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6047                           cat >conftest.$ac_ext <<_ACEOF
6048 #line 6048 "configure"
6049 #include "confdefs.h"
6050 #include <stdio.h>
6051 int
6052 main ()
6053 {
6054 printf("Hello")
6055   ;
6056   return 0;
6057 }
6058 _ACEOF
6059 rm -f conftest.$ac_objext
6060 if { (eval echo "$as_me:6060: \"$ac_compile\"") >&5
6061   (eval $ac_compile) 2>&5
6062   ac_status=$?
6063   echo "$as_me:6063: \$? = $ac_status" >&5
6064   (exit $ac_status); } &&
6065          { ac_try='test -s conftest.$ac_objext'
6066   { (eval echo "$as_me:6066: \"$ac_try\"") >&5
6067   (eval $ac_try) 2>&5
6068   ac_status=$?
6069   echo "$as_me:6069: \$? = $ac_status" >&5
6070   (exit $ac_status); }; }; then
6071   :
6072 else
6073   echo "$as_me: failed program was:" >&5
6074 cat conftest.$ac_ext >&5
6075 cf_have_incdir=yes
6076 fi
6077 rm -f conftest.$ac_objext conftest.$ac_ext
6078                           CPPFLAGS=$cf_save_CPPFLAGS
6079                         fi
6080                   fi
6081                 fi
6082
6083                 if test "$cf_have_incdir" = no ; then
6084                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6085
6086 echo "${as_me:-configure}:6086: testing adding $cf_add_incdir to include-path ..." 1>&5
6087
6088                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6089
6090                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6091                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6092                   cf_add_incdir="$cf_top_incdir"
6093                 else
6094                   break
6095                 fi
6096           fi
6097         done
6098   done
6099 fi
6100
6101 }
6102
6103 echo "$as_me:6103: checking for $cf_ncuhdr_root header in include-path" >&5
6104 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6105 if test "${cf_cv_ncurses_h+set}" = set; then
6106   echo $ECHO_N "(cached) $ECHO_C" >&6
6107 else
6108
6109         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6110         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6111         for cf_header in $cf_header_list
6112         do
6113
6114         cat >conftest.$ac_ext <<_ACEOF
6115 #line 6115 "configure"
6116 #include "confdefs.h"
6117
6118 #include <$cf_header>
6119 int
6120 main ()
6121 {
6122
6123 #ifdef NCURSES_VERSION
6124
6125 printf("%s\n", NCURSES_VERSION);
6126 #else
6127 #ifdef __NCURSES_H
6128 printf("old\n");
6129 #else
6130         make an error
6131 #endif
6132 #endif
6133
6134   ;
6135   return 0;
6136 }
6137 _ACEOF
6138 rm -f conftest.$ac_objext
6139 if { (eval echo "$as_me:6139: \"$ac_compile\"") >&5
6140   (eval $ac_compile) 2>&5
6141   ac_status=$?
6142   echo "$as_me:6142: \$? = $ac_status" >&5
6143   (exit $ac_status); } &&
6144          { ac_try='test -s conftest.$ac_objext'
6145   { (eval echo "$as_me:6145: \"$ac_try\"") >&5
6146   (eval $ac_try) 2>&5
6147   ac_status=$?
6148   echo "$as_me:6148: \$? = $ac_status" >&5
6149   (exit $ac_status); }; }; then
6150   cf_cv_ncurses_h=$cf_header
6151
6152 else
6153   echo "$as_me: failed program was:" >&5
6154 cat conftest.$ac_ext >&5
6155 cf_cv_ncurses_h=no
6156 fi
6157 rm -f conftest.$ac_objext conftest.$ac_ext
6158
6159                 test "$cf_cv_ncurses_h" != no && break
6160         done
6161
6162 fi
6163 echo "$as_me:6163: result: $cf_cv_ncurses_h" >&5
6164 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6165
6166 if test "$cf_cv_ncurses_h" != no ; then
6167         cf_cv_ncurses_header=$cf_cv_ncurses_h
6168 else
6169
6170 echo "$as_me:6170: checking for $cf_ncuhdr_root include-path" >&5
6171 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6172 if test "${cf_cv_ncurses_h2+set}" = set; then
6173   echo $ECHO_N "(cached) $ECHO_C" >&6
6174 else
6175
6176         test -n "$verbose" && echo
6177
6178 cf_search=
6179
6180 # collect the current set of include-directories from compiler flags
6181 cf_header_path_list=""
6182 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6183         for cf_header_path in $CPPFLAGS $CFLAGS
6184         do
6185                 case $cf_header_path in #(vi
6186                 -I*)
6187                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6188
6189 test "$cf_header_path" != "NONE" && \
6190 test -d "$cf_header_path" && \
6191  {
6192         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6193         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6194         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6195         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6196         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6197         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"
6198 }
6199
6200                         cf_header_path_list="$cf_header_path_list $cf_search"
6201                         ;;
6202                 esac
6203         done
6204 fi
6205
6206 # add the variations for the package we are looking for
6207
6208 cf_search=
6209
6210 test "/usr" != "$prefix" && \
6211 test -d "/usr" && \
6212 (test $prefix = NONE || test "/usr" != "$prefix") && {
6213         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6214         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6215         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6216         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6217         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6218         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6219 }
6220
6221 test "$prefix" != "NONE" && \
6222 test -d "$prefix" && \
6223  {
6224         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6225         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6226         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6227         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6228         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6229         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6230 }
6231
6232 test "/usr/local" != "$prefix" && \
6233 test -d "/usr/local" && \
6234 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6235         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6236         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6237         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6238         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6239         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6240         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6241 }
6242
6243 test "/opt" != "$prefix" && \
6244 test -d "/opt" && \
6245 (test $prefix = NONE || test "/opt" != "$prefix") && {
6246         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6247         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6248         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6249         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6250         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6251         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6252 }
6253
6254 test "$HOME" != "$prefix" && \
6255 test -d "$HOME" && \
6256 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6257         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6258         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6259         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6260         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6261         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6262         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6263 }
6264
6265 test "$includedir" != NONE && \
6266 test "$includedir" != "/usr/include" && \
6267 test -d "$includedir" && {
6268         test -d $includedir &&    cf_search="$cf_search $includedir"
6269         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6270 }
6271
6272 test "$oldincludedir" != NONE && \
6273 test "$oldincludedir" != "/usr/include" && \
6274 test -d "$oldincludedir" && {
6275         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6276         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6277 }
6278
6279 cf_search="$cf_search $cf_header_path_list"
6280
6281         test -n "$verbose" && echo search path $cf_search
6282         cf_save2_CPPFLAGS="$CPPFLAGS"
6283         for cf_incdir in $cf_search
6284         do
6285
6286 if test -n "$cf_incdir" ; then
6287   for cf_add_incdir in $cf_incdir
6288   do
6289         while test $cf_add_incdir != /usr/include
6290         do
6291           if test -d $cf_add_incdir
6292           then
6293                 cf_have_incdir=no
6294                 if test -n "$CFLAGS$CPPFLAGS" ; then
6295                   # a loop is needed to ensure we can add subdirs of existing dirs
6296                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6297                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6298                           cf_have_incdir=yes; break
6299                         fi
6300                   done
6301                 fi
6302
6303                 if test "$cf_have_incdir" = no ; then
6304                   if test "$cf_add_incdir" = /usr/local/include ; then
6305                         if test "$GCC" = yes
6306                         then
6307                           cf_save_CPPFLAGS=$CPPFLAGS
6308                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6309                           cat >conftest.$ac_ext <<_ACEOF
6310 #line 6310 "configure"
6311 #include "confdefs.h"
6312 #include <stdio.h>
6313 int
6314 main ()
6315 {
6316 printf("Hello")
6317   ;
6318   return 0;
6319 }
6320 _ACEOF
6321 rm -f conftest.$ac_objext
6322 if { (eval echo "$as_me:6322: \"$ac_compile\"") >&5
6323   (eval $ac_compile) 2>&5
6324   ac_status=$?
6325   echo "$as_me:6325: \$? = $ac_status" >&5
6326   (exit $ac_status); } &&
6327          { ac_try='test -s conftest.$ac_objext'
6328   { (eval echo "$as_me:6328: \"$ac_try\"") >&5
6329   (eval $ac_try) 2>&5
6330   ac_status=$?
6331   echo "$as_me:6331: \$? = $ac_status" >&5
6332   (exit $ac_status); }; }; then
6333   :
6334 else
6335   echo "$as_me: failed program was:" >&5
6336 cat conftest.$ac_ext >&5
6337 cf_have_incdir=yes
6338 fi
6339 rm -f conftest.$ac_objext conftest.$ac_ext
6340                           CPPFLAGS=$cf_save_CPPFLAGS
6341                         fi
6342                   fi
6343                 fi
6344
6345                 if test "$cf_have_incdir" = no ; then
6346                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6347
6348 echo "${as_me:-configure}:6348: testing adding $cf_add_incdir to include-path ..." 1>&5
6349
6350                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6351
6352                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6353                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6354                   cf_add_incdir="$cf_top_incdir"
6355                 else
6356                   break
6357                 fi
6358           fi
6359         done
6360   done
6361 fi
6362
6363                 for cf_header in \
6364                         ncurses.h \
6365                         curses.h
6366                 do
6367
6368         cat >conftest.$ac_ext <<_ACEOF
6369 #line 6369 "configure"
6370 #include "confdefs.h"
6371
6372 #include <$cf_header>
6373 int
6374 main ()
6375 {
6376
6377 #ifdef NCURSES_VERSION
6378
6379 printf("%s\n", NCURSES_VERSION);
6380 #else
6381 #ifdef __NCURSES_H
6382 printf("old\n");
6383 #else
6384         make an error
6385 #endif
6386 #endif
6387
6388   ;
6389   return 0;
6390 }
6391 _ACEOF
6392 rm -f conftest.$ac_objext
6393 if { (eval echo "$as_me:6393: \"$ac_compile\"") >&5
6394   (eval $ac_compile) 2>&5
6395   ac_status=$?
6396   echo "$as_me:6396: \$? = $ac_status" >&5
6397   (exit $ac_status); } &&
6398          { ac_try='test -s conftest.$ac_objext'
6399   { (eval echo "$as_me:6399: \"$ac_try\"") >&5
6400   (eval $ac_try) 2>&5
6401   ac_status=$?
6402   echo "$as_me:6402: \$? = $ac_status" >&5
6403   (exit $ac_status); }; }; then
6404   cf_cv_ncurses_h2=$cf_header
6405
6406 else
6407   echo "$as_me: failed program was:" >&5
6408 cat conftest.$ac_ext >&5
6409 cf_cv_ncurses_h2=no
6410 fi
6411 rm -f conftest.$ac_objext conftest.$ac_ext
6412
6413                         if test "$cf_cv_ncurses_h2" != no ; then
6414                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6415                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6416                                 break
6417                         fi
6418                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6419                 done
6420                 CPPFLAGS="$cf_save2_CPPFLAGS"
6421                 test "$cf_cv_ncurses_h2" != no && break
6422         done
6423         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6423: error: not found" >&5
6424 echo "$as_me: error: not found" >&2;}
6425    { (exit 1); exit 1; }; }
6426
6427 fi
6428 echo "$as_me:6428: result: $cf_cv_ncurses_h2" >&5
6429 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6430
6431         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6432         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6433         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6434                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6435         fi
6436
6437 if test -n "$cf_1st_incdir" ; then
6438   for cf_add_incdir in $cf_1st_incdir
6439   do
6440         while test $cf_add_incdir != /usr/include
6441         do
6442           if test -d $cf_add_incdir
6443           then
6444                 cf_have_incdir=no
6445                 if test -n "$CFLAGS$CPPFLAGS" ; then
6446                   # a loop is needed to ensure we can add subdirs of existing dirs
6447                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6448                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6449                           cf_have_incdir=yes; break
6450                         fi
6451                   done
6452                 fi
6453
6454                 if test "$cf_have_incdir" = no ; then
6455                   if test "$cf_add_incdir" = /usr/local/include ; then
6456                         if test "$GCC" = yes
6457                         then
6458                           cf_save_CPPFLAGS=$CPPFLAGS
6459                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6460                           cat >conftest.$ac_ext <<_ACEOF
6461 #line 6461 "configure"
6462 #include "confdefs.h"
6463 #include <stdio.h>
6464 int
6465 main ()
6466 {
6467 printf("Hello")
6468   ;
6469   return 0;
6470 }
6471 _ACEOF
6472 rm -f conftest.$ac_objext
6473 if { (eval echo "$as_me:6473: \"$ac_compile\"") >&5
6474   (eval $ac_compile) 2>&5
6475   ac_status=$?
6476   echo "$as_me:6476: \$? = $ac_status" >&5
6477   (exit $ac_status); } &&
6478          { ac_try='test -s conftest.$ac_objext'
6479   { (eval echo "$as_me:6479: \"$ac_try\"") >&5
6480   (eval $ac_try) 2>&5
6481   ac_status=$?
6482   echo "$as_me:6482: \$? = $ac_status" >&5
6483   (exit $ac_status); }; }; then
6484   :
6485 else
6486   echo "$as_me: failed program was:" >&5
6487 cat conftest.$ac_ext >&5
6488 cf_have_incdir=yes
6489 fi
6490 rm -f conftest.$ac_objext conftest.$ac_ext
6491                           CPPFLAGS=$cf_save_CPPFLAGS
6492                         fi
6493                   fi
6494                 fi
6495
6496                 if test "$cf_have_incdir" = no ; then
6497                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6498
6499 echo "${as_me:-configure}:6499: testing adding $cf_add_incdir to include-path ..." 1>&5
6500
6501                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6502
6503                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6504                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6505                   cf_add_incdir="$cf_top_incdir"
6506                 else
6507                   break
6508                 fi
6509           fi
6510         done
6511   done
6512 fi
6513
6514 fi
6515
6516 # Set definitions to allow ifdef'ing for ncurses.h
6517
6518 case $cf_cv_ncurses_header in # (vi
6519 *ncurses.h)
6520         cat >>confdefs.h <<\EOF
6521 #define HAVE_NCURSES_H 1
6522 EOF
6523
6524         ;;
6525 esac
6526
6527 case $cf_cv_ncurses_header in # (vi
6528 ncurses/curses.h|ncurses/ncurses.h)
6529         cat >>confdefs.h <<\EOF
6530 #define HAVE_NCURSES_NCURSES_H 1
6531 EOF
6532
6533         ;;
6534 ncursesw/curses.h|ncursesw/ncurses.h)
6535         cat >>confdefs.h <<\EOF
6536 #define HAVE_NCURSESW_NCURSES_H 1
6537 EOF
6538
6539         ;;
6540 esac
6541
6542 echo "$as_me:6542: checking for terminfo header" >&5
6543 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6544 if test "${cf_cv_term_header+set}" = set; then
6545   echo $ECHO_N "(cached) $ECHO_C" >&6
6546 else
6547
6548 case ${cf_cv_ncurses_header} in #(vi
6549 */ncurses.h|*/ncursesw.h) #(vi
6550         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6551         ;;
6552 *)
6553         cf_term_header=term.h
6554         ;;
6555 esac
6556
6557 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6558 do
6559 cat >conftest.$ac_ext <<_ACEOF
6560 #line 6560 "configure"
6561 #include "confdefs.h"
6562 #include <stdio.h>
6563 #include <${cf_cv_ncurses_header:-curses.h}>
6564 #include <$cf_test>
6565
6566 int
6567 main ()
6568 {
6569 int x = auto_left_margin
6570   ;
6571   return 0;
6572 }
6573 _ACEOF
6574 rm -f conftest.$ac_objext
6575 if { (eval echo "$as_me:6575: \"$ac_compile\"") >&5
6576   (eval $ac_compile) 2>&5
6577   ac_status=$?
6578   echo "$as_me:6578: \$? = $ac_status" >&5
6579   (exit $ac_status); } &&
6580          { ac_try='test -s conftest.$ac_objext'
6581   { (eval echo "$as_me:6581: \"$ac_try\"") >&5
6582   (eval $ac_try) 2>&5
6583   ac_status=$?
6584   echo "$as_me:6584: \$? = $ac_status" >&5
6585   (exit $ac_status); }; }; then
6586
6587         cf_cv_term_header="$cf_test"
6588 else
6589   echo "$as_me: failed program was:" >&5
6590 cat conftest.$ac_ext >&5
6591
6592         cf_cv_term_header=unknown
6593
6594 fi
6595 rm -f conftest.$ac_objext conftest.$ac_ext
6596         test "$cf_cv_term_header" != unknown && break
6597 done
6598
6599 fi
6600 echo "$as_me:6600: result: $cf_cv_term_header" >&5
6601 echo "${ECHO_T}$cf_cv_term_header" >&6
6602
6603 # Set definitions to allow ifdef'ing to accommodate subdirectories
6604
6605 case $cf_cv_term_header in # (vi
6606 *term.h)
6607         cat >>confdefs.h <<\EOF
6608 #define HAVE_TERM_H 1
6609 EOF
6610
6611         ;;
6612 esac
6613
6614 case $cf_cv_term_header in # (vi
6615 ncurses/term.h) #(vi
6616         cat >>confdefs.h <<\EOF
6617 #define HAVE_NCURSES_TERM_H 1
6618 EOF
6619
6620         ;;
6621 ncursesw/term.h)
6622         cat >>confdefs.h <<\EOF
6623 #define HAVE_NCURSESW_TERM_H 1
6624 EOF
6625
6626         ;;
6627 esac
6628
6629 # some applications need this, but should check for NCURSES_VERSION
6630 cat >>confdefs.h <<\EOF
6631 #define NCURSES 1
6632 EOF
6633
6634 echo "$as_me:6634: checking for ncurses version" >&5
6635 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6636 if test "${cf_cv_ncurses_version+set}" = set; then
6637   echo $ECHO_N "(cached) $ECHO_C" >&6
6638 else
6639
6640         cf_cv_ncurses_version=no
6641         cf_tempfile=out$$
6642         rm -f $cf_tempfile
6643         if test "$cross_compiling" = yes; then
6644
6645         # This will not work if the preprocessor splits the line after the
6646         # Autoconf token.  The 'unproto' program does that.
6647         cat > conftest.$ac_ext <<EOF
6648 #include <${cf_cv_ncurses_header:-curses.h}>
6649 #undef Autoconf
6650 #ifdef NCURSES_VERSION
6651 Autoconf NCURSES_VERSION
6652 #else
6653 #ifdef __NCURSES_H
6654 Autoconf "old"
6655 #endif
6656 ;
6657 #endif
6658 EOF
6659         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6660         { (eval echo "$as_me:6660: \"$cf_try\"") >&5
6661   (eval $cf_try) 2>&5
6662   ac_status=$?
6663   echo "$as_me:6663: \$? = $ac_status" >&5
6664   (exit $ac_status); }
6665         if test -f conftest.out ; then
6666                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6667                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6668                 rm -f conftest.out
6669         fi
6670
6671 else
6672   cat >conftest.$ac_ext <<_ACEOF
6673 #line 6673 "configure"
6674 #include "confdefs.h"
6675
6676 #include <${cf_cv_ncurses_header:-curses.h}>
6677 #include <stdio.h>
6678 int main()
6679 {
6680         FILE *fp = fopen("$cf_tempfile", "w");
6681 #ifdef NCURSES_VERSION
6682 # ifdef NCURSES_VERSION_PATCH
6683         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6684 # else
6685         fprintf(fp, "%s\n", NCURSES_VERSION);
6686 # endif
6687 #else
6688 # ifdef __NCURSES_H
6689         fprintf(fp, "old\n");
6690 # else
6691         make an error
6692 # endif
6693 #endif
6694         ${cf_cv_main_return:-return}(0);
6695 }
6696 _ACEOF
6697 rm -f conftest$ac_exeext
6698 if { (eval echo "$as_me:6698: \"$ac_link\"") >&5
6699   (eval $ac_link) 2>&5
6700   ac_status=$?
6701   echo "$as_me:6701: \$? = $ac_status" >&5
6702   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6703   { (eval echo "$as_me:6703: \"$ac_try\"") >&5
6704   (eval $ac_try) 2>&5
6705   ac_status=$?
6706   echo "$as_me:6706: \$? = $ac_status" >&5
6707   (exit $ac_status); }; }; then
6708
6709         cf_cv_ncurses_version=`cat $cf_tempfile`
6710 else
6711   echo "$as_me: program exited with status $ac_status" >&5
6712 echo "$as_me: failed program was:" >&5
6713 cat conftest.$ac_ext >&5
6714 fi
6715 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6716 fi
6717         rm -f $cf_tempfile
6718
6719 fi
6720 echo "$as_me:6720: result: $cf_cv_ncurses_version" >&5
6721 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6722 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
6723 #define NCURSES 1
6724 EOF
6725
6726 cf_nculib_root=ncurses
6727         # This works, except for the special case where we find gpm, but
6728         # ncurses is in a nonstandard location via $LIBS, and we really want
6729         # to link gpm.
6730 cf_ncurses_LIBS=""
6731 cf_ncurses_SAVE="$LIBS"
6732 echo "$as_me:6732: checking for Gpm_Open in -lgpm" >&5
6733 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6734 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6735   echo $ECHO_N "(cached) $ECHO_C" >&6
6736 else
6737   ac_check_lib_save_LIBS=$LIBS
6738 LIBS="-lgpm  $LIBS"
6739 cat >conftest.$ac_ext <<_ACEOF
6740 #line 6740 "configure"
6741 #include "confdefs.h"
6742
6743 /* Override any gcc2 internal prototype to avoid an error.  */
6744 #ifdef __cplusplus
6745 extern "C"
6746 #endif
6747 /* We use char because int might match the return type of a gcc2
6748    builtin and then its argument prototype would still apply.  */
6749 char Gpm_Open ();
6750 int
6751 main ()
6752 {
6753 Gpm_Open ();
6754   ;
6755   return 0;
6756 }
6757 _ACEOF
6758 rm -f conftest.$ac_objext conftest$ac_exeext
6759 if { (eval echo "$as_me:6759: \"$ac_link\"") >&5
6760   (eval $ac_link) 2>&5
6761   ac_status=$?
6762   echo "$as_me:6762: \$? = $ac_status" >&5
6763   (exit $ac_status); } &&
6764          { ac_try='test -s conftest$ac_exeext'
6765   { (eval echo "$as_me:6765: \"$ac_try\"") >&5
6766   (eval $ac_try) 2>&5
6767   ac_status=$?
6768   echo "$as_me:6768: \$? = $ac_status" >&5
6769   (exit $ac_status); }; }; then
6770   ac_cv_lib_gpm_Gpm_Open=yes
6771 else
6772   echo "$as_me: failed program was:" >&5
6773 cat conftest.$ac_ext >&5
6774 ac_cv_lib_gpm_Gpm_Open=no
6775 fi
6776 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6777 LIBS=$ac_check_lib_save_LIBS
6778 fi
6779 echo "$as_me:6779: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6780 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6781 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6782   echo "$as_me:6782: checking for initscr in -lgpm" >&5
6783 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6784 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6785   echo $ECHO_N "(cached) $ECHO_C" >&6
6786 else
6787   ac_check_lib_save_LIBS=$LIBS
6788 LIBS="-lgpm  $LIBS"
6789 cat >conftest.$ac_ext <<_ACEOF
6790 #line 6790 "configure"
6791 #include "confdefs.h"
6792
6793 /* Override any gcc2 internal prototype to avoid an error.  */
6794 #ifdef __cplusplus
6795 extern "C"
6796 #endif
6797 /* We use char because int might match the return type of a gcc2
6798    builtin and then its argument prototype would still apply.  */
6799 char initscr ();
6800 int
6801 main ()
6802 {
6803 initscr ();
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_lib_gpm_initscr=yes
6821 else
6822   echo "$as_me: failed program was:" >&5
6823 cat conftest.$ac_ext >&5
6824 ac_cv_lib_gpm_initscr=no
6825 fi
6826 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6827 LIBS=$ac_check_lib_save_LIBS
6828 fi
6829 echo "$as_me:6829: result: $ac_cv_lib_gpm_initscr" >&5
6830 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6831 if test $ac_cv_lib_gpm_initscr = yes; then
6832   LIBS="$cf_ncurses_SAVE"
6833 else
6834   cf_ncurses_LIBS="-lgpm"
6835 fi
6836
6837 fi
6838
6839 case $host_os in #(vi
6840 freebsd*)
6841         # This is only necessary if you are linking against an obsolete
6842         # version of ncurses (but it should do no harm, since it's static).
6843         if test "$cf_nculib_root" = ncurses ; then
6844                 echo "$as_me:6844: checking for tgoto in -lmytinfo" >&5
6845 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6846 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6847   echo $ECHO_N "(cached) $ECHO_C" >&6
6848 else
6849   ac_check_lib_save_LIBS=$LIBS
6850 LIBS="-lmytinfo  $LIBS"
6851 cat >conftest.$ac_ext <<_ACEOF
6852 #line 6852 "configure"
6853 #include "confdefs.h"
6854
6855 /* Override any gcc2 internal prototype to avoid an error.  */
6856 #ifdef __cplusplus
6857 extern "C"
6858 #endif
6859 /* We use char because int might match the return type of a gcc2
6860    builtin and then its argument prototype would still apply.  */
6861 char tgoto ();
6862 int
6863 main ()
6864 {
6865 tgoto ();
6866   ;
6867   return 0;
6868 }
6869 _ACEOF
6870 rm -f conftest.$ac_objext conftest$ac_exeext
6871 if { (eval echo "$as_me:6871: \"$ac_link\"") >&5
6872   (eval $ac_link) 2>&5
6873   ac_status=$?
6874   echo "$as_me:6874: \$? = $ac_status" >&5
6875   (exit $ac_status); } &&
6876          { ac_try='test -s conftest$ac_exeext'
6877   { (eval echo "$as_me:6877: \"$ac_try\"") >&5
6878   (eval $ac_try) 2>&5
6879   ac_status=$?
6880   echo "$as_me:6880: \$? = $ac_status" >&5
6881   (exit $ac_status); }; }; then
6882   ac_cv_lib_mytinfo_tgoto=yes
6883 else
6884   echo "$as_me: failed program was:" >&5
6885 cat conftest.$ac_ext >&5
6886 ac_cv_lib_mytinfo_tgoto=no
6887 fi
6888 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6889 LIBS=$ac_check_lib_save_LIBS
6890 fi
6891 echo "$as_me:6891: result: $ac_cv_lib_mytinfo_tgoto" >&5
6892 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6893 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6894   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6895 fi
6896
6897         fi
6898         ;;
6899 esac
6900
6901 LIBS="$cf_ncurses_LIBS $LIBS"
6902
6903 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6904 then
6905         LIBS="-l$cf_nculib_root $LIBS"
6906 else
6907
6908         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6909         cf_libdir=""
6910         echo "$as_me:6910: checking for initscr" >&5
6911 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6912 if test "${ac_cv_func_initscr+set}" = set; then
6913   echo $ECHO_N "(cached) $ECHO_C" >&6
6914 else
6915   cat >conftest.$ac_ext <<_ACEOF
6916 #line 6916 "configure"
6917 #include "confdefs.h"
6918 /* System header to define __stub macros and hopefully few prototypes,
6919     which can conflict with char initscr (); below.  */
6920 #include <assert.h>
6921 /* Override any gcc2 internal prototype to avoid an error.  */
6922 #ifdef __cplusplus
6923 extern "C"
6924 #endif
6925 /* We use char because int might match the return type of a gcc2
6926    builtin and then its argument prototype would still apply.  */
6927 char initscr ();
6928 char (*f) ();
6929
6930 int
6931 main ()
6932 {
6933 /* The GNU C library defines this for functions which it implements
6934     to always fail with ENOSYS.  Some functions are actually named
6935     something starting with __ and the normal name is an alias.  */
6936 #if defined (__stub_initscr) || defined (__stub___initscr)
6937 choke me
6938 #else
6939 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6940 #endif
6941
6942   ;
6943   return 0;
6944 }
6945 _ACEOF
6946 rm -f conftest.$ac_objext conftest$ac_exeext
6947 if { (eval echo "$as_me:6947: \"$ac_link\"") >&5
6948   (eval $ac_link) 2>&5
6949   ac_status=$?
6950   echo "$as_me:6950: \$? = $ac_status" >&5
6951   (exit $ac_status); } &&
6952          { ac_try='test -s conftest$ac_exeext'
6953   { (eval echo "$as_me:6953: \"$ac_try\"") >&5
6954   (eval $ac_try) 2>&5
6955   ac_status=$?
6956   echo "$as_me:6956: \$? = $ac_status" >&5
6957   (exit $ac_status); }; }; then
6958   ac_cv_func_initscr=yes
6959 else
6960   echo "$as_me: failed program was:" >&5
6961 cat conftest.$ac_ext >&5
6962 ac_cv_func_initscr=no
6963 fi
6964 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6965 fi
6966 echo "$as_me:6966: result: $ac_cv_func_initscr" >&5
6967 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6968 if test $ac_cv_func_initscr = yes; then
6969   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6970 else
6971
6972                 cf_save_LIBS="$LIBS"
6973                 echo "$as_me:6973: checking for initscr in -l$cf_nculib_root" >&5
6974 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6975                 LIBS="-l$cf_nculib_root $LIBS"
6976                 cat >conftest.$ac_ext <<_ACEOF
6977 #line 6977 "configure"
6978 #include "confdefs.h"
6979 #include <${cf_cv_ncurses_header:-curses.h}>
6980 int
6981 main ()
6982 {
6983 initscr()
6984   ;
6985   return 0;
6986 }
6987 _ACEOF
6988 rm -f conftest.$ac_objext conftest$ac_exeext
6989 if { (eval echo "$as_me:6989: \"$ac_link\"") >&5
6990   (eval $ac_link) 2>&5
6991   ac_status=$?
6992   echo "$as_me:6992: \$? = $ac_status" >&5
6993   (exit $ac_status); } &&
6994          { ac_try='test -s conftest$ac_exeext'
6995   { (eval echo "$as_me:6995: \"$ac_try\"") >&5
6996   (eval $ac_try) 2>&5
6997   ac_status=$?
6998   echo "$as_me:6998: \$? = $ac_status" >&5
6999   (exit $ac_status); }; }; then
7000   echo "$as_me:7000: result: yes" >&5
7001 echo "${ECHO_T}yes" >&6
7002                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7003
7004 else
7005   echo "$as_me: failed program was:" >&5
7006 cat conftest.$ac_ext >&5
7007 echo "$as_me:7007: result: no" >&5
7008 echo "${ECHO_T}no" >&6
7009
7010 cf_search=
7011 cf_library_path_list=""
7012 if test -n "${LDFLAGS}${LIBS}" ; then
7013         for cf_library_path in $LDFLAGS $LIBS
7014         do
7015                 case $cf_library_path in #(vi
7016                 -L*)
7017                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7018
7019 test "$cf_library_path" != "NONE" && \
7020 test -d "$cf_library_path" && \
7021  {
7022         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7023         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7024         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7025         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7026         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7027         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"
7028 }
7029
7030                         cf_library_path_list="$cf_library_path_list $cf_search"
7031                         ;;
7032                 esac
7033         done
7034 fi
7035
7036 cf_search=
7037
7038 test "/usr" != "$prefix" && \
7039 test -d "/usr" && \
7040 (test $prefix = NONE || test "/usr" != "$prefix") && {
7041         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7042         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7043         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7044         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7045         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7046         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7047 }
7048
7049 test "$prefix" != "NONE" && \
7050 test -d "$prefix" && \
7051  {
7052         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7053         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7054         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7055         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7056         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7057         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7058 }
7059
7060 test "/usr/local" != "$prefix" && \
7061 test -d "/usr/local" && \
7062 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7063         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7064         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7065         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7066         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7067         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7068         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7069 }
7070
7071 test "/opt" != "$prefix" && \
7072 test -d "/opt" && \
7073 (test $prefix = NONE || test "/opt" != "$prefix") && {
7074         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7075         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7076         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7077         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7078         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7079         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7080 }
7081
7082 test "$HOME" != "$prefix" && \
7083 test -d "$HOME" && \
7084 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7085         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7086         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7087         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7088         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7089         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7090         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7091 }
7092
7093 cf_search="$cf_library_path_list $cf_search"
7094
7095                         for cf_libdir in $cf_search
7096                         do
7097                                 echo "$as_me:7097: checking for -l$cf_nculib_root in $cf_libdir" >&5
7098 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7099                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7100                                 cat >conftest.$ac_ext <<_ACEOF
7101 #line 7101 "configure"
7102 #include "confdefs.h"
7103 #include <${cf_cv_ncurses_header:-curses.h}>
7104 int
7105 main ()
7106 {
7107 initscr()
7108   ;
7109   return 0;
7110 }
7111 _ACEOF
7112 rm -f conftest.$ac_objext conftest$ac_exeext
7113 if { (eval echo "$as_me:7113: \"$ac_link\"") >&5
7114   (eval $ac_link) 2>&5
7115   ac_status=$?
7116   echo "$as_me:7116: \$? = $ac_status" >&5
7117   (exit $ac_status); } &&
7118          { ac_try='test -s conftest$ac_exeext'
7119   { (eval echo "$as_me:7119: \"$ac_try\"") >&5
7120   (eval $ac_try) 2>&5
7121   ac_status=$?
7122   echo "$as_me:7122: \$? = $ac_status" >&5
7123   (exit $ac_status); }; }; then
7124   echo "$as_me:7124: result: yes" >&5
7125 echo "${ECHO_T}yes" >&6
7126                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7127                                          break
7128 else
7129   echo "$as_me: failed program was:" >&5
7130 cat conftest.$ac_ext >&5
7131 echo "$as_me:7131: result: no" >&5
7132 echo "${ECHO_T}no" >&6
7133                                          LIBS="$cf_save_LIBS"
7134 fi
7135 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7136                         done
7137
7138 fi
7139 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7140
7141 fi
7142
7143 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7144
7145 if test $cf_found_library = no ; then
7146         { { echo "$as_me:7146: error: Cannot link $cf_nculib_root library" >&5
7147 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7148    { (exit 1); exit 1; }; }
7149 fi
7150
7151 fi
7152
7153 if test -n "$cf_ncurses_LIBS" ; then
7154         echo "$as_me:7154: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7155 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7156         cf_ncurses_SAVE="$LIBS"
7157         for p in $cf_ncurses_LIBS ; do
7158                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7159                 if test "$q" != "$LIBS" ; then
7160                         LIBS="$q"
7161                 fi
7162         done
7163         cat >conftest.$ac_ext <<_ACEOF
7164 #line 7164 "configure"
7165 #include "confdefs.h"
7166 #include <${cf_cv_ncurses_header:-curses.h}>
7167 int
7168 main ()
7169 {
7170 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7171   ;
7172   return 0;
7173 }
7174 _ACEOF
7175 rm -f conftest.$ac_objext conftest$ac_exeext
7176 if { (eval echo "$as_me:7176: \"$ac_link\"") >&5
7177   (eval $ac_link) 2>&5
7178   ac_status=$?
7179   echo "$as_me:7179: \$? = $ac_status" >&5
7180   (exit $ac_status); } &&
7181          { ac_try='test -s conftest$ac_exeext'
7182   { (eval echo "$as_me:7182: \"$ac_try\"") >&5
7183   (eval $ac_try) 2>&5
7184   ac_status=$?
7185   echo "$as_me:7185: \$? = $ac_status" >&5
7186   (exit $ac_status); }; }; then
7187   echo "$as_me:7187: result: yes" >&5
7188 echo "${ECHO_T}yes" >&6
7189 else
7190   echo "$as_me: failed program was:" >&5
7191 cat conftest.$ac_ext >&5
7192 echo "$as_me:7192: result: no" >&5
7193 echo "${ECHO_T}no" >&6
7194                  LIBS="$cf_ncurses_SAVE"
7195 fi
7196 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7197 fi
7198
7199 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7200
7201 cat >>confdefs.h <<EOF
7202 #define $cf_nculib_ROOT 1
7203 EOF
7204
7205 fi
7206
7207 fi
7208
7209 if test "$NCURSES_CONFIG" != none ; then
7210
7211 cf_version=`$NCURSES_CONFIG --version`
7212
7213 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7214 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
7215 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
7216
7217 # ABI version is not available from headers
7218 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7219
7220 else
7221
7222 for cf_name in MAJOR MINOR PATCH
7223 do
7224 cat >conftest.$ac_ext <<CF_EOF
7225 #include <${cf_cv_ncurses_header:-curses.h}>
7226 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7227 CF_EOF
7228         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7229         { (eval echo "$as_me:7229: \"$cf_try\"") >&5
7230   (eval $cf_try) 2>&5
7231   ac_status=$?
7232   echo "$as_me:7232: \$? = $ac_status" >&5
7233   (exit $ac_status); }
7234         if test -f conftest.out ; then
7235                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
7236                 eval NCURSES_$cf_name=\"$cf_result\"
7237                 # cat conftest.$ac_ext
7238                 # cat conftest.out
7239         fi
7240 done
7241
7242 cf_cv_abi_version=${NCURSES_MAJOR}
7243
7244 fi
7245
7246 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7247
7248 cf_cv_timestamp=`date`
7249
7250 echo "$as_me:7250: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7251 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7252
7253 echo "$as_me:7253: checking if you want to have a library-prefix" >&5
7254 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
7255
7256 # Check whether --with-lib-prefix or --without-lib-prefix was given.
7257 if test "${with_lib_prefix+set}" = set; then
7258   withval="$with_lib_prefix"
7259   with_lib_prefix=$withval
7260 else
7261   with_lib_prefix=auto
7262 fi;
7263 echo "$as_me:7263: result: $with_lib_prefix" >&5
7264 echo "${ECHO_T}$with_lib_prefix" >&6
7265
7266 if test $with_lib_prefix = auto
7267 then
7268
7269         case $cf_cv_system_name in #(vi
7270         OS/2*|os2*) #(vi
7271         LIB_PREFIX=''
7272         ;;
7273         *)      LIB_PREFIX='lib'
7274         ;;
7275         esac
7276 cf_prefix=$LIB_PREFIX
7277
7278 elif test $with_lib_prefix = no
7279 then
7280         LIB_PREFIX=
7281 else
7282         LIB_PREFIX=$with_lib_prefix
7283 fi
7284
7285 LIB_SUFFIX=
7286
7287 ###############################################################################
7288
7289 if test X"$CC_G_OPT" = X"" ; then
7290         CC_G_OPT='-g'
7291         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7292 fi
7293
7294 echo "$as_me:7294: checking for default loader flags" >&5
7295 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7296 case $DFT_LWR_MODEL in
7297 normal)  LD_MODEL=''   ;;
7298 debug)   LD_MODEL=$CC_G_OPT ;;
7299 profile) LD_MODEL='-pg';;
7300 shared)  LD_MODEL=''   ;;
7301 esac
7302 echo "$as_me:7302: result: $LD_MODEL" >&5
7303 echo "${ECHO_T}$LD_MODEL" >&6
7304
7305 LD_RPATH_OPT=
7306 echo "$as_me:7306: checking for an rpath option" >&5
7307 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7308 case $cf_cv_system_name in #(vi
7309 irix*) #(vi
7310         if test "$GCC" = yes; then
7311                 LD_RPATH_OPT="-Wl,-rpath,"
7312         else
7313                 LD_RPATH_OPT="-rpath "
7314         fi
7315         ;;
7316 linux*|gnu*|k*bsd*-gnu) #(vi
7317         LD_RPATH_OPT="-Wl,-rpath,"
7318         ;;
7319 openbsd[2-9].*|mirbsd*) #(vi
7320         LD_RPATH_OPT="-Wl,-rpath,"
7321         ;;
7322 dragonfly*|freebsd*) #(vi
7323         LD_RPATH_OPT="-rpath "
7324         ;;
7325 netbsd*) #(vi
7326         LD_RPATH_OPT="-Wl,-rpath,"
7327         ;;
7328 osf*|mls+*) #(vi
7329         LD_RPATH_OPT="-rpath "
7330         ;;
7331 solaris2*) #(vi
7332         LD_RPATH_OPT="-R"
7333         ;;
7334 *)
7335         ;;
7336 esac
7337 echo "$as_me:7337: result: $LD_RPATH_OPT" >&5
7338 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7339
7340 case "x$LD_RPATH_OPT" in #(vi
7341 x-R*)
7342         echo "$as_me:7342: checking if we need a space after rpath option" >&5
7343 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7344         cf_save_LIBS="$LIBS"
7345         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
7346         cat >conftest.$ac_ext <<_ACEOF
7347 #line 7347 "configure"
7348 #include "confdefs.h"
7349
7350 int
7351 main ()
7352 {
7353
7354   ;
7355   return 0;
7356 }
7357 _ACEOF
7358 rm -f conftest.$ac_objext conftest$ac_exeext
7359 if { (eval echo "$as_me:7359: \"$ac_link\"") >&5
7360   (eval $ac_link) 2>&5
7361   ac_status=$?
7362   echo "$as_me:7362: \$? = $ac_status" >&5
7363   (exit $ac_status); } &&
7364          { ac_try='test -s conftest$ac_exeext'
7365   { (eval echo "$as_me:7365: \"$ac_try\"") >&5
7366   (eval $ac_try) 2>&5
7367   ac_status=$?
7368   echo "$as_me:7368: \$? = $ac_status" >&5
7369   (exit $ac_status); }; }; then
7370   cf_rpath_space=no
7371 else
7372   echo "$as_me: failed program was:" >&5
7373 cat conftest.$ac_ext >&5
7374 cf_rpath_space=yes
7375 fi
7376 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7377         LIBS="$cf_save_LIBS"
7378         echo "$as_me:7378: result: $cf_rpath_space" >&5
7379 echo "${ECHO_T}$cf_rpath_space" >&6
7380         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7381         ;;
7382 esac
7383
7384         LOCAL_LDFLAGS=
7385         LOCAL_LDFLAGS2=
7386         LD_SHARED_OPTS=
7387         INSTALL_LIB="-m 644"
7388
7389         cf_cv_do_symlinks=no
7390         cf_ld_rpath_opt=
7391         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7392
7393         echo "$as_me:7393: checking if release/abi version should be used for shared libs" >&5
7394 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7395
7396 # Check whether --with-shlib-version or --without-shlib-version was given.
7397 if test "${with_shlib_version+set}" = set; then
7398   withval="$with_shlib_version"
7399   test -z "$withval" && withval=auto
7400         case $withval in #(vi
7401         yes) #(vi
7402                 cf_cv_shlib_version=auto
7403                 ;;
7404         rel|abi|auto|no) #(vi
7405                 cf_cv_shlib_version=$withval
7406                 ;;
7407         *)
7408                 { { echo "$as_me:7408: error: option value must be one of: rel, abi, auto or no" >&5
7409 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7410    { (exit 1); exit 1; }; }
7411                 ;;
7412         esac
7413
7414 else
7415   cf_cv_shlib_version=auto
7416 fi;
7417         echo "$as_me:7417: result: $cf_cv_shlib_version" >&5
7418 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7419
7420         cf_cv_rm_so_locs=no
7421
7422         # Some less-capable ports of gcc support only -fpic
7423         CC_SHARED_OPTS=
7424         if test "$GCC" = yes
7425         then
7426                 echo "$as_me:7426: checking which $CC option to use" >&5
7427 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7428                 cf_save_CFLAGS="$CFLAGS"
7429                 for CC_SHARED_OPTS in -fPIC -fpic ''
7430                 do
7431                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7432                         cat >conftest.$ac_ext <<_ACEOF
7433 #line 7433 "configure"
7434 #include "confdefs.h"
7435 #include <stdio.h>
7436 int
7437 main ()
7438 {
7439 int x = 1
7440   ;
7441   return 0;
7442 }
7443 _ACEOF
7444 rm -f conftest.$ac_objext
7445 if { (eval echo "$as_me:7445: \"$ac_compile\"") >&5
7446   (eval $ac_compile) 2>&5
7447   ac_status=$?
7448   echo "$as_me:7448: \$? = $ac_status" >&5
7449   (exit $ac_status); } &&
7450          { ac_try='test -s conftest.$ac_objext'
7451   { (eval echo "$as_me:7451: \"$ac_try\"") >&5
7452   (eval $ac_try) 2>&5
7453   ac_status=$?
7454   echo "$as_me:7454: \$? = $ac_status" >&5
7455   (exit $ac_status); }; }; then
7456   break
7457 else
7458   echo "$as_me: failed program was:" >&5
7459 cat conftest.$ac_ext >&5
7460 fi
7461 rm -f conftest.$ac_objext conftest.$ac_ext
7462                 done
7463                 echo "$as_me:7463: result: $CC_SHARED_OPTS" >&5
7464 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7465                 CFLAGS="$cf_save_CFLAGS"
7466         fi
7467
7468         cf_cv_shlib_version_infix=no
7469
7470         case $cf_cv_system_name in #(vi
7471         aix4.3-9*|aix[5-7]*) #(vi
7472                 if test "$GCC" = yes; then
7473                         CC_SHARED_OPTS=
7474                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7475                 else
7476                         # CC_SHARED_OPTS='-qpic=large -G'
7477                         # perhaps "-bM:SRE -bnoentry -bexpall"
7478                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
7479                 fi
7480                 ;;
7481         beos*) #(vi
7482                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7483                 ;;
7484         cygwin*) #(vi
7485                 CC_SHARED_OPTS=
7486                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7487                 cf_cv_shlib_version=cygdll
7488                 cf_cv_shlib_version_infix=cygdll
7489                 cat >mk_shared_lib.sh <<-CF_EOF
7490                 #!/bin/sh
7491                 SHARED_LIB=\$1
7492                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7493                 shift
7494                 cat <<-EOF
7495                 Linking shared library
7496                 ** SHARED_LIB \$SHARED_LIB
7497                 ** IMPORT_LIB \$IMPORT_LIB
7498 EOF
7499                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7500 CF_EOF
7501                 chmod +x mk_shared_lib.sh
7502                 ;;
7503         darwin*) #(vi
7504                 EXTRA_CFLAGS="-no-cpp-precomp"
7505                 CC_SHARED_OPTS="-dynamic"
7506                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7507                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7508                 cf_cv_shlib_version_infix=yes
7509                 echo "$as_me:7509: checking if ld -search_paths_first works" >&5
7510 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7511 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7512   echo $ECHO_N "(cached) $ECHO_C" >&6
7513 else
7514
7515                         cf_save_LDFLAGS=$LDFLAGS
7516                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7517                         cat >conftest.$ac_ext <<_ACEOF
7518 #line 7518 "configure"
7519 #include "confdefs.h"
7520
7521 int
7522 main ()
7523 {
7524 int i;
7525   ;
7526   return 0;
7527 }
7528 _ACEOF
7529 rm -f conftest.$ac_objext conftest$ac_exeext
7530 if { (eval echo "$as_me:7530: \"$ac_link\"") >&5
7531   (eval $ac_link) 2>&5
7532   ac_status=$?
7533   echo "$as_me:7533: \$? = $ac_status" >&5
7534   (exit $ac_status); } &&
7535          { ac_try='test -s conftest$ac_exeext'
7536   { (eval echo "$as_me:7536: \"$ac_try\"") >&5
7537   (eval $ac_try) 2>&5
7538   ac_status=$?
7539   echo "$as_me:7539: \$? = $ac_status" >&5
7540   (exit $ac_status); }; }; then
7541   cf_cv_ldflags_search_paths_first=yes
7542 else
7543   echo "$as_me: failed program was:" >&5
7544 cat conftest.$ac_ext >&5
7545 cf_cv_ldflags_search_paths_first=no
7546 fi
7547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7548                                 LDFLAGS=$cf_save_LDFLAGS
7549 fi
7550 echo "$as_me:7550: result: $cf_cv_ldflags_search_paths_first" >&5
7551 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7552                 if test $cf_cv_ldflags_search_paths_first = yes; then
7553                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7554                 fi
7555                 ;;
7556         hpux*) #(vi
7557                 # (tested with gcc 2.7.2 -- I don't have c89)
7558                 if test "$GCC" = yes; then
7559                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7560                 else
7561                         CC_SHARED_OPTS='+Z'
7562                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7563                 fi
7564                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7565                 # HP-UX shared libraries must be executable, and should be
7566                 # readonly to exploit a quirk in the memory manager.
7567                 INSTALL_LIB="-m 555"
7568                 ;;
7569         interix*)
7570                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7571                 if test "$cf_cv_shlib_version" = rel; then
7572                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
7573                 else
7574                         cf_shared_soname='`basename `'
7575                 fi
7576                 CC_SHARED_OPTS=
7577                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
7578                 ;;
7579         irix*) #(vi
7580                 if test "$cf_cv_enable_rpath" = yes ; then
7581                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7582                 fi
7583                 # tested with IRIX 5.2 and 'cc'.
7584                 if test "$GCC" != yes; then
7585                         CC_SHARED_OPTS='-KPIC'
7586                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7587                 else
7588                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7589                 fi
7590                 cf_cv_rm_so_locs=yes
7591                 ;;
7592         linux*|gnu*|k*bsd*-gnu) #(vi
7593                 if test "$DFT_LWR_MODEL" = "shared" ; then
7594                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7595                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7596                 fi
7597                 if test "$cf_cv_enable_rpath" = yes ; then
7598                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7599                 fi
7600
7601         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7602         if test "$cf_cv_shlib_version" = rel; then
7603                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7604         else
7605                 cf_cv_shared_soname='`basename $@`'
7606         fi
7607
7608                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7609                 ;;
7610         mingw*) #(vi
7611                 cf_cv_shlib_version=mingw
7612                 cf_cv_shlib_version_infix=mingw
7613                 CC_SHARED_OPTS=
7614                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7615                 #MK_SHARED_LIB='${CC} ${CFLAGS} -mdll -Wl,-soname,'$cf_cv_shared_soname',-stats -o $[@]'
7616                 #MK_SHARED_LIB='${DLLTOOL} --export-all-symbols --output-exp --output-lib $[@]'
7617                 cat >mk_shared_lib.sh <<-CF_EOF
7618                 #!/bin/sh
7619                 SHARED_LIB=\$1
7620                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
7621                 shift
7622                 cat <<-EOF
7623                 Linking shared library
7624                 ** SHARED_LIB \$SHARED_LIB
7625                 ** IMPORT_LIB \$IMPORT_LIB
7626 EOF
7627                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7628 CF_EOF
7629                 chmod +x mk_shared_lib.sh
7630                 ;;
7631         openbsd[2-9].*|mirbsd*) #(vi
7632                 if test "$DFT_LWR_MODEL" = "shared" ; then
7633                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7634                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7635                 fi
7636                 if test "$cf_cv_enable_rpath" = yes ; then
7637                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7638                 fi
7639                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7640
7641         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7642         if test "$cf_cv_shlib_version" = rel; then
7643                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7644         else
7645                 cf_cv_shared_soname='`basename $@`'
7646         fi
7647
7648                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7649                 ;;
7650         nto-qnx*|openbsd*|freebsd[12].*) #(vi
7651                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7652                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7653                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7654                 ;;
7655         dragonfly*|freebsd*) #(vi
7656                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7657                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7658                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7659                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
7660                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7661                 fi
7662
7663         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7664         if test "$cf_cv_shlib_version" = rel; then
7665                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7666         else
7667                 cf_cv_shared_soname='`basename $@`'
7668         fi
7669
7670                 MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
7671                 ;;
7672         netbsd*) #(vi
7673                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7674                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7675                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7676                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7677                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
7678                         if test "$cf_cv_shlib_version" = auto; then
7679                         if test -f /usr/libexec/ld.elf_so; then
7680                                 cf_cv_shlib_version=abi
7681                         else
7682                                 cf_cv_shlib_version=rel
7683                         fi
7684                         fi
7685
7686         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7687         if test "$cf_cv_shlib_version" = rel; then
7688                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7689         else
7690                 cf_cv_shared_soname='`basename $@`'
7691         fi
7692
7693                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7694                 else
7695                         MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
7696                 fi
7697                 ;;
7698         osf*|mls+*) #(vi
7699                 # tested with OSF/1 V3.2 and 'cc'
7700                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7701                 # link with shared libs).
7702                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7703                 case $host_os in #(vi
7704                 osf4*)
7705                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7706                         ;;
7707                 esac
7708                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7709                 if test "$DFT_LWR_MODEL" = "shared" ; then
7710                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7711                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7712                 fi
7713                 cf_cv_rm_so_locs=yes
7714                 ;;
7715         sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
7716                 # tested with osr5.0.5
7717                 if test "$GCC" != yes; then
7718                         CC_SHARED_OPTS='-belf -KPIC'
7719                 fi
7720                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7721                 if test "$cf_cv_enable_rpath" = yes ; then
7722                         # only way is to set LD_RUN_PATH but no switch for it
7723                         RUN_PATH=$libdir
7724                 fi
7725                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7726                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7727                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7728                 ;;
7729         sunos4*) #(vi
7730                 # tested with SunOS 4.1.1 and gcc 2.7.0
7731                 if test "$GCC" != yes; then
7732                         CC_SHARED_OPTS='-KPIC'
7733                 fi
7734                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7735                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7736                 ;;
7737         solaris2*) #(vi
7738                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7739                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7740                 if test "$DFT_LWR_MODEL" = "shared" ; then
7741                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7742                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7743                 fi
7744                 if test "$cf_cv_enable_rpath" = yes ; then
7745                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7746                 fi
7747
7748         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7749         if test "$cf_cv_shlib_version" = rel; then
7750                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7751         else
7752                 cf_cv_shared_soname='`basename $@`'
7753         fi
7754
7755                 if test "$GCC" != yes; then
7756                         cf_save_CFLAGS="$CFLAGS"
7757                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7758                         do
7759                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7760                                 cat >conftest.$ac_ext <<_ACEOF
7761 #line 7761 "configure"
7762 #include "confdefs.h"
7763 #include <stdio.h>
7764 int
7765 main ()
7766 {
7767 printf("Hello\n");
7768   ;
7769   return 0;
7770 }
7771 _ACEOF
7772 rm -f conftest.$ac_objext
7773 if { (eval echo "$as_me:7773: \"$ac_compile\"") >&5
7774   (eval $ac_compile) 2>&5
7775   ac_status=$?
7776   echo "$as_me:7776: \$? = $ac_status" >&5
7777   (exit $ac_status); } &&
7778          { ac_try='test -s conftest.$ac_objext'
7779   { (eval echo "$as_me:7779: \"$ac_try\"") >&5
7780   (eval $ac_try) 2>&5
7781   ac_status=$?
7782   echo "$as_me:7782: \$? = $ac_status" >&5
7783   (exit $ac_status); }; }; then
7784   break
7785 else
7786   echo "$as_me: failed program was:" >&5
7787 cat conftest.$ac_ext >&5
7788 fi
7789 rm -f conftest.$ac_objext conftest.$ac_ext
7790                         done
7791                         CFLAGS="$cf_save_CFLAGS"
7792                         CC_SHARED_OPTS=$cf_shared_opts
7793                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7794                 else
7795                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7796                 fi
7797                 ;;
7798         sysv5uw7*|unix_sv*) #(vi
7799                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7800                 if test "$GCC" != yes; then
7801                         CC_SHARED_OPTS='-KPIC'
7802                 fi
7803                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7804                 ;;
7805         *)
7806                 CC_SHARED_OPTS='unknown'
7807                 MK_SHARED_LIB='echo unknown'
7808                 ;;
7809         esac
7810
7811         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7812         case "$cf_cv_shlib_version" in #(vi
7813         rel|abi)
7814                 case "$MK_SHARED_LIB" in #(vi
7815                 *'-o $@') #(vi
7816                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7817                         ;;
7818                 *)
7819                         { echo "$as_me:7819: WARNING: ignored --with-shlib-version" >&5
7820 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7821                         ;;
7822                 esac
7823                 ;;
7824         esac
7825
7826         # RPATH_LIST is a colon-separated list of directories
7827         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
7828         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
7829
7830         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
7831
7832 echo "${as_me:-configure}:7832: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
7833
7834         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
7835
7836 echo "${as_me:-configure}:7836: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
7837
7838 # The test/sample programs in the original tree link using rpath option.
7839 # Make it optional for packagers.
7840 if test -n "$LOCAL_LDFLAGS"
7841 then
7842         echo "$as_me:7842: checking if you want to link sample programs with rpath option" >&5
7843 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
7844
7845 # Check whether --enable-rpath-link or --disable-rpath-link was given.
7846 if test "${enable_rpath_link+set}" = set; then
7847   enableval="$enable_rpath_link"
7848   with_rpath_link=$enableval
7849 else
7850   with_rpath_link=yes
7851 fi;
7852         echo "$as_me:7852: result: $with_rpath_link" >&5
7853 echo "${ECHO_T}$with_rpath_link" >&6
7854         if test "$with_rpath_link" = no
7855         then
7856                 LOCAL_LDFLAGS=
7857                 LOCAL_LDFLAGS2=
7858         fi
7859 fi
7860
7861 ###############################################################################
7862
7863 ###   use option --enable-broken-linker to force on use of broken-linker support
7864 echo "$as_me:7864: checking if you want broken-linker support code" >&5
7865 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7866
7867 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7868 if test "${enable_broken_linker+set}" = set; then
7869   enableval="$enable_broken_linker"
7870   with_broken_linker=$enableval
7871 else
7872   with_broken_linker=${BROKEN_LINKER:-no}
7873 fi;
7874 echo "$as_me:7874: result: $with_broken_linker" >&5
7875 echo "${ECHO_T}$with_broken_linker" >&6
7876
7877 BROKEN_LINKER=0
7878 if test "$with_broken_linker" = yes ; then
7879         cat >>confdefs.h <<\EOF
7880 #define BROKEN_LINKER 1
7881 EOF
7882
7883         BROKEN_LINKER=1
7884 elif test "$DFT_LWR_MODEL" = shared ; then
7885         case $cf_cv_system_name in #(vi
7886         cygwin*)
7887                 cat >>confdefs.h <<\EOF
7888 #define BROKEN_LINKER 1
7889 EOF
7890
7891                 BROKEN_LINKER=1
7892                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7893
7894 echo "${as_me:-configure}:7894: testing cygwin linker is broken anyway ..." 1>&5
7895
7896                 ;;
7897         esac
7898 fi
7899
7900 # Check to define _XOPEN_SOURCE "automatically"
7901
7902 cf_XOPEN_SOURCE=500
7903 cf_POSIX_C_SOURCE=199506L
7904 cf_xopen_source=
7905
7906 case $host_os in #(vi
7907 aix[4-7]*) #(vi
7908         cf_xopen_source="-D_ALL_SOURCE"
7909         ;;
7910 cygwin) #(vi
7911         cf_XOPEN_SOURCE=600
7912         ;;
7913 darwin[0-8].*) #(vi
7914         cf_xopen_source="-D_APPLE_C_SOURCE"
7915         ;;
7916 darwin*) #(vi
7917         cf_xopen_source="-D_DARWIN_C_SOURCE"
7918         cf_XOPEN_SOURCE=
7919         ;;
7920 freebsd*|dragonfly*) #(vi
7921         # 5.x headers associate
7922         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7923         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7924         cf_POSIX_C_SOURCE=200112L
7925         cf_XOPEN_SOURCE=600
7926         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7927         ;;
7928 hpux11*) #(vi
7929         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7930         ;;
7931 hpux*) #(vi
7932         cf_xopen_source="-D_HPUX_SOURCE"
7933         ;;
7934 irix[56].*) #(vi
7935         cf_xopen_source="-D_SGI_SOURCE"
7936         cf_XOPEN_SOURCE=
7937         ;;
7938 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
7939
7940 echo "$as_me:7940: checking if we must define _GNU_SOURCE" >&5
7941 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7942 if test "${cf_cv_gnu_source+set}" = set; then
7943   echo $ECHO_N "(cached) $ECHO_C" >&6
7944 else
7945
7946 cat >conftest.$ac_ext <<_ACEOF
7947 #line 7947 "configure"
7948 #include "confdefs.h"
7949 #include <sys/types.h>
7950 int
7951 main ()
7952 {
7953
7954 #ifndef _XOPEN_SOURCE
7955 make an error
7956 #endif
7957   ;
7958   return 0;
7959 }
7960 _ACEOF
7961 rm -f conftest.$ac_objext
7962 if { (eval echo "$as_me:7962: \"$ac_compile\"") >&5
7963   (eval $ac_compile) 2>&5
7964   ac_status=$?
7965   echo "$as_me:7965: \$? = $ac_status" >&5
7966   (exit $ac_status); } &&
7967          { ac_try='test -s conftest.$ac_objext'
7968   { (eval echo "$as_me:7968: \"$ac_try\"") >&5
7969   (eval $ac_try) 2>&5
7970   ac_status=$?
7971   echo "$as_me:7971: \$? = $ac_status" >&5
7972   (exit $ac_status); }; }; then
7973   cf_cv_gnu_source=no
7974 else
7975   echo "$as_me: failed program was:" >&5
7976 cat conftest.$ac_ext >&5
7977 cf_save="$CPPFLAGS"
7978          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7979          cat >conftest.$ac_ext <<_ACEOF
7980 #line 7980 "configure"
7981 #include "confdefs.h"
7982 #include <sys/types.h>
7983 int
7984 main ()
7985 {
7986
7987 #ifdef _XOPEN_SOURCE
7988 make an error
7989 #endif
7990   ;
7991   return 0;
7992 }
7993 _ACEOF
7994 rm -f conftest.$ac_objext
7995 if { (eval echo "$as_me:7995: \"$ac_compile\"") >&5
7996   (eval $ac_compile) 2>&5
7997   ac_status=$?
7998   echo "$as_me:7998: \$? = $ac_status" >&5
7999   (exit $ac_status); } &&
8000          { ac_try='test -s conftest.$ac_objext'
8001   { (eval echo "$as_me:8001: \"$ac_try\"") >&5
8002   (eval $ac_try) 2>&5
8003   ac_status=$?
8004   echo "$as_me:8004: \$? = $ac_status" >&5
8005   (exit $ac_status); }; }; then
8006   cf_cv_gnu_source=no
8007 else
8008   echo "$as_me: failed program was:" >&5
8009 cat conftest.$ac_ext >&5
8010 cf_cv_gnu_source=yes
8011 fi
8012 rm -f conftest.$ac_objext conftest.$ac_ext
8013         CPPFLAGS="$cf_save"
8014
8015 fi
8016 rm -f conftest.$ac_objext conftest.$ac_ext
8017
8018 fi
8019 echo "$as_me:8019: result: $cf_cv_gnu_source" >&5
8020 echo "${ECHO_T}$cf_cv_gnu_source" >&6
8021 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
8022
8023         ;;
8024 mirbsd*) #(vi
8025         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
8026         cf_XOPEN_SOURCE=
8027
8028 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8029
8030 cf_save_CFLAGS="$CFLAGS"
8031 cf_save_CPPFLAGS="$CPPFLAGS"
8032
8033 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8034         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8035                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8036
8037 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8038         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8039                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8040
8041 echo "$as_me:8041: checking if we should define _POSIX_C_SOURCE" >&5
8042 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8043 if test "${cf_cv_posix_c_source+set}" = set; then
8044   echo $ECHO_N "(cached) $ECHO_C" >&6
8045 else
8046
8047 echo "${as_me:-configure}:8047: testing if the symbol is already defined go no further ..." 1>&5
8048
8049         cat >conftest.$ac_ext <<_ACEOF
8050 #line 8050 "configure"
8051 #include "confdefs.h"
8052 #include <sys/types.h>
8053 int
8054 main ()
8055 {
8056
8057 #ifndef _POSIX_C_SOURCE
8058 make an error
8059 #endif
8060   ;
8061   return 0;
8062 }
8063 _ACEOF
8064 rm -f conftest.$ac_objext
8065 if { (eval echo "$as_me:8065: \"$ac_compile\"") >&5
8066   (eval $ac_compile) 2>&5
8067   ac_status=$?
8068   echo "$as_me:8068: \$? = $ac_status" >&5
8069   (exit $ac_status); } &&
8070          { ac_try='test -s conftest.$ac_objext'
8071   { (eval echo "$as_me:8071: \"$ac_try\"") >&5
8072   (eval $ac_try) 2>&5
8073   ac_status=$?
8074   echo "$as_me:8074: \$? = $ac_status" >&5
8075   (exit $ac_status); }; }; then
8076   cf_cv_posix_c_source=no
8077 else
8078   echo "$as_me: failed program was:" >&5
8079 cat conftest.$ac_ext >&5
8080 cf_want_posix_source=no
8081          case .$cf_POSIX_C_SOURCE in #(vi
8082          .[12]??*) #(vi
8083                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8084                 ;;
8085          .2) #(vi
8086                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8087                 cf_want_posix_source=yes
8088                 ;;
8089          .*)
8090                 cf_want_posix_source=yes
8091                 ;;
8092          esac
8093          if test "$cf_want_posix_source" = yes ; then
8094                 cat >conftest.$ac_ext <<_ACEOF
8095 #line 8095 "configure"
8096 #include "confdefs.h"
8097 #include <sys/types.h>
8098 int
8099 main ()
8100 {
8101
8102 #ifdef _POSIX_SOURCE
8103 make an error
8104 #endif
8105   ;
8106   return 0;
8107 }
8108 _ACEOF
8109 rm -f conftest.$ac_objext
8110 if { (eval echo "$as_me:8110: \"$ac_compile\"") >&5
8111   (eval $ac_compile) 2>&5
8112   ac_status=$?
8113   echo "$as_me:8113: \$? = $ac_status" >&5
8114   (exit $ac_status); } &&
8115          { ac_try='test -s conftest.$ac_objext'
8116   { (eval echo "$as_me:8116: \"$ac_try\"") >&5
8117   (eval $ac_try) 2>&5
8118   ac_status=$?
8119   echo "$as_me:8119: \$? = $ac_status" >&5
8120   (exit $ac_status); }; }; then
8121   :
8122 else
8123   echo "$as_me: failed program was:" >&5
8124 cat conftest.$ac_ext >&5
8125 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8126 fi
8127 rm -f conftest.$ac_objext conftest.$ac_ext
8128          fi
8129
8130 echo "${as_me:-configure}:8130: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8131
8132          CFLAGS="$cf_trim_CFLAGS"
8133          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8134
8135 echo "${as_me:-configure}:8135: testing if the second compile does not leave our definition intact error ..." 1>&5
8136
8137          cat >conftest.$ac_ext <<_ACEOF
8138 #line 8138 "configure"
8139 #include "confdefs.h"
8140 #include <sys/types.h>
8141 int
8142 main ()
8143 {
8144
8145 #ifndef _POSIX_C_SOURCE
8146 make an error
8147 #endif
8148   ;
8149   return 0;
8150 }
8151 _ACEOF
8152 rm -f conftest.$ac_objext
8153 if { (eval echo "$as_me:8153: \"$ac_compile\"") >&5
8154   (eval $ac_compile) 2>&5
8155   ac_status=$?
8156   echo "$as_me:8156: \$? = $ac_status" >&5
8157   (exit $ac_status); } &&
8158          { ac_try='test -s conftest.$ac_objext'
8159   { (eval echo "$as_me:8159: \"$ac_try\"") >&5
8160   (eval $ac_try) 2>&5
8161   ac_status=$?
8162   echo "$as_me:8162: \$? = $ac_status" >&5
8163   (exit $ac_status); }; }; then
8164   :
8165 else
8166   echo "$as_me: failed program was:" >&5
8167 cat conftest.$ac_ext >&5
8168 cf_cv_posix_c_source=no
8169 fi
8170 rm -f conftest.$ac_objext conftest.$ac_ext
8171          CFLAGS="$cf_save_CFLAGS"
8172          CPPFLAGS="$cf_save_CPPFLAGS"
8173
8174 fi
8175 rm -f conftest.$ac_objext conftest.$ac_ext
8176
8177 fi
8178 echo "$as_me:8178: result: $cf_cv_posix_c_source" >&5
8179 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8180
8181 if test "$cf_cv_posix_c_source" != no ; then
8182         CFLAGS="$cf_trim_CFLAGS"
8183         CPPFLAGS="$cf_trim_CPPFLAGS"
8184
8185 cf_fix_cppflags=no
8186 cf_new_cflags=
8187 cf_new_cppflags=
8188 cf_new_extra_cppflags=
8189
8190 for cf_add_cflags in $cf_cv_posix_c_source
8191 do
8192 case $cf_fix_cppflags in
8193 no)
8194         case $cf_add_cflags in #(vi
8195         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8196                 case $cf_add_cflags in
8197                 -D*)
8198                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8199
8200                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8201                                 && test -z "${cf_tst_cflags}" \
8202                                 && cf_fix_cppflags=yes
8203
8204                         if test $cf_fix_cppflags = yes ; then
8205                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8206                                 continue
8207                         elif test "${cf_tst_cflags}" = "\"'" ; then
8208                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8209                                 continue
8210                         fi
8211                         ;;
8212                 esac
8213                 case "$CPPFLAGS" in
8214                 *$cf_add_cflags) #(vi
8215                         ;;
8216                 *) #(vi
8217                         case $cf_add_cflags in #(vi
8218                         -D*)
8219                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8220
8221 CPPFLAGS=`echo "$CPPFLAGS" | \
8222         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8223                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8224
8225                                 ;;
8226                         esac
8227                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8228                         ;;
8229                 esac
8230                 ;;
8231         *)
8232                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8233                 ;;
8234         esac
8235         ;;
8236 yes)
8237         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8238
8239         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8240
8241         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8242                 && test -z "${cf_tst_cflags}" \
8243                 && cf_fix_cppflags=no
8244         ;;
8245 esac
8246 done
8247
8248 if test -n "$cf_new_cflags" ; then
8249
8250         CFLAGS="$CFLAGS $cf_new_cflags"
8251 fi
8252
8253 if test -n "$cf_new_cppflags" ; then
8254
8255         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8256 fi
8257
8258 if test -n "$cf_new_extra_cppflags" ; then
8259
8260         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8261 fi
8262
8263 fi
8264
8265         ;;
8266 netbsd*) #(vi
8267         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
8268         ;;
8269 openbsd[4-9]*) #(vi
8270         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
8271         cf_xopen_source="-D_BSD_SOURCE"
8272         cf_XOPEN_SOURCE=600
8273         ;;
8274 openbsd*) #(vi
8275         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
8276         ;;
8277 osf[45]*) #(vi
8278         cf_xopen_source="-D_OSF_SOURCE"
8279         ;;
8280 nto-qnx*) #(vi
8281         cf_xopen_source="-D_QNX_SOURCE"
8282         ;;
8283 sco*) #(vi
8284         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
8285         ;;
8286 solaris2.*) #(vi
8287         cf_xopen_source="-D__EXTENSIONS__"
8288         ;;
8289 *)
8290
8291 echo "$as_me:8291: checking if we should define _XOPEN_SOURCE" >&5
8292 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8293 if test "${cf_cv_xopen_source+set}" = set; then
8294   echo $ECHO_N "(cached) $ECHO_C" >&6
8295 else
8296
8297         cat >conftest.$ac_ext <<_ACEOF
8298 #line 8298 "configure"
8299 #include "confdefs.h"
8300
8301 #include <stdlib.h>
8302 #include <string.h>
8303 #include <sys/types.h>
8304
8305 int
8306 main ()
8307 {
8308
8309 #ifndef _XOPEN_SOURCE
8310 make an error
8311 #endif
8312   ;
8313   return 0;
8314 }
8315 _ACEOF
8316 rm -f conftest.$ac_objext
8317 if { (eval echo "$as_me:8317: \"$ac_compile\"") >&5
8318   (eval $ac_compile) 2>&5
8319   ac_status=$?
8320   echo "$as_me:8320: \$? = $ac_status" >&5
8321   (exit $ac_status); } &&
8322          { ac_try='test -s conftest.$ac_objext'
8323   { (eval echo "$as_me:8323: \"$ac_try\"") >&5
8324   (eval $ac_try) 2>&5
8325   ac_status=$?
8326   echo "$as_me:8326: \$? = $ac_status" >&5
8327   (exit $ac_status); }; }; then
8328   cf_cv_xopen_source=no
8329 else
8330   echo "$as_me: failed program was:" >&5
8331 cat conftest.$ac_ext >&5
8332 cf_save="$CPPFLAGS"
8333          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8334          cat >conftest.$ac_ext <<_ACEOF
8335 #line 8335 "configure"
8336 #include "confdefs.h"
8337
8338 #include <stdlib.h>
8339 #include <string.h>
8340 #include <sys/types.h>
8341
8342 int
8343 main ()
8344 {
8345
8346 #ifdef _XOPEN_SOURCE
8347 make an error
8348 #endif
8349   ;
8350   return 0;
8351 }
8352 _ACEOF
8353 rm -f conftest.$ac_objext
8354 if { (eval echo "$as_me:8354: \"$ac_compile\"") >&5
8355   (eval $ac_compile) 2>&5
8356   ac_status=$?
8357   echo "$as_me:8357: \$? = $ac_status" >&5
8358   (exit $ac_status); } &&
8359          { ac_try='test -s conftest.$ac_objext'
8360   { (eval echo "$as_me:8360: \"$ac_try\"") >&5
8361   (eval $ac_try) 2>&5
8362   ac_status=$?
8363   echo "$as_me:8363: \$? = $ac_status" >&5
8364   (exit $ac_status); }; }; then
8365   cf_cv_xopen_source=no
8366 else
8367   echo "$as_me: failed program was:" >&5
8368 cat conftest.$ac_ext >&5
8369 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8370 fi
8371 rm -f conftest.$ac_objext conftest.$ac_ext
8372         CPPFLAGS="$cf_save"
8373
8374 fi
8375 rm -f conftest.$ac_objext conftest.$ac_ext
8376
8377 fi
8378 echo "$as_me:8378: result: $cf_cv_xopen_source" >&5
8379 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8380
8381 if test "$cf_cv_xopen_source" != no ; then
8382
8383 CFLAGS=`echo "$CFLAGS" | \
8384         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8385                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8386
8387 CPPFLAGS=`echo "$CPPFLAGS" | \
8388         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8389                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8390
8391         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8392
8393 cf_fix_cppflags=no
8394 cf_new_cflags=
8395 cf_new_cppflags=
8396 cf_new_extra_cppflags=
8397
8398 for cf_add_cflags in $cf_temp_xopen_source
8399 do
8400 case $cf_fix_cppflags in
8401 no)
8402         case $cf_add_cflags in #(vi
8403         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8404                 case $cf_add_cflags in
8405                 -D*)
8406                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8407
8408                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8409                                 && test -z "${cf_tst_cflags}" \
8410                                 && cf_fix_cppflags=yes
8411
8412                         if test $cf_fix_cppflags = yes ; then
8413                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8414                                 continue
8415                         elif test "${cf_tst_cflags}" = "\"'" ; then
8416                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8417                                 continue
8418                         fi
8419                         ;;
8420                 esac
8421                 case "$CPPFLAGS" in
8422                 *$cf_add_cflags) #(vi
8423                         ;;
8424                 *) #(vi
8425                         case $cf_add_cflags in #(vi
8426                         -D*)
8427                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8428
8429 CPPFLAGS=`echo "$CPPFLAGS" | \
8430         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8431                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8432
8433                                 ;;
8434                         esac
8435                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8436                         ;;
8437                 esac
8438                 ;;
8439         *)
8440                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8441                 ;;
8442         esac
8443         ;;
8444 yes)
8445         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8446
8447         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8448
8449         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8450                 && test -z "${cf_tst_cflags}" \
8451                 && cf_fix_cppflags=no
8452         ;;
8453 esac
8454 done
8455
8456 if test -n "$cf_new_cflags" ; then
8457
8458         CFLAGS="$CFLAGS $cf_new_cflags"
8459 fi
8460
8461 if test -n "$cf_new_cppflags" ; then
8462
8463         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8464 fi
8465
8466 if test -n "$cf_new_extra_cppflags" ; then
8467
8468         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8469 fi
8470
8471 fi
8472
8473 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8474
8475 cf_save_CFLAGS="$CFLAGS"
8476 cf_save_CPPFLAGS="$CPPFLAGS"
8477
8478 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8479         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8480                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8481
8482 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8483         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8484                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8485
8486 echo "$as_me:8486: checking if we should define _POSIX_C_SOURCE" >&5
8487 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8488 if test "${cf_cv_posix_c_source+set}" = set; then
8489   echo $ECHO_N "(cached) $ECHO_C" >&6
8490 else
8491
8492 echo "${as_me:-configure}:8492: testing if the symbol is already defined go no further ..." 1>&5
8493
8494         cat >conftest.$ac_ext <<_ACEOF
8495 #line 8495 "configure"
8496 #include "confdefs.h"
8497 #include <sys/types.h>
8498 int
8499 main ()
8500 {
8501
8502 #ifndef _POSIX_C_SOURCE
8503 make an error
8504 #endif
8505   ;
8506   return 0;
8507 }
8508 _ACEOF
8509 rm -f conftest.$ac_objext
8510 if { (eval echo "$as_me:8510: \"$ac_compile\"") >&5
8511   (eval $ac_compile) 2>&5
8512   ac_status=$?
8513   echo "$as_me:8513: \$? = $ac_status" >&5
8514   (exit $ac_status); } &&
8515          { ac_try='test -s conftest.$ac_objext'
8516   { (eval echo "$as_me:8516: \"$ac_try\"") >&5
8517   (eval $ac_try) 2>&5
8518   ac_status=$?
8519   echo "$as_me:8519: \$? = $ac_status" >&5
8520   (exit $ac_status); }; }; then
8521   cf_cv_posix_c_source=no
8522 else
8523   echo "$as_me: failed program was:" >&5
8524 cat conftest.$ac_ext >&5
8525 cf_want_posix_source=no
8526          case .$cf_POSIX_C_SOURCE in #(vi
8527          .[12]??*) #(vi
8528                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8529                 ;;
8530          .2) #(vi
8531                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8532                 cf_want_posix_source=yes
8533                 ;;
8534          .*)
8535                 cf_want_posix_source=yes
8536                 ;;
8537          esac
8538          if test "$cf_want_posix_source" = yes ; then
8539                 cat >conftest.$ac_ext <<_ACEOF
8540 #line 8540 "configure"
8541 #include "confdefs.h"
8542 #include <sys/types.h>
8543 int
8544 main ()
8545 {
8546
8547 #ifdef _POSIX_SOURCE
8548 make an error
8549 #endif
8550   ;
8551   return 0;
8552 }
8553 _ACEOF
8554 rm -f conftest.$ac_objext
8555 if { (eval echo "$as_me:8555: \"$ac_compile\"") >&5
8556   (eval $ac_compile) 2>&5
8557   ac_status=$?
8558   echo "$as_me:8558: \$? = $ac_status" >&5
8559   (exit $ac_status); } &&
8560          { ac_try='test -s conftest.$ac_objext'
8561   { (eval echo "$as_me:8561: \"$ac_try\"") >&5
8562   (eval $ac_try) 2>&5
8563   ac_status=$?
8564   echo "$as_me:8564: \$? = $ac_status" >&5
8565   (exit $ac_status); }; }; then
8566   :
8567 else
8568   echo "$as_me: failed program was:" >&5
8569 cat conftest.$ac_ext >&5
8570 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8571 fi
8572 rm -f conftest.$ac_objext conftest.$ac_ext
8573          fi
8574
8575 echo "${as_me:-configure}:8575: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8576
8577          CFLAGS="$cf_trim_CFLAGS"
8578          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8579
8580 echo "${as_me:-configure}:8580: testing if the second compile does not leave our definition intact error ..." 1>&5
8581
8582          cat >conftest.$ac_ext <<_ACEOF
8583 #line 8583 "configure"
8584 #include "confdefs.h"
8585 #include <sys/types.h>
8586 int
8587 main ()
8588 {
8589
8590 #ifndef _POSIX_C_SOURCE
8591 make an error
8592 #endif
8593   ;
8594   return 0;
8595 }
8596 _ACEOF
8597 rm -f conftest.$ac_objext
8598 if { (eval echo "$as_me:8598: \"$ac_compile\"") >&5
8599   (eval $ac_compile) 2>&5
8600   ac_status=$?
8601   echo "$as_me:8601: \$? = $ac_status" >&5
8602   (exit $ac_status); } &&
8603          { ac_try='test -s conftest.$ac_objext'
8604   { (eval echo "$as_me:8604: \"$ac_try\"") >&5
8605   (eval $ac_try) 2>&5
8606   ac_status=$?
8607   echo "$as_me:8607: \$? = $ac_status" >&5
8608   (exit $ac_status); }; }; then
8609   :
8610 else
8611   echo "$as_me: failed program was:" >&5
8612 cat conftest.$ac_ext >&5
8613 cf_cv_posix_c_source=no
8614 fi
8615 rm -f conftest.$ac_objext conftest.$ac_ext
8616          CFLAGS="$cf_save_CFLAGS"
8617          CPPFLAGS="$cf_save_CPPFLAGS"
8618
8619 fi
8620 rm -f conftest.$ac_objext conftest.$ac_ext
8621
8622 fi
8623 echo "$as_me:8623: result: $cf_cv_posix_c_source" >&5
8624 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8625
8626 if test "$cf_cv_posix_c_source" != no ; then
8627         CFLAGS="$cf_trim_CFLAGS"
8628         CPPFLAGS="$cf_trim_CPPFLAGS"
8629
8630 cf_fix_cppflags=no
8631 cf_new_cflags=
8632 cf_new_cppflags=
8633 cf_new_extra_cppflags=
8634
8635 for cf_add_cflags in $cf_cv_posix_c_source
8636 do
8637 case $cf_fix_cppflags in
8638 no)
8639         case $cf_add_cflags in #(vi
8640         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8641                 case $cf_add_cflags in
8642                 -D*)
8643                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8644
8645                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8646                                 && test -z "${cf_tst_cflags}" \
8647                                 && cf_fix_cppflags=yes
8648
8649                         if test $cf_fix_cppflags = yes ; then
8650                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8651                                 continue
8652                         elif test "${cf_tst_cflags}" = "\"'" ; then
8653                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8654                                 continue
8655                         fi
8656                         ;;
8657                 esac
8658                 case "$CPPFLAGS" in
8659                 *$cf_add_cflags) #(vi
8660                         ;;
8661                 *) #(vi
8662                         case $cf_add_cflags in #(vi
8663                         -D*)
8664                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8665
8666 CPPFLAGS=`echo "$CPPFLAGS" | \
8667         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8668                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8669
8670                                 ;;
8671                         esac
8672                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8673                         ;;
8674                 esac
8675                 ;;
8676         *)
8677                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8678                 ;;
8679         esac
8680         ;;
8681 yes)
8682         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8683
8684         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8685
8686         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8687                 && test -z "${cf_tst_cflags}" \
8688                 && cf_fix_cppflags=no
8689         ;;
8690 esac
8691 done
8692
8693 if test -n "$cf_new_cflags" ; then
8694
8695         CFLAGS="$CFLAGS $cf_new_cflags"
8696 fi
8697
8698 if test -n "$cf_new_cppflags" ; then
8699
8700         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8701 fi
8702
8703 if test -n "$cf_new_extra_cppflags" ; then
8704
8705         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8706 fi
8707
8708 fi
8709
8710         ;;
8711 esac
8712
8713 if test -n "$cf_xopen_source" ; then
8714
8715 cf_fix_cppflags=no
8716 cf_new_cflags=
8717 cf_new_cppflags=
8718 cf_new_extra_cppflags=
8719
8720 for cf_add_cflags in $cf_xopen_source
8721 do
8722 case $cf_fix_cppflags in
8723 no)
8724         case $cf_add_cflags in #(vi
8725         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8726                 case $cf_add_cflags in
8727                 -D*)
8728                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8729
8730                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8731                                 && test -z "${cf_tst_cflags}" \
8732                                 && cf_fix_cppflags=yes
8733
8734                         if test $cf_fix_cppflags = yes ; then
8735                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8736                                 continue
8737                         elif test "${cf_tst_cflags}" = "\"'" ; then
8738                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8739                                 continue
8740                         fi
8741                         ;;
8742                 esac
8743                 case "$CPPFLAGS" in
8744                 *$cf_add_cflags) #(vi
8745                         ;;
8746                 *) #(vi
8747                         case $cf_add_cflags in #(vi
8748                         -D*)
8749                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8750
8751 CPPFLAGS=`echo "$CPPFLAGS" | \
8752         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8753                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8754
8755                                 ;;
8756                         esac
8757                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8758                         ;;
8759                 esac
8760                 ;;
8761         *)
8762                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8763                 ;;
8764         esac
8765         ;;
8766 yes)
8767         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8768
8769         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8770
8771         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8772                 && test -z "${cf_tst_cflags}" \
8773                 && cf_fix_cppflags=no
8774         ;;
8775 esac
8776 done
8777
8778 if test -n "$cf_new_cflags" ; then
8779
8780         CFLAGS="$CFLAGS $cf_new_cflags"
8781 fi
8782
8783 if test -n "$cf_new_cppflags" ; then
8784
8785         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8786 fi
8787
8788 if test -n "$cf_new_extra_cppflags" ; then
8789
8790         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8791 fi
8792
8793 fi
8794
8795 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
8796         echo "$as_me:8796: checking if _XOPEN_SOURCE really is set" >&5
8797 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
8798         cat >conftest.$ac_ext <<_ACEOF
8799 #line 8799 "configure"
8800 #include "confdefs.h"
8801 #include <stdlib.h>
8802 int
8803 main ()
8804 {
8805
8806 #ifndef _XOPEN_SOURCE
8807 make an error
8808 #endif
8809   ;
8810   return 0;
8811 }
8812 _ACEOF
8813 rm -f conftest.$ac_objext
8814 if { (eval echo "$as_me:8814: \"$ac_compile\"") >&5
8815   (eval $ac_compile) 2>&5
8816   ac_status=$?
8817   echo "$as_me:8817: \$? = $ac_status" >&5
8818   (exit $ac_status); } &&
8819          { ac_try='test -s conftest.$ac_objext'
8820   { (eval echo "$as_me:8820: \"$ac_try\"") >&5
8821   (eval $ac_try) 2>&5
8822   ac_status=$?
8823   echo "$as_me:8823: \$? = $ac_status" >&5
8824   (exit $ac_status); }; }; then
8825   cf_XOPEN_SOURCE_set=yes
8826 else
8827   echo "$as_me: failed program was:" >&5
8828 cat conftest.$ac_ext >&5
8829 cf_XOPEN_SOURCE_set=no
8830 fi
8831 rm -f conftest.$ac_objext conftest.$ac_ext
8832         echo "$as_me:8832: result: $cf_XOPEN_SOURCE_set" >&5
8833 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
8834         if test $cf_XOPEN_SOURCE_set = yes
8835         then
8836                 cat >conftest.$ac_ext <<_ACEOF
8837 #line 8837 "configure"
8838 #include "confdefs.h"
8839 #include <stdlib.h>
8840 int
8841 main ()
8842 {
8843
8844 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
8845 make an error
8846 #endif
8847   ;
8848   return 0;
8849 }
8850 _ACEOF
8851 rm -f conftest.$ac_objext
8852 if { (eval echo "$as_me:8852: \"$ac_compile\"") >&5
8853   (eval $ac_compile) 2>&5
8854   ac_status=$?
8855   echo "$as_me:8855: \$? = $ac_status" >&5
8856   (exit $ac_status); } &&
8857          { ac_try='test -s conftest.$ac_objext'
8858   { (eval echo "$as_me:8858: \"$ac_try\"") >&5
8859   (eval $ac_try) 2>&5
8860   ac_status=$?
8861   echo "$as_me:8861: \$? = $ac_status" >&5
8862   (exit $ac_status); }; }; then
8863   cf_XOPEN_SOURCE_set_ok=yes
8864 else
8865   echo "$as_me: failed program was:" >&5
8866 cat conftest.$ac_ext >&5
8867 cf_XOPEN_SOURCE_set_ok=no
8868 fi
8869 rm -f conftest.$ac_objext conftest.$ac_ext
8870                 if test $cf_XOPEN_SOURCE_set_ok = no
8871                 then
8872                         { echo "$as_me:8872: WARNING: _XOPEN_SOURCE is lower than requested" >&5
8873 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
8874                 fi
8875         else
8876
8877 echo "$as_me:8877: checking if we should define _XOPEN_SOURCE" >&5
8878 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
8879 if test "${cf_cv_xopen_source+set}" = set; then
8880   echo $ECHO_N "(cached) $ECHO_C" >&6
8881 else
8882
8883         cat >conftest.$ac_ext <<_ACEOF
8884 #line 8884 "configure"
8885 #include "confdefs.h"
8886
8887 #include <stdlib.h>
8888 #include <string.h>
8889 #include <sys/types.h>
8890
8891 int
8892 main ()
8893 {
8894
8895 #ifndef _XOPEN_SOURCE
8896 make an error
8897 #endif
8898   ;
8899   return 0;
8900 }
8901 _ACEOF
8902 rm -f conftest.$ac_objext
8903 if { (eval echo "$as_me:8903: \"$ac_compile\"") >&5
8904   (eval $ac_compile) 2>&5
8905   ac_status=$?
8906   echo "$as_me:8906: \$? = $ac_status" >&5
8907   (exit $ac_status); } &&
8908          { ac_try='test -s conftest.$ac_objext'
8909   { (eval echo "$as_me:8909: \"$ac_try\"") >&5
8910   (eval $ac_try) 2>&5
8911   ac_status=$?
8912   echo "$as_me:8912: \$? = $ac_status" >&5
8913   (exit $ac_status); }; }; then
8914   cf_cv_xopen_source=no
8915 else
8916   echo "$as_me: failed program was:" >&5
8917 cat conftest.$ac_ext >&5
8918 cf_save="$CPPFLAGS"
8919          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
8920          cat >conftest.$ac_ext <<_ACEOF
8921 #line 8921 "configure"
8922 #include "confdefs.h"
8923
8924 #include <stdlib.h>
8925 #include <string.h>
8926 #include <sys/types.h>
8927
8928 int
8929 main ()
8930 {
8931
8932 #ifdef _XOPEN_SOURCE
8933 make an error
8934 #endif
8935   ;
8936   return 0;
8937 }
8938 _ACEOF
8939 rm -f conftest.$ac_objext
8940 if { (eval echo "$as_me:8940: \"$ac_compile\"") >&5
8941   (eval $ac_compile) 2>&5
8942   ac_status=$?
8943   echo "$as_me:8943: \$? = $ac_status" >&5
8944   (exit $ac_status); } &&
8945          { ac_try='test -s conftest.$ac_objext'
8946   { (eval echo "$as_me:8946: \"$ac_try\"") >&5
8947   (eval $ac_try) 2>&5
8948   ac_status=$?
8949   echo "$as_me:8949: \$? = $ac_status" >&5
8950   (exit $ac_status); }; }; then
8951   cf_cv_xopen_source=no
8952 else
8953   echo "$as_me: failed program was:" >&5
8954 cat conftest.$ac_ext >&5
8955 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8956 fi
8957 rm -f conftest.$ac_objext conftest.$ac_ext
8958         CPPFLAGS="$cf_save"
8959
8960 fi
8961 rm -f conftest.$ac_objext conftest.$ac_ext
8962
8963 fi
8964 echo "$as_me:8964: result: $cf_cv_xopen_source" >&5
8965 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8966
8967 if test "$cf_cv_xopen_source" != no ; then
8968
8969 CFLAGS=`echo "$CFLAGS" | \
8970         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8971                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8972
8973 CPPFLAGS=`echo "$CPPFLAGS" | \
8974         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8975                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8976
8977         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8978
8979 cf_fix_cppflags=no
8980 cf_new_cflags=
8981 cf_new_cppflags=
8982 cf_new_extra_cppflags=
8983
8984 for cf_add_cflags in $cf_temp_xopen_source
8985 do
8986 case $cf_fix_cppflags in
8987 no)
8988         case $cf_add_cflags in #(vi
8989         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8990                 case $cf_add_cflags in
8991                 -D*)
8992                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8993
8994                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8995                                 && test -z "${cf_tst_cflags}" \
8996                                 && cf_fix_cppflags=yes
8997
8998                         if test $cf_fix_cppflags = yes ; then
8999                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9000                                 continue
9001                         elif test "${cf_tst_cflags}" = "\"'" ; then
9002                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9003                                 continue
9004                         fi
9005                         ;;
9006                 esac
9007                 case "$CPPFLAGS" in
9008                 *$cf_add_cflags) #(vi
9009                         ;;
9010                 *) #(vi
9011                         case $cf_add_cflags in #(vi
9012                         -D*)
9013                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9014
9015 CPPFLAGS=`echo "$CPPFLAGS" | \
9016         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9017                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9018
9019                                 ;;
9020                         esac
9021                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9022                         ;;
9023                 esac
9024                 ;;
9025         *)
9026                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9027                 ;;
9028         esac
9029         ;;
9030 yes)
9031         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9032
9033         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9034
9035         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9036                 && test -z "${cf_tst_cflags}" \
9037                 && cf_fix_cppflags=no
9038         ;;
9039 esac
9040 done
9041
9042 if test -n "$cf_new_cflags" ; then
9043
9044         CFLAGS="$CFLAGS $cf_new_cflags"
9045 fi
9046
9047 if test -n "$cf_new_cppflags" ; then
9048
9049         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9050 fi
9051
9052 if test -n "$cf_new_extra_cppflags" ; then
9053
9054         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9055 fi
9056
9057 fi
9058
9059         fi
9060 fi
9061
9062 # Check whether --enable-largefile or --disable-largefile was given.
9063 if test "${enable_largefile+set}" = set; then
9064   enableval="$enable_largefile"
9065
9066 fi;
9067 if test "$enable_largefile" != no; then
9068
9069   echo "$as_me:9069: checking for special C compiler options needed for large files" >&5
9070 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
9071 if test "${ac_cv_sys_largefile_CC+set}" = set; then
9072   echo $ECHO_N "(cached) $ECHO_C" >&6
9073 else
9074   ac_cv_sys_largefile_CC=no
9075      if test "$GCC" != yes; then
9076        ac_save_CC=$CC
9077        while :; do
9078          # IRIX 6.2 and later do not support large files by default,
9079          # so use the C compiler's -n32 option if that helps.
9080          cat >conftest.$ac_ext <<_ACEOF
9081 #line 9081 "configure"
9082 #include "confdefs.h"
9083 #include <sys/types.h>
9084  /* Check that off_t can represent 2**63 - 1 correctly.
9085     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9086     since some C++ compilers masquerading as C compilers
9087     incorrectly reject 9223372036854775807.  */
9088 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9089   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9090                        && LARGE_OFF_T % 2147483647 == 1)
9091                       ? 1 : -1];
9092 int
9093 main ()
9094 {
9095
9096   ;
9097   return 0;
9098 }
9099 _ACEOF
9100          rm -f conftest.$ac_objext
9101 if { (eval echo "$as_me:9101: \"$ac_compile\"") >&5
9102   (eval $ac_compile) 2>&5
9103   ac_status=$?
9104   echo "$as_me:9104: \$? = $ac_status" >&5
9105   (exit $ac_status); } &&
9106          { ac_try='test -s conftest.$ac_objext'
9107   { (eval echo "$as_me:9107: \"$ac_try\"") >&5
9108   (eval $ac_try) 2>&5
9109   ac_status=$?
9110   echo "$as_me:9110: \$? = $ac_status" >&5
9111   (exit $ac_status); }; }; then
9112   break
9113 else
9114   echo "$as_me: failed program was:" >&5
9115 cat conftest.$ac_ext >&5
9116 fi
9117 rm -f conftest.$ac_objext
9118          CC="$CC -n32"
9119          rm -f conftest.$ac_objext
9120 if { (eval echo "$as_me:9120: \"$ac_compile\"") >&5
9121   (eval $ac_compile) 2>&5
9122   ac_status=$?
9123   echo "$as_me:9123: \$? = $ac_status" >&5
9124   (exit $ac_status); } &&
9125          { ac_try='test -s conftest.$ac_objext'
9126   { (eval echo "$as_me:9126: \"$ac_try\"") >&5
9127   (eval $ac_try) 2>&5
9128   ac_status=$?
9129   echo "$as_me:9129: \$? = $ac_status" >&5
9130   (exit $ac_status); }; }; then
9131   ac_cv_sys_largefile_CC=' -n32'; break
9132 else
9133   echo "$as_me: failed program was:" >&5
9134 cat conftest.$ac_ext >&5
9135 fi
9136 rm -f conftest.$ac_objext
9137          break
9138        done
9139        CC=$ac_save_CC
9140        rm -f conftest.$ac_ext
9141     fi
9142 fi
9143 echo "$as_me:9143: result: $ac_cv_sys_largefile_CC" >&5
9144 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
9145   if test "$ac_cv_sys_largefile_CC" != no; then
9146     CC=$CC$ac_cv_sys_largefile_CC
9147   fi
9148
9149   echo "$as_me:9149: checking for _FILE_OFFSET_BITS value needed for large files" >&5
9150 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
9151 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
9152   echo $ECHO_N "(cached) $ECHO_C" >&6
9153 else
9154   while :; do
9155   ac_cv_sys_file_offset_bits=no
9156   cat >conftest.$ac_ext <<_ACEOF
9157 #line 9157 "configure"
9158 #include "confdefs.h"
9159 #include <sys/types.h>
9160  /* Check that off_t can represent 2**63 - 1 correctly.
9161     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9162     since some C++ compilers masquerading as C compilers
9163     incorrectly reject 9223372036854775807.  */
9164 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9165   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9166                        && LARGE_OFF_T % 2147483647 == 1)
9167                       ? 1 : -1];
9168 int
9169 main ()
9170 {
9171
9172   ;
9173   return 0;
9174 }
9175 _ACEOF
9176 rm -f conftest.$ac_objext
9177 if { (eval echo "$as_me:9177: \"$ac_compile\"") >&5
9178   (eval $ac_compile) 2>&5
9179   ac_status=$?
9180   echo "$as_me:9180: \$? = $ac_status" >&5
9181   (exit $ac_status); } &&
9182          { ac_try='test -s conftest.$ac_objext'
9183   { (eval echo "$as_me:9183: \"$ac_try\"") >&5
9184   (eval $ac_try) 2>&5
9185   ac_status=$?
9186   echo "$as_me:9186: \$? = $ac_status" >&5
9187   (exit $ac_status); }; }; then
9188   break
9189 else
9190   echo "$as_me: failed program was:" >&5
9191 cat conftest.$ac_ext >&5
9192 fi
9193 rm -f conftest.$ac_objext conftest.$ac_ext
9194   cat >conftest.$ac_ext <<_ACEOF
9195 #line 9195 "configure"
9196 #include "confdefs.h"
9197 #define _FILE_OFFSET_BITS 64
9198 #include <sys/types.h>
9199  /* Check that off_t can represent 2**63 - 1 correctly.
9200     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9201     since some C++ compilers masquerading as C compilers
9202     incorrectly reject 9223372036854775807.  */
9203 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9204   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9205                        && LARGE_OFF_T % 2147483647 == 1)
9206                       ? 1 : -1];
9207 int
9208 main ()
9209 {
9210
9211   ;
9212   return 0;
9213 }
9214 _ACEOF
9215 rm -f conftest.$ac_objext
9216 if { (eval echo "$as_me:9216: \"$ac_compile\"") >&5
9217   (eval $ac_compile) 2>&5
9218   ac_status=$?
9219   echo "$as_me:9219: \$? = $ac_status" >&5
9220   (exit $ac_status); } &&
9221          { ac_try='test -s conftest.$ac_objext'
9222   { (eval echo "$as_me:9222: \"$ac_try\"") >&5
9223   (eval $ac_try) 2>&5
9224   ac_status=$?
9225   echo "$as_me:9225: \$? = $ac_status" >&5
9226   (exit $ac_status); }; }; then
9227   ac_cv_sys_file_offset_bits=64; break
9228 else
9229   echo "$as_me: failed program was:" >&5
9230 cat conftest.$ac_ext >&5
9231 fi
9232 rm -f conftest.$ac_objext conftest.$ac_ext
9233   break
9234 done
9235 fi
9236 echo "$as_me:9236: result: $ac_cv_sys_file_offset_bits" >&5
9237 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
9238 if test "$ac_cv_sys_file_offset_bits" != no; then
9239
9240 cat >>confdefs.h <<EOF
9241 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
9242 EOF
9243
9244 fi
9245 rm -rf conftest*
9246   echo "$as_me:9246: checking for _LARGE_FILES value needed for large files" >&5
9247 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
9248 if test "${ac_cv_sys_large_files+set}" = set; then
9249   echo $ECHO_N "(cached) $ECHO_C" >&6
9250 else
9251   while :; do
9252   ac_cv_sys_large_files=no
9253   cat >conftest.$ac_ext <<_ACEOF
9254 #line 9254 "configure"
9255 #include "confdefs.h"
9256 #include <sys/types.h>
9257  /* Check that off_t can represent 2**63 - 1 correctly.
9258     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9259     since some C++ compilers masquerading as C compilers
9260     incorrectly reject 9223372036854775807.  */
9261 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9262   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9263                        && LARGE_OFF_T % 2147483647 == 1)
9264                       ? 1 : -1];
9265 int
9266 main ()
9267 {
9268
9269   ;
9270   return 0;
9271 }
9272 _ACEOF
9273 rm -f conftest.$ac_objext
9274 if { (eval echo "$as_me:9274: \"$ac_compile\"") >&5
9275   (eval $ac_compile) 2>&5
9276   ac_status=$?
9277   echo "$as_me:9277: \$? = $ac_status" >&5
9278   (exit $ac_status); } &&
9279          { ac_try='test -s conftest.$ac_objext'
9280   { (eval echo "$as_me:9280: \"$ac_try\"") >&5
9281   (eval $ac_try) 2>&5
9282   ac_status=$?
9283   echo "$as_me:9283: \$? = $ac_status" >&5
9284   (exit $ac_status); }; }; then
9285   break
9286 else
9287   echo "$as_me: failed program was:" >&5
9288 cat conftest.$ac_ext >&5
9289 fi
9290 rm -f conftest.$ac_objext conftest.$ac_ext
9291   cat >conftest.$ac_ext <<_ACEOF
9292 #line 9292 "configure"
9293 #include "confdefs.h"
9294 #define _LARGE_FILES 1
9295 #include <sys/types.h>
9296  /* Check that off_t can represent 2**63 - 1 correctly.
9297     We can't simply define LARGE_OFF_T to be 9223372036854775807,
9298     since some C++ compilers masquerading as C compilers
9299     incorrectly reject 9223372036854775807.  */
9300 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
9301   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
9302                        && LARGE_OFF_T % 2147483647 == 1)
9303                       ? 1 : -1];
9304 int
9305 main ()
9306 {
9307
9308   ;
9309   return 0;
9310 }
9311 _ACEOF
9312 rm -f conftest.$ac_objext
9313 if { (eval echo "$as_me:9313: \"$ac_compile\"") >&5
9314   (eval $ac_compile) 2>&5
9315   ac_status=$?
9316   echo "$as_me:9316: \$? = $ac_status" >&5
9317   (exit $ac_status); } &&
9318          { ac_try='test -s conftest.$ac_objext'
9319   { (eval echo "$as_me:9319: \"$ac_try\"") >&5
9320   (eval $ac_try) 2>&5
9321   ac_status=$?
9322   echo "$as_me:9322: \$? = $ac_status" >&5
9323   (exit $ac_status); }; }; then
9324   ac_cv_sys_large_files=1; break
9325 else
9326   echo "$as_me: failed program was:" >&5
9327 cat conftest.$ac_ext >&5
9328 fi
9329 rm -f conftest.$ac_objext conftest.$ac_ext
9330   break
9331 done
9332 fi
9333 echo "$as_me:9333: result: $ac_cv_sys_large_files" >&5
9334 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
9335 if test "$ac_cv_sys_large_files" != no; then
9336
9337 cat >>confdefs.h <<EOF
9338 #define _LARGE_FILES $ac_cv_sys_large_files
9339 EOF
9340
9341 fi
9342 rm -rf conftest*
9343 fi
9344
9345     if test "$enable_largefile" != no ; then
9346         echo "$as_me:9346: checking for _LARGEFILE_SOURCE value needed for large files" >&5
9347 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
9348 if test "${ac_cv_sys_largefile_source+set}" = set; then
9349   echo $ECHO_N "(cached) $ECHO_C" >&6
9350 else
9351   while :; do
9352   ac_cv_sys_largefile_source=no
9353   cat >conftest.$ac_ext <<_ACEOF
9354 #line 9354 "configure"
9355 #include "confdefs.h"
9356 #include <stdio.h>
9357 int
9358 main ()
9359 {
9360 return !fseeko;
9361   ;
9362   return 0;
9363 }
9364 _ACEOF
9365 rm -f conftest.$ac_objext
9366 if { (eval echo "$as_me:9366: \"$ac_compile\"") >&5
9367   (eval $ac_compile) 2>&5
9368   ac_status=$?
9369   echo "$as_me:9369: \$? = $ac_status" >&5
9370   (exit $ac_status); } &&
9371          { ac_try='test -s conftest.$ac_objext'
9372   { (eval echo "$as_me:9372: \"$ac_try\"") >&5
9373   (eval $ac_try) 2>&5
9374   ac_status=$?
9375   echo "$as_me:9375: \$? = $ac_status" >&5
9376   (exit $ac_status); }; }; then
9377   break
9378 else
9379   echo "$as_me: failed program was:" >&5
9380 cat conftest.$ac_ext >&5
9381 fi
9382 rm -f conftest.$ac_objext conftest.$ac_ext
9383   cat >conftest.$ac_ext <<_ACEOF
9384 #line 9384 "configure"
9385 #include "confdefs.h"
9386 #define _LARGEFILE_SOURCE 1
9387 #include <stdio.h>
9388 int
9389 main ()
9390 {
9391 return !fseeko;
9392   ;
9393   return 0;
9394 }
9395 _ACEOF
9396 rm -f conftest.$ac_objext
9397 if { (eval echo "$as_me:9397: \"$ac_compile\"") >&5
9398   (eval $ac_compile) 2>&5
9399   ac_status=$?
9400   echo "$as_me:9400: \$? = $ac_status" >&5
9401   (exit $ac_status); } &&
9402          { ac_try='test -s conftest.$ac_objext'
9403   { (eval echo "$as_me:9403: \"$ac_try\"") >&5
9404   (eval $ac_try) 2>&5
9405   ac_status=$?
9406   echo "$as_me:9406: \$? = $ac_status" >&5
9407   (exit $ac_status); }; }; then
9408   ac_cv_sys_largefile_source=1; break
9409 else
9410   echo "$as_me: failed program was:" >&5
9411 cat conftest.$ac_ext >&5
9412 fi
9413 rm -f conftest.$ac_objext conftest.$ac_ext
9414   break
9415 done
9416 fi
9417 echo "$as_me:9417: result: $ac_cv_sys_largefile_source" >&5
9418 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
9419 if test "$ac_cv_sys_largefile_source" != no; then
9420
9421 cat >>confdefs.h <<EOF
9422 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
9423 EOF
9424
9425 fi
9426 rm -rf conftest*
9427
9428 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
9429 # in glibc 2.1.3, but that breaks too many other things.
9430 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
9431 echo "$as_me:9431: checking for fseeko" >&5
9432 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
9433 if test "${ac_cv_func_fseeko+set}" = set; then
9434   echo $ECHO_N "(cached) $ECHO_C" >&6
9435 else
9436   cat >conftest.$ac_ext <<_ACEOF
9437 #line 9437 "configure"
9438 #include "confdefs.h"
9439 #include <stdio.h>
9440 int
9441 main ()
9442 {
9443 return fseeko && fseeko (stdin, 0, 0);
9444   ;
9445   return 0;
9446 }
9447 _ACEOF
9448 rm -f conftest.$ac_objext conftest$ac_exeext
9449 if { (eval echo "$as_me:9449: \"$ac_link\"") >&5
9450   (eval $ac_link) 2>&5
9451   ac_status=$?
9452   echo "$as_me:9452: \$? = $ac_status" >&5
9453   (exit $ac_status); } &&
9454          { ac_try='test -s conftest$ac_exeext'
9455   { (eval echo "$as_me:9455: \"$ac_try\"") >&5
9456   (eval $ac_try) 2>&5
9457   ac_status=$?
9458   echo "$as_me:9458: \$? = $ac_status" >&5
9459   (exit $ac_status); }; }; then
9460   ac_cv_func_fseeko=yes
9461 else
9462   echo "$as_me: failed program was:" >&5
9463 cat conftest.$ac_ext >&5
9464 ac_cv_func_fseeko=no
9465 fi
9466 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9467 fi
9468 echo "$as_me:9468: result: $ac_cv_func_fseeko" >&5
9469 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
9470 if test $ac_cv_func_fseeko = yes; then
9471
9472 cat >>confdefs.h <<\EOF
9473 #define HAVE_FSEEKO 1
9474 EOF
9475
9476 fi
9477
9478         # Normally we would collect these definitions in the config.h,
9479         # but (like _XOPEN_SOURCE), some environments rely on having these
9480         # defined before any of the system headers are included.  Another
9481         # case comes up with C++, e.g., on AIX the compiler compiles the
9482         # header files by themselves before looking at the body files it is
9483         # told to compile.  For ncurses, those header files do not include
9484         # the config.h
9485         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
9486         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
9487         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
9488
9489         echo "$as_me:9489: checking whether to use struct dirent64" >&5
9490 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
9491 if test "${cf_cv_struct_dirent64+set}" = set; then
9492   echo $ECHO_N "(cached) $ECHO_C" >&6
9493 else
9494
9495                 cat >conftest.$ac_ext <<_ACEOF
9496 #line 9496 "configure"
9497 #include "confdefs.h"
9498
9499 #include <sys/types.h>
9500 #include <dirent.h>
9501
9502 int
9503 main ()
9504 {
9505
9506                 /* if transitional largefile support is setup, this is true */
9507                 extern struct dirent64 * readdir(DIR *);
9508                 struct dirent64 *x = readdir((DIR *)0);
9509                 struct dirent *y = readdir((DIR *)0);
9510                 int z = x - y;
9511
9512   ;
9513   return 0;
9514 }
9515 _ACEOF
9516 rm -f conftest.$ac_objext
9517 if { (eval echo "$as_me:9517: \"$ac_compile\"") >&5
9518   (eval $ac_compile) 2>&5
9519   ac_status=$?
9520   echo "$as_me:9520: \$? = $ac_status" >&5
9521   (exit $ac_status); } &&
9522          { ac_try='test -s conftest.$ac_objext'
9523   { (eval echo "$as_me:9523: \"$ac_try\"") >&5
9524   (eval $ac_try) 2>&5
9525   ac_status=$?
9526   echo "$as_me:9526: \$? = $ac_status" >&5
9527   (exit $ac_status); }; }; then
9528   cf_cv_struct_dirent64=yes
9529 else
9530   echo "$as_me: failed program was:" >&5
9531 cat conftest.$ac_ext >&5
9532 cf_cv_struct_dirent64=no
9533 fi
9534 rm -f conftest.$ac_objext conftest.$ac_ext
9535
9536 fi
9537 echo "$as_me:9537: result: $cf_cv_struct_dirent64" >&5
9538 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
9539         test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
9540 #define HAVE_STRUCT_DIRENT64 1
9541 EOF
9542
9543     fi
9544
9545 ### Enable compiling-in rcs id's
9546 echo "$as_me:9546: checking if RCS identifiers should be compiled-in" >&5
9547 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
9548
9549 # Check whether --with-rcs-ids or --without-rcs-ids was given.
9550 if test "${with_rcs_ids+set}" = set; then
9551   withval="$with_rcs_ids"
9552   with_rcs_ids=$withval
9553 else
9554   with_rcs_ids=no
9555 fi;
9556 echo "$as_me:9556: result: $with_rcs_ids" >&5
9557 echo "${ECHO_T}$with_rcs_ids" >&6
9558 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF
9559 #define USE_RCS_IDS 1
9560 EOF
9561
9562 ###############################################################################
9563
9564 ### Note that some functions (such as const) are normally disabled anyway.
9565 echo "$as_me:9565: checking if you want to build with function extensions" >&5
9566 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
9567
9568 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
9569 if test "${enable_ext_funcs+set}" = set; then
9570   enableval="$enable_ext_funcs"
9571   with_ext_funcs=$enableval
9572 else
9573   with_ext_funcs=yes
9574 fi;
9575 echo "$as_me:9575: result: $with_ext_funcs" >&5
9576 echo "${ECHO_T}$with_ext_funcs" >&6
9577 if test "$with_ext_funcs" = yes ; then
9578         NCURSES_EXT_FUNCS=1
9579         cat >>confdefs.h <<\EOF
9580 #define HAVE_USE_DEFAULT_COLORS 1
9581 EOF
9582
9583         cat >>confdefs.h <<\EOF
9584 #define NCURSES_EXT_FUNCS 1
9585 EOF
9586
9587 else
9588         NCURSES_EXT_FUNCS=0
9589 fi
9590
9591 ###   use option --enable-const to turn on use of const beyond that in XSI.
9592 echo "$as_me:9592: checking for extended use of const keyword" >&5
9593 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
9594
9595 # Check whether --enable-const or --disable-const was given.
9596 if test "${enable_const+set}" = set; then
9597   enableval="$enable_const"
9598   with_ext_const=$enableval
9599 else
9600   with_ext_const=no
9601 fi;
9602 echo "$as_me:9602: result: $with_ext_const" >&5
9603 echo "${ECHO_T}$with_ext_const" >&6
9604 NCURSES_CONST='/*nothing*/'
9605 if test "$with_ext_const" = yes ; then
9606         NCURSES_CONST=const
9607 fi
9608
9609 ###############################################################################
9610 # These options are relatively safe to experiment with.
9611
9612 echo "$as_me:9612: checking if you want all development code" >&5
9613 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
9614
9615 # Check whether --with-develop or --without-develop was given.
9616 if test "${with_develop+set}" = set; then
9617   withval="$with_develop"
9618   with_develop=$withval
9619 else
9620   with_develop=no
9621 fi;
9622 echo "$as_me:9622: result: $with_develop" >&5
9623 echo "${ECHO_T}$with_develop" >&6
9624
9625 ###############################################################################
9626 # These are just experimental, probably should not be in a package:
9627
9628 # This is still experimental (20080329), but should ultimately be moved to
9629 # the script-block --with-normal, etc.
9630
9631 echo "$as_me:9631: checking if you want to link with the pthread library" >&5
9632 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
9633
9634 # Check whether --with-pthread or --without-pthread was given.
9635 if test "${with_pthread+set}" = set; then
9636   withval="$with_pthread"
9637   with_pthread=$withval
9638 else
9639   with_pthread=no
9640 fi;
9641 echo "$as_me:9641: result: $with_pthread" >&5
9642 echo "${ECHO_T}$with_pthread" >&6
9643
9644 if test "$with_pthread" != no ; then
9645     echo "$as_me:9645: checking for pthread.h" >&5
9646 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
9647 if test "${ac_cv_header_pthread_h+set}" = set; then
9648   echo $ECHO_N "(cached) $ECHO_C" >&6
9649 else
9650   cat >conftest.$ac_ext <<_ACEOF
9651 #line 9651 "configure"
9652 #include "confdefs.h"
9653 #include <pthread.h>
9654 _ACEOF
9655 if { (eval echo "$as_me:9655: \"$ac_cpp conftest.$ac_ext\"") >&5
9656   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9657   ac_status=$?
9658   egrep -v '^ *\+' conftest.er1 >conftest.err
9659   rm -f conftest.er1
9660   cat conftest.err >&5
9661   echo "$as_me:9661: \$? = $ac_status" >&5
9662   (exit $ac_status); } >/dev/null; then
9663   if test -s conftest.err; then
9664     ac_cpp_err=$ac_c_preproc_warn_flag
9665   else
9666     ac_cpp_err=
9667   fi
9668 else
9669   ac_cpp_err=yes
9670 fi
9671 if test -z "$ac_cpp_err"; then
9672   ac_cv_header_pthread_h=yes
9673 else
9674   echo "$as_me: failed program was:" >&5
9675   cat conftest.$ac_ext >&5
9676   ac_cv_header_pthread_h=no
9677 fi
9678 rm -f conftest.err conftest.$ac_ext
9679 fi
9680 echo "$as_me:9680: result: $ac_cv_header_pthread_h" >&5
9681 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
9682 if test $ac_cv_header_pthread_h = yes; then
9683
9684         cat >>confdefs.h <<\EOF
9685 #define HAVE_PTHREADS_H 1
9686 EOF
9687
9688         for cf_lib_pthread in pthread c_r
9689         do
9690             echo "$as_me:9690: checking if we can link with the $cf_lib_pthread library" >&5
9691 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
9692             cf_save_LIBS="$LIBS"
9693             LIBS="-l$cf_lib_pthread $LIBS"
9694             cat >conftest.$ac_ext <<_ACEOF
9695 #line 9695 "configure"
9696 #include "confdefs.h"
9697
9698 #include <pthread.h>
9699
9700 int
9701 main ()
9702 {
9703
9704                 int rc = pthread_create(0,0,0,0);
9705                 int r2 = pthread_mutexattr_settype(0, 0);
9706
9707   ;
9708   return 0;
9709 }
9710 _ACEOF
9711 rm -f conftest.$ac_objext conftest$ac_exeext
9712 if { (eval echo "$as_me:9712: \"$ac_link\"") >&5
9713   (eval $ac_link) 2>&5
9714   ac_status=$?
9715   echo "$as_me:9715: \$? = $ac_status" >&5
9716   (exit $ac_status); } &&
9717          { ac_try='test -s conftest$ac_exeext'
9718   { (eval echo "$as_me:9718: \"$ac_try\"") >&5
9719   (eval $ac_try) 2>&5
9720   ac_status=$?
9721   echo "$as_me:9721: \$? = $ac_status" >&5
9722   (exit $ac_status); }; }; then
9723   with_pthread=yes
9724 else
9725   echo "$as_me: failed program was:" >&5
9726 cat conftest.$ac_ext >&5
9727 with_pthread=no
9728 fi
9729 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9730             LIBS="$cf_save_LIBS"
9731             echo "$as_me:9731: result: $with_pthread" >&5
9732 echo "${ECHO_T}$with_pthread" >&6
9733             test "$with_pthread" = yes && break
9734         done
9735
9736         if test "$with_pthread" = yes ; then
9737             LIBS="-l$cf_lib_pthread $LIBS"
9738             cat >>confdefs.h <<\EOF
9739 #define HAVE_LIBPTHREADS 1
9740 EOF
9741
9742         else
9743             { { echo "$as_me:9743: error: Cannot link with pthread library" >&5
9744 echo "$as_me: error: Cannot link with pthread library" >&2;}
9745    { (exit 1); exit 1; }; }
9746         fi
9747
9748 fi
9749
9750 fi
9751
9752 echo "$as_me:9752: checking if you want to use weak-symbols for pthreads" >&5
9753 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
9754
9755 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
9756 if test "${enable_weak_symbols+set}" = set; then
9757   enableval="$enable_weak_symbols"
9758   use_weak_symbols=$withval
9759 else
9760   use_weak_symbols=no
9761 fi;
9762 echo "$as_me:9762: result: $use_weak_symbols" >&5
9763 echo "${ECHO_T}$use_weak_symbols" >&6
9764 if test "$use_weak_symbols" = yes ; then
9765
9766 echo "$as_me:9766: checking if $CC supports weak symbols" >&5
9767 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9768 if test "${cf_cv_weak_symbols+set}" = set; then
9769   echo $ECHO_N "(cached) $ECHO_C" >&6
9770 else
9771
9772 cat >conftest.$ac_ext <<_ACEOF
9773 #line 9773 "configure"
9774 #include "confdefs.h"
9775
9776 #include <stdio.h>
9777 int
9778 main ()
9779 {
9780
9781 #if defined(__GNUC__)
9782 #  if defined __USE_ISOC99
9783 #    define _cat_pragma(exp)    _Pragma(#exp)
9784 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9785 #  else
9786 #    define _weak_pragma(exp)
9787 #  endif
9788 #  define _declare(name)        __extension__ extern __typeof__(name) name
9789 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9790 #endif
9791
9792 weak_symbol(fopen);
9793
9794   ;
9795   return 0;
9796 }
9797 _ACEOF
9798 rm -f conftest.$ac_objext
9799 if { (eval echo "$as_me:9799: \"$ac_compile\"") >&5
9800   (eval $ac_compile) 2>&5
9801   ac_status=$?
9802   echo "$as_me:9802: \$? = $ac_status" >&5
9803   (exit $ac_status); } &&
9804          { ac_try='test -s conftest.$ac_objext'
9805   { (eval echo "$as_me:9805: \"$ac_try\"") >&5
9806   (eval $ac_try) 2>&5
9807   ac_status=$?
9808   echo "$as_me:9808: \$? = $ac_status" >&5
9809   (exit $ac_status); }; }; then
9810   cf_cv_weak_symbols=yes
9811 else
9812   echo "$as_me: failed program was:" >&5
9813 cat conftest.$ac_ext >&5
9814 cf_cv_weak_symbols=no
9815 fi
9816 rm -f conftest.$ac_objext conftest.$ac_ext
9817
9818 fi
9819 echo "$as_me:9819: result: $cf_cv_weak_symbols" >&5
9820 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9821
9822 else
9823     cf_cv_weak_symbols=no
9824 fi
9825
9826 if test $cf_cv_weak_symbols = yes ; then
9827     cat >>confdefs.h <<\EOF
9828 #define USE_WEAK_SYMBOLS 1
9829 EOF
9830
9831 fi
9832
9833 PTHREAD=
9834 if test "$with_pthread" = "yes" ; then
9835     cat >>confdefs.h <<\EOF
9836 #define USE_PTHREADS 1
9837 EOF
9838
9839     enable_reentrant=yes
9840     if test $cf_cv_weak_symbols = yes ; then
9841         PTHREAD=-lpthread
9842     fi
9843 fi
9844
9845 # OpenSUSE is installing ncurses6, using reentrant option.
9846 echo "$as_me:9846: checking for _nc_TABSIZE" >&5
9847 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
9848 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
9849   echo $ECHO_N "(cached) $ECHO_C" >&6
9850 else
9851   cat >conftest.$ac_ext <<_ACEOF
9852 #line 9852 "configure"
9853 #include "confdefs.h"
9854 /* System header to define __stub macros and hopefully few prototypes,
9855     which can conflict with char _nc_TABSIZE (); below.  */
9856 #include <assert.h>
9857 /* Override any gcc2 internal prototype to avoid an error.  */
9858 #ifdef __cplusplus
9859 extern "C"
9860 #endif
9861 /* We use char because int might match the return type of a gcc2
9862    builtin and then its argument prototype would still apply.  */
9863 char _nc_TABSIZE ();
9864 char (*f) ();
9865
9866 int
9867 main ()
9868 {
9869 /* The GNU C library defines this for functions which it implements
9870     to always fail with ENOSYS.  Some functions are actually named
9871     something starting with __ and the normal name is an alias.  */
9872 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
9873 choke me
9874 #else
9875 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9876 #endif
9877
9878   ;
9879   return 0;
9880 }
9881 _ACEOF
9882 rm -f conftest.$ac_objext conftest$ac_exeext
9883 if { (eval echo "$as_me:9883: \"$ac_link\"") >&5
9884   (eval $ac_link) 2>&5
9885   ac_status=$?
9886   echo "$as_me:9886: \$? = $ac_status" >&5
9887   (exit $ac_status); } &&
9888          { ac_try='test -s conftest$ac_exeext'
9889   { (eval echo "$as_me:9889: \"$ac_try\"") >&5
9890   (eval $ac_try) 2>&5
9891   ac_status=$?
9892   echo "$as_me:9892: \$? = $ac_status" >&5
9893   (exit $ac_status); }; }; then
9894   ac_cv_func__nc_TABSIZE=yes
9895 else
9896   echo "$as_me: failed program was:" >&5
9897 cat conftest.$ac_ext >&5
9898 ac_cv_func__nc_TABSIZE=no
9899 fi
9900 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9901 fi
9902 echo "$as_me:9902: result: $ac_cv_func__nc_TABSIZE" >&5
9903 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
9904 if test $ac_cv_func__nc_TABSIZE = yes; then
9905   assume_reentrant=yes
9906 else
9907   assume_reentrant=no
9908 fi
9909
9910 # Reentrant code has to be opaque; there's little advantage to making ncurses
9911 # opaque outside of that, so there is no --enable-opaque option.  We can use
9912 # this option without --with-pthreads, but this will be always set for
9913 # pthreads.
9914 echo "$as_me:9914: checking if you want experimental reentrant code" >&5
9915 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9916
9917 # Check whether --enable-reentrant or --disable-reentrant was given.
9918 if test "${enable_reentrant+set}" = set; then
9919   enableval="$enable_reentrant"
9920   with_reentrant=$enableval
9921 else
9922   with_reentrant=$assume_reentrant
9923 fi;
9924 echo "$as_me:9924: result: $with_reentrant" >&5
9925 echo "${ECHO_T}$with_reentrant" >&6
9926 if test "$with_reentrant" = yes ; then
9927         cf_cv_enable_reentrant=1
9928         if test $cf_cv_weak_symbols = yes ; then
9929
9930 # remove pthread library from $LIBS
9931 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9932
9933         elif test "$assume_reentrant" = no ; then
9934                 LIB_SUFFIX="t${LIB_SUFFIX}"
9935         fi
9936         cat >>confdefs.h <<\EOF
9937 #define USE_REENTRANT 1
9938 EOF
9939
9940 else
9941         cf_cv_enable_reentrant=0
9942 fi
9943
9944 ### Allow using a different wrap-prefix
9945 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9946         echo "$as_me:9946: checking for prefix used to wrap public variables" >&5
9947 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9948
9949 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9950 if test "${with_wrap_prefix+set}" = set; then
9951   withval="$with_wrap_prefix"
9952   NCURSES_WRAP_PREFIX=$withval
9953 else
9954   NCURSES_WRAP_PREFIX=_nc_
9955 fi;
9956         echo "$as_me:9956: result: $NCURSES_WRAP_PREFIX" >&5
9957 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9958 else
9959         NCURSES_WRAP_PREFIX=_nc_
9960 fi
9961
9962 cat >>confdefs.h <<EOF
9963 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9964 EOF
9965
9966 ###############################################################################
9967
9968 ###     use option --disable-echo to suppress full display compiling commands
9969
9970 echo "$as_me:9970: checking if you want to see long compiling messages" >&5
9971 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
9972
9973 # Check whether --enable-echo or --disable-echo was given.
9974 if test "${enable_echo+set}" = set; then
9975   enableval="$enable_echo"
9976   test "$enableval" != no && enableval=yes
9977   if test "$enableval" != "yes" ; then
9978
9979     ECHO_LT='--silent'
9980     ECHO_LD='@echo linking $@;'
9981     RULE_CC='@echo compiling $<'
9982     SHOW_CC='@echo compiling $@'
9983     ECHO_CC='@'
9984
9985   else
9986
9987     ECHO_LT=''
9988     ECHO_LD=''
9989     RULE_CC=''
9990     SHOW_CC=''
9991     ECHO_CC=''
9992
9993   fi
9994 else
9995   enableval=yes
9996
9997     ECHO_LT=''
9998     ECHO_LD=''
9999     RULE_CC=''
10000     SHOW_CC=''
10001     ECHO_CC=''
10002
10003 fi;
10004 echo "$as_me:10004: result: $enableval" >&5
10005 echo "${ECHO_T}$enableval" >&6
10006
10007 ###     use option --enable-warnings to turn on all gcc warnings
10008 echo "$as_me:10008: checking if you want to see compiler warnings" >&5
10009 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
10010
10011 # Check whether --enable-warnings or --disable-warnings was given.
10012 if test "${enable_warnings+set}" = set; then
10013   enableval="$enable_warnings"
10014   with_warnings=$enableval
10015 fi;
10016 echo "$as_me:10016: result: $with_warnings" >&5
10017 echo "${ECHO_T}$with_warnings" >&6
10018
10019 if test "x$with_warnings" = "xyes"; then
10020
10021         ADAFLAGS="$ADAFLAGS -gnatg"
10022
10023 INTEL_COMPILER=no
10024
10025 if test "$GCC" = yes ; then
10026         case $host_os in
10027         linux*|gnu*)
10028                 echo "$as_me:10028: checking if this is really Intel C compiler" >&5
10029 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
10030                 cf_save_CFLAGS="$CFLAGS"
10031                 CFLAGS="$CFLAGS -no-gcc"
10032                 cat >conftest.$ac_ext <<_ACEOF
10033 #line 10033 "configure"
10034 #include "confdefs.h"
10035
10036 int
10037 main ()
10038 {
10039
10040 #ifdef __INTEL_COMPILER
10041 #else
10042 make an error
10043 #endif
10044
10045   ;
10046   return 0;
10047 }
10048 _ACEOF
10049 rm -f conftest.$ac_objext
10050 if { (eval echo "$as_me:10050: \"$ac_compile\"") >&5
10051   (eval $ac_compile) 2>&5
10052   ac_status=$?
10053   echo "$as_me:10053: \$? = $ac_status" >&5
10054   (exit $ac_status); } &&
10055          { ac_try='test -s conftest.$ac_objext'
10056   { (eval echo "$as_me:10056: \"$ac_try\"") >&5
10057   (eval $ac_try) 2>&5
10058   ac_status=$?
10059   echo "$as_me:10059: \$? = $ac_status" >&5
10060   (exit $ac_status); }; }; then
10061   INTEL_COMPILER=yes
10062 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
10063
10064 else
10065   echo "$as_me: failed program was:" >&5
10066 cat conftest.$ac_ext >&5
10067 fi
10068 rm -f conftest.$ac_objext conftest.$ac_ext
10069                 CFLAGS="$cf_save_CFLAGS"
10070                 echo "$as_me:10070: result: $INTEL_COMPILER" >&5
10071 echo "${ECHO_T}$INTEL_COMPILER" >&6
10072                 ;;
10073         esac
10074 fi
10075
10076 cat > conftest.$ac_ext <<EOF
10077 #line 10077 "${as_me:-configure}"
10078 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
10079 EOF
10080
10081 if test "$INTEL_COMPILER" = yes
10082 then
10083 # The "-wdXXX" options suppress warnings:
10084 # remark #1419: external declaration in primary source file
10085 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
10086 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
10087 # remark #193: zero used for undefined preprocessing identifier
10088 # remark #593: variable "curs_sb_left_arrow" was set but never used
10089 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
10090 # remark #869: parameter "tw" was never referenced
10091 # remark #981: operands are evaluated in unspecified order
10092 # warning #279: controlling expression is constant
10093
10094         { echo "$as_me:10094: checking for $CC warning options..." >&5
10095 echo "$as_me: checking for $CC warning options..." >&6;}
10096         cf_save_CFLAGS="$CFLAGS"
10097         EXTRA_CFLAGS="-Wall"
10098         for cf_opt in \
10099                 wd1419 \
10100                 wd1683 \
10101                 wd1684 \
10102                 wd193 \
10103                 wd593 \
10104                 wd279 \
10105                 wd810 \
10106                 wd869 \
10107                 wd981
10108         do
10109                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10110                 if { (eval echo "$as_me:10110: \"$ac_compile\"") >&5
10111   (eval $ac_compile) 2>&5
10112   ac_status=$?
10113   echo "$as_me:10113: \$? = $ac_status" >&5
10114   (exit $ac_status); }; then
10115                         test -n "$verbose" && echo "$as_me:10115: result: ... -$cf_opt" >&5
10116 echo "${ECHO_T}... -$cf_opt" >&6
10117                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10118                 fi
10119         done
10120         CFLAGS="$cf_save_CFLAGS"
10121
10122 elif test "$GCC" = yes
10123 then
10124         { echo "$as_me:10124: checking for $CC warning options..." >&5
10125 echo "$as_me: checking for $CC warning options..." >&6;}
10126         cf_save_CFLAGS="$CFLAGS"
10127         EXTRA_CFLAGS=
10128         cf_warn_CONST=""
10129         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
10130         for cf_opt in W Wall \
10131                 Wbad-function-cast \
10132                 Wcast-align \
10133                 Wcast-qual \
10134                 Winline \
10135                 Wmissing-declarations \
10136                 Wmissing-prototypes \
10137                 Wnested-externs \
10138                 Wpointer-arith \
10139                 Wshadow \
10140                 Wstrict-prototypes \
10141                 Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
10142         do
10143                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
10144                 if { (eval echo "$as_me:10144: \"$ac_compile\"") >&5
10145   (eval $ac_compile) 2>&5
10146   ac_status=$?
10147   echo "$as_me:10147: \$? = $ac_status" >&5
10148   (exit $ac_status); }; then
10149                         test -n "$verbose" && echo "$as_me:10149: result: ... -$cf_opt" >&5
10150 echo "${ECHO_T}... -$cf_opt" >&6
10151                         case $cf_opt in #(vi
10152                         Wcast-qual) #(vi
10153                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
10154                                 ;;
10155                         Winline) #(vi
10156                                 case $GCC_VERSION in
10157                                 [34].*)
10158                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10159
10160 echo "${as_me:-configure}:10160: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10161
10162                                         continue;;
10163                                 esac
10164                                 ;;
10165                         Wpointer-arith) #(vi
10166                                 case $GCC_VERSION in
10167                                 [12].*)
10168                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
10169
10170 echo "${as_me:-configure}:10170: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
10171
10172                                         continue;;
10173                                 esac
10174                                 ;;
10175                         esac
10176                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
10177                 fi
10178         done
10179         CFLAGS="$cf_save_CFLAGS"
10180 fi
10181 rm -rf conftest*
10182
10183 fi
10184
10185 if test "$GCC" = yes
10186 then
10187 cat > conftest.i <<EOF
10188 #ifndef GCC_PRINTF
10189 #define GCC_PRINTF 0
10190 #endif
10191 #ifndef GCC_SCANF
10192 #define GCC_SCANF 0
10193 #endif
10194 #ifndef GCC_NORETURN
10195 #define GCC_NORETURN /* nothing */
10196 #endif
10197 #ifndef GCC_UNUSED
10198 #define GCC_UNUSED /* nothing */
10199 #endif
10200 EOF
10201 if test "$GCC" = yes
10202 then
10203         { echo "$as_me:10203: checking for $CC __attribute__ directives..." >&5
10204 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
10205 cat > conftest.$ac_ext <<EOF
10206 #line 10206 "${as_me:-configure}"
10207 #include "confdefs.h"
10208 #include "conftest.h"
10209 #include "conftest.i"
10210 #if     GCC_PRINTF
10211 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
10212 #else
10213 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
10214 #endif
10215 #if     GCC_SCANF
10216 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
10217 #else
10218 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
10219 #endif
10220 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
10221 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
10222 extern void foo(void) GCC_NORETURN;
10223 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
10224 EOF
10225         cf_printf_attribute=no
10226         cf_scanf_attribute=no
10227         for cf_attribute in scanf printf unused noreturn
10228         do
10229
10230 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10231
10232                 cf_directive="__attribute__(($cf_attribute))"
10233                 echo "checking for $CC $cf_directive" 1>&5
10234
10235                 case $cf_attribute in #(vi
10236                 printf) #(vi
10237                         cf_printf_attribute=yes
10238                         cat >conftest.h <<EOF
10239 #define GCC_$cf_ATTRIBUTE 1
10240 EOF
10241                         ;;
10242                 scanf) #(vi
10243                         cf_scanf_attribute=yes
10244                         cat >conftest.h <<EOF
10245 #define GCC_$cf_ATTRIBUTE 1
10246 EOF
10247                         ;;
10248                 *) #(vi
10249                         cat >conftest.h <<EOF
10250 #define GCC_$cf_ATTRIBUTE $cf_directive
10251 EOF
10252                         ;;
10253                 esac
10254
10255                 if { (eval echo "$as_me:10255: \"$ac_compile\"") >&5
10256   (eval $ac_compile) 2>&5
10257   ac_status=$?
10258   echo "$as_me:10258: \$? = $ac_status" >&5
10259   (exit $ac_status); }; then
10260                         test -n "$verbose" && echo "$as_me:10260: result: ... $cf_attribute" >&5
10261 echo "${ECHO_T}... $cf_attribute" >&6
10262                         cat conftest.h >>confdefs.h
10263                         case $cf_attribute in #(vi
10264                         printf) #(vi
10265                                 if test "$cf_printf_attribute" = no ; then
10266                                         cat >>confdefs.h <<EOF
10267 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
10268 EOF
10269                                 else
10270                                         cat >>confdefs.h <<EOF
10271 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
10272 EOF
10273                                 fi
10274                                 ;;
10275                         scanf) #(vi
10276                                 if test "$cf_scanf_attribute" = no ; then
10277                                         cat >>confdefs.h <<EOF
10278 #define GCC_SCANFLIKE(fmt,var) /* nothing */
10279 EOF
10280                                 else
10281                                         cat >>confdefs.h <<EOF
10282 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
10283 EOF
10284                                 fi
10285                                 ;;
10286                         esac
10287                 fi
10288         done
10289 else
10290         fgrep define conftest.i >>confdefs.h
10291 fi
10292 rm -rf conftest*
10293 fi
10294
10295 ###     use option --enable-assertions to turn on generation of assertion code
10296 echo "$as_me:10296: checking if you want to enable runtime assertions" >&5
10297 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
10298
10299 # Check whether --enable-assertions or --disable-assertions was given.
10300 if test "${enable_assertions+set}" = set; then
10301   enableval="$enable_assertions"
10302   with_assertions=$enableval
10303 else
10304   with_assertions=no
10305 fi;
10306 echo "$as_me:10306: result: $with_assertions" >&5
10307 echo "${ECHO_T}$with_assertions" >&6
10308 if test -n "$GCC"
10309 then
10310         if test "$with_assertions" = no
10311         then
10312                 cat >>confdefs.h <<\EOF
10313 #define NDEBUG 1
10314 EOF
10315
10316                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
10317         else
10318
10319         ADAFLAGS="$ADAFLAGS -gnata"
10320
10321         fi
10322 fi
10323
10324 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
10325 cat >>confdefs.h <<\EOF
10326 #define HAVE_NC_ALLOC_H 1
10327 EOF
10328
10329 ###     use option --enable-expanded to generate certain macros as functions
10330
10331 # Check whether --enable-expanded or --disable-expanded was given.
10332 if test "${enable_expanded+set}" = set; then
10333   enableval="$enable_expanded"
10334   test "$enableval" = yes && cat >>confdefs.h <<\EOF
10335 #define NCURSES_EXPANDED 1
10336 EOF
10337
10338 fi;
10339
10340 ###     use option --disable-macros to suppress macros in favor of functions
10341
10342 # Check whether --enable-macros or --disable-macros was given.
10343 if test "${enable_macros+set}" = set; then
10344   enableval="$enable_macros"
10345   test "$enableval" = no && cat >>confdefs.h <<\EOF
10346 #define NCURSES_NOMACROS 1
10347 EOF
10348
10349 fi;
10350
10351 # Normally we only add trace() to the debug-library.  Allow this to be
10352 # extended to all models of the ncurses library:
10353 cf_all_traces=no
10354 case "$CFLAGS $CPPFLAGS" in
10355 *-DTRACE*)
10356         cf_all_traces=yes
10357         ;;
10358 esac
10359
10360 echo "$as_me:10360: checking whether to add trace feature to all models" >&5
10361 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
10362
10363 # Check whether --with-trace or --without-trace was given.
10364 if test "${with_trace+set}" = set; then
10365   withval="$with_trace"
10366   cf_with_trace=$withval
10367 else
10368   cf_with_trace=$cf_all_traces
10369 fi;
10370 echo "$as_me:10370: result: $cf_with_trace" >&5
10371 echo "${ECHO_T}$cf_with_trace" >&6
10372
10373 if test "$cf_with_trace" = yes ; then
10374         ADA_TRACE=TRUE
10375
10376 cf_fix_cppflags=no
10377 cf_new_cflags=
10378 cf_new_cppflags=
10379 cf_new_extra_cppflags=
10380
10381 for cf_add_cflags in -DTRACE
10382 do
10383 case $cf_fix_cppflags in
10384 no)
10385         case $cf_add_cflags in #(vi
10386         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10387                 case $cf_add_cflags in
10388                 -D*)
10389                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10390
10391                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10392                                 && test -z "${cf_tst_cflags}" \
10393                                 && cf_fix_cppflags=yes
10394
10395                         if test $cf_fix_cppflags = yes ; then
10396                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10397                                 continue
10398                         elif test "${cf_tst_cflags}" = "\"'" ; then
10399                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10400                                 continue
10401                         fi
10402                         ;;
10403                 esac
10404                 case "$CPPFLAGS" in
10405                 *$cf_add_cflags) #(vi
10406                         ;;
10407                 *) #(vi
10408                         case $cf_add_cflags in #(vi
10409                         -D*)
10410                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10411
10412 CPPFLAGS=`echo "$CPPFLAGS" | \
10413         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10414                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10415
10416                                 ;;
10417                         esac
10418                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10419                         ;;
10420                 esac
10421                 ;;
10422         *)
10423                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10424                 ;;
10425         esac
10426         ;;
10427 yes)
10428         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10429
10430         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10431
10432         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10433                 && test -z "${cf_tst_cflags}" \
10434                 && cf_fix_cppflags=no
10435         ;;
10436 esac
10437 done
10438
10439 if test -n "$cf_new_cflags" ; then
10440
10441         CFLAGS="$CFLAGS $cf_new_cflags"
10442 fi
10443
10444 if test -n "$cf_new_cppflags" ; then
10445
10446         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10447 fi
10448
10449 if test -n "$cf_new_extra_cppflags" ; then
10450
10451         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10452 fi
10453
10454 else
10455         ADA_TRACE=FALSE
10456 fi
10457
10458 ###     Checks for libraries.
10459 case $cf_cv_system_name in #(vi
10460 *mingw32*) #(vi
10461         ;;
10462 *)
10463 echo "$as_me:10463: checking for gettimeofday" >&5
10464 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
10465 if test "${ac_cv_func_gettimeofday+set}" = set; then
10466   echo $ECHO_N "(cached) $ECHO_C" >&6
10467 else
10468   cat >conftest.$ac_ext <<_ACEOF
10469 #line 10469 "configure"
10470 #include "confdefs.h"
10471 /* System header to define __stub macros and hopefully few prototypes,
10472     which can conflict with char gettimeofday (); below.  */
10473 #include <assert.h>
10474 /* Override any gcc2 internal prototype to avoid an error.  */
10475 #ifdef __cplusplus
10476 extern "C"
10477 #endif
10478 /* We use char because int might match the return type of a gcc2
10479    builtin and then its argument prototype would still apply.  */
10480 char gettimeofday ();
10481 char (*f) ();
10482
10483 int
10484 main ()
10485 {
10486 /* The GNU C library defines this for functions which it implements
10487     to always fail with ENOSYS.  Some functions are actually named
10488     something starting with __ and the normal name is an alias.  */
10489 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
10490 choke me
10491 #else
10492 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10493 #endif
10494
10495   ;
10496   return 0;
10497 }
10498 _ACEOF
10499 rm -f conftest.$ac_objext conftest$ac_exeext
10500 if { (eval echo "$as_me:10500: \"$ac_link\"") >&5
10501   (eval $ac_link) 2>&5
10502   ac_status=$?
10503   echo "$as_me:10503: \$? = $ac_status" >&5
10504   (exit $ac_status); } &&
10505          { ac_try='test -s conftest$ac_exeext'
10506   { (eval echo "$as_me:10506: \"$ac_try\"") >&5
10507   (eval $ac_try) 2>&5
10508   ac_status=$?
10509   echo "$as_me:10509: \$? = $ac_status" >&5
10510   (exit $ac_status); }; }; then
10511   ac_cv_func_gettimeofday=yes
10512 else
10513   echo "$as_me: failed program was:" >&5
10514 cat conftest.$ac_ext >&5
10515 ac_cv_func_gettimeofday=no
10516 fi
10517 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10518 fi
10519 echo "$as_me:10519: result: $ac_cv_func_gettimeofday" >&5
10520 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
10521 if test $ac_cv_func_gettimeofday = yes; then
10522   cat >>confdefs.h <<\EOF
10523 #define HAVE_GETTIMEOFDAY 1
10524 EOF
10525
10526 else
10527
10528 echo "$as_me:10528: checking for gettimeofday in -lbsd" >&5
10529 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
10530 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
10531   echo $ECHO_N "(cached) $ECHO_C" >&6
10532 else
10533   ac_check_lib_save_LIBS=$LIBS
10534 LIBS="-lbsd  $LIBS"
10535 cat >conftest.$ac_ext <<_ACEOF
10536 #line 10536 "configure"
10537 #include "confdefs.h"
10538
10539 /* Override any gcc2 internal prototype to avoid an error.  */
10540 #ifdef __cplusplus
10541 extern "C"
10542 #endif
10543 /* We use char because int might match the return type of a gcc2
10544    builtin and then its argument prototype would still apply.  */
10545 char gettimeofday ();
10546 int
10547 main ()
10548 {
10549 gettimeofday ();
10550   ;
10551   return 0;
10552 }
10553 _ACEOF
10554 rm -f conftest.$ac_objext conftest$ac_exeext
10555 if { (eval echo "$as_me:10555: \"$ac_link\"") >&5
10556   (eval $ac_link) 2>&5
10557   ac_status=$?
10558   echo "$as_me:10558: \$? = $ac_status" >&5
10559   (exit $ac_status); } &&
10560          { ac_try='test -s conftest$ac_exeext'
10561   { (eval echo "$as_me:10561: \"$ac_try\"") >&5
10562   (eval $ac_try) 2>&5
10563   ac_status=$?
10564   echo "$as_me:10564: \$? = $ac_status" >&5
10565   (exit $ac_status); }; }; then
10566   ac_cv_lib_bsd_gettimeofday=yes
10567 else
10568   echo "$as_me: failed program was:" >&5
10569 cat conftest.$ac_ext >&5
10570 ac_cv_lib_bsd_gettimeofday=no
10571 fi
10572 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10573 LIBS=$ac_check_lib_save_LIBS
10574 fi
10575 echo "$as_me:10575: result: $ac_cv_lib_bsd_gettimeofday" >&5
10576 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
10577 if test $ac_cv_lib_bsd_gettimeofday = yes; then
10578   cat >>confdefs.h <<\EOF
10579 #define HAVE_GETTIMEOFDAY 1
10580 EOF
10581
10582         LIBS="$LIBS -lbsd"
10583 fi
10584
10585 fi
10586         ;;
10587 esac
10588
10589 ###     Checks for header files.
10590 echo "$as_me:10590: checking for ANSI C header files" >&5
10591 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10592 if test "${ac_cv_header_stdc+set}" = set; then
10593   echo $ECHO_N "(cached) $ECHO_C" >&6
10594 else
10595   cat >conftest.$ac_ext <<_ACEOF
10596 #line 10596 "configure"
10597 #include "confdefs.h"
10598 #include <stdlib.h>
10599 #include <stdarg.h>
10600 #include <string.h>
10601 #include <float.h>
10602
10603 _ACEOF
10604 if { (eval echo "$as_me:10604: \"$ac_cpp conftest.$ac_ext\"") >&5
10605   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10606   ac_status=$?
10607   egrep -v '^ *\+' conftest.er1 >conftest.err
10608   rm -f conftest.er1
10609   cat conftest.err >&5
10610   echo "$as_me:10610: \$? = $ac_status" >&5
10611   (exit $ac_status); } >/dev/null; then
10612   if test -s conftest.err; then
10613     ac_cpp_err=$ac_c_preproc_warn_flag
10614   else
10615     ac_cpp_err=
10616   fi
10617 else
10618   ac_cpp_err=yes
10619 fi
10620 if test -z "$ac_cpp_err"; then
10621   ac_cv_header_stdc=yes
10622 else
10623   echo "$as_me: failed program was:" >&5
10624   cat conftest.$ac_ext >&5
10625   ac_cv_header_stdc=no
10626 fi
10627 rm -f conftest.err conftest.$ac_ext
10628
10629 if test $ac_cv_header_stdc = yes; then
10630   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10631   cat >conftest.$ac_ext <<_ACEOF
10632 #line 10632 "configure"
10633 #include "confdefs.h"
10634 #include <string.h>
10635
10636 _ACEOF
10637 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10638   egrep "memchr" >/dev/null 2>&1; then
10639   :
10640 else
10641   ac_cv_header_stdc=no
10642 fi
10643 rm -rf conftest*
10644
10645 fi
10646
10647 if test $ac_cv_header_stdc = yes; then
10648   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10649   cat >conftest.$ac_ext <<_ACEOF
10650 #line 10650 "configure"
10651 #include "confdefs.h"
10652 #include <stdlib.h>
10653
10654 _ACEOF
10655 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10656   egrep "free" >/dev/null 2>&1; then
10657   :
10658 else
10659   ac_cv_header_stdc=no
10660 fi
10661 rm -rf conftest*
10662
10663 fi
10664
10665 if test $ac_cv_header_stdc = yes; then
10666   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10667   if test "$cross_compiling" = yes; then
10668   :
10669 else
10670   cat >conftest.$ac_ext <<_ACEOF
10671 #line 10671 "configure"
10672 #include "confdefs.h"
10673 #include <ctype.h>
10674 #if ((' ' & 0x0FF) == 0x020)
10675 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10676 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10677 #else
10678 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
10679                      || ('j' <= (c) && (c) <= 'r') \
10680                      || ('s' <= (c) && (c) <= 'z'))
10681 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10682 #endif
10683
10684 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10685 int
10686 main ()
10687 {
10688   int i;
10689   for (i = 0; i < 256; i++)
10690     if (XOR (islower (i), ISLOWER (i))
10691         || toupper (i) != TOUPPER (i))
10692       $ac_main_return(2);
10693   $ac_main_return (0);
10694 }
10695 _ACEOF
10696 rm -f conftest$ac_exeext
10697 if { (eval echo "$as_me:10697: \"$ac_link\"") >&5
10698   (eval $ac_link) 2>&5
10699   ac_status=$?
10700   echo "$as_me:10700: \$? = $ac_status" >&5
10701   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10702   { (eval echo "$as_me:10702: \"$ac_try\"") >&5
10703   (eval $ac_try) 2>&5
10704   ac_status=$?
10705   echo "$as_me:10705: \$? = $ac_status" >&5
10706   (exit $ac_status); }; }; then
10707   :
10708 else
10709   echo "$as_me: program exited with status $ac_status" >&5
10710 echo "$as_me: failed program was:" >&5
10711 cat conftest.$ac_ext >&5
10712 ac_cv_header_stdc=no
10713 fi
10714 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10715 fi
10716 fi
10717 fi
10718 echo "$as_me:10718: result: $ac_cv_header_stdc" >&5
10719 echo "${ECHO_T}$ac_cv_header_stdc" >&6
10720 if test $ac_cv_header_stdc = yes; then
10721
10722 cat >>confdefs.h <<\EOF
10723 #define STDC_HEADERS 1
10724 EOF
10725
10726 fi
10727
10728 ac_header_dirent=no
10729 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
10730   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
10731 echo "$as_me:10731: checking for $ac_hdr that defines DIR" >&5
10732 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
10733 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10734   echo $ECHO_N "(cached) $ECHO_C" >&6
10735 else
10736   cat >conftest.$ac_ext <<_ACEOF
10737 #line 10737 "configure"
10738 #include "confdefs.h"
10739 #include <sys/types.h>
10740 #include <$ac_hdr>
10741
10742 int
10743 main ()
10744 {
10745 if ((DIR *) 0)
10746 return 0;
10747   ;
10748   return 0;
10749 }
10750 _ACEOF
10751 rm -f conftest.$ac_objext
10752 if { (eval echo "$as_me:10752: \"$ac_compile\"") >&5
10753   (eval $ac_compile) 2>&5
10754   ac_status=$?
10755   echo "$as_me:10755: \$? = $ac_status" >&5
10756   (exit $ac_status); } &&
10757          { ac_try='test -s conftest.$ac_objext'
10758   { (eval echo "$as_me:10758: \"$ac_try\"") >&5
10759   (eval $ac_try) 2>&5
10760   ac_status=$?
10761   echo "$as_me:10761: \$? = $ac_status" >&5
10762   (exit $ac_status); }; }; then
10763   eval "$as_ac_Header=yes"
10764 else
10765   echo "$as_me: failed program was:" >&5
10766 cat conftest.$ac_ext >&5
10767 eval "$as_ac_Header=no"
10768 fi
10769 rm -f conftest.$ac_objext conftest.$ac_ext
10770 fi
10771 echo "$as_me:10771: result: `eval echo '${'$as_ac_Header'}'`" >&5
10772 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10773 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10774   cat >>confdefs.h <<EOF
10775 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
10776 EOF
10777
10778 ac_header_dirent=$ac_hdr; break
10779 fi
10780
10781 done
10782 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
10783 if test $ac_header_dirent = dirent.h; then
10784   echo "$as_me:10784: checking for opendir in -ldir" >&5
10785 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
10786 if test "${ac_cv_lib_dir_opendir+set}" = set; then
10787   echo $ECHO_N "(cached) $ECHO_C" >&6
10788 else
10789   ac_check_lib_save_LIBS=$LIBS
10790 LIBS="-ldir  $LIBS"
10791 cat >conftest.$ac_ext <<_ACEOF
10792 #line 10792 "configure"
10793 #include "confdefs.h"
10794
10795 /* Override any gcc2 internal prototype to avoid an error.  */
10796 #ifdef __cplusplus
10797 extern "C"
10798 #endif
10799 /* We use char because int might match the return type of a gcc2
10800    builtin and then its argument prototype would still apply.  */
10801 char opendir ();
10802 int
10803 main ()
10804 {
10805 opendir ();
10806   ;
10807   return 0;
10808 }
10809 _ACEOF
10810 rm -f conftest.$ac_objext conftest$ac_exeext
10811 if { (eval echo "$as_me:10811: \"$ac_link\"") >&5
10812   (eval $ac_link) 2>&5
10813   ac_status=$?
10814   echo "$as_me:10814: \$? = $ac_status" >&5
10815   (exit $ac_status); } &&
10816          { ac_try='test -s conftest$ac_exeext'
10817   { (eval echo "$as_me:10817: \"$ac_try\"") >&5
10818   (eval $ac_try) 2>&5
10819   ac_status=$?
10820   echo "$as_me:10820: \$? = $ac_status" >&5
10821   (exit $ac_status); }; }; then
10822   ac_cv_lib_dir_opendir=yes
10823 else
10824   echo "$as_me: failed program was:" >&5
10825 cat conftest.$ac_ext >&5
10826 ac_cv_lib_dir_opendir=no
10827 fi
10828 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10829 LIBS=$ac_check_lib_save_LIBS
10830 fi
10831 echo "$as_me:10831: result: $ac_cv_lib_dir_opendir" >&5
10832 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
10833 if test $ac_cv_lib_dir_opendir = yes; then
10834   LIBS="$LIBS -ldir"
10835 fi
10836
10837 else
10838   echo "$as_me:10838: checking for opendir in -lx" >&5
10839 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
10840 if test "${ac_cv_lib_x_opendir+set}" = set; then
10841   echo $ECHO_N "(cached) $ECHO_C" >&6
10842 else
10843   ac_check_lib_save_LIBS=$LIBS
10844 LIBS="-lx  $LIBS"
10845 cat >conftest.$ac_ext <<_ACEOF
10846 #line 10846 "configure"
10847 #include "confdefs.h"
10848
10849 /* Override any gcc2 internal prototype to avoid an error.  */
10850 #ifdef __cplusplus
10851 extern "C"
10852 #endif
10853 /* We use char because int might match the return type of a gcc2
10854    builtin and then its argument prototype would still apply.  */
10855 char opendir ();
10856 int
10857 main ()
10858 {
10859 opendir ();
10860   ;
10861   return 0;
10862 }
10863 _ACEOF
10864 rm -f conftest.$ac_objext conftest$ac_exeext
10865 if { (eval echo "$as_me:10865: \"$ac_link\"") >&5
10866   (eval $ac_link) 2>&5
10867   ac_status=$?
10868   echo "$as_me:10868: \$? = $ac_status" >&5
10869   (exit $ac_status); } &&
10870          { ac_try='test -s conftest$ac_exeext'
10871   { (eval echo "$as_me:10871: \"$ac_try\"") >&5
10872   (eval $ac_try) 2>&5
10873   ac_status=$?
10874   echo "$as_me:10874: \$? = $ac_status" >&5
10875   (exit $ac_status); }; }; then
10876   ac_cv_lib_x_opendir=yes
10877 else
10878   echo "$as_me: failed program was:" >&5
10879 cat conftest.$ac_ext >&5
10880 ac_cv_lib_x_opendir=no
10881 fi
10882 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10883 LIBS=$ac_check_lib_save_LIBS
10884 fi
10885 echo "$as_me:10885: result: $ac_cv_lib_x_opendir" >&5
10886 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10887 if test $ac_cv_lib_x_opendir = yes; then
10888   LIBS="$LIBS -lx"
10889 fi
10890
10891 fi
10892
10893 echo "$as_me:10893: checking whether time.h and sys/time.h may both be included" >&5
10894 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10895 if test "${ac_cv_header_time+set}" = set; then
10896   echo $ECHO_N "(cached) $ECHO_C" >&6
10897 else
10898   cat >conftest.$ac_ext <<_ACEOF
10899 #line 10899 "configure"
10900 #include "confdefs.h"
10901 #include <sys/types.h>
10902 #include <sys/time.h>
10903 #include <time.h>
10904
10905 int
10906 main ()
10907 {
10908 if ((struct tm *) 0)
10909 return 0;
10910   ;
10911   return 0;
10912 }
10913 _ACEOF
10914 rm -f conftest.$ac_objext
10915 if { (eval echo "$as_me:10915: \"$ac_compile\"") >&5
10916   (eval $ac_compile) 2>&5
10917   ac_status=$?
10918   echo "$as_me:10918: \$? = $ac_status" >&5
10919   (exit $ac_status); } &&
10920          { ac_try='test -s conftest.$ac_objext'
10921   { (eval echo "$as_me:10921: \"$ac_try\"") >&5
10922   (eval $ac_try) 2>&5
10923   ac_status=$?
10924   echo "$as_me:10924: \$? = $ac_status" >&5
10925   (exit $ac_status); }; }; then
10926   ac_cv_header_time=yes
10927 else
10928   echo "$as_me: failed program was:" >&5
10929 cat conftest.$ac_ext >&5
10930 ac_cv_header_time=no
10931 fi
10932 rm -f conftest.$ac_objext conftest.$ac_ext
10933 fi
10934 echo "$as_me:10934: result: $ac_cv_header_time" >&5
10935 echo "${ECHO_T}$ac_cv_header_time" >&6
10936 if test $ac_cv_header_time = yes; then
10937
10938 cat >>confdefs.h <<\EOF
10939 #define TIME_WITH_SYS_TIME 1
10940 EOF
10941
10942 fi
10943
10944 ###     checks for compiler characteristics
10945 ac_ext=c
10946 ac_cpp='$CPP $CPPFLAGS'
10947 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10948 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10949 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10950 ac_main_return=return
10951
10952 echo "$as_me:10952: checking for $CC option to accept ANSI C" >&5
10953 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
10954 if test "${ac_cv_prog_cc_stdc+set}" = set; then
10955   echo $ECHO_N "(cached) $ECHO_C" >&6
10956 else
10957   ac_cv_prog_cc_stdc=no
10958 ac_save_CC=$CC
10959 cat >conftest.$ac_ext <<_ACEOF
10960 #line 10960 "configure"
10961 #include "confdefs.h"
10962 #include <stdarg.h>
10963 #include <stdio.h>
10964 #include <sys/types.h>
10965 #include <sys/stat.h>
10966 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
10967 struct buf { int x; };
10968 FILE * (*rcsopen) (struct buf *, struct stat *, int);
10969 static char *e (p, i)
10970      char **p;
10971      int i;
10972 {
10973   return p[i];
10974 }
10975 static char *f (char * (*g) (char **, int), char **p, ...)
10976 {
10977   char *s;
10978   va_list v;
10979   va_start (v,p);
10980   s = g (p, va_arg (v,int));
10981   va_end (v);
10982   return s;
10983 }
10984 int test (int i, double x);
10985 struct s1 {int (*f) (int a);};
10986 struct s2 {int (*f) (double a);};
10987 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
10988 int argc;
10989 char **argv;
10990 int
10991 main ()
10992 {
10993 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
10994   ;
10995   return 0;
10996 }
10997 _ACEOF
10998 # Don't try gcc -ansi; that turns off useful extensions and
10999 # breaks some systems' header files.
11000 # AIX                   -qlanglvl=ansi
11001 # Ultrix and OSF/1      -std1
11002 # HP-UX 10.20 and later -Ae
11003 # HP-UX older versions  -Aa -D_HPUX_SOURCE
11004 # SVR4                  -Xc -D__EXTENSIONS__
11005 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
11006 do
11007   CC="$ac_save_CC $ac_arg"
11008   rm -f conftest.$ac_objext
11009 if { (eval echo "$as_me:11009: \"$ac_compile\"") >&5
11010   (eval $ac_compile) 2>&5
11011   ac_status=$?
11012   echo "$as_me:11012: \$? = $ac_status" >&5
11013   (exit $ac_status); } &&
11014          { ac_try='test -s conftest.$ac_objext'
11015   { (eval echo "$as_me:11015: \"$ac_try\"") >&5
11016   (eval $ac_try) 2>&5
11017   ac_status=$?
11018   echo "$as_me:11018: \$? = $ac_status" >&5
11019   (exit $ac_status); }; }; then
11020   ac_cv_prog_cc_stdc=$ac_arg
11021 break
11022 else
11023   echo "$as_me: failed program was:" >&5
11024 cat conftest.$ac_ext >&5
11025 fi
11026 rm -f conftest.$ac_objext
11027 done
11028 rm -f conftest.$ac_ext conftest.$ac_objext
11029 CC=$ac_save_CC
11030
11031 fi
11032
11033 case "x$ac_cv_prog_cc_stdc" in
11034   x|xno)
11035     echo "$as_me:11035: result: none needed" >&5
11036 echo "${ECHO_T}none needed" >&6 ;;
11037   *)
11038     echo "$as_me:11038: result: $ac_cv_prog_cc_stdc" >&5
11039 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
11040     CC="$CC $ac_cv_prog_cc_stdc" ;;
11041 esac
11042
11043 echo "$as_me:11043: checking for an ANSI C-conforming const" >&5
11044 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
11045 if test "${ac_cv_c_const+set}" = set; then
11046   echo $ECHO_N "(cached) $ECHO_C" >&6
11047 else
11048   cat >conftest.$ac_ext <<_ACEOF
11049 #line 11049 "configure"
11050 #include "confdefs.h"
11051
11052 int
11053 main ()
11054 {
11055 /* FIXME: Include the comments suggested by Paul. */
11056 #ifndef __cplusplus
11057   /* Ultrix mips cc rejects this.  */
11058   typedef int charset[2];
11059   const charset x;
11060   /* SunOS 4.1.1 cc rejects this.  */
11061   char const *const *ccp;
11062   char **p;
11063   /* NEC SVR4.0.2 mips cc rejects this.  */
11064   struct point {int x, y;};
11065   static struct point const zero = {0,0};
11066   /* AIX XL C 1.02.0.0 rejects this.
11067      It does not let you subtract one const X* pointer from another in
11068      an arm of an if-expression whose if-part is not a constant
11069      expression */
11070   const char *g = "string";
11071   ccp = &g + (g ? g-g : 0);
11072   /* HPUX 7.0 cc rejects these. */
11073   ++ccp;
11074   p = (char**) ccp;
11075   ccp = (char const *const *) p;
11076   { /* SCO 3.2v4 cc rejects this.  */
11077     char *t;
11078     char const *s = 0 ? (char *) 0 : (char const *) 0;
11079
11080     *t++ = 0;
11081   }
11082   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
11083     int x[] = {25, 17};
11084     const int *foo = &x[0];
11085     ++foo;
11086   }
11087   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
11088     typedef const int *iptr;
11089     iptr p = 0;
11090     ++p;
11091   }
11092   { /* AIX XL C 1.02.0.0 rejects this saying
11093        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
11094     struct s { int j; const int *ap[3]; };
11095     struct s *b; b->j = 5;
11096   }
11097   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
11098     const int foo = 10;
11099   }
11100 #endif
11101
11102   ;
11103   return 0;
11104 }
11105 _ACEOF
11106 rm -f conftest.$ac_objext
11107 if { (eval echo "$as_me:11107: \"$ac_compile\"") >&5
11108   (eval $ac_compile) 2>&5
11109   ac_status=$?
11110   echo "$as_me:11110: \$? = $ac_status" >&5
11111   (exit $ac_status); } &&
11112          { ac_try='test -s conftest.$ac_objext'
11113   { (eval echo "$as_me:11113: \"$ac_try\"") >&5
11114   (eval $ac_try) 2>&5
11115   ac_status=$?
11116   echo "$as_me:11116: \$? = $ac_status" >&5
11117   (exit $ac_status); }; }; then
11118   ac_cv_c_const=yes
11119 else
11120   echo "$as_me: failed program was:" >&5
11121 cat conftest.$ac_ext >&5
11122 ac_cv_c_const=no
11123 fi
11124 rm -f conftest.$ac_objext conftest.$ac_ext
11125 fi
11126 echo "$as_me:11126: result: $ac_cv_c_const" >&5
11127 echo "${ECHO_T}$ac_cv_c_const" >&6
11128 if test $ac_cv_c_const = no; then
11129
11130 cat >>confdefs.h <<\EOF
11131 #define const
11132 EOF
11133
11134 fi
11135
11136 ###     Checks for external-data
11137
11138 echo "$as_me:11138: checking if data-only library module links" >&5
11139 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
11140 if test "${cf_cv_link_dataonly+set}" = set; then
11141   echo $ECHO_N "(cached) $ECHO_C" >&6
11142 else
11143
11144         rm -f conftest.a
11145         cat >conftest.$ac_ext <<EOF
11146 #line 11146 "configure"
11147 int     testdata[3] = { 123, 456, 789 };
11148 EOF
11149         if { (eval echo "$as_me:11149: \"$ac_compile\"") >&5
11150   (eval $ac_compile) 2>&5
11151   ac_status=$?
11152   echo "$as_me:11152: \$? = $ac_status" >&5
11153   (exit $ac_status); } ; then
11154                 mv conftest.o data.o && \
11155                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
11156         fi
11157         rm -f conftest.$ac_ext data.o
11158         cat >conftest.$ac_ext <<EOF
11159 #line 11159 "configure"
11160 int     testfunc()
11161 {
11162 #if defined(NeXT)
11163         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
11164 #else
11165         extern int testdata[3];
11166         return testdata[0] == 123
11167            &&  testdata[1] == 456
11168            &&  testdata[2] == 789;
11169 #endif
11170 }
11171 EOF
11172         if { (eval echo "$as_me:11172: \"$ac_compile\"") >&5
11173   (eval $ac_compile) 2>&5
11174   ac_status=$?
11175   echo "$as_me:11175: \$? = $ac_status" >&5
11176   (exit $ac_status); }; then
11177                 mv conftest.o func.o && \
11178                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
11179         fi
11180         rm -f conftest.$ac_ext func.o
11181         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
11182         cf_saveLIBS="$LIBS"
11183         LIBS="conftest.a $LIBS"
11184         if test "$cross_compiling" = yes; then
11185   cf_cv_link_dataonly=unknown
11186 else
11187   cat >conftest.$ac_ext <<_ACEOF
11188 #line 11188 "configure"
11189 #include "confdefs.h"
11190
11191         int main()
11192         {
11193                 extern int testfunc();
11194                 ${cf_cv_main_return:-return} (!testfunc());
11195         }
11196
11197 _ACEOF
11198 rm -f 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); } && { ac_try='./conftest$ac_exeext'
11204   { (eval echo "$as_me:11204: \"$ac_try\"") >&5
11205   (eval $ac_try) 2>&5
11206   ac_status=$?
11207   echo "$as_me:11207: \$? = $ac_status" >&5
11208   (exit $ac_status); }; }; then
11209   cf_cv_link_dataonly=yes
11210 else
11211   echo "$as_me: program exited with status $ac_status" >&5
11212 echo "$as_me: failed program was:" >&5
11213 cat conftest.$ac_ext >&5
11214 cf_cv_link_dataonly=no
11215 fi
11216 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11217 fi
11218         LIBS="$cf_saveLIBS"
11219
11220 fi
11221
11222 echo "$as_me:11222: result: $cf_cv_link_dataonly" >&5
11223 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
11224
11225 if test "$cf_cv_link_dataonly" = no ; then
11226         cat >>confdefs.h <<\EOF
11227 #define BROKEN_LINKER 1
11228 EOF
11229
11230         BROKEN_LINKER=1
11231 fi
11232
11233 ###     Checks for library functions.
11234
11235 echo "$as_me:11235: checking for working mkstemp" >&5
11236 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
11237 if test "${cf_cv_func_mkstemp+set}" = set; then
11238   echo $ECHO_N "(cached) $ECHO_C" >&6
11239 else
11240
11241 rm -rf conftest*
11242 if test "$cross_compiling" = yes; then
11243   cf_cv_func_mkstemp=maybe
11244 else
11245   cat >conftest.$ac_ext <<_ACEOF
11246 #line 11246 "configure"
11247 #include "confdefs.h"
11248
11249 #include <sys/types.h>
11250 #include <stdlib.h>
11251 #include <stdio.h>
11252 #include <string.h>
11253 #include <sys/stat.h>
11254 int main()
11255 {
11256         char *tmpl = "conftestXXXXXX";
11257         char name[2][80];
11258         int n;
11259         int result = 0;
11260         int fd;
11261         struct stat sb;
11262
11263         umask(077);
11264         for (n = 0; n < 2; ++n) {
11265                 strcpy(name[n], tmpl);
11266                 if ((fd = mkstemp(name[n])) >= 0) {
11267                         if (!strcmp(name[n], tmpl)
11268                          || stat(name[n], &sb) != 0
11269                          || (sb.st_mode & S_IFMT) != S_IFREG
11270                          || (sb.st_mode & 077) != 0) {
11271                                 result = 1;
11272                         }
11273                         close(fd);
11274                 }
11275         }
11276         if (result == 0
11277          && !strcmp(name[0], name[1]))
11278                 result = 1;
11279         ${cf_cv_main_return:-return}(result);
11280 }
11281
11282 _ACEOF
11283 rm -f conftest$ac_exeext
11284 if { (eval echo "$as_me:11284: \"$ac_link\"") >&5
11285   (eval $ac_link) 2>&5
11286   ac_status=$?
11287   echo "$as_me:11287: \$? = $ac_status" >&5
11288   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11289   { (eval echo "$as_me:11289: \"$ac_try\"") >&5
11290   (eval $ac_try) 2>&5
11291   ac_status=$?
11292   echo "$as_me:11292: \$? = $ac_status" >&5
11293   (exit $ac_status); }; }; then
11294   cf_cv_func_mkstemp=yes
11295
11296 else
11297   echo "$as_me: program exited with status $ac_status" >&5
11298 echo "$as_me: failed program was:" >&5
11299 cat conftest.$ac_ext >&5
11300 cf_cv_func_mkstemp=no
11301
11302 fi
11303 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11304 fi
11305
11306 fi
11307 echo "$as_me:11307: result: $cf_cv_func_mkstemp" >&5
11308 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
11309 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
11310         echo "$as_me:11310: checking for mkstemp" >&5
11311 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
11312 if test "${ac_cv_func_mkstemp+set}" = set; then
11313   echo $ECHO_N "(cached) $ECHO_C" >&6
11314 else
11315   cat >conftest.$ac_ext <<_ACEOF
11316 #line 11316 "configure"
11317 #include "confdefs.h"
11318 /* System header to define __stub macros and hopefully few prototypes,
11319     which can conflict with char mkstemp (); below.  */
11320 #include <assert.h>
11321 /* Override any gcc2 internal prototype to avoid an error.  */
11322 #ifdef __cplusplus
11323 extern "C"
11324 #endif
11325 /* We use char because int might match the return type of a gcc2
11326    builtin and then its argument prototype would still apply.  */
11327 char mkstemp ();
11328 char (*f) ();
11329
11330 int
11331 main ()
11332 {
11333 /* The GNU C library defines this for functions which it implements
11334     to always fail with ENOSYS.  Some functions are actually named
11335     something starting with __ and the normal name is an alias.  */
11336 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
11337 choke me
11338 #else
11339 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11340 #endif
11341
11342   ;
11343   return 0;
11344 }
11345 _ACEOF
11346 rm -f conftest.$ac_objext conftest$ac_exeext
11347 if { (eval echo "$as_me:11347: \"$ac_link\"") >&5
11348   (eval $ac_link) 2>&5
11349   ac_status=$?
11350   echo "$as_me:11350: \$? = $ac_status" >&5
11351   (exit $ac_status); } &&
11352          { ac_try='test -s conftest$ac_exeext'
11353   { (eval echo "$as_me:11353: \"$ac_try\"") >&5
11354   (eval $ac_try) 2>&5
11355   ac_status=$?
11356   echo "$as_me:11356: \$? = $ac_status" >&5
11357   (exit $ac_status); }; }; then
11358   ac_cv_func_mkstemp=yes
11359 else
11360   echo "$as_me: failed program was:" >&5
11361 cat conftest.$ac_ext >&5
11362 ac_cv_func_mkstemp=no
11363 fi
11364 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11365 fi
11366 echo "$as_me:11366: result: $ac_cv_func_mkstemp" >&5
11367 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
11368
11369 fi
11370 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
11371         cat >>confdefs.h <<\EOF
11372 #define HAVE_MKSTEMP 1
11373 EOF
11374
11375 fi
11376
11377 echo "$as_me:11377: checking return type of signal handlers" >&5
11378 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
11379 if test "${ac_cv_type_signal+set}" = set; then
11380   echo $ECHO_N "(cached) $ECHO_C" >&6
11381 else
11382   cat >conftest.$ac_ext <<_ACEOF
11383 #line 11383 "configure"
11384 #include "confdefs.h"
11385 #include <sys/types.h>
11386 #include <signal.h>
11387 #ifdef signal
11388 # undef signal
11389 #endif
11390 #ifdef __cplusplus
11391 extern "C" void (*signal (int, void (*)(int)))(int);
11392 #else
11393 void (*signal ()) ();
11394 #endif
11395
11396 int
11397 main ()
11398 {
11399 int i;
11400   ;
11401   return 0;
11402 }
11403 _ACEOF
11404 rm -f conftest.$ac_objext
11405 if { (eval echo "$as_me:11405: \"$ac_compile\"") >&5
11406   (eval $ac_compile) 2>&5
11407   ac_status=$?
11408   echo "$as_me:11408: \$? = $ac_status" >&5
11409   (exit $ac_status); } &&
11410          { ac_try='test -s conftest.$ac_objext'
11411   { (eval echo "$as_me:11411: \"$ac_try\"") >&5
11412   (eval $ac_try) 2>&5
11413   ac_status=$?
11414   echo "$as_me:11414: \$? = $ac_status" >&5
11415   (exit $ac_status); }; }; then
11416   ac_cv_type_signal=void
11417 else
11418   echo "$as_me: failed program was:" >&5
11419 cat conftest.$ac_ext >&5
11420 ac_cv_type_signal=int
11421 fi
11422 rm -f conftest.$ac_objext conftest.$ac_ext
11423 fi
11424 echo "$as_me:11424: result: $ac_cv_type_signal" >&5
11425 echo "${ECHO_T}$ac_cv_type_signal" >&6
11426
11427 cat >>confdefs.h <<EOF
11428 #define RETSIGTYPE $ac_cv_type_signal
11429 EOF
11430
11431 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
11432         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11433         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
11434 fi
11435
11436 cf_with_ada=yes
11437 if test "$cf_with_ada" != "no" ; then
11438
11439 cf_ada_make=gnatmake
11440 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
11441 set dummy $cf_ada_make; ac_word=$2
11442 echo "$as_me:11442: checking for $ac_word" >&5
11443 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11444 if test "${ac_cv_prog_gnat_exists+set}" = set; then
11445   echo $ECHO_N "(cached) $ECHO_C" >&6
11446 else
11447   if test -n "$gnat_exists"; then
11448   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
11449 else
11450   ac_save_IFS=$IFS; IFS=$ac_path_separator
11451 ac_dummy="$PATH"
11452 for ac_dir in $ac_dummy; do
11453   IFS=$ac_save_IFS
11454   test -z "$ac_dir" && ac_dir=.
11455   $as_executable_p "$ac_dir/$ac_word" || continue
11456 ac_cv_prog_gnat_exists="yes"
11457 echo "$as_me:11457: found $ac_dir/$ac_word" >&5
11458 break
11459 done
11460
11461   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
11462 fi
11463 fi
11464 gnat_exists=$ac_cv_prog_gnat_exists
11465 if test -n "$gnat_exists"; then
11466   echo "$as_me:11466: result: $gnat_exists" >&5
11467 echo "${ECHO_T}$gnat_exists" >&6
11468 else
11469   echo "$as_me:11469: result: no" >&5
11470 echo "${ECHO_T}no" >&6
11471 fi
11472
11473 if test "$ac_cv_prog_gnat_exists" = no; then
11474    cf_ada_make=
11475    cf_cv_prog_gnat_correct=no
11476 else
11477
11478 echo "$as_me:11478: checking for gnat version" >&5
11479 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
11480 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
11481         grep '[0-9].[0-9][0-9]*' |\
11482     sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
11483 echo "$as_me:11483: result: $cf_gnat_version" >&5
11484 echo "${ECHO_T}$cf_gnat_version" >&6
11485
11486 case $cf_gnat_version in #(vi
11487 3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9]) #(vi
11488         cf_cv_prog_gnat_correct=yes
11489         ;;
11490 *)
11491         { echo "$as_me:11491: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
11492 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
11493         cf_cv_prog_gnat_correct=no
11494         ;;
11495 esac
11496
11497    # Extract the first word of "m4", so it can be a program name with args.
11498 set dummy m4; ac_word=$2
11499 echo "$as_me:11499: checking for $ac_word" >&5
11500 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11501 if test "${ac_cv_prog_M4_exists+set}" = set; then
11502   echo $ECHO_N "(cached) $ECHO_C" >&6
11503 else
11504   if test -n "$M4_exists"; then
11505   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
11506 else
11507   ac_save_IFS=$IFS; IFS=$ac_path_separator
11508 ac_dummy="$PATH"
11509 for ac_dir in $ac_dummy; do
11510   IFS=$ac_save_IFS
11511   test -z "$ac_dir" && ac_dir=.
11512   $as_executable_p "$ac_dir/$ac_word" || continue
11513 ac_cv_prog_M4_exists="yes"
11514 echo "$as_me:11514: found $ac_dir/$ac_word" >&5
11515 break
11516 done
11517
11518   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
11519 fi
11520 fi
11521 M4_exists=$ac_cv_prog_M4_exists
11522 if test -n "$M4_exists"; then
11523   echo "$as_me:11523: result: $M4_exists" >&5
11524 echo "${ECHO_T}$M4_exists" >&6
11525 else
11526   echo "$as_me:11526: result: no" >&5
11527 echo "${ECHO_T}no" >&6
11528 fi
11529
11530    if test "$ac_cv_prog_M4_exists" = no; then
11531       cf_cv_prog_gnat_correct=no
11532       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
11533    fi
11534    if test "$cf_cv_prog_gnat_correct" = yes; then
11535       echo "$as_me:11535: checking if GNAT works" >&5
11536 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
11537
11538 rm -rf conftest* *~conftest*
11539 cat >>conftest.ads <<CF_EOF
11540 procedure conftest;
11541 CF_EOF
11542 cat >>conftest.adb <<CF_EOF
11543 with Text_IO;
11544 with GNAT.OS_Lib;
11545 procedure conftest is
11546 begin
11547    Text_IO.Put ("Hello World");
11548    Text_IO.New_Line;
11549    GNAT.OS_Lib.OS_Exit (0);
11550 end conftest;
11551 CF_EOF
11552 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11553    if ( ./conftest 1>&5 2>&1 ) ; then
11554       cf_cv_prog_gnat_correct=yes
11555    else
11556       cf_cv_prog_gnat_correct=no
11557    fi
11558 else
11559    cf_cv_prog_gnat_correct=no
11560 fi
11561 rm -rf conftest* *~conftest*
11562
11563       echo "$as_me:11563: result: $cf_cv_prog_gnat_correct" >&5
11564 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
11565    fi
11566 fi
11567
11568         if test "$cf_cv_prog_gnat_correct" = yes; then
11569
11570         echo "$as_me:11570: checking optimization options for ADAFLAGS" >&5
11571 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
11572         case "$CFLAGS" in
11573         *-g*)
11574
11575         ADAFLAGS="$ADAFLAGS -g"
11576
11577                 ;;
11578         esac
11579         case "$CFLAGS" in
11580         *-O*)
11581                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
11582
11583         ADAFLAGS="$ADAFLAGS $cf_O_flag"
11584
11585                 ;;
11586         esac
11587         echo "$as_me:11587: result: $ADAFLAGS" >&5
11588 echo "${ECHO_T}$ADAFLAGS" >&6
11589
11590 echo "$as_me:11590: checking if GNAT supports generics" >&5
11591 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
11592 case $cf_gnat_version in #(vi
11593 3.[1-9]*|[4-9].*) #(vi
11594         cf_gnat_generics=yes
11595         ;;
11596 *)
11597         cf_gnat_generics=no
11598         ;;
11599 esac
11600 echo "$as_me:11600: result: $cf_gnat_generics" >&5
11601 echo "${ECHO_T}$cf_gnat_generics" >&6
11602
11603 if test "$cf_gnat_generics" = yes
11604 then
11605         cf_compile_generics=generics
11606         cf_generic_objects="\${GENOBJS}"
11607 else
11608         cf_compile_generics=
11609         cf_generic_objects=
11610 fi
11611
11612 echo "$as_me:11612: checking if GNAT supports SIGINT" >&5
11613 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
11614 if test "${cf_cv_gnat_sigint+set}" = set; then
11615   echo $ECHO_N "(cached) $ECHO_C" >&6
11616 else
11617
11618 rm -rf conftest* *~conftest*
11619 cat >>conftest.ads <<CF_EOF
11620 with Ada.Interrupts.Names;
11621
11622 package ConfTest is
11623
11624    pragma Warnings (Off);  --  the next pragma exists since 3.11p
11625    pragma Unreserve_All_Interrupts;
11626    pragma Warnings (On);
11627
11628    protected Process is
11629       procedure Stop;
11630       function Continue return Boolean;
11631       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
11632    private
11633       Done : Boolean := False;
11634    end Process;
11635
11636 end ConfTest;
11637 CF_EOF
11638 cat >>conftest.adb <<CF_EOF
11639 package body ConfTest is
11640    protected body Process is
11641       procedure Stop is
11642       begin
11643          Done := True;
11644       end Stop;
11645       function Continue return Boolean is
11646       begin
11647          return not Done;
11648       end Continue;
11649    end Process;
11650 end ConfTest;
11651 CF_EOF
11652 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11653       cf_cv_gnat_sigint=yes
11654 else
11655    cf_cv_gnat_sigint=no
11656 fi
11657 rm -rf conftest* *~conftest*
11658
11659 fi
11660 echo "$as_me:11660: result: $cf_cv_gnat_sigint" >&5
11661 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
11662
11663 if test $cf_cv_gnat_sigint = yes ; then
11664         USE_GNAT_SIGINT=""
11665 else
11666         USE_GNAT_SIGINT="#"
11667 fi
11668
11669 echo "$as_me:11669: checking if GNAT pragma Unreferenced works" >&5
11670 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
11671 if test "${cf_cv_pragma_unreferenced+set}" = set; then
11672   echo $ECHO_N "(cached) $ECHO_C" >&6
11673 else
11674
11675 rm -rf conftest* *~conftest*
11676 cat >>conftest.ads <<CF_EOF
11677 procedure conftest;
11678 CF_EOF
11679 cat >>conftest.adb <<CF_EOF
11680 with Text_IO;
11681 with GNAT.OS_Lib;
11682 procedure conftest is
11683    test : Integer;
11684    pragma Unreferenced (test);
11685 begin
11686    test := 1;
11687    Text_IO.Put ("Hello World");
11688    Text_IO.New_Line;
11689    GNAT.OS_Lib.OS_Exit (0);
11690 end conftest;
11691 CF_EOF
11692 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
11693       cf_cv_pragma_unreferenced=yes
11694 else
11695    cf_cv_pragma_unreferenced=no
11696 fi
11697 rm -rf conftest* *~conftest*
11698
11699 fi
11700 echo "$as_me:11700: result: $cf_cv_pragma_unreferenced" >&5
11701 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
11702
11703 # if the pragma is supported, use it (needed in the Trace code).
11704 if test $cf_cv_pragma_unreferenced = yes ; then
11705         PRAGMA_UNREF=TRUE
11706 else
11707         PRAGMA_UNREF=FALSE
11708 fi
11709
11710 cf_gnat_libraries=no
11711 cf_gnat_projects=no
11712
11713 echo "$as_me:11713: checking if GNAT supports project files" >&5
11714 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
11715 case $cf_gnat_version in #(vi
11716 3.[0-9]*) #(vi
11717         ;;
11718 *)
11719         case $cf_cv_system_name in #(vi
11720         cygwin*) #(vi
11721                 ;;
11722         *)
11723                 mkdir conftest.src conftest.bin conftest.lib
11724                 cd conftest.src
11725                 rm -rf conftest* *~conftest*
11726                 cat >>library.gpr <<CF_EOF
11727 project Library is
11728   Kind := External ("LIB_KIND");
11729   for Library_Name use "ConfTest";
11730   for Object_Dir use ".";
11731   for Library_ALI_Dir use External("LIBRARY_DIR");
11732   for Library_Version use External ("SONAME");
11733   for Library_Kind use Kind;
11734   for Library_Dir use External("BUILD_DIR");
11735   Source_Dir := External ("SOURCE_DIR");
11736   for Source_Dirs use (Source_Dir);
11737   package Compiler is
11738      for Default_Switches ("Ada") use
11739        ("-g",
11740         "-O2",
11741         "-gnatafno",
11742         "-gnatVa",   -- All validity checks
11743         "-gnatwa");  -- Activate all optional errors
11744   end Compiler;
11745 end Library;
11746 CF_EOF
11747                 cat >>confpackage.ads <<CF_EOF
11748 package ConfPackage is
11749    procedure conftest;
11750 end ConfPackage;
11751 CF_EOF
11752                 cat >>confpackage.adb <<CF_EOF
11753 with Text_IO;
11754 package body ConfPackage is
11755    procedure conftest is
11756    begin
11757       Text_IO.Put ("Hello World");
11758       Text_IO.New_Line;
11759    end conftest;
11760 end ConfPackage;
11761 CF_EOF
11762                 if ( $cf_ada_make $ADAFLAGS \
11763                                 -Plibrary.gpr \
11764                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
11765                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
11766                                 -XSOURCE_DIR=`pwd` \
11767                                 -XSONAME=libConfTest.so.1 \
11768                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
11769                         cf_gnat_projects=yes
11770                 fi
11771                 cd ..
11772                 if test -f conftest.lib/confpackage.ali
11773                 then
11774                         cf_gnat_libraries=yes
11775                 fi
11776                 rm -rf conftest* *~conftest*
11777                 ;;
11778         esac
11779         ;;
11780 esac
11781 echo "$as_me:11781: result: $cf_gnat_projects" >&5
11782 echo "${ECHO_T}$cf_gnat_projects" >&6
11783
11784 if test $cf_gnat_projects = yes
11785 then
11786         echo "$as_me:11786: checking if GNAT supports libraries" >&5
11787 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
11788         echo "$as_me:11788: result: $cf_gnat_libraries" >&5
11789 echo "${ECHO_T}$cf_gnat_libraries" >&6
11790 fi
11791
11792 if test "$cf_gnat_projects" = yes
11793 then
11794         USE_OLD_MAKERULES="#"
11795         USE_GNAT_PROJECTS=""
11796 else
11797         USE_OLD_MAKERULES=""
11798         USE_GNAT_PROJECTS="#"
11799 fi
11800
11801 if test "$cf_gnat_libraries" = yes
11802 then
11803         USE_GNAT_LIBRARIES=""
11804 else
11805         USE_GNAT_LIBRARIES="#"
11806 fi
11807
11808 echo "$as_me:11808: checking for ada-compiler" >&5
11809 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
11810
11811 # Check whether --with-ada-compiler or --without-ada-compiler was given.
11812 if test "${with_ada_compiler+set}" = set; then
11813   withval="$with_ada_compiler"
11814   cf_ada_compiler=$withval
11815 else
11816   cf_ada_compiler=gnatmake
11817 fi;
11818
11819 echo "$as_me:11819: result: $cf_ada_compiler" >&5
11820 echo "${ECHO_T}$cf_ada_compiler" >&6
11821
11822                 cf_ada_package=terminal_interface
11823
11824 echo "$as_me:11824: checking for ada-include" >&5
11825 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
11826
11827 # Check whether --with-ada-include or --without-ada-include was given.
11828 if test "${with_ada_include+set}" = set; then
11829   withval="$with_ada_include"
11830
11831 else
11832   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
11833 fi; if test -n "$prefix/share/ada/adainclude" ; then
11834
11835 if test "x$prefix" != xNONE; then
11836   cf_path_syntax="$prefix"
11837 else
11838   cf_path_syntax="$ac_default_prefix"
11839 fi
11840
11841 case ".$withval" in #(vi
11842 .\$\(*\)*|.\'*\'*) #(vi
11843   ;;
11844 ..|./*|.\\*) #(vi
11845   ;;
11846 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11847   ;;
11848 .\${*prefix}*) #(vi
11849   eval withval="$withval"
11850   case ".$withval" in #(vi
11851   .NONE/*)
11852     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11853     ;;
11854   esac
11855   ;; #(vi
11856 .no|.NONE/*)
11857   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11858   ;;
11859 *)
11860   { { echo "$as_me:11860: error: expected a pathname, not \"$withval\"" >&5
11861 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11862    { (exit 1); exit 1; }; }
11863   ;;
11864 esac
11865
11866 fi
11867 ADA_INCLUDE="$withval"
11868
11869 echo "$as_me:11869: result: $ADA_INCLUDE" >&5
11870 echo "${ECHO_T}$ADA_INCLUDE" >&6
11871
11872 echo "$as_me:11872: checking for ada-objects" >&5
11873 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
11874
11875 # Check whether --with-ada-objects or --without-ada-objects was given.
11876 if test "${with_ada_objects+set}" = set; then
11877   withval="$with_ada_objects"
11878
11879 else
11880   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
11881 fi; if test -n "$prefix/lib/ada/adalib" ; then
11882
11883 if test "x$prefix" != xNONE; then
11884   cf_path_syntax="$prefix"
11885 else
11886   cf_path_syntax="$ac_default_prefix"
11887 fi
11888
11889 case ".$withval" in #(vi
11890 .\$\(*\)*|.\'*\'*) #(vi
11891   ;;
11892 ..|./*|.\\*) #(vi
11893   ;;
11894 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11895   ;;
11896 .\${*prefix}*) #(vi
11897   eval withval="$withval"
11898   case ".$withval" in #(vi
11899   .NONE/*)
11900     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11901     ;;
11902   esac
11903   ;; #(vi
11904 .no|.NONE/*)
11905   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11906   ;;
11907 *)
11908   { { echo "$as_me:11908: error: expected a pathname, not \"$withval\"" >&5
11909 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11910    { (exit 1); exit 1; }; }
11911   ;;
11912 esac
11913
11914 fi
11915 ADA_OBJECTS="$withval"
11916
11917 echo "$as_me:11917: result: $ADA_OBJECTS" >&5
11918 echo "${ECHO_T}$ADA_OBJECTS" >&6
11919
11920 echo "$as_me:11920: checking if an Ada95 shared-library should be built" >&5
11921 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
11922
11923 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
11924 if test "${with_ada_sharedlib+set}" = set; then
11925   withval="$with_ada_sharedlib"
11926   with_ada_sharedlib=$withval
11927 else
11928   with_ada_sharedlib=no
11929 fi;
11930 echo "$as_me:11930: result: $with_ada_sharedlib" >&5
11931 echo "${ECHO_T}$with_ada_sharedlib" >&6
11932
11933 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
11934 MAKE_ADA_SHAREDLIB="#"
11935
11936 if test "x$with_ada_sharedlib" != xno
11937 then
11938         MAKE_ADA_SHAREDLIB=
11939         if test "x$with_ada_sharedlib" != xyes
11940         then
11941                 ADA_SHAREDLIB="$with_ada_sharedlib"
11942         fi
11943 fi
11944
11945         else
11946                 { { echo "$as_me:11946: error: No usable Ada compiler found" >&5
11947 echo "$as_me: error: No usable Ada compiler found" >&2;}
11948    { (exit 1); exit 1; }; }
11949         fi
11950 else
11951         { { echo "$as_me:11951: error: The Ada compiler is needed for this package" >&5
11952 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
11953    { (exit 1); exit 1; }; }
11954 fi
11955
11956 ################################################################################
11957
11958 # not needed
11959 TINFO_LDFLAGS2=
11960
11961 TINFO_LIBS=
11962
11963 ### Construct the list of include-directories to be generated
11964
11965 CPPFLAGS="$CPPFLAGS -I. -I../include"
11966 if test "$srcdir" != "."; then
11967         CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
11968 fi
11969 if test "$GCC" != yes; then
11970         CPPFLAGS="$CPPFLAGS -I\${includedir}"
11971 elif test "$includedir" != "/usr/include"; then
11972         if test "$includedir" = '${prefix}/include' ; then
11973                 if test $prefix != /usr ; then
11974                         CPPFLAGS="$CPPFLAGS -I\${includedir}"
11975                 fi
11976         else
11977                 CPPFLAGS="$CPPFLAGS -I\${includedir}"
11978         fi
11979 fi
11980
11981 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
11982 if test "$srcdir" != "."; then
11983         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
11984 fi
11985 if test "$GCC" != yes; then
11986         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11987 elif test "$includedir" != "/usr/include"; then
11988         if test "$includedir" = '${prefix}/include' ; then
11989                 if test $prefix != /usr ; then
11990                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11991                 fi
11992         else
11993                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11994         fi
11995 fi
11996
11997 ### Build up pieces for makefile rules
11998 echo "$as_me:11998: checking default library suffix" >&5
11999 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
12000
12001         case $DFT_LWR_MODEL in
12002         libtool) DFT_ARG_SUFFIX=''   ;;
12003         normal)  DFT_ARG_SUFFIX=''   ;;
12004         debug)   DFT_ARG_SUFFIX='_g' ;;
12005         profile) DFT_ARG_SUFFIX='_p' ;;
12006         shared)  DFT_ARG_SUFFIX=''   ;;
12007         esac
12008         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
12009 echo "$as_me:12009: result: $DFT_ARG_SUFFIX" >&5
12010 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
12011
12012 echo "$as_me:12012: checking default library-dependency suffix" >&5
12013 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
12014
12015         case $DFT_LWR_MODEL in #(vi
12016         libtool) #(vi
12017                 DFT_LIB_SUFFIX='.la'
12018                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12019                 ;;
12020         normal) #(vi
12021                 DFT_LIB_SUFFIX='.a'
12022                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12023                 ;;
12024         debug) #(vi
12025                 DFT_LIB_SUFFIX='_g.a'
12026                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12027                 ;;
12028         profile) #(vi
12029                 DFT_LIB_SUFFIX='_p.a'
12030                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12031                 ;;
12032         shared) #(vi
12033                 case $cf_cv_system_name in
12034                 aix[5-7]*) #(vi
12035                         DFT_LIB_SUFFIX='.a'
12036                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12037                         ;;
12038                 cygwin*|mingw*) #(vi
12039                         DFT_LIB_SUFFIX='.dll'
12040                         DFT_DEP_SUFFIX='.dll.a'
12041                         ;;
12042                 darwin*) #(vi
12043                         DFT_LIB_SUFFIX='.dylib'
12044                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12045                         ;;
12046                 hpux*) #(vi
12047                         case $target in
12048                         ia64*) #(vi
12049                                 DFT_LIB_SUFFIX='.so'
12050                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12051                                 ;;
12052                         *) #(vi
12053                                 DFT_LIB_SUFFIX='.sl'
12054                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12055                                 ;;
12056                         esac
12057                         ;;
12058                 *)      DFT_LIB_SUFFIX='.so'
12059                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
12060                         ;;
12061                 esac
12062         esac
12063         test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
12064         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
12065 echo "$as_me:12065: result: $DFT_DEP_SUFFIX" >&5
12066 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
12067
12068 echo "$as_me:12068: checking default object directory" >&5
12069 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
12070
12071         case $DFT_LWR_MODEL in
12072         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
12073         normal)  DFT_OBJ_SUBDIR='objects' ;;
12074         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
12075         profile) DFT_OBJ_SUBDIR='obj_p' ;;
12076         shared)
12077                 case $cf_cv_system_name in #(vi
12078                 cygwin) #(vi
12079                         DFT_OBJ_SUBDIR='objects' ;;
12080                 *)
12081                         DFT_OBJ_SUBDIR='obj_s' ;;
12082                 esac
12083         esac
12084 echo "$as_me:12084: result: $DFT_OBJ_SUBDIR" >&5
12085 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
12086
12087 ### Set up low-level terminfo dependencies for makefiles.
12088
12089 if test "$DFT_LWR_MODEL" = shared ; then
12090         case $cf_cv_system_name in #(vi
12091         cygwin*)
12092                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
12093                 ;;
12094         esac
12095 fi
12096
12097 ### Construct the list of subdirectories for which we'll customize makefiles
12098 ### with the appropriate compile-rules.
12099
12100 SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
12101
12102 cat >>confdefs.h <<EOF
12103 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
12104 EOF
12105
12106 ### Now that we're done running tests, add the compiler-warnings, if any
12107
12108 cf_fix_cppflags=no
12109 cf_new_cflags=
12110 cf_new_cppflags=
12111 cf_new_extra_cppflags=
12112
12113 for cf_add_cflags in $EXTRA_CFLAGS
12114 do
12115 case $cf_fix_cppflags in
12116 no)
12117         case $cf_add_cflags in #(vi
12118         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12119                 case $cf_add_cflags in
12120                 -D*)
12121                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12122
12123                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12124                                 && test -z "${cf_tst_cflags}" \
12125                                 && cf_fix_cppflags=yes
12126
12127                         if test $cf_fix_cppflags = yes ; then
12128                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12129                                 continue
12130                         elif test "${cf_tst_cflags}" = "\"'" ; then
12131                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12132                                 continue
12133                         fi
12134                         ;;
12135                 esac
12136                 case "$CPPFLAGS" in
12137                 *$cf_add_cflags) #(vi
12138                         ;;
12139                 *) #(vi
12140                         case $cf_add_cflags in #(vi
12141                         -D*)
12142                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12143
12144 CPPFLAGS=`echo "$CPPFLAGS" | \
12145         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12146                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12147
12148                                 ;;
12149                         esac
12150                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12151                         ;;
12152                 esac
12153                 ;;
12154         *)
12155                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12156                 ;;
12157         esac
12158         ;;
12159 yes)
12160         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12161
12162         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12163
12164         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12165                 && test -z "${cf_tst_cflags}" \
12166                 && cf_fix_cppflags=no
12167         ;;
12168 esac
12169 done
12170
12171 if test -n "$cf_new_cflags" ; then
12172
12173         CFLAGS="$CFLAGS $cf_new_cflags"
12174 fi
12175
12176 if test -n "$cf_new_cppflags" ; then
12177
12178         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12179 fi
12180
12181 if test -n "$cf_new_extra_cppflags" ; then
12182
12183         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12184 fi
12185
12186 ################################################################################
12187
12188 if test x"$enable_pc_files" = xyes ; then \
12189 SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
12190 MAKE_PC_FILES=
12191 else
12192 MAKE_PC_FILES="#"
12193 fi
12194
12195 ################################################################################
12196
12197 TEST_ARG2=
12198
12199 TEST_LIBS2=
12200
12201 NCURSES_SHLIB2="sh -c"
12202
12203 ADA_SUBDIRS="include gen src doc"
12204 if test "x$cf_with_tests" != "xno" ; then
12205         ADA_SUBDIRS="$ADA_SUBDIRS samples"
12206 fi
12207 for cf_dir in $ADA_SUBDIRS
12208 do
12209         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
12210 done
12211
12212 NCURSES_TREE="#"
12213
12214 EXTERNAL_TREE=
12215
12216 # match layout used by make-tar.sh
12217 ADAHTML_DIR=../doc/ada
12218
12219 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
12220 ac_config_commands="$ac_config_commands default"
12221 cat >confcache <<\_ACEOF
12222 # This file is a shell script that caches the results of configure
12223 # tests run on this system so they can be shared between configure
12224 # scripts and configure runs, see configure's option --config-cache.
12225 # It is not useful on other systems.  If it contains results you don't
12226 # want to keep, you may remove or edit it.
12227 #
12228 # config.status only pays attention to the cache file if you give it
12229 # the --recheck option to rerun configure.
12230 #
12231 # `ac_cv_env_foo' variables (set or unset) will be overriden when
12232 # loading this file, other *unset* `ac_cv_foo' will be assigned the
12233 # following values.
12234
12235 _ACEOF
12236
12237 # The following way of writing the cache mishandles newlines in values,
12238 # but we know of no workaround that is simple, portable, and efficient.
12239 # So, don't put newlines in cache variables' values.
12240 # Ultrix sh set writes to stderr and can't be redirected directly,
12241 # and sets the high bit in the cache file unless we assign to the vars.
12242 {
12243   (set) 2>&1 |
12244     case `(ac_space=' '; set | grep ac_space) 2>&1` in
12245     *ac_space=\ *)
12246       # `set' does not quote correctly, so add quotes (double-quote
12247       # substitution turns \\\\ into \\, and sed turns \\ into \).
12248       sed -n \
12249         "s/'/'\\\\''/g;
12250           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
12251       ;;
12252     *)
12253       # `set' quotes correctly as required by POSIX, so do not add quotes.
12254       sed -n \
12255         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
12256       ;;
12257     esac;
12258 } |
12259   sed '
12260      t clear
12261      : clear
12262      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
12263      t end
12264      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
12265      : end' >>confcache
12266 if cmp -s $cache_file confcache; then :; else
12267   if test -w $cache_file; then
12268     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
12269     cat confcache >$cache_file
12270   else
12271     echo "not updating unwritable cache $cache_file"
12272   fi
12273 fi
12274 rm -f confcache
12275
12276 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12277 # Let make expand exec_prefix.
12278 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12279
12280 # VPATH may cause trouble with some makes, so we remove $(srcdir),
12281 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
12282 # trailing colons and then remove the whole line if VPATH becomes empty
12283 # (actually we leave an empty line to preserve line numbers).
12284 if test "x$srcdir" = x.; then
12285   ac_vpsub='/^[         ]*VPATH[        ]*=/{
12286 s/:*\$(srcdir):*/:/;
12287 s/:*\${srcdir}:*/:/;
12288 s/:*@srcdir@:*/:/;
12289 s/^\([^=]*=[    ]*\):*/\1/;
12290 s/:*$//;
12291 s/^[^=]*=[      ]*$//;
12292 }'
12293 fi
12294
12295 DEFS=-DHAVE_CONFIG_H
12296
12297 : ${CONFIG_STATUS=./config.status}
12298 ac_clean_files_save=$ac_clean_files
12299 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
12300 { echo "$as_me:12300: creating $CONFIG_STATUS" >&5
12301 echo "$as_me: creating $CONFIG_STATUS" >&6;}
12302 cat >$CONFIG_STATUS <<_ACEOF
12303 #! $SHELL
12304 # Generated automatically by configure.
12305 # Run this file to recreate the current configuration.
12306 # Compiler output produced by configure, useful for debugging
12307 # configure, is in config.log if it exists.
12308
12309 debug=false
12310 SHELL=\${CONFIG_SHELL-$SHELL}
12311 ac_cs_invocation="\$0 \$@"
12312
12313 _ACEOF
12314
12315 cat >>$CONFIG_STATUS <<\_ACEOF
12316 # Be Bourne compatible
12317 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
12318   emulate sh
12319   NULLCMD=:
12320 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
12321   set -o posix
12322 fi
12323
12324 # Name of the executable.
12325 as_me=`echo "$0" |sed 's,.*[\\/],,'`
12326
12327 if expr a : '\(a\)' >/dev/null 2>&1; then
12328   as_expr=expr
12329 else
12330   as_expr=false
12331 fi
12332
12333 rm -f conf$$ conf$$.exe conf$$.file
12334 echo >conf$$.file
12335 if ln -s conf$$.file conf$$ 2>/dev/null; then
12336   # We could just check for DJGPP; but this test a) works b) is more generic
12337   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
12338   if test -f conf$$.exe; then
12339     # Don't use ln at all; we don't have any links
12340     as_ln_s='cp -p'
12341   else
12342     as_ln_s='ln -s'
12343   fi
12344 elif ln conf$$.file conf$$ 2>/dev/null; then
12345   as_ln_s=ln
12346 else
12347   as_ln_s='cp -p'
12348 fi
12349 rm -f conf$$ conf$$.exe conf$$.file
12350
12351 as_executable_p="test -f"
12352
12353 # Support unset when possible.
12354 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
12355   as_unset=unset
12356 else
12357   as_unset=false
12358 fi
12359
12360 # NLS nuisances.
12361 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
12362 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
12363 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
12364 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
12365 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
12366 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
12367 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
12368 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
12369
12370 # IFS
12371 # We need space, tab and new line, in precisely that order.
12372 as_nl='
12373 '
12374 IFS="   $as_nl"
12375
12376 # CDPATH.
12377 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
12378
12379 exec 6>&1
12380
12381 _ACEOF
12382
12383 # Files that config.status was made for.
12384 if test -n "$ac_config_files"; then
12385   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
12386 fi
12387
12388 if test -n "$ac_config_headers"; then
12389   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
12390 fi
12391
12392 if test -n "$ac_config_links"; then
12393   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
12394 fi
12395
12396 if test -n "$ac_config_commands"; then
12397   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
12398 fi
12399
12400 cat >>$CONFIG_STATUS <<\EOF
12401
12402 ac_cs_usage="\
12403 \`$as_me' instantiates files from templates according to the
12404 current configuration.
12405
12406 Usage: $0 [OPTIONS] [FILE]...
12407
12408   -h, --help       print this help, then exit
12409   -V, --version    print version number, then exit
12410   -d, --debug      don't remove temporary files
12411       --recheck    update $as_me by reconfiguring in the same conditions
12412   --file=FILE[:TEMPLATE]
12413                    instantiate the configuration file FILE
12414   --header=FILE[:TEMPLATE]
12415                    instantiate the configuration header FILE
12416
12417 Configuration files:
12418 $config_files
12419
12420 Configuration headers:
12421 $config_headers
12422
12423 Configuration commands:
12424 $config_commands
12425
12426 Report bugs to <dickey@invisible-island.net>."
12427 EOF
12428
12429 cat >>$CONFIG_STATUS <<EOF
12430 ac_cs_version="\\
12431 config.status
12432 configured by $0, generated by GNU Autoconf 2.52.20120310,
12433   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
12434
12435 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
12436 Free Software Foundation, Inc.
12437 This config.status script is free software; the Free Software Foundation
12438 gives unlimited permission to copy, distribute and modify it."
12439 srcdir=$srcdir
12440 INSTALL="$INSTALL"
12441 EOF
12442
12443 cat >>$CONFIG_STATUS <<\EOF
12444 # If no file are specified by the user, then we need to provide default
12445 # value.  By we need to know if files were specified by the user.
12446 ac_need_defaults=:
12447 while test $# != 0
12448 do
12449   case $1 in
12450   --*=*)
12451     ac_option=`expr "x$1" : 'x\([^=]*\)='`
12452     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
12453     shift
12454     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
12455     shift
12456     ;;
12457   -*);;
12458   *) # This is not an option, so the user has probably given explicit
12459      # arguments.
12460      ac_need_defaults=false;;
12461   esac
12462
12463   case $1 in
12464   # Handling of the options.
12465 EOF
12466 cat >>$CONFIG_STATUS <<EOF
12467   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12468     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
12469     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
12470 EOF
12471 cat >>$CONFIG_STATUS <<\EOF
12472   --version | --vers* | -V )
12473     echo "$ac_cs_version"; exit 0 ;;
12474   --he | --h)
12475     # Conflict between --help and --header
12476     { { echo "$as_me:12476: error: ambiguous option: $1
12477 Try \`$0 --help' for more information." >&5
12478 echo "$as_me: error: ambiguous option: $1
12479 Try \`$0 --help' for more information." >&2;}
12480    { (exit 1); exit 1; }; };;
12481   --help | --hel | -h )
12482     echo "$ac_cs_usage"; exit 0 ;;
12483   --debug | --d* | -d )
12484     debug=: ;;
12485   --file | --fil | --fi | --f )
12486     shift
12487     CONFIG_FILES="$CONFIG_FILES $1"
12488     ac_need_defaults=false;;
12489   --header | --heade | --head | --hea )
12490     shift
12491     CONFIG_HEADERS="$CONFIG_HEADERS $1"
12492     ac_need_defaults=false;;
12493
12494   # This is an error.
12495   -*) { { echo "$as_me:12495: error: unrecognized option: $1
12496 Try \`$0 --help' for more information." >&5
12497 echo "$as_me: error: unrecognized option: $1
12498 Try \`$0 --help' for more information." >&2;}
12499    { (exit 1); exit 1; }; } ;;
12500
12501   *) ac_config_targets="$ac_config_targets $1" ;;
12502
12503   esac
12504   shift
12505 done
12506
12507 exec 5>>config.log
12508 cat >&5 << _ACEOF
12509
12510 ## ----------------------- ##
12511 ## Running config.status.  ##
12512 ## ----------------------- ##
12513
12514 This file was extended by $as_me 2.52.20120310, executed with
12515   CONFIG_FILES    = $CONFIG_FILES
12516   CONFIG_HEADERS  = $CONFIG_HEADERS
12517   CONFIG_LINKS    = $CONFIG_LINKS
12518   CONFIG_COMMANDS = $CONFIG_COMMANDS
12519   > $ac_cs_invocation
12520 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12521
12522 _ACEOF
12523 EOF
12524
12525 cat >>$CONFIG_STATUS <<EOF
12526 #
12527 # INIT-COMMANDS section.
12528 #
12529
12530 ### Special initialization commands, used to pass information from the
12531 ### configuration-run into config.status
12532
12533 AWK="$AWK"
12534 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
12535 DFT_LWR_MODEL="$DFT_LWR_MODEL"
12536 LIB_NAME="$LIB_NAME"
12537 LIB_PREFIX="$LIB_PREFIX"
12538 LIB_SUFFIX="$LIB_SUFFIX"
12539 LN_S="$LN_S"
12540 NCURSES_MAJOR="$NCURSES_MAJOR"
12541 NCURSES_MINOR="$NCURSES_MINOR"
12542 NCURSES_PATCH="$NCURSES_PATCH"
12543 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
12544 cf_cv_abi_version="$cf_cv_abi_version"
12545 cf_cv_rel_version="$cf_cv_rel_version"
12546 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
12547 cf_cv_shared_soname='$cf_cv_shared_soname'
12548 cf_cv_shlib_version="$cf_cv_shlib_version"
12549 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
12550 cf_cv_system_name="$cf_cv_system_name"
12551 host="$host"
12552 target="$target"
12553
12554 EOF
12555
12556 cat >>$CONFIG_STATUS <<\EOF
12557 for ac_config_target in $ac_config_targets
12558 do
12559   case "$ac_config_target" in
12560   # Handling of arguments.
12561   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
12562   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
12563   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
12564   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
12565   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
12566   *) { { echo "$as_me:12566: error: invalid argument: $ac_config_target" >&5
12567 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
12568    { (exit 1); exit 1; }; };;
12569   esac
12570 done
12571
12572 # If the user did not use the arguments to specify the items to instantiate,
12573 # then the envvar interface is used.  Set only those that are not.
12574 # We use the long form for the default assignment because of an extremely
12575 # bizarre bug on SunOS 4.1.3.
12576 if $ac_need_defaults; then
12577   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
12578   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
12579   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
12580 fi
12581
12582 # Create a temporary directory, and hook for its removal unless debugging.
12583 $debug ||
12584 {
12585   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
12586   trap '{ (exit 1); exit 1; }' 1 2 13 15
12587 }
12588
12589 # Create a (secure) tmp directory for tmp files.
12590 : ${TMPDIR=/tmp}
12591 {
12592   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
12593   test -n "$tmp" && test -d "$tmp"
12594 }  ||
12595 {
12596   tmp=$TMPDIR/cs$$-$RANDOM
12597   (umask 077 && mkdir $tmp)
12598 } ||
12599 {
12600    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
12601    { (exit 1); exit 1; }
12602 }
12603
12604 EOF
12605
12606 cat >>$CONFIG_STATUS <<EOF
12607
12608 #
12609 # CONFIG_FILES section.
12610 #
12611
12612 # No need to generate the scripts if there are no CONFIG_FILES.
12613 # This happens for instance when ./config.status config.h
12614 if test -n "\$CONFIG_FILES"; then
12615   # Protect against being on the right side of a sed subst in config.status.
12616   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
12617    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
12618 s,@SHELL@,$SHELL,;t t
12619 s,@exec_prefix@,$exec_prefix,;t t
12620 s,@prefix@,$prefix,;t t
12621 s,@program_transform_name@,$program_transform_name,;t t
12622 s,@bindir@,$bindir,;t t
12623 s,@sbindir@,$sbindir,;t t
12624 s,@libexecdir@,$libexecdir,;t t
12625 s,@datadir@,$datadir,;t t
12626 s,@sysconfdir@,$sysconfdir,;t t
12627 s,@sharedstatedir@,$sharedstatedir,;t t
12628 s,@localstatedir@,$localstatedir,;t t
12629 s,@libdir@,$libdir,;t t
12630 s,@includedir@,$includedir,;t t
12631 s,@oldincludedir@,$oldincludedir,;t t
12632 s,@infodir@,$infodir,;t t
12633 s,@mandir@,$mandir,;t t
12634 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
12635 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
12636 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
12637 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
12638 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
12639 s,@build_alias@,$build_alias,;t t
12640 s,@host_alias@,$host_alias,;t t
12641 s,@target_alias@,$target_alias,;t t
12642 s,@ECHO_C@,$ECHO_C,;t t
12643 s,@ECHO_N@,$ECHO_N,;t t
12644 s,@ECHO_T@,$ECHO_T,;t t
12645 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
12646 s,@DEFS@,$DEFS,;t t
12647 s,@LIBS@,$LIBS,;t t
12648 s,@top_builddir@,$top_builddir,;t t
12649 s,@build@,$build,;t t
12650 s,@build_cpu@,$build_cpu,;t t
12651 s,@build_vendor@,$build_vendor,;t t
12652 s,@build_os@,$build_os,;t t
12653 s,@host@,$host,;t t
12654 s,@host_cpu@,$host_cpu,;t t
12655 s,@host_vendor@,$host_vendor,;t t
12656 s,@host_os@,$host_os,;t t
12657 s,@target@,$target,;t t
12658 s,@target_cpu@,$target_cpu,;t t
12659 s,@target_vendor@,$target_vendor,;t t
12660 s,@target_os@,$target_os,;t t
12661 s,@CC@,$CC,;t t
12662 s,@CFLAGS@,$CFLAGS,;t t
12663 s,@LDFLAGS@,$LDFLAGS,;t t
12664 s,@CPPFLAGS@,$CPPFLAGS,;t t
12665 s,@ac_ct_CC@,$ac_ct_CC,;t t
12666 s,@EXEEXT@,$EXEEXT,;t t
12667 s,@OBJEXT@,$OBJEXT,;t t
12668 s,@CPP@,$CPP,;t t
12669 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
12670 s,@PROG_EXT@,$PROG_EXT,;t t
12671 s,@AWK@,$AWK,;t t
12672 s,@EGREP@,$EGREP,;t t
12673 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
12674 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
12675 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
12676 s,@LN_S@,$LN_S,;t t
12677 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
12678 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
12679 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
12680 s,@SET_MAKE@,$SET_MAKE,;t t
12681 s,@CTAGS@,$CTAGS,;t t
12682 s,@ETAGS@,$ETAGS,;t t
12683 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
12684 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
12685 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
12686 s,@RANLIB@,$RANLIB,;t t
12687 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
12688 s,@LD@,$LD,;t t
12689 s,@ac_ct_LD@,$ac_ct_LD,;t t
12690 s,@AR@,$AR,;t t
12691 s,@ac_ct_AR@,$ac_ct_AR,;t t
12692 s,@ARFLAGS@,$ARFLAGS,;t t
12693 s,@DESTDIR@,$DESTDIR,;t t
12694 s,@BUILD_CC@,$BUILD_CC,;t t
12695 s,@BUILD_CPP@,$BUILD_CPP,;t t
12696 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
12697 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
12698 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
12699 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
12700 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
12701 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
12702 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
12703 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
12704 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
12705 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
12706 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
12707 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
12708 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
12709 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
12710 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
12711 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
12712 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
12713 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
12714 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
12715 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
12716 s,@CC_G_OPT@,$CC_G_OPT,;t t
12717 s,@LD_MODEL@,$LD_MODEL,;t t
12718 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
12719 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
12720 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
12721 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
12722 s,@LINK_PROGS@,$LINK_PROGS,;t t
12723 s,@LINK_TESTS@,$LINK_TESTS,;t t
12724 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
12725 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
12726 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
12727 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
12728 s,@RPATH_LIST@,$RPATH_LIST,;t t
12729 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
12730 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
12731 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
12732 s,@PTHREAD@,$PTHREAD,;t t
12733 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
12734 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
12735 s,@ECHO_LT@,$ECHO_LT,;t t
12736 s,@ECHO_LD@,$ECHO_LD,;t t
12737 s,@RULE_CC@,$RULE_CC,;t t
12738 s,@SHOW_CC@,$SHOW_CC,;t t
12739 s,@ECHO_CC@,$ECHO_CC,;t t
12740 s,@ADAFLAGS@,$ADAFLAGS,;t t
12741 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
12742 s,@ADA_TRACE@,$ADA_TRACE,;t t
12743 s,@gnat_exists@,$gnat_exists,;t t
12744 s,@M4_exists@,$M4_exists,;t t
12745 s,@cf_ada_make@,$cf_ada_make,;t t
12746 s,@cf_compile_generics@,$cf_compile_generics,;t t
12747 s,@cf_generic_objects@,$cf_generic_objects,;t t
12748 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
12749 s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
12750 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
12751 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
12752 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
12753 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
12754 s,@cf_ada_package@,$cf_ada_package,;t t
12755 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
12756 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
12757 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
12758 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
12759 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
12760 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
12761 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
12762 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
12763 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
12764 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
12765 s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
12766 s,@cross_compiling@,$cross_compiling,;t t
12767 s,@TEST_ARG2@,$TEST_ARG2,;t t
12768 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
12769 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
12770 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
12771 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
12772 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
12773 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
12774 CEOF
12775
12776 EOF
12777
12778   cat >>$CONFIG_STATUS <<\EOF
12779   # Split the substitutions into bite-sized pieces for seds with
12780   # small command number limits, like on Digital OSF/1 and HP-UX.
12781   ac_max_sed_lines=48
12782   ac_sed_frag=1 # Number of current file.
12783   ac_beg=1 # First line for current file.
12784   ac_end=$ac_max_sed_lines # Line after last line for current file.
12785   ac_more_lines=:
12786   ac_sed_cmds=
12787   while $ac_more_lines; do
12788     if test $ac_beg -gt 1; then
12789       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12790     else
12791       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12792     fi
12793     if test ! -s $tmp/subs.frag; then
12794       ac_more_lines=false
12795     else
12796       # The purpose of the label and of the branching condition is to
12797       # speed up the sed processing (if there are no `@' at all, there
12798       # is no need to browse any of the substitutions).
12799       # These are the two extra sed commands mentioned above.
12800       (echo ':t
12801   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
12802       if test -z "$ac_sed_cmds"; then
12803         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
12804       else
12805         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
12806       fi
12807       ac_sed_frag=`expr $ac_sed_frag + 1`
12808       ac_beg=$ac_end
12809       ac_end=`expr $ac_end + $ac_max_sed_lines`
12810     fi
12811   done
12812   if test -z "$ac_sed_cmds"; then
12813     ac_sed_cmds=cat
12814   fi
12815 fi # test -n "$CONFIG_FILES"
12816
12817 EOF
12818 cat >>$CONFIG_STATUS <<\EOF
12819 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12820   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12821   case $ac_file in
12822   - | *:- | *:-:* ) # input from stdin
12823         cat >$tmp/stdin
12824         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12825         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12826   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12827         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12828   * )   ac_file_in=$ac_file.in ;;
12829   esac
12830
12831   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12832   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12833          X"$ac_file" : 'X\(//\)[^/]' \| \
12834          X"$ac_file" : 'X\(//\)$' \| \
12835          X"$ac_file" : 'X\(/\)' \| \
12836          .     : '\(.\)' 2>/dev/null ||
12837 echo X"$ac_file" |
12838     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12839           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12840           /^X\(\/\/\)$/{ s//\1/; q; }
12841           /^X\(\/\).*/{ s//\1/; q; }
12842           s/.*/./; q'`
12843   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12844     { case "$ac_dir" in
12845   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12846   *)                      as_incr_dir=.;;
12847 esac
12848 as_dummy="$ac_dir"
12849 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12850   case $as_mkdir_dir in
12851     # Skip DOS drivespec
12852     ?:) as_incr_dir=$as_mkdir_dir ;;
12853     *)
12854       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12855       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12856     ;;
12857   esac
12858 done; }
12859
12860     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
12861     # A "../" for each directory in $ac_dir_suffix.
12862     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
12863   else
12864     ac_dir_suffix= ac_dots=
12865   fi
12866
12867   case $srcdir in
12868   .)  ac_srcdir=.
12869       if test -z "$ac_dots"; then
12870          ac_top_srcdir=.
12871       else
12872          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
12873       fi ;;
12874   [\\/]* | ?:[\\/]* )
12875       ac_srcdir=$srcdir$ac_dir_suffix;
12876       ac_top_srcdir=$srcdir ;;
12877   *) # Relative path.
12878     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
12879     ac_top_srcdir=$ac_dots$srcdir ;;
12880   esac
12881
12882   case $INSTALL in
12883   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
12884   *) ac_INSTALL=$ac_dots$INSTALL ;;
12885   esac
12886
12887   if test x"$ac_file" != x-; then
12888     { echo "$as_me:12888: creating $ac_file" >&5
12889 echo "$as_me: creating $ac_file" >&6;}
12890     rm -f "$ac_file"
12891   fi
12892   # Let's still pretend it is `configure' which instantiates (i.e., don't
12893   # use $as_me), people would be surprised to read:
12894   #    /* config.h.  Generated automatically by config.status.  */
12895   configure_input="Generated automatically from `echo $ac_file_in |
12896                                                  sed 's,.*/,,'` by configure."
12897
12898   # First look for the input files in the build tree, otherwise in the
12899   # src tree.
12900   ac_file_inputs=`IFS=:
12901     for f in $ac_file_in; do
12902       case $f in
12903       -) echo $tmp/stdin ;;
12904       [\\/$]*)
12905          # Absolute (can't be DOS-style, as IFS=:)
12906          test -f "$f" || { { echo "$as_me:12906: error: cannot find input file: $f" >&5
12907 echo "$as_me: error: cannot find input file: $f" >&2;}
12908    { (exit 1); exit 1; }; }
12909          echo $f;;
12910       *) # Relative
12911          if test -f "$f"; then
12912            # Build tree
12913            echo $f
12914          elif test -f "$srcdir/$f"; then
12915            # Source tree
12916            echo $srcdir/$f
12917          else
12918            # /dev/null tree
12919            { { echo "$as_me:12919: error: cannot find input file: $f" >&5
12920 echo "$as_me: error: cannot find input file: $f" >&2;}
12921    { (exit 1); exit 1; }; }
12922          fi;;
12923       esac
12924     done` || { (exit 1); exit 1; }
12925 EOF
12926 cat >>$CONFIG_STATUS <<EOF
12927   sed "$ac_vpsub
12928 $extrasub
12929 EOF
12930 cat >>$CONFIG_STATUS <<\EOF
12931 :t
12932 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
12933 s,@configure_input@,$configure_input,;t t
12934 s,@srcdir@,$ac_srcdir,;t t
12935 s,@top_srcdir@,$ac_top_srcdir,;t t
12936 s,@INSTALL@,$ac_INSTALL,;t t
12937 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
12938   rm -f $tmp/stdin
12939   if test x"$ac_file" != x-; then
12940     mv $tmp/out $ac_file
12941   else
12942     cat $tmp/out
12943     rm -f $tmp/out
12944   fi
12945
12946 done
12947 EOF
12948 cat >>$CONFIG_STATUS <<\EOF
12949
12950 #
12951 # CONFIG_HEADER section.
12952 #
12953
12954 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12955 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12956 #
12957 # ac_d sets the value in "#define NAME VALUE" lines.
12958 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12959 ac_dB='[        ].*$,\1#\2'
12960 ac_dC=' '
12961 ac_dD=',;t'
12962 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12963 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12964 ac_iB='\([      ]\),\1#\2define\3'
12965 ac_iC=' '
12966 ac_iD='\4,;t'
12967 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12968 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12969 ac_uB='$,\1#\2define\3'
12970 ac_uC=' '
12971 ac_uD=',;t'
12972
12973 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
12974   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12975   case $ac_file in
12976   - | *:- | *:-:* ) # input from stdin
12977         cat >$tmp/stdin
12978         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12979         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12980   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12981         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12982   * )   ac_file_in=$ac_file.in ;;
12983   esac
12984
12985   test x"$ac_file" != x- && { echo "$as_me:12985: creating $ac_file" >&5
12986 echo "$as_me: creating $ac_file" >&6;}
12987
12988   # First look for the input files in the build tree, otherwise in the
12989   # src tree.
12990   ac_file_inputs=`IFS=:
12991     for f in $ac_file_in; do
12992       case $f in
12993       -) echo $tmp/stdin ;;
12994       [\\/$]*)
12995          # Absolute (can't be DOS-style, as IFS=:)
12996          test -f "$f" || { { echo "$as_me:12996: error: cannot find input file: $f" >&5
12997 echo "$as_me: error: cannot find input file: $f" >&2;}
12998    { (exit 1); exit 1; }; }
12999          echo $f;;
13000       *) # Relative
13001          if test -f "$f"; then
13002            # Build tree
13003            echo $f
13004          elif test -f "$srcdir/$f"; then
13005            # Source tree
13006            echo $srcdir/$f
13007          else
13008            # /dev/null tree
13009            { { echo "$as_me:13009: error: cannot find input file: $f" >&5
13010 echo "$as_me: error: cannot find input file: $f" >&2;}
13011    { (exit 1); exit 1; }; }
13012          fi;;
13013       esac
13014     done` || { (exit 1); exit 1; }
13015   # Remove the trailing spaces.
13016   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
13017
13018 EOF
13019
13020 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
13021 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
13022 # be either 'cat' or 'sort'.
13023 cat confdefs.h | uniq >conftest.vals
13024
13025 # Break up conftest.vals because some shells have a limit on
13026 # the size of here documents, and old seds have small limits too.
13027
13028 rm -f conftest.tail
13029 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
13030 while grep . conftest.vals >/dev/null
13031 do
13032   # Write chunks of a limited-size here document to conftest.frag.
13033   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
13034   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
13035   echo 'CEOF' >> $CONFIG_STATUS
13036   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13037   rm -f conftest.vals
13038   mv conftest.tail conftest.vals
13039 done
13040 rm -f conftest.vals
13041
13042 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
13043 # marker @DEFS@.
13044 echo '  cat >> conftest.edit <<CEOF
13045 /@DEFS@/r conftest.frag
13046 /@DEFS@/d
13047 CEOF
13048 sed -f conftest.edit $tmp/in > $tmp/out
13049 rm -f $tmp/in
13050 mv $tmp/out $tmp/in
13051 rm -f conftest.edit conftest.frag
13052 ' >> $CONFIG_STATUS
13053
13054 cat >>$CONFIG_STATUS <<\EOF
13055   # Let's still pretend it is `configure' which instantiates (i.e., don't
13056   # use $as_me), people would be surprised to read:
13057   #    /* config.h.  Generated automatically by config.status.  */
13058   if test x"$ac_file" = x-; then
13059     echo "/* Generated automatically by configure.  */" >$tmp/config.h
13060   else
13061     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
13062   fi
13063   cat $tmp/in >>$tmp/config.h
13064   rm -f $tmp/in
13065   if test x"$ac_file" != x-; then
13066     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
13067       { echo "$as_me:13067: $ac_file is unchanged" >&5
13068 echo "$as_me: $ac_file is unchanged" >&6;}
13069     else
13070       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13071          X"$ac_file" : 'X\(//\)[^/]' \| \
13072          X"$ac_file" : 'X\(//\)$' \| \
13073          X"$ac_file" : 'X\(/\)' \| \
13074          .     : '\(.\)' 2>/dev/null ||
13075 echo X"$ac_file" |
13076     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13077           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13078           /^X\(\/\/\)$/{ s//\1/; q; }
13079           /^X\(\/\).*/{ s//\1/; q; }
13080           s/.*/./; q'`
13081       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13082         { case "$ac_dir" in
13083   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
13084   *)                      as_incr_dir=.;;
13085 esac
13086 as_dummy="$ac_dir"
13087 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
13088   case $as_mkdir_dir in
13089     # Skip DOS drivespec
13090     ?:) as_incr_dir=$as_mkdir_dir ;;
13091     *)
13092       as_incr_dir=$as_incr_dir/$as_mkdir_dir
13093       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
13094     ;;
13095   esac
13096 done; }
13097
13098       fi
13099       rm -f $ac_file
13100       mv $tmp/config.h $ac_file
13101     fi
13102   else
13103     cat $tmp/config.h
13104     rm -f $tmp/config.h
13105   fi
13106 done
13107 EOF
13108 cat >>$CONFIG_STATUS <<\EOF
13109 #
13110 # CONFIG_COMMANDS section.
13111 #
13112 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
13113   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
13114   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
13115
13116   case $ac_dest in
13117     default )
13118 if test -z "$USE_OLD_MAKERULES" ; then
13119         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
13120 fi
13121  ;;
13122   esac
13123 done
13124 EOF
13125
13126 cat >>$CONFIG_STATUS <<\EOF
13127
13128 { (exit 0); exit 0; }
13129 EOF
13130 chmod +x $CONFIG_STATUS
13131 ac_clean_files=$ac_clean_files_save
13132
13133 # configure is writing to config.log, and then calls config.status.
13134 # config.status does its own redirection, appending to config.log.
13135 # Unfortunately, on DOS this fails, as config.log is still kept open
13136 # by configure, so config.status won't be able to write to it; its
13137 # output is simply discarded.  So we exec the FD to /dev/null,
13138 # effectively closing config.log, so it can be properly (re)opened and
13139 # appended to by config.status.  When coming back to configure, we
13140 # need to make the FD available again.
13141 if test "$no_create" != yes; then
13142   ac_cs_success=:
13143   exec 5>/dev/null
13144   $SHELL $CONFIG_STATUS || ac_cs_success=false
13145   exec 5>>config.log
13146   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
13147   # would make configure fail if this is the last instruction.
13148   $ac_cs_success || { (exit 1); exit 1; }
13149 fi
13150 ${MAKE:-make} preinstall