]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 5.8 - patch 20110326
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.26 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20101002.
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   --enable-pc-files       generate and install .pc files for pkg-config
649   --without-tests         suppress build with test-programs
650   --enable-mixed-case     tic should assume mixed-case filenames
651   --with-install-prefix   prefixes actual install-location ($DESTDIR)
652 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
653   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
654   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
655   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
656   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
657   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
658   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
659 Options to Specify the Libraries Built/Used:
660   --enable-widec          compile with wide-char/UTF-8 code
661   --with-curses-dir=DIR   directory in which (n)curses is installed
662   --with-shlib-version=X  Specify rel or abi version for shared libs
663 Fine-Tuning Your Configuration:
664   --enable-broken_linker  compile with broken-linker support code
665   --disable-largefile     omit support for large files
666   --with-rcs-ids          compile-in RCS identifiers
667 Extensions:
668   --disable-ext-funcs     disable function-extensions
669   --enable-const          compile with extra/non-standard const
670 Development Code:
671   --without-develop       disable development options
672 Experimental Code:
673   --with-pthread          use POSIX thread library
674   --enable-weak-symbols   enable weak-symbols for pthreads
675   --enable-reentrant      compile with experimental reentrant code
676   --with-wrap-prefix=XXX  override prefix used for public variables
677 Testing/development Options:
678   --enable-echo           build: display "compiling" commands (default)
679   --enable-warnings       build: turn on GCC compiler warnings
680   --enable-assertions     test: turn on generation of assertion code
681   --enable-expanded       test: generate functions for certain macros
682   --disable-macros        test: use functions rather than macros
683   --with-trace            test: add trace() function to all models of ncurses
684 Ada95 Binding Options:
685   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
686   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
687   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
688   --with-ada-sharedlib=XX build Ada95 shared-library
689
690 Some influential environment variables:
691   CC          C compiler command
692   CFLAGS      C compiler flags
693   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
694               nonstandard directory <lib dir>
695   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
696               headers in a nonstandard directory <include dir>
697   CPP         C preprocessor
698
699 Use these variables to override the choices made by `configure' or to help
700 it to find libraries and programs with nonstandard names/locations.
701
702 EOF
703 fi
704
705 if test "$ac_init_help" = "recursive"; then
706   # If there are subdirs, report their specific --help.
707   ac_popdir=`pwd`
708   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
709     cd $ac_subdir
710     # A "../" for each directory in /$ac_subdir.
711     ac_dots=`echo $ac_subdir |
712              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
713
714     case $srcdir in
715     .) # No --srcdir option.  We are building in place.
716       ac_sub_srcdir=$srcdir ;;
717     [\\/]* | ?:[\\/]* ) # Absolute path.
718       ac_sub_srcdir=$srcdir/$ac_subdir ;;
719     *) # Relative path.
720       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
721     esac
722
723     # Check for guested configure; otherwise get Cygnus style configure.
724     if test -f $ac_sub_srcdir/configure.gnu; then
725       echo
726       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
727     elif test -f $ac_sub_srcdir/configure; then
728       echo
729       $SHELL $ac_sub_srcdir/configure  --help=recursive
730     elif test -f $ac_sub_srcdir/configure.ac ||
731            test -f $ac_sub_srcdir/configure.in; then
732       echo
733       $ac_configure --help
734     else
735       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
736     fi
737     cd $ac_popdir
738   done
739 fi
740
741 test -n "$ac_init_help" && exit 0
742 if $ac_init_version; then
743   cat <<\EOF
744
745 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
746 Free Software Foundation, Inc.
747 This configure script is free software; the Free Software Foundation
748 gives unlimited permission to copy, distribute and modify it.
749 EOF
750   exit 0
751 fi
752 exec 5>config.log
753 cat >&5 <<EOF
754 This file contains any messages produced by compilers while
755 running configure, to aid debugging if configure makes a mistake.
756
757 It was created by $as_me, which was
758 generated by GNU Autoconf 2.52.20101002.  Invocation command line was
759
760   $ $0 $@
761
762 EOF
763 {
764 cat <<_ASUNAME
765 ## ---------- ##
766 ## Platform.  ##
767 ## ---------- ##
768
769 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
770 uname -m = `(uname -m) 2>/dev/null || echo unknown`
771 uname -r = `(uname -r) 2>/dev/null || echo unknown`
772 uname -s = `(uname -s) 2>/dev/null || echo unknown`
773 uname -v = `(uname -v) 2>/dev/null || echo unknown`
774
775 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
776 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
777
778 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
779 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
780 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
781 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
782 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
783 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
784 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
785
786 PATH = $PATH
787
788 _ASUNAME
789 } >&5
790
791 cat >&5 <<EOF
792 ## ------------ ##
793 ## Core tests.  ##
794 ## ------------ ##
795
796 EOF
797
798 # Keep a trace of the command line.
799 # Strip out --no-create and --no-recursion so they do not pile up.
800 # Also quote any args containing shell meta-characters.
801 ac_configure_args=
802 ac_sep=
803 for ac_arg
804 do
805   case $ac_arg in
806   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
807   | --no-cr | --no-c) ;;
808   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
809   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
810   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
811     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
812     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
813     ac_sep=" " ;;
814   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
815      ac_sep=" " ;;
816   esac
817   # Get rid of the leading space.
818 done
819
820 # When interrupted or exit'd, cleanup temporary files, and complete
821 # config.log.  We remove comments because anyway the quotes in there
822 # would cause problems or look ugly.
823 trap 'exit_status=$?
824   # Save into config.log some information that might help in debugging.
825   echo >&5
826   echo "## ----------------- ##" >&5
827   echo "## Cache variables.  ##" >&5
828   echo "## ----------------- ##" >&5
829   echo >&5
830   # The following way of writing the cache mishandles newlines in values,
831 {
832   (set) 2>&1 |
833     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
834     *ac_space=\ *)
835       sed -n \
836         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
837           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
838       ;;
839     *)
840       sed -n \
841         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
842       ;;
843     esac;
844 } >&5
845   sed "/^$/d" confdefs.h >conftest.log
846   if test -s conftest.log; then
847     echo >&5
848     echo "## ------------ ##" >&5
849     echo "## confdefs.h.  ##" >&5
850     echo "## ------------ ##" >&5
851     echo >&5
852     cat conftest.log >&5
853   fi
854   (echo; echo) >&5
855   test "$ac_signal" != 0 &&
856     echo "$as_me: caught signal $ac_signal" >&5
857   echo "$as_me: exit $exit_status" >&5
858   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
859     exit $exit_status
860      ' 0
861 for ac_signal in 1 2 13 15; do
862   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
863 done
864 ac_signal=0
865
866 # confdefs.h avoids OS command line length limits that DEFS can exceed.
867 rm -rf conftest* confdefs.h
868 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
869 echo >confdefs.h
870
871 # Let the site file select an alternate cache file if it wants to.
872 # Prefer explicitly selected file to automatically selected ones.
873 if test -z "$CONFIG_SITE"; then
874   if test "x$prefix" != xNONE; then
875     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
876   else
877     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
878   fi
879 fi
880 for ac_site_file in $CONFIG_SITE; do
881   if test -r "$ac_site_file"; then
882     { echo "$as_me:882: loading site script $ac_site_file" >&5
883 echo "$as_me: loading site script $ac_site_file" >&6;}
884     cat "$ac_site_file" >&5
885     . "$ac_site_file"
886   fi
887 done
888
889 if test -r "$cache_file"; then
890   # Some versions of bash will fail to source /dev/null (special
891   # files actually), so we avoid doing that.
892   if test -f "$cache_file"; then
893     { echo "$as_me:893: loading cache $cache_file" >&5
894 echo "$as_me: loading cache $cache_file" >&6;}
895     case $cache_file in
896       [\\/]* | ?:[\\/]* ) . $cache_file;;
897       *)                      . ./$cache_file;;
898     esac
899   fi
900 else
901   { echo "$as_me:901: creating cache $cache_file" >&5
902 echo "$as_me: creating cache $cache_file" >&6;}
903   >$cache_file
904 fi
905
906 # Check that the precious variables saved in the cache have kept the same
907 # value.
908 ac_cache_corrupted=false
909 for ac_var in `(set) 2>&1 |
910                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
911   eval ac_old_set=\$ac_cv_env_${ac_var}_set
912   eval ac_new_set=\$ac_env_${ac_var}_set
913   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
914   eval ac_new_val="\$ac_env_${ac_var}_value"
915   case $ac_old_set,$ac_new_set in
916     set,)
917       { echo "$as_me:917: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
918 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
919       ac_cache_corrupted=: ;;
920     ,set)
921       { echo "$as_me:921: error: \`$ac_var' was not set in the previous run" >&5
922 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
923       ac_cache_corrupted=: ;;
924     ,);;
925     *)
926       if test "x$ac_old_val" != "x$ac_new_val"; then
927         { echo "$as_me:927: error: \`$ac_var' has changed since the previous run:" >&5
928 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
929         { echo "$as_me:929:   former value:  $ac_old_val" >&5
930 echo "$as_me:   former value:  $ac_old_val" >&2;}
931         { echo "$as_me:931:   current value: $ac_new_val" >&5
932 echo "$as_me:   current value: $ac_new_val" >&2;}
933         ac_cache_corrupted=:
934       fi;;
935   esac
936   # Pass precious variables to config.status.  It doesn't matter if
937   # we pass some twice (in addition to the command line arguments).
938   if test "$ac_new_set" = set; then
939     case $ac_new_val in
940     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
941       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
942       ac_configure_args="$ac_configure_args '$ac_arg'"
943       ;;
944     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
945        ;;
946     esac
947   fi
948 done
949 if $ac_cache_corrupted; then
950   { echo "$as_me:950: error: changes in the environment can compromise the build" >&5
951 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
952   { { echo "$as_me:952: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
953 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
954    { (exit 1); exit 1; }; }
955 fi
956
957 ac_ext=c
958 ac_cpp='$CPP $CPPFLAGS'
959 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
960 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
961 ac_compiler_gnu=$ac_cv_c_compiler_gnu
962 ac_main_return=return
963
964 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
965   *c*,-n*) ECHO_N= ECHO_C='
966 ' ECHO_T='      ' ;;
967   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
968   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
969 esac
970 echo "#! $SHELL" >conftest.sh
971 echo  "exit 0"   >>conftest.sh
972 chmod +x conftest.sh
973 if { (echo "$as_me:973: PATH=\".;.\"; conftest.sh") >&5
974   (PATH=".;."; conftest.sh) 2>&5
975   ac_status=$?
976   echo "$as_me:976: \$? = $ac_status" >&5
977   (exit $ac_status); }; then
978   ac_path_separator=';'
979 else
980   ac_path_separator=:
981 fi
982 PATH_SEPARATOR="$ac_path_separator"
983 rm -f conftest.sh
984
985 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
986
987 top_builddir=`pwd`
988
989 ac_aux_dir=
990 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
991   if test -f $ac_dir/install-sh; then
992     ac_aux_dir=$ac_dir
993     ac_install_sh="$ac_aux_dir/install-sh -c"
994     break
995   elif 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/shtool; then
1000     ac_aux_dir=$ac_dir
1001     ac_install_sh="$ac_aux_dir/shtool install -c"
1002     break
1003   fi
1004 done
1005 if test -z "$ac_aux_dir"; then
1006   { { echo "$as_me:1006: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1007 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1008    { (exit 1); exit 1; }; }
1009 fi
1010 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1011 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1012 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1013
1014 # Make sure we can run config.sub.
1015 $ac_config_sub sun4 >/dev/null 2>&1 ||
1016   { { echo "$as_me:1016: error: cannot run $ac_config_sub" >&5
1017 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1018    { (exit 1); exit 1; }; }
1019
1020 echo "$as_me:1020: checking build system type" >&5
1021 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1022 if test "${ac_cv_build+set}" = set; then
1023   echo $ECHO_N "(cached) $ECHO_C" >&6
1024 else
1025   ac_cv_build_alias=$build_alias
1026 test -z "$ac_cv_build_alias" &&
1027   ac_cv_build_alias=`$ac_config_guess`
1028 test -z "$ac_cv_build_alias" &&
1029   { { echo "$as_me:1029: error: cannot guess build type; you must specify one" >&5
1030 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1031    { (exit 1); exit 1; }; }
1032 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1033   { { echo "$as_me:1033: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1034 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1035    { (exit 1); exit 1; }; }
1036
1037 fi
1038 echo "$as_me:1038: result: $ac_cv_build" >&5
1039 echo "${ECHO_T}$ac_cv_build" >&6
1040 build=$ac_cv_build
1041 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1042 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1043 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1044
1045 echo "$as_me:1045: checking host system type" >&5
1046 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1047 if test "${ac_cv_host+set}" = set; then
1048   echo $ECHO_N "(cached) $ECHO_C" >&6
1049 else
1050   ac_cv_host_alias=$host_alias
1051 test -z "$ac_cv_host_alias" &&
1052   ac_cv_host_alias=$ac_cv_build_alias
1053 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1054   { { echo "$as_me:1054: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1055 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1056    { (exit 1); exit 1; }; }
1057
1058 fi
1059 echo "$as_me:1059: result: $ac_cv_host" >&5
1060 echo "${ECHO_T}$ac_cv_host" >&6
1061 host=$ac_cv_host
1062 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1063 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1064 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1065
1066 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1067         echo "$as_me:1067: checking target system type" >&5
1068 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1069 if test "${ac_cv_target+set}" = set; then
1070   echo $ECHO_N "(cached) $ECHO_C" >&6
1071 else
1072   ac_cv_target_alias=$target_alias
1073 test "x$ac_cv_target_alias" = "x" &&
1074   ac_cv_target_alias=$ac_cv_host_alias
1075 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1076   { { echo "$as_me:1076: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1077 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1078    { (exit 1); exit 1; }; }
1079
1080 fi
1081 echo "$as_me:1081: result: $ac_cv_target" >&5
1082 echo "${ECHO_T}$ac_cv_target" >&6
1083 target=$ac_cv_target
1084 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1085 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1086 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1087
1088 # The aliases save the names the user supplied, while $host etc.
1089 # will get canonicalized.
1090 test -n "$target_alias" &&
1091   test "$program_prefix$program_suffix$program_transform_name" = \
1092     NONENONEs,x,x, &&
1093   program_prefix=${target_alias}-
1094         system_name="$host_os"
1095 else
1096         system_name="`(uname -s -r) 2>/dev/null`"
1097         if test -z "$system_name" ; then
1098                 system_name="`(hostname) 2>/dev/null`"
1099         fi
1100 fi
1101 test -n "$system_name" && cat >>confdefs.h <<EOF
1102 #define SYSTEM_NAME "$system_name"
1103 EOF
1104
1105 if test "${cf_cv_system_name+set}" = set; then
1106   echo $ECHO_N "(cached) $ECHO_C" >&6
1107 else
1108   cf_cv_system_name="$system_name"
1109 fi
1110
1111 test -z "$system_name" && system_name="$cf_cv_system_name"
1112 test -n "$cf_cv_system_name" && echo "$as_me:1112: result: Configuring for $cf_cv_system_name" >&5
1113 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1114
1115 if test ".$system_name" != ".$cf_cv_system_name" ; then
1116         echo "$as_me:1116: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1117 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1118         { { echo "$as_me:1118: error: \"Please remove config.cache and try again.\"" >&5
1119 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1120    { (exit 1); exit 1; }; }
1121 fi
1122
1123 # Check whether --with-system-type or --without-system-type was given.
1124 if test "${with_system_type+set}" = set; then
1125   withval="$with_system_type"
1126   { echo "$as_me:1126: WARNING: overriding system type to $withval" >&5
1127 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1128  cf_cv_system_name=$withval
1129 fi;
1130
1131 ###     Save the given $CFLAGS to allow user-override.
1132 cf_user_CFLAGS="$CFLAGS"
1133
1134 ###     Default install-location
1135
1136 echo "$as_me:1136: checking for prefix" >&5
1137 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1138 if test "x$prefix" = "xNONE" ; then
1139         case "$cf_cv_system_name" in
1140                 # non-vendor systems don't have a conflict
1141         openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu)
1142                 prefix=/usr
1143                 ;;
1144         *)      prefix=$ac_default_prefix
1145                 ;;
1146         esac
1147 fi
1148 echo "$as_me:1148: result: $prefix" >&5
1149 echo "${ECHO_T}$prefix" >&6
1150
1151 if test "x$prefix" = "xNONE" ; then
1152 echo "$as_me:1152: checking for default include-directory" >&5
1153 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1154 test -n "$verbose" && echo 1>&6
1155 for cf_symbol in \
1156         $includedir \
1157         $includedir/ncurses \
1158         $prefix/include \
1159         $prefix/include/ncurses \
1160         /usr/local/include \
1161         /usr/local/include/ncurses \
1162         /usr/include \
1163         /usr/include/ncurses
1164 do
1165         cf_dir=`eval echo $cf_symbol`
1166         if test -f $cf_dir/curses.h ; then
1167         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1168                 includedir="$cf_symbol"
1169                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1170                 break
1171         fi
1172         fi
1173         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1174 done
1175 echo "$as_me:1175: result: $includedir" >&5
1176 echo "${ECHO_T}$includedir" >&6
1177 fi
1178
1179 ###     Checks for programs.
1180 ac_ext=c
1181 ac_cpp='$CPP $CPPFLAGS'
1182 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1183 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1184 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1185 ac_main_return=return
1186 if test -n "$ac_tool_prefix"; then
1187   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1188 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1189 echo "$as_me:1189: checking for $ac_word" >&5
1190 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1191 if test "${ac_cv_prog_CC+set}" = set; then
1192   echo $ECHO_N "(cached) $ECHO_C" >&6
1193 else
1194   if test -n "$CC"; then
1195   ac_cv_prog_CC="$CC" # Let the user override the test.
1196 else
1197   ac_save_IFS=$IFS; IFS=$ac_path_separator
1198 ac_dummy="$PATH"
1199 for ac_dir in $ac_dummy; do
1200   IFS=$ac_save_IFS
1201   test -z "$ac_dir" && ac_dir=.
1202   $as_executable_p "$ac_dir/$ac_word" || continue
1203 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1204 echo "$as_me:1204: found $ac_dir/$ac_word" >&5
1205 break
1206 done
1207
1208 fi
1209 fi
1210 CC=$ac_cv_prog_CC
1211 if test -n "$CC"; then
1212   echo "$as_me:1212: result: $CC" >&5
1213 echo "${ECHO_T}$CC" >&6
1214 else
1215   echo "$as_me:1215: result: no" >&5
1216 echo "${ECHO_T}no" >&6
1217 fi
1218
1219 fi
1220 if test -z "$ac_cv_prog_CC"; then
1221   ac_ct_CC=$CC
1222   # Extract the first word of "gcc", so it can be a program name with args.
1223 set dummy gcc; ac_word=$2
1224 echo "$as_me:1224: checking for $ac_word" >&5
1225 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1226 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1227   echo $ECHO_N "(cached) $ECHO_C" >&6
1228 else
1229   if test -n "$ac_ct_CC"; then
1230   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1231 else
1232   ac_save_IFS=$IFS; IFS=$ac_path_separator
1233 ac_dummy="$PATH"
1234 for ac_dir in $ac_dummy; do
1235   IFS=$ac_save_IFS
1236   test -z "$ac_dir" && ac_dir=.
1237   $as_executable_p "$ac_dir/$ac_word" || continue
1238 ac_cv_prog_ac_ct_CC="gcc"
1239 echo "$as_me:1239: found $ac_dir/$ac_word" >&5
1240 break
1241 done
1242
1243 fi
1244 fi
1245 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1246 if test -n "$ac_ct_CC"; then
1247   echo "$as_me:1247: result: $ac_ct_CC" >&5
1248 echo "${ECHO_T}$ac_ct_CC" >&6
1249 else
1250   echo "$as_me:1250: result: no" >&5
1251 echo "${ECHO_T}no" >&6
1252 fi
1253
1254   CC=$ac_ct_CC
1255 else
1256   CC="$ac_cv_prog_CC"
1257 fi
1258
1259 if test -z "$CC"; then
1260   if test -n "$ac_tool_prefix"; then
1261   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1262 set dummy ${ac_tool_prefix}cc; ac_word=$2
1263 echo "$as_me:1263: checking for $ac_word" >&5
1264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1265 if test "${ac_cv_prog_CC+set}" = set; then
1266   echo $ECHO_N "(cached) $ECHO_C" >&6
1267 else
1268   if test -n "$CC"; then
1269   ac_cv_prog_CC="$CC" # Let the user override the test.
1270 else
1271   ac_save_IFS=$IFS; IFS=$ac_path_separator
1272 ac_dummy="$PATH"
1273 for ac_dir in $ac_dummy; do
1274   IFS=$ac_save_IFS
1275   test -z "$ac_dir" && ac_dir=.
1276   $as_executable_p "$ac_dir/$ac_word" || continue
1277 ac_cv_prog_CC="${ac_tool_prefix}cc"
1278 echo "$as_me:1278: found $ac_dir/$ac_word" >&5
1279 break
1280 done
1281
1282 fi
1283 fi
1284 CC=$ac_cv_prog_CC
1285 if test -n "$CC"; then
1286   echo "$as_me:1286: result: $CC" >&5
1287 echo "${ECHO_T}$CC" >&6
1288 else
1289   echo "$as_me:1289: result: no" >&5
1290 echo "${ECHO_T}no" >&6
1291 fi
1292
1293 fi
1294 if test -z "$ac_cv_prog_CC"; then
1295   ac_ct_CC=$CC
1296   # Extract the first word of "cc", so it can be a program name with args.
1297 set dummy cc; ac_word=$2
1298 echo "$as_me:1298: checking for $ac_word" >&5
1299 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1300 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1301   echo $ECHO_N "(cached) $ECHO_C" >&6
1302 else
1303   if test -n "$ac_ct_CC"; then
1304   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1305 else
1306   ac_save_IFS=$IFS; IFS=$ac_path_separator
1307 ac_dummy="$PATH"
1308 for ac_dir in $ac_dummy; do
1309   IFS=$ac_save_IFS
1310   test -z "$ac_dir" && ac_dir=.
1311   $as_executable_p "$ac_dir/$ac_word" || continue
1312 ac_cv_prog_ac_ct_CC="cc"
1313 echo "$as_me:1313: found $ac_dir/$ac_word" >&5
1314 break
1315 done
1316
1317 fi
1318 fi
1319 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1320 if test -n "$ac_ct_CC"; then
1321   echo "$as_me:1321: result: $ac_ct_CC" >&5
1322 echo "${ECHO_T}$ac_ct_CC" >&6
1323 else
1324   echo "$as_me:1324: result: no" >&5
1325 echo "${ECHO_T}no" >&6
1326 fi
1327
1328   CC=$ac_ct_CC
1329 else
1330   CC="$ac_cv_prog_CC"
1331 fi
1332
1333 fi
1334 if test -z "$CC"; then
1335   # Extract the first word of "cc", so it can be a program name with args.
1336 set dummy cc; ac_word=$2
1337 echo "$as_me:1337: checking for $ac_word" >&5
1338 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1339 if test "${ac_cv_prog_CC+set}" = set; then
1340   echo $ECHO_N "(cached) $ECHO_C" >&6
1341 else
1342   if test -n "$CC"; then
1343   ac_cv_prog_CC="$CC" # Let the user override the test.
1344 else
1345   ac_prog_rejected=no
1346   ac_save_IFS=$IFS; IFS=$ac_path_separator
1347 ac_dummy="$PATH"
1348 for ac_dir in $ac_dummy; do
1349   IFS=$ac_save_IFS
1350   test -z "$ac_dir" && ac_dir=.
1351   $as_executable_p "$ac_dir/$ac_word" || continue
1352 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1353   ac_prog_rejected=yes
1354   continue
1355 fi
1356 ac_cv_prog_CC="cc"
1357 echo "$as_me:1357: found $ac_dir/$ac_word" >&5
1358 break
1359 done
1360
1361 if test $ac_prog_rejected = yes; then
1362   # We found a bogon in the path, so make sure we never use it.
1363   set dummy $ac_cv_prog_CC
1364   shift
1365   if test $# != 0; then
1366     # We chose a different compiler from the bogus one.
1367     # However, it has the same basename, so the bogon will be chosen
1368     # first if we set CC to just the basename; use the full file name.
1369     shift
1370     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1371     shift
1372     ac_cv_prog_CC="$@"
1373   fi
1374 fi
1375 fi
1376 fi
1377 CC=$ac_cv_prog_CC
1378 if test -n "$CC"; then
1379   echo "$as_me:1379: result: $CC" >&5
1380 echo "${ECHO_T}$CC" >&6
1381 else
1382   echo "$as_me:1382: result: no" >&5
1383 echo "${ECHO_T}no" >&6
1384 fi
1385
1386 fi
1387 if test -z "$CC"; then
1388   if test -n "$ac_tool_prefix"; then
1389   for ac_prog in cl
1390   do
1391     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1392 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1393 echo "$as_me:1393: checking for $ac_word" >&5
1394 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1395 if test "${ac_cv_prog_CC+set}" = set; then
1396   echo $ECHO_N "(cached) $ECHO_C" >&6
1397 else
1398   if test -n "$CC"; then
1399   ac_cv_prog_CC="$CC" # Let the user override the test.
1400 else
1401   ac_save_IFS=$IFS; IFS=$ac_path_separator
1402 ac_dummy="$PATH"
1403 for ac_dir in $ac_dummy; do
1404   IFS=$ac_save_IFS
1405   test -z "$ac_dir" && ac_dir=.
1406   $as_executable_p "$ac_dir/$ac_word" || continue
1407 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1408 echo "$as_me:1408: found $ac_dir/$ac_word" >&5
1409 break
1410 done
1411
1412 fi
1413 fi
1414 CC=$ac_cv_prog_CC
1415 if test -n "$CC"; then
1416   echo "$as_me:1416: result: $CC" >&5
1417 echo "${ECHO_T}$CC" >&6
1418 else
1419   echo "$as_me:1419: result: no" >&5
1420 echo "${ECHO_T}no" >&6
1421 fi
1422
1423     test -n "$CC" && break
1424   done
1425 fi
1426 if test -z "$CC"; then
1427   ac_ct_CC=$CC
1428   for ac_prog in cl
1429 do
1430   # Extract the first word of "$ac_prog", so it can be a program name with args.
1431 set dummy $ac_prog; ac_word=$2
1432 echo "$as_me:1432: checking for $ac_word" >&5
1433 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1434 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1435   echo $ECHO_N "(cached) $ECHO_C" >&6
1436 else
1437   if test -n "$ac_ct_CC"; then
1438   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1439 else
1440   ac_save_IFS=$IFS; IFS=$ac_path_separator
1441 ac_dummy="$PATH"
1442 for ac_dir in $ac_dummy; do
1443   IFS=$ac_save_IFS
1444   test -z "$ac_dir" && ac_dir=.
1445   $as_executable_p "$ac_dir/$ac_word" || continue
1446 ac_cv_prog_ac_ct_CC="$ac_prog"
1447 echo "$as_me:1447: found $ac_dir/$ac_word" >&5
1448 break
1449 done
1450
1451 fi
1452 fi
1453 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1454 if test -n "$ac_ct_CC"; then
1455   echo "$as_me:1455: result: $ac_ct_CC" >&5
1456 echo "${ECHO_T}$ac_ct_CC" >&6
1457 else
1458   echo "$as_me:1458: result: no" >&5
1459 echo "${ECHO_T}no" >&6
1460 fi
1461
1462   test -n "$ac_ct_CC" && break
1463 done
1464
1465   CC=$ac_ct_CC
1466 fi
1467
1468 fi
1469
1470 test -z "$CC" && { { echo "$as_me:1470: error: no acceptable cc found in \$PATH" >&5
1471 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1472    { (exit 1); exit 1; }; }
1473
1474 # Provide some information about the compiler.
1475 echo "$as_me:1475:" \
1476      "checking for C compiler version" >&5
1477 ac_compiler=`set X $ac_compile; echo $2`
1478 { (eval echo "$as_me:1478: \"$ac_compiler --version </dev/null >&5\"") >&5
1479   (eval $ac_compiler --version </dev/null >&5) 2>&5
1480   ac_status=$?
1481   echo "$as_me:1481: \$? = $ac_status" >&5
1482   (exit $ac_status); }
1483 { (eval echo "$as_me:1483: \"$ac_compiler -v </dev/null >&5\"") >&5
1484   (eval $ac_compiler -v </dev/null >&5) 2>&5
1485   ac_status=$?
1486   echo "$as_me:1486: \$? = $ac_status" >&5
1487   (exit $ac_status); }
1488 { (eval echo "$as_me:1488: \"$ac_compiler -V </dev/null >&5\"") >&5
1489   (eval $ac_compiler -V </dev/null >&5) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit $ac_status); }
1493
1494 cat >conftest.$ac_ext <<_ACEOF
1495 #line 1495 "configure"
1496 #include "confdefs.h"
1497
1498 int
1499 main ()
1500 {
1501
1502   ;
1503   return 0;
1504 }
1505 _ACEOF
1506 ac_clean_files_save=$ac_clean_files
1507 ac_clean_files="$ac_clean_files a.out a.exe"
1508 # Try to create an executable without -o first, disregard a.out.
1509 # It will help us diagnose broken compilers, and finding out an intuition
1510 # of exeext.
1511 echo "$as_me:1511: checking for C compiler default output" >&5
1512 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1513 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1514 if { (eval echo "$as_me:1514: \"$ac_link_default\"") >&5
1515   (eval $ac_link_default) 2>&5
1516   ac_status=$?
1517   echo "$as_me:1517: \$? = $ac_status" >&5
1518   (exit $ac_status); }; then
1519   # Find the output, starting from the most likely.  This scheme is
1520 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1521 # resort.
1522 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1523                 ls a.out conftest 2>/dev/null;
1524                 ls a.* conftest.* 2>/dev/null`; do
1525   case $ac_file in
1526     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1527     a.out ) # We found the default executable, but exeext='' is most
1528             # certainly right.
1529             break;;
1530     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1531           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1532           export ac_cv_exeext
1533           break;;
1534     * ) break;;
1535   esac
1536 done
1537 else
1538   echo "$as_me: failed program was:" >&5
1539 cat conftest.$ac_ext >&5
1540 { { echo "$as_me:1540: error: C compiler cannot create executables" >&5
1541 echo "$as_me: error: C compiler cannot create executables" >&2;}
1542    { (exit 77); exit 77; }; }
1543 fi
1544
1545 ac_exeext=$ac_cv_exeext
1546 echo "$as_me:1546: result: $ac_file" >&5
1547 echo "${ECHO_T}$ac_file" >&6
1548
1549 # Check the compiler produces executables we can run.  If not, either
1550 # the compiler is broken, or we cross compile.
1551 echo "$as_me:1551: checking whether the C compiler works" >&5
1552 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1553 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1554 # If not cross compiling, check that we can run a simple program.
1555 if test "$cross_compiling" != yes; then
1556   if { ac_try='./$ac_file'
1557   { (eval echo "$as_me:1557: \"$ac_try\"") >&5
1558   (eval $ac_try) 2>&5
1559   ac_status=$?
1560   echo "$as_me:1560: \$? = $ac_status" >&5
1561   (exit $ac_status); }; }; then
1562     cross_compiling=no
1563   else
1564     if test "$cross_compiling" = maybe; then
1565         cross_compiling=yes
1566     else
1567         { { echo "$as_me:1567: error: cannot run C compiled programs.
1568 If you meant to cross compile, use \`--host'." >&5
1569 echo "$as_me: error: cannot run C compiled programs.
1570 If you meant to cross compile, use \`--host'." >&2;}
1571    { (exit 1); exit 1; }; }
1572     fi
1573   fi
1574 fi
1575 echo "$as_me:1575: result: yes" >&5
1576 echo "${ECHO_T}yes" >&6
1577
1578 rm -f a.out a.exe conftest$ac_cv_exeext
1579 ac_clean_files=$ac_clean_files_save
1580 # Check the compiler produces executables we can run.  If not, either
1581 # the compiler is broken, or we cross compile.
1582 echo "$as_me:1582: checking whether we are cross compiling" >&5
1583 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1584 echo "$as_me:1584: result: $cross_compiling" >&5
1585 echo "${ECHO_T}$cross_compiling" >&6
1586
1587 echo "$as_me:1587: checking for executable suffix" >&5
1588 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1589 if { (eval echo "$as_me:1589: \"$ac_link\"") >&5
1590   (eval $ac_link) 2>&5
1591   ac_status=$?
1592   echo "$as_me:1592: \$? = $ac_status" >&5
1593   (exit $ac_status); }; then
1594   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1595 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1596 # work properly (i.e., refer to `conftest.exe'), while it won't with
1597 # `rm'.
1598 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1599   case $ac_file in
1600     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1601     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1602           export ac_cv_exeext
1603           break;;
1604     * ) break;;
1605   esac
1606 done
1607 else
1608   { { echo "$as_me:1608: error: cannot compute EXEEXT: cannot compile and link" >&5
1609 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1610    { (exit 1); exit 1; }; }
1611 fi
1612
1613 rm -f conftest$ac_cv_exeext
1614 echo "$as_me:1614: result: $ac_cv_exeext" >&5
1615 echo "${ECHO_T}$ac_cv_exeext" >&6
1616
1617 rm -f conftest.$ac_ext
1618 EXEEXT=$ac_cv_exeext
1619 ac_exeext=$EXEEXT
1620 echo "$as_me:1620: checking for object suffix" >&5
1621 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1622 if test "${ac_cv_objext+set}" = set; then
1623   echo $ECHO_N "(cached) $ECHO_C" >&6
1624 else
1625   cat >conftest.$ac_ext <<_ACEOF
1626 #line 1626 "configure"
1627 #include "confdefs.h"
1628
1629 int
1630 main ()
1631 {
1632
1633   ;
1634   return 0;
1635 }
1636 _ACEOF
1637 rm -f conftest.o conftest.obj
1638 if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5
1639   (eval $ac_compile) 2>&5
1640   ac_status=$?
1641   echo "$as_me:1641: \$? = $ac_status" >&5
1642   (exit $ac_status); }; then
1643   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1644   case $ac_file in
1645     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1646     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1647        break;;
1648   esac
1649 done
1650 else
1651   echo "$as_me: failed program was:" >&5
1652 cat conftest.$ac_ext >&5
1653 { { echo "$as_me:1653: error: cannot compute OBJEXT: cannot compile" >&5
1654 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1655    { (exit 1); exit 1; }; }
1656 fi
1657
1658 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1659 fi
1660 echo "$as_me:1660: result: $ac_cv_objext" >&5
1661 echo "${ECHO_T}$ac_cv_objext" >&6
1662 OBJEXT=$ac_cv_objext
1663 ac_objext=$OBJEXT
1664 echo "$as_me:1664: checking whether we are using the GNU C compiler" >&5
1665 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1666 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1667   echo $ECHO_N "(cached) $ECHO_C" >&6
1668 else
1669   cat >conftest.$ac_ext <<_ACEOF
1670 #line 1670 "configure"
1671 #include "confdefs.h"
1672
1673 int
1674 main ()
1675 {
1676 #ifndef __GNUC__
1677        choke me
1678 #endif
1679
1680   ;
1681   return 0;
1682 }
1683 _ACEOF
1684 rm -f conftest.$ac_objext
1685 if { (eval echo "$as_me:1685: \"$ac_compile\"") >&5
1686   (eval $ac_compile) 2>&5
1687   ac_status=$?
1688   echo "$as_me:1688: \$? = $ac_status" >&5
1689   (exit $ac_status); } &&
1690          { ac_try='test -s conftest.$ac_objext'
1691   { (eval echo "$as_me:1691: \"$ac_try\"") >&5
1692   (eval $ac_try) 2>&5
1693   ac_status=$?
1694   echo "$as_me:1694: \$? = $ac_status" >&5
1695   (exit $ac_status); }; }; then
1696   ac_compiler_gnu=yes
1697 else
1698   echo "$as_me: failed program was:" >&5
1699 cat conftest.$ac_ext >&5
1700 ac_compiler_gnu=no
1701 fi
1702 rm -f conftest.$ac_objext conftest.$ac_ext
1703 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1704
1705 fi
1706 echo "$as_me:1706: result: $ac_cv_c_compiler_gnu" >&5
1707 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1708 GCC=`test $ac_compiler_gnu = yes && echo yes`
1709 ac_test_CFLAGS=${CFLAGS+set}
1710 ac_save_CFLAGS=$CFLAGS
1711 CFLAGS="-g"
1712 echo "$as_me:1712: checking whether $CC accepts -g" >&5
1713 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1714 if test "${ac_cv_prog_cc_g+set}" = set; then
1715   echo $ECHO_N "(cached) $ECHO_C" >&6
1716 else
1717   cat >conftest.$ac_ext <<_ACEOF
1718 #line 1718 "configure"
1719 #include "confdefs.h"
1720
1721 int
1722 main ()
1723 {
1724
1725   ;
1726   return 0;
1727 }
1728 _ACEOF
1729 rm -f conftest.$ac_objext
1730 if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
1731   (eval $ac_compile) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); } &&
1735          { ac_try='test -s conftest.$ac_objext'
1736   { (eval echo "$as_me:1736: \"$ac_try\"") >&5
1737   (eval $ac_try) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); }; }; then
1741   ac_cv_prog_cc_g=yes
1742 else
1743   echo "$as_me: failed program was:" >&5
1744 cat conftest.$ac_ext >&5
1745 ac_cv_prog_cc_g=no
1746 fi
1747 rm -f conftest.$ac_objext conftest.$ac_ext
1748 fi
1749 echo "$as_me:1749: result: $ac_cv_prog_cc_g" >&5
1750 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1751 if test "$ac_test_CFLAGS" = set; then
1752   CFLAGS=$ac_save_CFLAGS
1753 elif test $ac_cv_prog_cc_g = yes; then
1754   if test "$GCC" = yes; then
1755     CFLAGS="-g -O2"
1756   else
1757     CFLAGS="-g"
1758   fi
1759 else
1760   if test "$GCC" = yes; then
1761     CFLAGS="-O2"
1762   else
1763     CFLAGS=
1764   fi
1765 fi
1766 # Some people use a C++ compiler to compile C.  Since we use `exit',
1767 # in C++ we need to declare it.  In case someone uses the same compiler
1768 # for both compiling C and C++ we need to have the C++ compiler decide
1769 # the declaration of exit, since it's the most demanding environment.
1770 cat >conftest.$ac_ext <<_ACEOF
1771 #ifndef __cplusplus
1772   choke me
1773 #endif
1774 _ACEOF
1775 rm -f conftest.$ac_objext
1776 if { (eval echo "$as_me:1776: \"$ac_compile\"") >&5
1777   (eval $ac_compile) 2>&5
1778   ac_status=$?
1779   echo "$as_me:1779: \$? = $ac_status" >&5
1780   (exit $ac_status); } &&
1781          { ac_try='test -s conftest.$ac_objext'
1782   { (eval echo "$as_me:1782: \"$ac_try\"") >&5
1783   (eval $ac_try) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit $ac_status); }; }; then
1787   for ac_declaration in \
1788    ''\
1789    '#include <stdlib.h>' \
1790    'extern "C" void std::exit (int) throw (); using std::exit;' \
1791    'extern "C" void std::exit (int); using std::exit;' \
1792    'extern "C" void exit (int) throw ();' \
1793    'extern "C" void exit (int);' \
1794    'void exit (int);'
1795 do
1796   cat >conftest.$ac_ext <<_ACEOF
1797 #line 1797 "configure"
1798 #include "confdefs.h"
1799 #include <stdlib.h>
1800 $ac_declaration
1801 int
1802 main ()
1803 {
1804 exit (42);
1805   ;
1806   return 0;
1807 }
1808 _ACEOF
1809 rm -f conftest.$ac_objext
1810 if { (eval echo "$as_me:1810: \"$ac_compile\"") >&5
1811   (eval $ac_compile) 2>&5
1812   ac_status=$?
1813   echo "$as_me:1813: \$? = $ac_status" >&5
1814   (exit $ac_status); } &&
1815          { ac_try='test -s conftest.$ac_objext'
1816   { (eval echo "$as_me:1816: \"$ac_try\"") >&5
1817   (eval $ac_try) 2>&5
1818   ac_status=$?
1819   echo "$as_me:1819: \$? = $ac_status" >&5
1820   (exit $ac_status); }; }; then
1821   :
1822 else
1823   echo "$as_me: failed program was:" >&5
1824 cat conftest.$ac_ext >&5
1825 continue
1826 fi
1827 rm -f conftest.$ac_objext conftest.$ac_ext
1828   cat >conftest.$ac_ext <<_ACEOF
1829 #line 1829 "configure"
1830 #include "confdefs.h"
1831 $ac_declaration
1832 int
1833 main ()
1834 {
1835 exit (42);
1836   ;
1837   return 0;
1838 }
1839 _ACEOF
1840 rm -f conftest.$ac_objext
1841 if { (eval echo "$as_me:1841: \"$ac_compile\"") >&5
1842   (eval $ac_compile) 2>&5
1843   ac_status=$?
1844   echo "$as_me:1844: \$? = $ac_status" >&5
1845   (exit $ac_status); } &&
1846          { ac_try='test -s conftest.$ac_objext'
1847   { (eval echo "$as_me:1847: \"$ac_try\"") >&5
1848   (eval $ac_try) 2>&5
1849   ac_status=$?
1850   echo "$as_me:1850: \$? = $ac_status" >&5
1851   (exit $ac_status); }; }; then
1852   break
1853 else
1854   echo "$as_me: failed program was:" >&5
1855 cat conftest.$ac_ext >&5
1856 fi
1857 rm -f conftest.$ac_objext conftest.$ac_ext
1858 done
1859 rm -rf conftest*
1860 if test -n "$ac_declaration"; then
1861   echo '#ifdef __cplusplus' >>confdefs.h
1862   echo $ac_declaration      >>confdefs.h
1863   echo '#endif'             >>confdefs.h
1864 fi
1865
1866 else
1867   echo "$as_me: failed program was:" >&5
1868 cat conftest.$ac_ext >&5
1869 fi
1870 rm -f conftest.$ac_objext conftest.$ac_ext
1871 ac_ext=c
1872 ac_cpp='$CPP $CPPFLAGS'
1873 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1874 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1875 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1876 ac_main_return=return
1877
1878 GCC_VERSION=none
1879 if test "$GCC" = yes ; then
1880         echo "$as_me:1880: checking version of $CC" >&5
1881 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1882         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1883         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1884         echo "$as_me:1884: result: $GCC_VERSION" >&5
1885 echo "${ECHO_T}$GCC_VERSION" >&6
1886 fi
1887
1888 ac_ext=c
1889 ac_cpp='$CPP $CPPFLAGS'
1890 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1891 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1892 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1893 ac_main_return=return
1894 echo "$as_me:1894: checking how to run the C preprocessor" >&5
1895 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1896 # On Suns, sometimes $CPP names a directory.
1897 if test -n "$CPP" && test -d "$CPP"; then
1898   CPP=
1899 fi
1900 if test -z "$CPP"; then
1901   if test "${ac_cv_prog_CPP+set}" = set; then
1902   echo $ECHO_N "(cached) $ECHO_C" >&6
1903 else
1904       # Double quotes because CPP needs to be expanded
1905     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1906     do
1907       ac_preproc_ok=false
1908 for ac_c_preproc_warn_flag in '' yes
1909 do
1910   # Use a header file that comes with gcc, so configuring glibc
1911   # with a fresh cross-compiler works.
1912   # On the NeXT, cc -E runs the code through the compiler's parser,
1913   # not just through cpp. "Syntax error" is here to catch this case.
1914   cat >conftest.$ac_ext <<_ACEOF
1915 #line 1915 "configure"
1916 #include "confdefs.h"
1917 #include <assert.h>
1918                      Syntax error
1919 _ACEOF
1920 if { (eval echo "$as_me:1920: \"$ac_cpp conftest.$ac_ext\"") >&5
1921   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1922   ac_status=$?
1923   egrep -v '^ *\+' conftest.er1 >conftest.err
1924   rm -f conftest.er1
1925   cat conftest.err >&5
1926   echo "$as_me:1926: \$? = $ac_status" >&5
1927   (exit $ac_status); } >/dev/null; then
1928   if test -s conftest.err; then
1929     ac_cpp_err=$ac_c_preproc_warn_flag
1930   else
1931     ac_cpp_err=
1932   fi
1933 else
1934   ac_cpp_err=yes
1935 fi
1936 if test -z "$ac_cpp_err"; then
1937   :
1938 else
1939   echo "$as_me: failed program was:" >&5
1940   cat conftest.$ac_ext >&5
1941   # Broken: fails on valid input.
1942 continue
1943 fi
1944 rm -f conftest.err conftest.$ac_ext
1945
1946   # OK, works on sane cases.  Now check whether non-existent headers
1947   # can be detected and how.
1948   cat >conftest.$ac_ext <<_ACEOF
1949 #line 1949 "configure"
1950 #include "confdefs.h"
1951 #include <ac_nonexistent.h>
1952 _ACEOF
1953 if { (eval echo "$as_me:1953: \"$ac_cpp conftest.$ac_ext\"") >&5
1954   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1955   ac_status=$?
1956   egrep -v '^ *\+' conftest.er1 >conftest.err
1957   rm -f conftest.er1
1958   cat conftest.err >&5
1959   echo "$as_me:1959: \$? = $ac_status" >&5
1960   (exit $ac_status); } >/dev/null; then
1961   if test -s conftest.err; then
1962     ac_cpp_err=$ac_c_preproc_warn_flag
1963   else
1964     ac_cpp_err=
1965   fi
1966 else
1967   ac_cpp_err=yes
1968 fi
1969 if test -z "$ac_cpp_err"; then
1970   # Broken: success on invalid input.
1971 continue
1972 else
1973   echo "$as_me: failed program was:" >&5
1974   cat conftest.$ac_ext >&5
1975   # Passes both tests.
1976 ac_preproc_ok=:
1977 break
1978 fi
1979 rm -f conftest.err conftest.$ac_ext
1980
1981 done
1982 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1983 rm -f conftest.err conftest.$ac_ext
1984 if $ac_preproc_ok; then
1985   break
1986 fi
1987
1988     done
1989     ac_cv_prog_CPP=$CPP
1990
1991 fi
1992   CPP=$ac_cv_prog_CPP
1993 else
1994   ac_cv_prog_CPP=$CPP
1995 fi
1996 echo "$as_me:1996: result: $CPP" >&5
1997 echo "${ECHO_T}$CPP" >&6
1998 ac_preproc_ok=false
1999 for ac_c_preproc_warn_flag in '' yes
2000 do
2001   # Use a header file that comes with gcc, so configuring glibc
2002   # with a fresh cross-compiler works.
2003   # On the NeXT, cc -E runs the code through the compiler's parser,
2004   # not just through cpp. "Syntax error" is here to catch this case.
2005   cat >conftest.$ac_ext <<_ACEOF
2006 #line 2006 "configure"
2007 #include "confdefs.h"
2008 #include <assert.h>
2009                      Syntax error
2010 _ACEOF
2011 if { (eval echo "$as_me:2011: \"$ac_cpp conftest.$ac_ext\"") >&5
2012   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2013   ac_status=$?
2014   egrep -v '^ *\+' conftest.er1 >conftest.err
2015   rm -f conftest.er1
2016   cat conftest.err >&5
2017   echo "$as_me:2017: \$? = $ac_status" >&5
2018   (exit $ac_status); } >/dev/null; then
2019   if test -s conftest.err; then
2020     ac_cpp_err=$ac_c_preproc_warn_flag
2021   else
2022     ac_cpp_err=
2023   fi
2024 else
2025   ac_cpp_err=yes
2026 fi
2027 if test -z "$ac_cpp_err"; then
2028   :
2029 else
2030   echo "$as_me: failed program was:" >&5
2031   cat conftest.$ac_ext >&5
2032   # Broken: fails on valid input.
2033 continue
2034 fi
2035 rm -f conftest.err conftest.$ac_ext
2036
2037   # OK, works on sane cases.  Now check whether non-existent headers
2038   # can be detected and how.
2039   cat >conftest.$ac_ext <<_ACEOF
2040 #line 2040 "configure"
2041 #include "confdefs.h"
2042 #include <ac_nonexistent.h>
2043 _ACEOF
2044 if { (eval echo "$as_me:2044: \"$ac_cpp conftest.$ac_ext\"") >&5
2045   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2046   ac_status=$?
2047   egrep -v '^ *\+' conftest.er1 >conftest.err
2048   rm -f conftest.er1
2049   cat conftest.err >&5
2050   echo "$as_me:2050: \$? = $ac_status" >&5
2051   (exit $ac_status); } >/dev/null; then
2052   if test -s conftest.err; then
2053     ac_cpp_err=$ac_c_preproc_warn_flag
2054   else
2055     ac_cpp_err=
2056   fi
2057 else
2058   ac_cpp_err=yes
2059 fi
2060 if test -z "$ac_cpp_err"; then
2061   # Broken: success on invalid input.
2062 continue
2063 else
2064   echo "$as_me: failed program was:" >&5
2065   cat conftest.$ac_ext >&5
2066   # Passes both tests.
2067 ac_preproc_ok=:
2068 break
2069 fi
2070 rm -f conftest.err conftest.$ac_ext
2071
2072 done
2073 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2074 rm -f conftest.err conftest.$ac_ext
2075 if $ac_preproc_ok; then
2076   :
2077 else
2078   { { echo "$as_me:2078: error: C preprocessor \"$CPP\" fails sanity check" >&5
2079 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2080    { (exit 1); exit 1; }; }
2081 fi
2082
2083 ac_ext=c
2084 ac_cpp='$CPP $CPPFLAGS'
2085 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2086 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2087 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2088 ac_main_return=return
2089
2090 if test $ac_cv_c_compiler_gnu = yes; then
2091     echo "$as_me:2091: checking whether $CC needs -traditional" >&5
2092 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2093 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2094   echo $ECHO_N "(cached) $ECHO_C" >&6
2095 else
2096     ac_pattern="Autoconf.*'x'"
2097   cat >conftest.$ac_ext <<_ACEOF
2098 #line 2098 "configure"
2099 #include "confdefs.h"
2100 #include <sgtty.h>
2101 int Autoconf = TIOCGETP;
2102 _ACEOF
2103 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2104   egrep "$ac_pattern" >/dev/null 2>&1; then
2105   ac_cv_prog_gcc_traditional=yes
2106 else
2107   ac_cv_prog_gcc_traditional=no
2108 fi
2109 rm -rf conftest*
2110
2111   if test $ac_cv_prog_gcc_traditional = no; then
2112     cat >conftest.$ac_ext <<_ACEOF
2113 #line 2113 "configure"
2114 #include "confdefs.h"
2115 #include <termio.h>
2116 int Autoconf = TCGETA;
2117 _ACEOF
2118 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2119   egrep "$ac_pattern" >/dev/null 2>&1; then
2120   ac_cv_prog_gcc_traditional=yes
2121 fi
2122 rm -rf conftest*
2123
2124   fi
2125 fi
2126 echo "$as_me:2126: result: $ac_cv_prog_gcc_traditional" >&5
2127 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2128   if test $ac_cv_prog_gcc_traditional = yes; then
2129     CC="$CC -traditional"
2130   fi
2131 fi
2132
2133 echo "$as_me:2133: checking whether $CC understands -c and -o together" >&5
2134 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2135 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2136   echo $ECHO_N "(cached) $ECHO_C" >&6
2137 else
2138
2139 cat > conftest.$ac_ext <<CF_EOF
2140 #include <stdio.h>
2141 int main()
2142 {
2143         ${cf_cv_main_return:-return}(0);
2144 }
2145 CF_EOF
2146 # We do the test twice because some compilers refuse to overwrite an
2147 # existing .o file with -o, though they will create one.
2148 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2149 if { (eval echo "$as_me:2149: \"$ac_try\"") >&5
2150   (eval $ac_try) 2>&5
2151   ac_status=$?
2152   echo "$as_me:2152: \$? = $ac_status" >&5
2153   (exit $ac_status); } &&
2154   test -f conftest2.$ac_objext && { (eval echo "$as_me:2154: \"$ac_try\"") >&5
2155   (eval $ac_try) 2>&5
2156   ac_status=$?
2157   echo "$as_me:2157: \$? = $ac_status" >&5
2158   (exit $ac_status); };
2159 then
2160   eval cf_cv_prog_CC_c_o=yes
2161 else
2162   eval cf_cv_prog_CC_c_o=no
2163 fi
2164 rm -rf conftest*
2165
2166 fi
2167 if test $cf_cv_prog_CC_c_o = yes; then
2168   echo "$as_me:2168: result: yes" >&5
2169 echo "${ECHO_T}yes" >&6
2170 else
2171   echo "$as_me:2171: result: no" >&5
2172 echo "${ECHO_T}no" >&6
2173 fi
2174
2175 echo "$as_me:2175: checking for POSIXized ISC" >&5
2176 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6
2177 if test -d /etc/conf/kconfig.d &&
2178    grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2179 then
2180   echo "$as_me:2180: result: yes" >&5
2181 echo "${ECHO_T}yes" >&6
2182   ISC=yes # If later tests want to check for ISC.
2183
2184 cat >>confdefs.h <<\EOF
2185 #define _POSIX_SOURCE 1
2186 EOF
2187
2188   if test "$GCC" = yes; then
2189     CC="$CC -posix"
2190   else
2191     CC="$CC -Xp"
2192   fi
2193 else
2194   echo "$as_me:2194: result: no" >&5
2195 echo "${ECHO_T}no" >&6
2196   ISC=
2197 fi
2198
2199 echo "$as_me:2199: checking for ${CC:-cc} option to accept ANSI C" >&5
2200 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
2201 if test "${cf_cv_ansi_cc+set}" = set; then
2202   echo $ECHO_N "(cached) $ECHO_C" >&6
2203 else
2204
2205 cf_cv_ansi_cc=no
2206 cf_save_CFLAGS="$CFLAGS"
2207 cf_save_CPPFLAGS="$CPPFLAGS"
2208 # Don't try gcc -ansi; that turns off useful extensions and
2209 # breaks some systems' header files.
2210 # AIX                   -qlanglvl=ansi
2211 # Ultrix and OSF/1      -std1
2212 # HP-UX                 -Aa -D_HPUX_SOURCE
2213 # SVR4                  -Xc
2214 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2215 for cf_arg in "-DCC_HAS_PROTOS" \
2216         "" \
2217         -qlanglvl=ansi \
2218         -std1 \
2219         -Ae \
2220         "-Aa -D_HPUX_SOURCE" \
2221         -Xc
2222 do
2223
2224 cf_fix_cppflags=no
2225 cf_new_cflags=
2226 cf_new_cppflags=
2227 cf_new_extra_cppflags=
2228
2229 for cf_add_cflags in $cf_arg
2230 do
2231 case $cf_fix_cppflags in
2232 no)
2233         case $cf_add_cflags in #(vi
2234         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2235                 case $cf_add_cflags in
2236                 -D*)
2237                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2238
2239                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2240                                 && test -z "${cf_tst_cflags}" \
2241                                 && cf_fix_cppflags=yes
2242
2243                         if test $cf_fix_cppflags = yes ; then
2244                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2245                                 continue
2246                         elif test "${cf_tst_cflags}" = "\"'" ; then
2247                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2248                                 continue
2249                         fi
2250                         ;;
2251                 esac
2252                 case "$CPPFLAGS" in
2253                 *$cf_add_cflags) #(vi
2254                         ;;
2255                 *) #(vi
2256                         case $cf_add_cflags in #(vi
2257                         -D*)
2258                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2259
2260 CPPFLAGS=`echo "$CPPFLAGS" | \
2261         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2262                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2263
2264                                 ;;
2265                         esac
2266                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2267                         ;;
2268                 esac
2269                 ;;
2270         *)
2271                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2272                 ;;
2273         esac
2274         ;;
2275 yes)
2276         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2277
2278         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2279
2280         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2281                 && test -z "${cf_tst_cflags}" \
2282                 && cf_fix_cppflags=no
2283         ;;
2284 esac
2285 done
2286
2287 if test -n "$cf_new_cflags" ; then
2288
2289         CFLAGS="$CFLAGS $cf_new_cflags"
2290 fi
2291
2292 if test -n "$cf_new_cppflags" ; then
2293
2294         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2295 fi
2296
2297 if test -n "$cf_new_extra_cppflags" ; then
2298
2299         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2300 fi
2301
2302         cat >conftest.$ac_ext <<_ACEOF
2303 #line 2303 "configure"
2304 #include "confdefs.h"
2305
2306 #ifndef CC_HAS_PROTOS
2307 #if !defined(__STDC__) || (__STDC__ != 1)
2308 choke me
2309 #endif
2310 #endif
2311
2312 int
2313 main ()
2314 {
2315
2316         int test (int i, double x);
2317         struct s1 {int (*f) (int a);};
2318         struct s2 {int (*f) (double a);};
2319   ;
2320   return 0;
2321 }
2322 _ACEOF
2323 rm -f conftest.$ac_objext
2324 if { (eval echo "$as_me:2324: \"$ac_compile\"") >&5
2325   (eval $ac_compile) 2>&5
2326   ac_status=$?
2327   echo "$as_me:2327: \$? = $ac_status" >&5
2328   (exit $ac_status); } &&
2329          { ac_try='test -s conftest.$ac_objext'
2330   { (eval echo "$as_me:2330: \"$ac_try\"") >&5
2331   (eval $ac_try) 2>&5
2332   ac_status=$?
2333   echo "$as_me:2333: \$? = $ac_status" >&5
2334   (exit $ac_status); }; }; then
2335   cf_cv_ansi_cc="$cf_arg"; break
2336 else
2337   echo "$as_me: failed program was:" >&5
2338 cat conftest.$ac_ext >&5
2339 fi
2340 rm -f conftest.$ac_objext conftest.$ac_ext
2341 done
2342 CFLAGS="$cf_save_CFLAGS"
2343 CPPFLAGS="$cf_save_CPPFLAGS"
2344
2345 fi
2346 echo "$as_me:2346: result: $cf_cv_ansi_cc" >&5
2347 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2348
2349 if test "$cf_cv_ansi_cc" != "no"; then
2350 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2351
2352 cf_fix_cppflags=no
2353 cf_new_cflags=
2354 cf_new_cppflags=
2355 cf_new_extra_cppflags=
2356
2357 for cf_add_cflags in $cf_cv_ansi_cc
2358 do
2359 case $cf_fix_cppflags in
2360 no)
2361         case $cf_add_cflags in #(vi
2362         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2363                 case $cf_add_cflags in
2364                 -D*)
2365                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2366
2367                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2368                                 && test -z "${cf_tst_cflags}" \
2369                                 && cf_fix_cppflags=yes
2370
2371                         if test $cf_fix_cppflags = yes ; then
2372                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2373                                 continue
2374                         elif test "${cf_tst_cflags}" = "\"'" ; then
2375                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2376                                 continue
2377                         fi
2378                         ;;
2379                 esac
2380                 case "$CPPFLAGS" in
2381                 *$cf_add_cflags) #(vi
2382                         ;;
2383                 *) #(vi
2384                         case $cf_add_cflags in #(vi
2385                         -D*)
2386                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2387
2388 CPPFLAGS=`echo "$CPPFLAGS" | \
2389         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2390                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2391
2392                                 ;;
2393                         esac
2394                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2395                         ;;
2396                 esac
2397                 ;;
2398         *)
2399                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2400                 ;;
2401         esac
2402         ;;
2403 yes)
2404         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2405
2406         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2407
2408         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2409                 && test -z "${cf_tst_cflags}" \
2410                 && cf_fix_cppflags=no
2411         ;;
2412 esac
2413 done
2414
2415 if test -n "$cf_new_cflags" ; then
2416
2417         CFLAGS="$CFLAGS $cf_new_cflags"
2418 fi
2419
2420 if test -n "$cf_new_cppflags" ; then
2421
2422         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2423 fi
2424
2425 if test -n "$cf_new_extra_cppflags" ; then
2426
2427         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2428 fi
2429
2430 else
2431         cat >>confdefs.h <<\EOF
2432 #define CC_HAS_PROTOS 1
2433 EOF
2434
2435 fi
2436 fi
2437
2438 if test "$cf_cv_ansi_cc" = "no"; then
2439         { { echo "$as_me:2439: error: Your compiler does not appear to recognize prototypes.
2440 You have the following choices:
2441         a. adjust your compiler options
2442         b. get an up-to-date compiler
2443         c. use a wrapper such as unproto" >&5
2444 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2445 You have the following choices:
2446         a. adjust your compiler options
2447         b. get an up-to-date compiler
2448         c. use a wrapper such as unproto" >&2;}
2449    { (exit 1); exit 1; }; }
2450 fi
2451
2452 case $cf_cv_system_name in
2453 os2*)
2454     CFLAGS="$CFLAGS -Zmt"
2455     CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
2456     CXXFLAGS="$CXXFLAGS -Zmt"
2457     # autoconf's macro sets -Zexe and suffix both, which conflict:w
2458     LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
2459     ac_cv_exeext=.exe
2460     ;;
2461 esac
2462
2463 PROG_EXT="$EXEEXT"
2464
2465 test -n "$PROG_EXT" && cat >>confdefs.h <<EOF
2466 #define PROG_EXT "$PROG_EXT"
2467 EOF
2468
2469 test "$program_prefix" != NONE &&
2470   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2471 # Use a double $ so make ignores it.
2472 test "$program_suffix" != NONE &&
2473   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2474 # Double any \ or $.  echo might interpret backslashes.
2475 # By default was `s,x,x', remove it if useless.
2476 cat <<\_ACEOF >conftest.sed
2477 s/[\\$]/&&/g;s/;s,x,x,$//
2478 _ACEOF
2479 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2480 rm conftest.sed
2481
2482 for ac_prog in mawk gawk nawk awk
2483 do
2484   # Extract the first word of "$ac_prog", so it can be a program name with args.
2485 set dummy $ac_prog; ac_word=$2
2486 echo "$as_me:2486: checking for $ac_word" >&5
2487 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2488 if test "${ac_cv_prog_AWK+set}" = set; then
2489   echo $ECHO_N "(cached) $ECHO_C" >&6
2490 else
2491   if test -n "$AWK"; then
2492   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2493 else
2494   ac_save_IFS=$IFS; IFS=$ac_path_separator
2495 ac_dummy="$PATH"
2496 for ac_dir in $ac_dummy; do
2497   IFS=$ac_save_IFS
2498   test -z "$ac_dir" && ac_dir=.
2499   $as_executable_p "$ac_dir/$ac_word" || continue
2500 ac_cv_prog_AWK="$ac_prog"
2501 echo "$as_me:2501: found $ac_dir/$ac_word" >&5
2502 break
2503 done
2504
2505 fi
2506 fi
2507 AWK=$ac_cv_prog_AWK
2508 if test -n "$AWK"; then
2509   echo "$as_me:2509: result: $AWK" >&5
2510 echo "${ECHO_T}$AWK" >&6
2511 else
2512   echo "$as_me:2512: result: no" >&5
2513 echo "${ECHO_T}no" >&6
2514 fi
2515
2516   test -n "$AWK" && break
2517 done
2518
2519 test -z "$AWK" && { { echo "$as_me:2519: error: No awk program found" >&5
2520 echo "$as_me: error: No awk program found" >&2;}
2521    { (exit 1); exit 1; }; }
2522
2523 echo "$as_me:2523: checking for egrep" >&5
2524 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2525 if test "${ac_cv_prog_egrep+set}" = set; then
2526   echo $ECHO_N "(cached) $ECHO_C" >&6
2527 else
2528   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2529     then ac_cv_prog_egrep='grep -E'
2530     else ac_cv_prog_egrep='egrep'
2531     fi
2532 fi
2533 echo "$as_me:2533: result: $ac_cv_prog_egrep" >&5
2534 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2535  EGREP=$ac_cv_prog_egrep
2536
2537 test -z "$EGREP" && { { echo "$as_me:2537: error: No egrep program found" >&5
2538 echo "$as_me: error: No egrep program found" >&2;}
2539    { (exit 1); exit 1; }; }
2540
2541 # Find a good install program.  We prefer a C program (faster),
2542 # so one script is as good as another.  But avoid the broken or
2543 # incompatible versions:
2544 # SysV /etc/install, /usr/sbin/install
2545 # SunOS /usr/etc/install
2546 # IRIX /sbin/install
2547 # AIX /bin/install
2548 # AmigaOS /C/install, which installs bootblocks on floppy discs
2549 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2550 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2551 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2552 # ./install, which can be erroneously created by make from ./install.sh.
2553 echo "$as_me:2553: checking for a BSD compatible install" >&5
2554 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2555 if test -z "$INSTALL"; then
2556 if test "${ac_cv_path_install+set}" = set; then
2557   echo $ECHO_N "(cached) $ECHO_C" >&6
2558 else
2559     ac_save_IFS=$IFS; IFS=$ac_path_separator
2560   for ac_dir in $PATH; do
2561     IFS=$ac_save_IFS
2562     # Account for people who put trailing slashes in PATH elements.
2563     case $ac_dir/ in
2564     / | ./ | .// | /cC/* \
2565     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2566     | /usr/ucb/* ) ;;
2567     *)
2568       # OSF1 and SCO ODT 3.0 have their own names for install.
2569       # Don't use installbsd from OSF since it installs stuff as root
2570       # by default.
2571       for ac_prog in ginstall scoinst install; do
2572         if $as_executable_p "$ac_dir/$ac_prog"; then
2573           if test $ac_prog = install &&
2574             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2575             # AIX install.  It has an incompatible calling convention.
2576             :
2577           elif test $ac_prog = install &&
2578             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2579             # program-specific install script used by HP pwplus--don't use.
2580             :
2581           else
2582             ac_cv_path_install="$ac_dir/$ac_prog -c"
2583             break 2
2584           fi
2585         fi
2586       done
2587       ;;
2588     esac
2589   done
2590
2591 fi
2592   if test "${ac_cv_path_install+set}" = set; then
2593     INSTALL=$ac_cv_path_install
2594   else
2595     # As a last resort, use the slow shell script.  We don't cache a
2596     # path for INSTALL within a source directory, because that will
2597     # break other packages using the cache if that directory is
2598     # removed, or if the path is relative.
2599     INSTALL=$ac_install_sh
2600   fi
2601 fi
2602 echo "$as_me:2602: result: $INSTALL" >&5
2603 echo "${ECHO_T}$INSTALL" >&6
2604
2605 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2606 # It thinks the first close brace ends the variable substitution.
2607 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2608
2609 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2610
2611 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2612
2613 echo "$as_me:2613: checking whether ln -s works" >&5
2614 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2615 LN_S=$as_ln_s
2616 if test "$LN_S" = "ln -s"; then
2617   echo "$as_me:2617: result: yes" >&5
2618 echo "${ECHO_T}yes" >&6
2619 else
2620   echo "$as_me:2620: result: no, using $LN_S" >&5
2621 echo "${ECHO_T}no, using $LN_S" >&6
2622 fi
2623
2624 echo "$as_me:2624: checking if $LN_S -f options work" >&5
2625 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2626
2627 rm -f conf$$.src conf$$dst
2628 echo >conf$$.dst
2629 echo first >conf$$.src
2630 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2631         cf_prog_ln_sf=yes
2632 else
2633         cf_prog_ln_sf=no
2634 fi
2635 rm -f conf$$.dst conf$$src
2636 echo "$as_me:2636: result: $cf_prog_ln_sf" >&5
2637 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2638
2639 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2640
2641 echo "$as_me:2641: checking for long file names" >&5
2642 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2643 if test "${ac_cv_sys_long_file_names+set}" = set; then
2644   echo $ECHO_N "(cached) $ECHO_C" >&6
2645 else
2646   ac_cv_sys_long_file_names=yes
2647 # Test for long file names in all the places we know might matter:
2648 #      .                the current directory, where building will happen
2649 #      $prefix/lib      where we will be installing things
2650 #      $exec_prefix/lib likewise
2651 # eval it to expand exec_prefix.
2652 #      $TMPDIR          if set, where it might want to write temporary files
2653 # if $TMPDIR is not set:
2654 #      /tmp             where it might want to write temporary files
2655 #      /var/tmp         likewise
2656 #      /usr/tmp         likewise
2657 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2658   ac_tmpdirs=$TMPDIR
2659 else
2660   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2661 fi
2662 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2663   test -d $ac_dir || continue
2664   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2665   ac_xdir=$ac_dir/cf$$
2666   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2667   ac_tf1=$ac_xdir/conftest9012345
2668   ac_tf2=$ac_xdir/conftest9012346
2669   (echo 1 >$ac_tf1) 2>/dev/null
2670   (echo 2 >$ac_tf2) 2>/dev/null
2671   ac_val=`cat $ac_tf1 2>/dev/null`
2672   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2673     ac_cv_sys_long_file_names=no
2674     rm -rf $ac_xdir 2>/dev/null
2675     break
2676   fi
2677   rm -rf $ac_xdir 2>/dev/null
2678 done
2679 fi
2680 echo "$as_me:2680: result: $ac_cv_sys_long_file_names" >&5
2681 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2682 if test $ac_cv_sys_long_file_names = yes; then
2683
2684 cat >>confdefs.h <<\EOF
2685 #define HAVE_LONG_FILE_NAMES 1
2686 EOF
2687
2688 fi
2689
2690 # if we find pkg-config, check if we should install the ".pc" files.
2691
2692 echo "$as_me:2692: checking if you want to use pkg-config" >&5
2693 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2694
2695 # Check whether --with-pkg-config or --without-pkg-config was given.
2696 if test "${with_pkg_config+set}" = set; then
2697   withval="$with_pkg_config"
2698   cf_pkg_config=$withval
2699 else
2700   cf_pkg_config=yes
2701 fi;
2702 echo "$as_me:2702: result: $cf_pkg_config" >&5
2703 echo "${ECHO_T}$cf_pkg_config" >&6
2704
2705 case $cf_pkg_config in #(vi
2706 no) #(vi
2707         PKG_CONFIG=none
2708         ;;
2709 yes) #(vi
2710         if test -n "$ac_tool_prefix"; then
2711   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2712 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2713 echo "$as_me:2713: checking for $ac_word" >&5
2714 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2715 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2716   echo $ECHO_N "(cached) $ECHO_C" >&6
2717 else
2718   case $PKG_CONFIG in
2719   [\\/]* | ?:[\\/]*)
2720   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2721   ;;
2722   *)
2723   ac_save_IFS=$IFS; IFS=$ac_path_separator
2724 ac_dummy="$PATH"
2725 for ac_dir in $ac_dummy; do
2726   IFS=$ac_save_IFS
2727   test -z "$ac_dir" && ac_dir=.
2728   if $as_executable_p "$ac_dir/$ac_word"; then
2729    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2730    echo "$as_me:2730: found $ac_dir/$ac_word" >&5
2731    break
2732 fi
2733 done
2734
2735   ;;
2736 esac
2737 fi
2738 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2739
2740 if test -n "$PKG_CONFIG"; then
2741   echo "$as_me:2741: result: $PKG_CONFIG" >&5
2742 echo "${ECHO_T}$PKG_CONFIG" >&6
2743 else
2744   echo "$as_me:2744: result: no" >&5
2745 echo "${ECHO_T}no" >&6
2746 fi
2747
2748 fi
2749 if test -z "$ac_cv_path_PKG_CONFIG"; then
2750   ac_pt_PKG_CONFIG=$PKG_CONFIG
2751   # Extract the first word of "pkg-config", so it can be a program name with args.
2752 set dummy pkg-config; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   case $ac_pt_PKG_CONFIG in
2759   [\\/]* | ?:[\\/]*)
2760   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2761   ;;
2762   *)
2763   ac_save_IFS=$IFS; IFS=$ac_path_separator
2764 ac_dummy="$PATH"
2765 for ac_dir in $ac_dummy; do
2766   IFS=$ac_save_IFS
2767   test -z "$ac_dir" && ac_dir=.
2768   if $as_executable_p "$ac_dir/$ac_word"; then
2769    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2770    echo "$as_me:2770: found $ac_dir/$ac_word" >&5
2771    break
2772 fi
2773 done
2774
2775   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2776   ;;
2777 esac
2778 fi
2779 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2780
2781 if test -n "$ac_pt_PKG_CONFIG"; then
2782   echo "$as_me:2782: result: $ac_pt_PKG_CONFIG" >&5
2783 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2784 else
2785   echo "$as_me:2785: result: no" >&5
2786 echo "${ECHO_T}no" >&6
2787 fi
2788
2789   PKG_CONFIG=$ac_pt_PKG_CONFIG
2790 else
2791   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2792 fi
2793
2794         ;;
2795 *)
2796         PKG_CONFIG=$withval
2797         ;;
2798 esac
2799
2800 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2801 if test "$PKG_CONFIG" != none ; then
2802
2803 if test "x$prefix" != xNONE; then
2804   cf_path_syntax="$prefix"
2805 else
2806   cf_path_syntax="$ac_default_prefix"
2807 fi
2808
2809 case ".$PKG_CONFIG" in #(vi
2810 .\$\(*\)*|.\'*\'*) #(vi
2811   ;;
2812 ..|./*|.\\*) #(vi
2813   ;;
2814 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2815   ;;
2816 .\${*prefix}*) #(vi
2817   eval PKG_CONFIG="$PKG_CONFIG"
2818   case ".$PKG_CONFIG" in #(vi
2819   .NONE/*)
2820     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2821     ;;
2822   esac
2823   ;; #(vi
2824 .no|.NONE/*)
2825   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2826   ;;
2827 *)
2828   { { echo "$as_me:2828: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2829 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2830    { (exit 1); exit 1; }; }
2831   ;;
2832 esac
2833
2834 fi
2835
2836 if test "$PKG_CONFIG" != no ; then
2837         echo "$as_me:2837: checking if we should install .pc files for $PKG_CONFIG" >&5
2838 echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6
2839
2840         # Leave this as something that can be overridden in the environment.
2841         if test -z "$PKG_CONFIG_LIBDIR" ; then
2842                 PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
2843         fi
2844         PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
2845         if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
2846
2847 # Check whether --enable-pc-files or --disable-pc-files was given.
2848 if test "${enable_pc_files+set}" = set; then
2849   enableval="$enable_pc_files"
2850   enable_pc_files=$enableval
2851 else
2852   enable_pc_files=no
2853 fi;
2854                 echo "$as_me:2854: result: $enable_pc_files" >&5
2855 echo "${ECHO_T}$enable_pc_files" >&6
2856         else
2857                 echo "$as_me:2857: result: no" >&5
2858 echo "${ECHO_T}no" >&6
2859                 { echo "$as_me:2859: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5
2860 echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;}
2861                 enable_pc_files=no
2862         fi
2863 fi
2864
2865 echo "$as_me:2865: checking if you want to build test-programs" >&5
2866 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2867
2868 # Check whether --with-tests or --without-tests was given.
2869 if test "${with_tests+set}" = set; then
2870   withval="$with_tests"
2871   cf_with_tests=$withval
2872 else
2873   cf_with_tests=yes
2874 fi;
2875 echo "$as_me:2875: result: $cf_with_tests" >&5
2876 echo "${ECHO_T}$cf_with_tests" >&6
2877
2878 echo "$as_me:2878: checking if we should assume mixed-case filenames" >&5
2879 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2880
2881 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2882 if test "${enable_mixed_case+set}" = set; then
2883   enableval="$enable_mixed_case"
2884   enable_mixedcase=$enableval
2885 else
2886   enable_mixedcase=auto
2887 fi;
2888 echo "$as_me:2888: result: $enable_mixedcase" >&5
2889 echo "${ECHO_T}$enable_mixedcase" >&6
2890 if test "$enable_mixedcase" = "auto" ; then
2891
2892 echo "$as_me:2892: checking if filesystem supports mixed-case filenames" >&5
2893 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2894 if test "${cf_cv_mixedcase+set}" = set; then
2895   echo $ECHO_N "(cached) $ECHO_C" >&6
2896 else
2897
2898 if test "$cross_compiling" = yes ; then
2899         case $target_alias in #(vi
2900         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2901                 cf_cv_mixedcase=no
2902                 ;;
2903         *)
2904                 cf_cv_mixedcase=yes
2905                 ;;
2906         esac
2907 else
2908         rm -f conftest CONFTEST
2909         echo test >conftest
2910         if test -f CONFTEST ; then
2911                 cf_cv_mixedcase=no
2912         else
2913                 cf_cv_mixedcase=yes
2914         fi
2915         rm -f conftest CONFTEST
2916 fi
2917
2918 fi
2919 echo "$as_me:2919: result: $cf_cv_mixedcase" >&5
2920 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2921 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2922 #define MIXEDCASE_FILENAMES 1
2923 EOF
2924
2925 else
2926     cf_cv_mixedcase=$enable_mixedcase
2927     if test "$enable_mixedcase" = "yes" ; then
2928         cat >>confdefs.h <<\EOF
2929 #define MIXEDCASE_FILENAMES 1
2930 EOF
2931
2932     fi
2933 fi
2934
2935 # do this after mixed-case option (tags/TAGS is not as important as tic).
2936 echo "$as_me:2936: checking whether ${MAKE-make} sets \${MAKE}" >&5
2937 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2938 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2939 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2940   echo $ECHO_N "(cached) $ECHO_C" >&6
2941 else
2942   cat >conftest.make <<\EOF
2943 all:
2944         @echo 'ac_maketemp="${MAKE}"'
2945 EOF
2946 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2947 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2948 if test -n "$ac_maketemp"; then
2949   eval ac_cv_prog_make_${ac_make}_set=yes
2950 else
2951   eval ac_cv_prog_make_${ac_make}_set=no
2952 fi
2953 rm -f conftest.make
2954 fi
2955 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2956   echo "$as_me:2956: result: yes" >&5
2957 echo "${ECHO_T}yes" >&6
2958   SET_MAKE=
2959 else
2960   echo "$as_me:2960: result: no" >&5
2961 echo "${ECHO_T}no" >&6
2962   SET_MAKE="MAKE=${MAKE-make}"
2963 fi
2964
2965 for ac_prog in exctags ctags
2966 do
2967   # Extract the first word of "$ac_prog", so it can be a program name with args.
2968 set dummy $ac_prog; ac_word=$2
2969 echo "$as_me:2969: checking for $ac_word" >&5
2970 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2971 if test "${ac_cv_prog_CTAGS+set}" = set; then
2972   echo $ECHO_N "(cached) $ECHO_C" >&6
2973 else
2974   if test -n "$CTAGS"; then
2975   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2976 else
2977   ac_save_IFS=$IFS; IFS=$ac_path_separator
2978 ac_dummy="$PATH"
2979 for ac_dir in $ac_dummy; do
2980   IFS=$ac_save_IFS
2981   test -z "$ac_dir" && ac_dir=.
2982   $as_executable_p "$ac_dir/$ac_word" || continue
2983 ac_cv_prog_CTAGS="$ac_prog"
2984 echo "$as_me:2984: found $ac_dir/$ac_word" >&5
2985 break
2986 done
2987
2988 fi
2989 fi
2990 CTAGS=$ac_cv_prog_CTAGS
2991 if test -n "$CTAGS"; then
2992   echo "$as_me:2992: result: $CTAGS" >&5
2993 echo "${ECHO_T}$CTAGS" >&6
2994 else
2995   echo "$as_me:2995: result: no" >&5
2996 echo "${ECHO_T}no" >&6
2997 fi
2998
2999   test -n "$CTAGS" && break
3000 done
3001
3002 for ac_prog in exetags etags
3003 do
3004   # Extract the first word of "$ac_prog", so it can be a program name with args.
3005 set dummy $ac_prog; ac_word=$2
3006 echo "$as_me:3006: checking for $ac_word" >&5
3007 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3008 if test "${ac_cv_prog_ETAGS+set}" = set; then
3009   echo $ECHO_N "(cached) $ECHO_C" >&6
3010 else
3011   if test -n "$ETAGS"; then
3012   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3013 else
3014   ac_save_IFS=$IFS; IFS=$ac_path_separator
3015 ac_dummy="$PATH"
3016 for ac_dir in $ac_dummy; do
3017   IFS=$ac_save_IFS
3018   test -z "$ac_dir" && ac_dir=.
3019   $as_executable_p "$ac_dir/$ac_word" || continue
3020 ac_cv_prog_ETAGS="$ac_prog"
3021 echo "$as_me:3021: found $ac_dir/$ac_word" >&5
3022 break
3023 done
3024
3025 fi
3026 fi
3027 ETAGS=$ac_cv_prog_ETAGS
3028 if test -n "$ETAGS"; then
3029   echo "$as_me:3029: result: $ETAGS" >&5
3030 echo "${ECHO_T}$ETAGS" >&6
3031 else
3032   echo "$as_me:3032: result: no" >&5
3033 echo "${ECHO_T}no" >&6
3034 fi
3035
3036   test -n "$ETAGS" && break
3037 done
3038
3039 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3040 set dummy ${CTAGS:-ctags}; ac_word=$2
3041 echo "$as_me:3041: checking for $ac_word" >&5
3042 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3043 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3044   echo $ECHO_N "(cached) $ECHO_C" >&6
3045 else
3046   if test -n "$MAKE_LOWER_TAGS"; then
3047   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3048 else
3049   ac_save_IFS=$IFS; IFS=$ac_path_separator
3050 ac_dummy="$PATH"
3051 for ac_dir in $ac_dummy; do
3052   IFS=$ac_save_IFS
3053   test -z "$ac_dir" && ac_dir=.
3054   $as_executable_p "$ac_dir/$ac_word" || continue
3055 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3056 echo "$as_me:3056: found $ac_dir/$ac_word" >&5
3057 break
3058 done
3059
3060   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3061 fi
3062 fi
3063 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3064 if test -n "$MAKE_LOWER_TAGS"; then
3065   echo "$as_me:3065: result: $MAKE_LOWER_TAGS" >&5
3066 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3067 else
3068   echo "$as_me:3068: result: no" >&5
3069 echo "${ECHO_T}no" >&6
3070 fi
3071
3072 if test "$cf_cv_mixedcase" = yes ; then
3073         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3074 set dummy ${ETAGS:-etags}; ac_word=$2
3075 echo "$as_me:3075: checking for $ac_word" >&5
3076 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3077 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3078   echo $ECHO_N "(cached) $ECHO_C" >&6
3079 else
3080   if test -n "$MAKE_UPPER_TAGS"; then
3081   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3082 else
3083   ac_save_IFS=$IFS; IFS=$ac_path_separator
3084 ac_dummy="$PATH"
3085 for ac_dir in $ac_dummy; do
3086   IFS=$ac_save_IFS
3087   test -z "$ac_dir" && ac_dir=.
3088   $as_executable_p "$ac_dir/$ac_word" || continue
3089 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3090 echo "$as_me:3090: found $ac_dir/$ac_word" >&5
3091 break
3092 done
3093
3094   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3095 fi
3096 fi
3097 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3098 if test -n "$MAKE_UPPER_TAGS"; then
3099   echo "$as_me:3099: result: $MAKE_UPPER_TAGS" >&5
3100 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3101 else
3102   echo "$as_me:3102: result: no" >&5
3103 echo "${ECHO_T}no" >&6
3104 fi
3105
3106 else
3107         MAKE_UPPER_TAGS=no
3108 fi
3109
3110 if test "$MAKE_UPPER_TAGS" = yes ; then
3111         MAKE_UPPER_TAGS=
3112 else
3113         MAKE_UPPER_TAGS="#"
3114 fi
3115
3116 if test "$MAKE_LOWER_TAGS" = yes ; then
3117         MAKE_LOWER_TAGS=
3118 else
3119         MAKE_LOWER_TAGS="#"
3120 fi
3121
3122 echo "$as_me:3122: checking for makeflags variable" >&5
3123 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3124 if test "${cf_cv_makeflags+set}" = set; then
3125   echo $ECHO_N "(cached) $ECHO_C" >&6
3126 else
3127
3128         cf_cv_makeflags=''
3129         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3130         do
3131                 cat >cf_makeflags.tmp <<CF_EOF
3132 SHELL = /bin/sh
3133 all :
3134         @ echo '.$cf_option'
3135 CF_EOF
3136                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[       ]*$,,'`
3137                 case "$cf_result" in
3138                 .*k)
3139                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3140                         case "$cf_result" in
3141                         .*CC=*) cf_cv_makeflags=
3142                                 ;;
3143                         *)      cf_cv_makeflags=$cf_option
3144                                 ;;
3145                         esac
3146                         break
3147                         ;;
3148                 .-)     ;;
3149                 *)      echo "given option \"$cf_option\", no match \"$cf_result\""
3150                         ;;
3151                 esac
3152         done
3153         rm -f cf_makeflags.tmp
3154
3155 fi
3156 echo "$as_me:3156: result: $cf_cv_makeflags" >&5
3157 echo "${ECHO_T}$cf_cv_makeflags" >&6
3158
3159 if test -n "$ac_tool_prefix"; then
3160   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3161 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3162 echo "$as_me:3162: checking for $ac_word" >&5
3163 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3164 if test "${ac_cv_prog_RANLIB+set}" = set; then
3165   echo $ECHO_N "(cached) $ECHO_C" >&6
3166 else
3167   if test -n "$RANLIB"; then
3168   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3169 else
3170   ac_save_IFS=$IFS; IFS=$ac_path_separator
3171 ac_dummy="$PATH"
3172 for ac_dir in $ac_dummy; do
3173   IFS=$ac_save_IFS
3174   test -z "$ac_dir" && ac_dir=.
3175   $as_executable_p "$ac_dir/$ac_word" || continue
3176 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3177 echo "$as_me:3177: found $ac_dir/$ac_word" >&5
3178 break
3179 done
3180
3181 fi
3182 fi
3183 RANLIB=$ac_cv_prog_RANLIB
3184 if test -n "$RANLIB"; then
3185   echo "$as_me:3185: result: $RANLIB" >&5
3186 echo "${ECHO_T}$RANLIB" >&6
3187 else
3188   echo "$as_me:3188: result: no" >&5
3189 echo "${ECHO_T}no" >&6
3190 fi
3191
3192 fi
3193 if test -z "$ac_cv_prog_RANLIB"; then
3194   ac_ct_RANLIB=$RANLIB
3195   # Extract the first word of "ranlib", so it can be a program name with args.
3196 set dummy ranlib; ac_word=$2
3197 echo "$as_me:3197: checking for $ac_word" >&5
3198 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3199 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3200   echo $ECHO_N "(cached) $ECHO_C" >&6
3201 else
3202   if test -n "$ac_ct_RANLIB"; then
3203   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3204 else
3205   ac_save_IFS=$IFS; IFS=$ac_path_separator
3206 ac_dummy="$PATH"
3207 for ac_dir in $ac_dummy; do
3208   IFS=$ac_save_IFS
3209   test -z "$ac_dir" && ac_dir=.
3210   $as_executable_p "$ac_dir/$ac_word" || continue
3211 ac_cv_prog_ac_ct_RANLIB="ranlib"
3212 echo "$as_me:3212: found $ac_dir/$ac_word" >&5
3213 break
3214 done
3215
3216   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3217 fi
3218 fi
3219 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3220 if test -n "$ac_ct_RANLIB"; then
3221   echo "$as_me:3221: result: $ac_ct_RANLIB" >&5
3222 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3223 else
3224   echo "$as_me:3224: result: no" >&5
3225 echo "${ECHO_T}no" >&6
3226 fi
3227
3228   RANLIB=$ac_ct_RANLIB
3229 else
3230   RANLIB="$ac_cv_prog_RANLIB"
3231 fi
3232
3233 if test -n "$ac_tool_prefix"; then
3234   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3235 set dummy ${ac_tool_prefix}ld; ac_word=$2
3236 echo "$as_me:3236: checking for $ac_word" >&5
3237 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3238 if test "${ac_cv_prog_LD+set}" = set; then
3239   echo $ECHO_N "(cached) $ECHO_C" >&6
3240 else
3241   if test -n "$LD"; then
3242   ac_cv_prog_LD="$LD" # Let the user override the test.
3243 else
3244   ac_save_IFS=$IFS; IFS=$ac_path_separator
3245 ac_dummy="$PATH"
3246 for ac_dir in $ac_dummy; do
3247   IFS=$ac_save_IFS
3248   test -z "$ac_dir" && ac_dir=.
3249   $as_executable_p "$ac_dir/$ac_word" || continue
3250 ac_cv_prog_LD="${ac_tool_prefix}ld"
3251 echo "$as_me:3251: found $ac_dir/$ac_word" >&5
3252 break
3253 done
3254
3255 fi
3256 fi
3257 LD=$ac_cv_prog_LD
3258 if test -n "$LD"; then
3259   echo "$as_me:3259: result: $LD" >&5
3260 echo "${ECHO_T}$LD" >&6
3261 else
3262   echo "$as_me:3262: result: no" >&5
3263 echo "${ECHO_T}no" >&6
3264 fi
3265
3266 fi
3267 if test -z "$ac_cv_prog_LD"; then
3268   ac_ct_LD=$LD
3269   # Extract the first word of "ld", so it can be a program name with args.
3270 set dummy ld; ac_word=$2
3271 echo "$as_me:3271: checking for $ac_word" >&5
3272 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3273 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3274   echo $ECHO_N "(cached) $ECHO_C" >&6
3275 else
3276   if test -n "$ac_ct_LD"; then
3277   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3278 else
3279   ac_save_IFS=$IFS; IFS=$ac_path_separator
3280 ac_dummy="$PATH"
3281 for ac_dir in $ac_dummy; do
3282   IFS=$ac_save_IFS
3283   test -z "$ac_dir" && ac_dir=.
3284   $as_executable_p "$ac_dir/$ac_word" || continue
3285 ac_cv_prog_ac_ct_LD="ld"
3286 echo "$as_me:3286: found $ac_dir/$ac_word" >&5
3287 break
3288 done
3289
3290   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3291 fi
3292 fi
3293 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3294 if test -n "$ac_ct_LD"; then
3295   echo "$as_me:3295: result: $ac_ct_LD" >&5
3296 echo "${ECHO_T}$ac_ct_LD" >&6
3297 else
3298   echo "$as_me:3298: result: no" >&5
3299 echo "${ECHO_T}no" >&6
3300 fi
3301
3302   LD=$ac_ct_LD
3303 else
3304   LD="$ac_cv_prog_LD"
3305 fi
3306
3307 if test -n "$ac_tool_prefix"; then
3308   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3309 set dummy ${ac_tool_prefix}ar; ac_word=$2
3310 echo "$as_me:3310: checking for $ac_word" >&5
3311 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3312 if test "${ac_cv_prog_AR+set}" = set; then
3313   echo $ECHO_N "(cached) $ECHO_C" >&6
3314 else
3315   if test -n "$AR"; then
3316   ac_cv_prog_AR="$AR" # Let the user override the test.
3317 else
3318   ac_save_IFS=$IFS; IFS=$ac_path_separator
3319 ac_dummy="$PATH"
3320 for ac_dir in $ac_dummy; do
3321   IFS=$ac_save_IFS
3322   test -z "$ac_dir" && ac_dir=.
3323   $as_executable_p "$ac_dir/$ac_word" || continue
3324 ac_cv_prog_AR="${ac_tool_prefix}ar"
3325 echo "$as_me:3325: found $ac_dir/$ac_word" >&5
3326 break
3327 done
3328
3329 fi
3330 fi
3331 AR=$ac_cv_prog_AR
3332 if test -n "$AR"; then
3333   echo "$as_me:3333: result: $AR" >&5
3334 echo "${ECHO_T}$AR" >&6
3335 else
3336   echo "$as_me:3336: result: no" >&5
3337 echo "${ECHO_T}no" >&6
3338 fi
3339
3340 fi
3341 if test -z "$ac_cv_prog_AR"; then
3342   ac_ct_AR=$AR
3343   # Extract the first word of "ar", so it can be a program name with args.
3344 set dummy ar; ac_word=$2
3345 echo "$as_me:3345: checking for $ac_word" >&5
3346 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3347 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3348   echo $ECHO_N "(cached) $ECHO_C" >&6
3349 else
3350   if test -n "$ac_ct_AR"; then
3351   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3352 else
3353   ac_save_IFS=$IFS; IFS=$ac_path_separator
3354 ac_dummy="$PATH"
3355 for ac_dir in $ac_dummy; do
3356   IFS=$ac_save_IFS
3357   test -z "$ac_dir" && ac_dir=.
3358   $as_executable_p "$ac_dir/$ac_word" || continue
3359 ac_cv_prog_ac_ct_AR="ar"
3360 echo "$as_me:3360: found $ac_dir/$ac_word" >&5
3361 break
3362 done
3363
3364   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3365 fi
3366 fi
3367 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3368 if test -n "$ac_ct_AR"; then
3369   echo "$as_me:3369: result: $ac_ct_AR" >&5
3370 echo "${ECHO_T}$ac_ct_AR" >&6
3371 else
3372   echo "$as_me:3372: result: no" >&5
3373 echo "${ECHO_T}no" >&6
3374 fi
3375
3376   AR=$ac_ct_AR
3377 else
3378   AR="$ac_cv_prog_AR"
3379 fi
3380
3381 if test -n "$ac_tool_prefix"; then
3382   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3383 set dummy ${ac_tool_prefix}ar; ac_word=$2
3384 echo "$as_me:3384: checking for $ac_word" >&5
3385 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3386 if test "${ac_cv_prog_AR+set}" = set; then
3387   echo $ECHO_N "(cached) $ECHO_C" >&6
3388 else
3389   if test -n "$AR"; then
3390   ac_cv_prog_AR="$AR" # Let the user override the test.
3391 else
3392   ac_save_IFS=$IFS; IFS=$ac_path_separator
3393 ac_dummy="$PATH"
3394 for ac_dir in $ac_dummy; do
3395   IFS=$ac_save_IFS
3396   test -z "$ac_dir" && ac_dir=.
3397   $as_executable_p "$ac_dir/$ac_word" || continue
3398 ac_cv_prog_AR="${ac_tool_prefix}ar"
3399 echo "$as_me:3399: found $ac_dir/$ac_word" >&5
3400 break
3401 done
3402
3403 fi
3404 fi
3405 AR=$ac_cv_prog_AR
3406 if test -n "$AR"; then
3407   echo "$as_me:3407: result: $AR" >&5
3408 echo "${ECHO_T}$AR" >&6
3409 else
3410   echo "$as_me:3410: result: no" >&5
3411 echo "${ECHO_T}no" >&6
3412 fi
3413
3414 fi
3415 if test -z "$ac_cv_prog_AR"; then
3416   ac_ct_AR=$AR
3417   # Extract the first word of "ar", so it can be a program name with args.
3418 set dummy ar; ac_word=$2
3419 echo "$as_me:3419: checking for $ac_word" >&5
3420 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3421 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3422   echo $ECHO_N "(cached) $ECHO_C" >&6
3423 else
3424   if test -n "$ac_ct_AR"; then
3425   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3426 else
3427   ac_save_IFS=$IFS; IFS=$ac_path_separator
3428 ac_dummy="$PATH"
3429 for ac_dir in $ac_dummy; do
3430   IFS=$ac_save_IFS
3431   test -z "$ac_dir" && ac_dir=.
3432   $as_executable_p "$ac_dir/$ac_word" || continue
3433 ac_cv_prog_ac_ct_AR="ar"
3434 echo "$as_me:3434: found $ac_dir/$ac_word" >&5
3435 break
3436 done
3437
3438   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3439 fi
3440 fi
3441 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3442 if test -n "$ac_ct_AR"; then
3443   echo "$as_me:3443: result: $ac_ct_AR" >&5
3444 echo "${ECHO_T}$ac_ct_AR" >&6
3445 else
3446   echo "$as_me:3446: result: no" >&5
3447 echo "${ECHO_T}no" >&6
3448 fi
3449
3450   AR=$ac_ct_AR
3451 else
3452   AR="$ac_cv_prog_AR"
3453 fi
3454
3455 echo "$as_me:3455: checking for options to update archives" >&5
3456 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3457 if test "${cf_cv_ar_flags+set}" = set; then
3458   echo $ECHO_N "(cached) $ECHO_C" >&6
3459 else
3460
3461         cf_cv_ar_flags=unknown
3462         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3463         do
3464
3465                 # check if $ARFLAGS already contains this choice
3466                 if test "x$ARFLAGS" != "x" ; then
3467                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3468                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3469                                 cf_cv_ar_flags=
3470                                 break
3471                         fi
3472                 fi
3473
3474                 rm -f conftest.$ac_cv_objext
3475                 rm -f conftest.a
3476
3477                 cat >conftest.$ac_ext <<EOF
3478 #line 3478 "configure"
3479 int     testdata[3] = { 123, 456, 789 };
3480 EOF
3481                 if { (eval echo "$as_me:3481: \"$ac_compile\"") >&5
3482   (eval $ac_compile) 2>&5
3483   ac_status=$?
3484   echo "$as_me:3484: \$? = $ac_status" >&5
3485   (exit $ac_status); } ; then
3486                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3487                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3488                         if test -f conftest.a ; then
3489                                 cf_cv_ar_flags=$cf_ar_flags
3490                                 break
3491                         fi
3492                 else
3493                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3494
3495 echo "${as_me:-configure}:3495: testing cannot compile test-program ..." 1>&5
3496
3497                         break
3498                 fi
3499         done
3500         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3501
3502 fi
3503 echo "$as_me:3503: result: $cf_cv_ar_flags" >&5
3504 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3505
3506 if test -n "$ARFLAGS" ; then
3507         if test -n "$cf_cv_ar_flags" ; then
3508                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3509         fi
3510 else
3511         ARFLAGS=$cf_cv_ar_flags
3512 fi
3513
3514 echo "$as_me:3514: checking if you have specified an install-prefix" >&5
3515 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3516
3517 # Check whether --with-install-prefix or --without-install-prefix was given.
3518 if test "${with_install_prefix+set}" = set; then
3519   withval="$with_install_prefix"
3520   case "$withval" in #(vi
3521         yes|no) #(vi
3522                 ;;
3523         *)      DESTDIR="$withval"
3524                 ;;
3525         esac
3526 fi;
3527 echo "$as_me:3527: result: $DESTDIR" >&5
3528 echo "${ECHO_T}$DESTDIR" >&6
3529
3530 ###############################################################################
3531
3532 # If we're cross-compiling, allow the user to override the tools and their
3533 # options.  The configure script is oriented toward identifying the host
3534 # compiler, etc., but we need a build compiler to generate parts of the source.
3535
3536 if test "$cross_compiling" = yes ; then
3537
3538         # defaults that we might want to override
3539         : ${BUILD_CFLAGS:=''}
3540         : ${BUILD_CPPFLAGS:=''}
3541         : ${BUILD_LDFLAGS:=''}
3542         : ${BUILD_LIBS:=''}
3543         : ${BUILD_EXEEXT:='$x'}
3544         : ${BUILD_OBJEXT:='o'}
3545
3546 # Check whether --with-build-cc or --without-build-cc was given.
3547 if test "${with_build_cc+set}" = set; then
3548   withval="$with_build_cc"
3549   BUILD_CC="$withval"
3550 else
3551   for ac_prog in gcc cc cl
3552 do
3553   # Extract the first word of "$ac_prog", so it can be a program name with args.
3554 set dummy $ac_prog; ac_word=$2
3555 echo "$as_me:3555: checking for $ac_word" >&5
3556 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3557 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3558   echo $ECHO_N "(cached) $ECHO_C" >&6
3559 else
3560   if test -n "$BUILD_CC"; then
3561   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3562 else
3563   ac_save_IFS=$IFS; IFS=$ac_path_separator
3564 ac_dummy="$PATH"
3565 for ac_dir in $ac_dummy; do
3566   IFS=$ac_save_IFS
3567   test -z "$ac_dir" && ac_dir=.
3568   $as_executable_p "$ac_dir/$ac_word" || continue
3569 ac_cv_prog_BUILD_CC="$ac_prog"
3570 echo "$as_me:3570: found $ac_dir/$ac_word" >&5
3571 break
3572 done
3573
3574 fi
3575 fi
3576 BUILD_CC=$ac_cv_prog_BUILD_CC
3577 if test -n "$BUILD_CC"; then
3578   echo "$as_me:3578: result: $BUILD_CC" >&5
3579 echo "${ECHO_T}$BUILD_CC" >&6
3580 else
3581   echo "$as_me:3581: result: no" >&5
3582 echo "${ECHO_T}no" >&6
3583 fi
3584
3585   test -n "$BUILD_CC" && break
3586 done
3587
3588 fi;
3589         echo "$as_me:3589: checking for native build C compiler" >&5
3590 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3591         echo "$as_me:3591: result: $BUILD_CC" >&5
3592 echo "${ECHO_T}$BUILD_CC" >&6
3593
3594         echo "$as_me:3594: checking for native build C preprocessor" >&5
3595 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3596
3597 # Check whether --with-build-cpp or --without-build-cpp was given.
3598 if test "${with_build_cpp+set}" = set; then
3599   withval="$with_build_cpp"
3600   BUILD_CPP="$withval"
3601 else
3602   BUILD_CPP='${BUILD_CC} -E'
3603 fi;
3604         echo "$as_me:3604: result: $BUILD_CPP" >&5
3605 echo "${ECHO_T}$BUILD_CPP" >&6
3606
3607         echo "$as_me:3607: checking for native build C flags" >&5
3608 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3609
3610 # Check whether --with-build-cflags or --without-build-cflags was given.
3611 if test "${with_build_cflags+set}" = set; then
3612   withval="$with_build_cflags"
3613   BUILD_CFLAGS="$withval"
3614 fi;
3615         echo "$as_me:3615: result: $BUILD_CFLAGS" >&5
3616 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3617
3618         echo "$as_me:3618: checking for native build C preprocessor-flags" >&5
3619 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3620
3621 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3622 if test "${with_build_cppflags+set}" = set; then
3623   withval="$with_build_cppflags"
3624   BUILD_CPPFLAGS="$withval"
3625 fi;
3626         echo "$as_me:3626: result: $BUILD_CPPFLAGS" >&5
3627 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3628
3629         echo "$as_me:3629: checking for native build linker-flags" >&5
3630 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3631
3632 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3633 if test "${with_build_ldflags+set}" = set; then
3634   withval="$with_build_ldflags"
3635   BUILD_LDFLAGS="$withval"
3636 fi;
3637         echo "$as_me:3637: result: $BUILD_LDFLAGS" >&5
3638 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3639
3640         echo "$as_me:3640: checking for native build linker-libraries" >&5
3641 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3642
3643 # Check whether --with-build-libs or --without-build-libs was given.
3644 if test "${with_build_libs+set}" = set; then
3645   withval="$with_build_libs"
3646   BUILD_LIBS="$withval"
3647 fi;
3648         echo "$as_me:3648: result: $BUILD_LIBS" >&5
3649 echo "${ECHO_T}$BUILD_LIBS" >&6
3650
3651         # this assumes we're on Unix.
3652         BUILD_EXEEXT=
3653         BUILD_OBJEXT=o
3654
3655         : ${BUILD_CC:='${CC}'}
3656
3657         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3658                 { { echo "$as_me:3658: error: Cross-build requires two compilers.
3659 Use --with-build-cc to specify the native compiler." >&5
3660 echo "$as_me: error: Cross-build requires two compilers.
3661 Use --with-build-cc to specify the native compiler." >&2;}
3662    { (exit 1); exit 1; }; }
3663         fi
3664
3665 else
3666         : ${BUILD_CC:='${CC}'}
3667         : ${BUILD_CPP:='${CPP}'}
3668         : ${BUILD_CFLAGS:='${CFLAGS}'}
3669         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3670         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3671         : ${BUILD_LIBS:='${LIBS}'}
3672         : ${BUILD_EXEEXT:='$x'}
3673         : ${BUILD_OBJEXT:='o'}
3674 fi
3675
3676 ###############################################################################
3677
3678 ### Options to allow the user to specify the set of libraries which are used.
3679 ### Use "--without-normal --with-shared" to allow the default model to be
3680 ### shared, for example.
3681 cf_list_models=""
3682 echo "$as_me:3682: checking for specified models" >&5
3683 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3684 test -z "$cf_list_models" && cf_list_models=normal
3685 echo "$as_me:3685: result: $cf_list_models" >&5
3686 echo "${ECHO_T}$cf_list_models" >&6
3687
3688 ### Use the first model as the default, and save its suffix for use in building
3689 ### up test-applications.
3690 echo "$as_me:3690: checking for default model" >&5
3691 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3692 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3693 echo "$as_me:3693: result: $DFT_LWR_MODEL" >&5
3694 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3695
3696 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3697
3698 echo "$as_me:3698: checking for specific curses-directory" >&5
3699 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3700
3701 # Check whether --with-curses-dir or --without-curses-dir was given.
3702 if test "${with_curses_dir+set}" = set; then
3703   withval="$with_curses_dir"
3704   cf_cv_curses_dir=$withval
3705 else
3706   cf_cv_curses_dir=no
3707 fi;
3708 echo "$as_me:3708: result: $cf_cv_curses_dir" >&5
3709 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3710
3711 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3712 then
3713
3714 if test "x$prefix" != xNONE; then
3715   cf_path_syntax="$prefix"
3716 else
3717   cf_path_syntax="$ac_default_prefix"
3718 fi
3719
3720 case ".$withval" in #(vi
3721 .\$\(*\)*|.\'*\'*) #(vi
3722   ;;
3723 ..|./*|.\\*) #(vi
3724   ;;
3725 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
3726   ;;
3727 .\${*prefix}*) #(vi
3728   eval withval="$withval"
3729   case ".$withval" in #(vi
3730   .NONE/*)
3731     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3732     ;;
3733   esac
3734   ;; #(vi
3735 .no|.NONE/*)
3736   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3737   ;;
3738 *)
3739   { { echo "$as_me:3739: error: expected a pathname, not \"$withval\"" >&5
3740 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3741    { (exit 1); exit 1; }; }
3742   ;;
3743 esac
3744
3745         if test -d "$cf_cv_curses_dir"
3746         then
3747
3748 if test -n "$cf_cv_curses_dir/include" ; then
3749   for cf_add_incdir in $cf_cv_curses_dir/include
3750   do
3751         while test $cf_add_incdir != /usr/include
3752         do
3753           if test -d $cf_add_incdir
3754           then
3755                 cf_have_incdir=no
3756                 if test -n "$CFLAGS$CPPFLAGS" ; then
3757                   # a loop is needed to ensure we can add subdirs of existing dirs
3758                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3759                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3760                           cf_have_incdir=yes; break
3761                         fi
3762                   done
3763                 fi
3764
3765                 if test "$cf_have_incdir" = no ; then
3766                   if test "$cf_add_incdir" = /usr/local/include ; then
3767                         if test "$GCC" = yes
3768                         then
3769                           cf_save_CPPFLAGS=$CPPFLAGS
3770                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3771                           cat >conftest.$ac_ext <<_ACEOF
3772 #line 3772 "configure"
3773 #include "confdefs.h"
3774 #include <stdio.h>
3775 int
3776 main ()
3777 {
3778 printf("Hello")
3779   ;
3780   return 0;
3781 }
3782 _ACEOF
3783 rm -f conftest.$ac_objext
3784 if { (eval echo "$as_me:3784: \"$ac_compile\"") >&5
3785   (eval $ac_compile) 2>&5
3786   ac_status=$?
3787   echo "$as_me:3787: \$? = $ac_status" >&5
3788   (exit $ac_status); } &&
3789          { ac_try='test -s conftest.$ac_objext'
3790   { (eval echo "$as_me:3790: \"$ac_try\"") >&5
3791   (eval $ac_try) 2>&5
3792   ac_status=$?
3793   echo "$as_me:3793: \$? = $ac_status" >&5
3794   (exit $ac_status); }; }; then
3795   :
3796 else
3797   echo "$as_me: failed program was:" >&5
3798 cat conftest.$ac_ext >&5
3799 cf_have_incdir=yes
3800 fi
3801 rm -f conftest.$ac_objext conftest.$ac_ext
3802                           CPPFLAGS=$cf_save_CPPFLAGS
3803                         fi
3804                   fi
3805                 fi
3806
3807                 if test "$cf_have_incdir" = no ; then
3808                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3809
3810 echo "${as_me:-configure}:3810: testing adding $cf_add_incdir to include-path ..." 1>&5
3811
3812                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3813
3814                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3815                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3816                   cf_add_incdir="$cf_top_incdir"
3817                 else
3818                   break
3819                 fi
3820           fi
3821         done
3822   done
3823 fi
3824
3825 if test -n "$cf_cv_curses_dir/lib" ; then
3826   for cf_add_libdir in $cf_cv_curses_dir/lib
3827   do
3828     if test $cf_add_libdir = /usr/lib ; then
3829       :
3830     elif test -d $cf_add_libdir
3831     then
3832       cf_have_libdir=no
3833       if test -n "$LDFLAGS$LIBS" ; then
3834         # a loop is needed to ensure we can add subdirs of existing dirs
3835         for cf_test_libdir in $LDFLAGS $LIBS ; do
3836           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3837             cf_have_libdir=yes; break
3838           fi
3839         done
3840       fi
3841       if test "$cf_have_libdir" = no ; then
3842         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3843
3844 echo "${as_me:-configure}:3844: testing adding $cf_add_libdir to library-path ..." 1>&5
3845
3846         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3847       fi
3848     fi
3849   done
3850 fi
3851
3852         fi
3853 fi
3854
3855 echo "$as_me:3855: checking if you want wide-character code" >&5
3856 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3857
3858 # Check whether --enable-widec or --disable-widec was given.
3859 if test "${enable_widec+set}" = set; then
3860   enableval="$enable_widec"
3861   with_widec=$enableval
3862 else
3863   with_widec=no
3864 fi;
3865 echo "$as_me:3865: result: $with_widec" >&5
3866 echo "${ECHO_T}$with_widec" >&6
3867 if test "$with_widec" = yes ; then
3868
3869 echo "$as_me:3869: checking for multibyte character support" >&5
3870 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3871 if test "${cf_cv_utf8_lib+set}" = set; then
3872   echo $ECHO_N "(cached) $ECHO_C" >&6
3873 else
3874
3875         cf_save_LIBS="$LIBS"
3876         cat >conftest.$ac_ext <<_ACEOF
3877 #line 3877 "configure"
3878 #include "confdefs.h"
3879
3880 #include <stdlib.h>
3881 int
3882 main ()
3883 {
3884 putwc(0,0);
3885   ;
3886   return 0;
3887 }
3888 _ACEOF
3889 rm -f conftest.$ac_objext conftest$ac_exeext
3890 if { (eval echo "$as_me:3890: \"$ac_link\"") >&5
3891   (eval $ac_link) 2>&5
3892   ac_status=$?
3893   echo "$as_me:3893: \$? = $ac_status" >&5
3894   (exit $ac_status); } &&
3895          { ac_try='test -s conftest$ac_exeext'
3896   { (eval echo "$as_me:3896: \"$ac_try\"") >&5
3897   (eval $ac_try) 2>&5
3898   ac_status=$?
3899   echo "$as_me:3899: \$? = $ac_status" >&5
3900   (exit $ac_status); }; }; then
3901   cf_cv_utf8_lib=yes
3902 else
3903   echo "$as_me: failed program was:" >&5
3904 cat conftest.$ac_ext >&5
3905
3906 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3907 # will be set on completion of the AC_TRY_LINK below.
3908 cf_cv_header_path_utf8=
3909 cf_cv_library_path_utf8=
3910
3911 echo "${as_me:-configure}:3911: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3912
3913 cf_save_LIBS="$LIBS"
3914
3915 cat >conftest.$ac_ext <<_ACEOF
3916 #line 3916 "configure"
3917 #include "confdefs.h"
3918
3919 #include <libutf8.h>
3920 int
3921 main ()
3922 {
3923 putwc(0,0);
3924   ;
3925   return 0;
3926 }
3927 _ACEOF
3928 rm -f conftest.$ac_objext conftest$ac_exeext
3929 if { (eval echo "$as_me:3929: \"$ac_link\"") >&5
3930   (eval $ac_link) 2>&5
3931   ac_status=$?
3932   echo "$as_me:3932: \$? = $ac_status" >&5
3933   (exit $ac_status); } &&
3934          { ac_try='test -s conftest$ac_exeext'
3935   { (eval echo "$as_me:3935: \"$ac_try\"") >&5
3936   (eval $ac_try) 2>&5
3937   ac_status=$?
3938   echo "$as_me:3938: \$? = $ac_status" >&5
3939   (exit $ac_status); }; }; then
3940
3941         cf_cv_find_linkage_utf8=yes
3942         cf_cv_header_path_utf8=/usr/include
3943         cf_cv_library_path_utf8=/usr/lib
3944
3945 else
3946   echo "$as_me: failed program was:" >&5
3947 cat conftest.$ac_ext >&5
3948
3949 LIBS="-lutf8  $cf_save_LIBS"
3950
3951 cat >conftest.$ac_ext <<_ACEOF
3952 #line 3952 "configure"
3953 #include "confdefs.h"
3954
3955 #include <libutf8.h>
3956 int
3957 main ()
3958 {
3959 putwc(0,0);
3960   ;
3961   return 0;
3962 }
3963 _ACEOF
3964 rm -f conftest.$ac_objext conftest$ac_exeext
3965 if { (eval echo "$as_me:3965: \"$ac_link\"") >&5
3966   (eval $ac_link) 2>&5
3967   ac_status=$?
3968   echo "$as_me:3968: \$? = $ac_status" >&5
3969   (exit $ac_status); } &&
3970          { ac_try='test -s conftest$ac_exeext'
3971   { (eval echo "$as_me:3971: \"$ac_try\"") >&5
3972   (eval $ac_try) 2>&5
3973   ac_status=$?
3974   echo "$as_me:3974: \$? = $ac_status" >&5
3975   (exit $ac_status); }; }; then
3976
3977         cf_cv_find_linkage_utf8=yes
3978         cf_cv_header_path_utf8=/usr/include
3979         cf_cv_library_path_utf8=/usr/lib
3980         cf_cv_library_file_utf8="-lutf8"
3981
3982 else
3983   echo "$as_me: failed program was:" >&5
3984 cat conftest.$ac_ext >&5
3985
3986         cf_cv_find_linkage_utf8=no
3987         LIBS="$cf_save_LIBS"
3988
3989     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
3990
3991 echo "${as_me:-configure}:3991: testing find linkage for utf8 library ..." 1>&5
3992
3993 echo "${as_me:-configure}:3993: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3994
3995     cf_save_CPPFLAGS="$CPPFLAGS"
3996     cf_test_CPPFLAGS="$CPPFLAGS"
3997
3998 cf_search=
3999
4000 # collect the current set of include-directories from compiler flags
4001 cf_header_path_list=""
4002 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4003         for cf_header_path in $CPPFLAGS $CFLAGS
4004         do
4005                 case $cf_header_path in #(vi
4006                 -I*)
4007                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4008
4009 test "$cf_header_path" != "NONE" && \
4010 test -d "$cf_header_path" && \
4011  {
4012         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4013         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4014         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
4015         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
4016         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
4017         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
4018 }
4019
4020                         cf_header_path_list="$cf_header_path_list $cf_search"
4021                         ;;
4022                 esac
4023         done
4024 fi
4025
4026 # add the variations for the package we are looking for
4027
4028 cf_search=
4029
4030 test "/usr" != "$prefix" && \
4031 test -d "/usr" && \
4032 (test $prefix = NONE || test "/usr" != "$prefix") && {
4033         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4034         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4035         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
4036         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
4037         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
4038         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
4039 }
4040
4041 test "$prefix" != "NONE" && \
4042 test -d "$prefix" && \
4043  {
4044         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4045         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4046         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
4047         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
4048         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
4049         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
4050 }
4051
4052 test "/usr/local" != "$prefix" && \
4053 test -d "/usr/local" && \
4054 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4055         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4056         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4057         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
4058         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
4059         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
4060         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
4061 }
4062
4063 test "/opt" != "$prefix" && \
4064 test -d "/opt" && \
4065 (test $prefix = NONE || test "/opt" != "$prefix") && {
4066         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4067         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4068         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
4069         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
4070         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
4071         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
4072 }
4073
4074 test "$HOME" != "$prefix" && \
4075 test -d "$HOME" && \
4076 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4077         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4078         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4079         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
4080         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
4081         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
4082         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
4083 }
4084
4085 test "$includedir" != NONE && \
4086 test "$includedir" != "/usr/include" && \
4087 test -d "$includedir" && {
4088         test -d $includedir &&    cf_search="$cf_search $includedir"
4089         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
4090 }
4091
4092 test "$oldincludedir" != NONE && \
4093 test "$oldincludedir" != "/usr/include" && \
4094 test -d "$oldincludedir" && {
4095         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4096         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
4097 }
4098
4099 cf_search="$cf_search $cf_header_path_list"
4100
4101     for cf_cv_header_path_utf8 in $cf_search
4102     do
4103       if test -d $cf_cv_header_path_utf8 ; then
4104         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
4105
4106 echo "${as_me:-configure}:4106: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
4107
4108         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
4109         cat >conftest.$ac_ext <<_ACEOF
4110 #line 4110 "configure"
4111 #include "confdefs.h"
4112
4113 #include <libutf8.h>
4114 int
4115 main ()
4116 {
4117 putwc(0,0);
4118   ;
4119   return 0;
4120 }
4121 _ACEOF
4122 rm -f conftest.$ac_objext
4123 if { (eval echo "$as_me:4123: \"$ac_compile\"") >&5
4124   (eval $ac_compile) 2>&5
4125   ac_status=$?
4126   echo "$as_me:4126: \$? = $ac_status" >&5
4127   (exit $ac_status); } &&
4128          { ac_try='test -s conftest.$ac_objext'
4129   { (eval echo "$as_me:4129: \"$ac_try\"") >&5
4130   (eval $ac_try) 2>&5
4131   ac_status=$?
4132   echo "$as_me:4132: \$? = $ac_status" >&5
4133   (exit $ac_status); }; }; then
4134
4135             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
4136
4137 echo "${as_me:-configure}:4137: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
4138
4139             cf_cv_find_linkage_utf8=maybe
4140             cf_test_CPPFLAGS="$CPPFLAGS"
4141             break
4142 else
4143   echo "$as_me: failed program was:" >&5
4144 cat conftest.$ac_ext >&5
4145
4146             CPPFLAGS="$cf_save_CPPFLAGS"
4147
4148 fi
4149 rm -f conftest.$ac_objext conftest.$ac_ext
4150       fi
4151     done
4152
4153     if test "$cf_cv_find_linkage_utf8" = maybe ; then
4154
4155 echo "${as_me:-configure}:4155: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
4156
4157       cf_save_LIBS="$LIBS"
4158       cf_save_LDFLAGS="$LDFLAGS"
4159
4160       if test "$cf_cv_find_linkage_utf8" != yes ; then
4161
4162 cf_search=
4163 cf_library_path_list=""
4164 if test -n "${LDFLAGS}${LIBS}" ; then
4165         for cf_library_path in $LDFLAGS $LIBS
4166         do
4167                 case $cf_library_path in #(vi
4168                 -L*)
4169                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
4170
4171 test "$cf_library_path" != "NONE" && \
4172 test -d "$cf_library_path" && \
4173  {
4174         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
4175         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
4176         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
4177         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
4178         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
4179         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
4180 }
4181
4182                         cf_library_path_list="$cf_library_path_list $cf_search"
4183                         ;;
4184                 esac
4185         done
4186 fi
4187
4188 cf_search=
4189
4190 test "/usr" != "$prefix" && \
4191 test -d "/usr" && \
4192 (test $prefix = NONE || test "/usr" != "$prefix") && {
4193         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
4194         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
4195         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
4196         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
4197         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
4198         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
4199 }
4200
4201 test "$prefix" != "NONE" && \
4202 test -d "$prefix" && \
4203  {
4204         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
4205         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4206         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
4207         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
4208         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
4209         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
4210 }
4211
4212 test "/usr/local" != "$prefix" && \
4213 test -d "/usr/local" && \
4214 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4215         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
4216         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
4217         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
4218         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
4219         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
4220         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
4221 }
4222
4223 test "/opt" != "$prefix" && \
4224 test -d "/opt" && \
4225 (test $prefix = NONE || test "/opt" != "$prefix") && {
4226         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
4227         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
4228         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
4229         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
4230         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
4231         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
4232 }
4233
4234 test "$HOME" != "$prefix" && \
4235 test -d "$HOME" && \
4236 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4237         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
4238         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
4239         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
4240         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
4241         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
4242         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
4243 }
4244
4245 cf_search="$cf_library_path_list $cf_search"
4246
4247         for cf_cv_library_path_utf8 in $cf_search
4248         do
4249           if test -d $cf_cv_library_path_utf8 ; then
4250             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
4251
4252 echo "${as_me:-configure}:4252: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
4253
4254             CPPFLAGS="$cf_test_CPPFLAGS"
4255             LIBS="-lutf8  $cf_save_LIBS"
4256             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
4257             cat >conftest.$ac_ext <<_ACEOF
4258 #line 4258 "configure"
4259 #include "confdefs.h"
4260
4261 #include <libutf8.h>
4262 int
4263 main ()
4264 {
4265 putwc(0,0);
4266   ;
4267   return 0;
4268 }
4269 _ACEOF
4270 rm -f conftest.$ac_objext conftest$ac_exeext
4271 if { (eval echo "$as_me:4271: \"$ac_link\"") >&5
4272   (eval $ac_link) 2>&5
4273   ac_status=$?
4274   echo "$as_me:4274: \$? = $ac_status" >&5
4275   (exit $ac_status); } &&
4276          { ac_try='test -s conftest$ac_exeext'
4277   { (eval echo "$as_me:4277: \"$ac_try\"") >&5
4278   (eval $ac_try) 2>&5
4279   ac_status=$?
4280   echo "$as_me:4280: \$? = $ac_status" >&5
4281   (exit $ac_status); }; }; then
4282
4283                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4284
4285 echo "${as_me:-configure}:4285: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4286
4287                 cf_cv_find_linkage_utf8=yes
4288                 cf_cv_library_file_utf8="-lutf8"
4289                 break
4290 else
4291   echo "$as_me: failed program was:" >&5
4292 cat conftest.$ac_ext >&5
4293
4294                 CPPFLAGS="$cf_save_CPPFLAGS"
4295                 LIBS="$cf_save_LIBS"
4296                 LDFLAGS="$cf_save_LDFLAGS"
4297
4298 fi
4299 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4300           fi
4301         done
4302         CPPFLAGS="$cf_save_CPPFLAGS"
4303         LDFLAGS="$cf_save_LDFLAGS"
4304       fi
4305
4306     else
4307       cf_cv_find_linkage_utf8=no
4308     fi
4309
4310 fi
4311 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4312
4313 fi
4314 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4315
4316 LIBS="$cf_save_LIBS"
4317
4318 if test "$cf_cv_find_linkage_utf8" = yes ; then
4319 cf_cv_utf8_lib=add-on
4320 else
4321 cf_cv_utf8_lib=no
4322 fi
4323
4324 fi
4325 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4326 fi
4327 echo "$as_me:4327: result: $cf_cv_utf8_lib" >&5
4328 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4329
4330 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4331 # ncurses/ncursesw:
4332 if test "$cf_cv_utf8_lib" = "add-on" ; then
4333         cat >>confdefs.h <<\EOF
4334 #define HAVE_LIBUTF8_H 1
4335 EOF
4336
4337 if test -n "$cf_cv_header_path_utf8" ; then
4338   for cf_add_incdir in $cf_cv_header_path_utf8
4339   do
4340         while test $cf_add_incdir != /usr/include
4341         do
4342           if test -d $cf_add_incdir
4343           then
4344                 cf_have_incdir=no
4345                 if test -n "$CFLAGS$CPPFLAGS" ; then
4346                   # a loop is needed to ensure we can add subdirs of existing dirs
4347                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4348                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4349                           cf_have_incdir=yes; break
4350                         fi
4351                   done
4352                 fi
4353
4354                 if test "$cf_have_incdir" = no ; then
4355                   if test "$cf_add_incdir" = /usr/local/include ; then
4356                         if test "$GCC" = yes
4357                         then
4358                           cf_save_CPPFLAGS=$CPPFLAGS
4359                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4360                           cat >conftest.$ac_ext <<_ACEOF
4361 #line 4361 "configure"
4362 #include "confdefs.h"
4363 #include <stdio.h>
4364 int
4365 main ()
4366 {
4367 printf("Hello")
4368   ;
4369   return 0;
4370 }
4371 _ACEOF
4372 rm -f conftest.$ac_objext
4373 if { (eval echo "$as_me:4373: \"$ac_compile\"") >&5
4374   (eval $ac_compile) 2>&5
4375   ac_status=$?
4376   echo "$as_me:4376: \$? = $ac_status" >&5
4377   (exit $ac_status); } &&
4378          { ac_try='test -s conftest.$ac_objext'
4379   { (eval echo "$as_me:4379: \"$ac_try\"") >&5
4380   (eval $ac_try) 2>&5
4381   ac_status=$?
4382   echo "$as_me:4382: \$? = $ac_status" >&5
4383   (exit $ac_status); }; }; then
4384   :
4385 else
4386   echo "$as_me: failed program was:" >&5
4387 cat conftest.$ac_ext >&5
4388 cf_have_incdir=yes
4389 fi
4390 rm -f conftest.$ac_objext conftest.$ac_ext
4391                           CPPFLAGS=$cf_save_CPPFLAGS
4392                         fi
4393                   fi
4394                 fi
4395
4396                 if test "$cf_have_incdir" = no ; then
4397                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4398
4399 echo "${as_me:-configure}:4399: testing adding $cf_add_incdir to include-path ..." 1>&5
4400
4401                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4402
4403                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4404                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4405                   cf_add_incdir="$cf_top_incdir"
4406                 else
4407                   break
4408                 fi
4409           fi
4410         done
4411   done
4412 fi
4413
4414 if test -n "$cf_cv_library_path_utf8" ; then
4415   for cf_add_libdir in $cf_cv_library_path_utf8
4416   do
4417     if test $cf_add_libdir = /usr/lib ; then
4418       :
4419     elif test -d $cf_add_libdir
4420     then
4421       cf_have_libdir=no
4422       if test -n "$LDFLAGS$LIBS" ; then
4423         # a loop is needed to ensure we can add subdirs of existing dirs
4424         for cf_test_libdir in $LDFLAGS $LIBS ; do
4425           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4426             cf_have_libdir=yes; break
4427           fi
4428         done
4429       fi
4430       if test "$cf_have_libdir" = no ; then
4431         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4432
4433 echo "${as_me:-configure}:4433: testing adding $cf_add_libdir to library-path ..." 1>&5
4434
4435         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4436       fi
4437     fi
4438   done
4439 fi
4440
4441         LIBS="$cf_cv_library_file_utf8 $LIBS"
4442 fi
4443
4444 cf_ncuconfig_root=ncursesw
4445
4446 echo "Looking for ${cf_ncuconfig_root}-config"
4447 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4448 do
4449   # Extract the first word of "$ac_prog", so it can be a program name with args.
4450 set dummy $ac_prog; ac_word=$2
4451 echo "$as_me:4451: checking for $ac_word" >&5
4452 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4453 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
4454   echo $ECHO_N "(cached) $ECHO_C" >&6
4455 else
4456   case $NCURSES_CONFIG in
4457   [\\/]* | ?:[\\/]*)
4458   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
4459   ;;
4460   *)
4461   ac_save_IFS=$IFS; IFS=$ac_path_separator
4462 ac_dummy="$PATH"
4463 for ac_dir in $ac_dummy; do
4464   IFS=$ac_save_IFS
4465   test -z "$ac_dir" && ac_dir=.
4466   if $as_executable_p "$ac_dir/$ac_word"; then
4467    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
4468    echo "$as_me:4468: found $ac_dir/$ac_word" >&5
4469    break
4470 fi
4471 done
4472
4473   ;;
4474 esac
4475 fi
4476 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
4477
4478 if test -n "$NCURSES_CONFIG"; then
4479   echo "$as_me:4479: result: $NCURSES_CONFIG" >&5
4480 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4481 else
4482   echo "$as_me:4482: result: no" >&5
4483 echo "${ECHO_T}no" >&6
4484 fi
4485
4486   test -n "$NCURSES_CONFIG" && break
4487 done
4488 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
4489
4490 if test "$NCURSES_CONFIG" != none ; then
4491
4492 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4493 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
4494
4495 # even with config script, some packages use no-override for curses.h
4496
4497 echo "$as_me:4497: checking if we have identified curses headers" >&5
4498 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4499 if test "${cf_cv_ncurses_header+set}" = set; then
4500   echo $ECHO_N "(cached) $ECHO_C" >&6
4501 else
4502
4503 cf_cv_ncurses_header=none
4504 for cf_header in  \
4505     ncursesw/curses.h \
4506         ncursesw/ncurses.h \
4507         curses.h \
4508         ncurses.h
4509 do
4510 cat >conftest.$ac_ext <<_ACEOF
4511 #line 4511 "configure"
4512 #include "confdefs.h"
4513 #include <${cf_header}>
4514 int
4515 main ()
4516 {
4517 initscr(); tgoto("?", 0,0)
4518   ;
4519   return 0;
4520 }
4521 _ACEOF
4522 rm -f conftest.$ac_objext
4523 if { (eval echo "$as_me:4523: \"$ac_compile\"") >&5
4524   (eval $ac_compile) 2>&5
4525   ac_status=$?
4526   echo "$as_me:4526: \$? = $ac_status" >&5
4527   (exit $ac_status); } &&
4528          { ac_try='test -s conftest.$ac_objext'
4529   { (eval echo "$as_me:4529: \"$ac_try\"") >&5
4530   (eval $ac_try) 2>&5
4531   ac_status=$?
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit $ac_status); }; }; then
4534   cf_cv_ncurses_header=$cf_header; break
4535 else
4536   echo "$as_me: failed program was:" >&5
4537 cat conftest.$ac_ext >&5
4538 fi
4539 rm -f conftest.$ac_objext conftest.$ac_ext
4540 done
4541
4542 fi
4543 echo "$as_me:4543: result: $cf_cv_ncurses_header" >&5
4544 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4545
4546 if test "$cf_cv_ncurses_header" = none ; then
4547         { { echo "$as_me:4547: error: No curses header-files found" >&5
4548 echo "$as_me: error: No curses header-files found" >&2;}
4549    { (exit 1); exit 1; }; }
4550 fi
4551
4552 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4553
4554 for ac_header in $cf_cv_ncurses_header
4555 do
4556 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4557 echo "$as_me:4557: checking for $ac_header" >&5
4558 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4559 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4560   echo $ECHO_N "(cached) $ECHO_C" >&6
4561 else
4562   cat >conftest.$ac_ext <<_ACEOF
4563 #line 4563 "configure"
4564 #include "confdefs.h"
4565 #include <$ac_header>
4566 _ACEOF
4567 if { (eval echo "$as_me:4567: \"$ac_cpp conftest.$ac_ext\"") >&5
4568   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4569   ac_status=$?
4570   egrep -v '^ *\+' conftest.er1 >conftest.err
4571   rm -f conftest.er1
4572   cat conftest.err >&5
4573   echo "$as_me:4573: \$? = $ac_status" >&5
4574   (exit $ac_status); } >/dev/null; then
4575   if test -s conftest.err; then
4576     ac_cpp_err=$ac_c_preproc_warn_flag
4577   else
4578     ac_cpp_err=
4579   fi
4580 else
4581   ac_cpp_err=yes
4582 fi
4583 if test -z "$ac_cpp_err"; then
4584   eval "$as_ac_Header=yes"
4585 else
4586   echo "$as_me: failed program was:" >&5
4587   cat conftest.$ac_ext >&5
4588   eval "$as_ac_Header=no"
4589 fi
4590 rm -f conftest.err conftest.$ac_ext
4591 fi
4592 echo "$as_me:4592: result: `eval echo '${'$as_ac_Header'}'`" >&5
4593 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4594 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4595   cat >>confdefs.h <<EOF
4596 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4597 EOF
4598
4599 fi
4600 done
4601
4602 cat >>confdefs.h <<\EOF
4603 #define NCURSES 1
4604 EOF
4605
4606 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4607
4608 cat >>confdefs.h <<EOF
4609 #define $cf_nculib_ROOT 1
4610 EOF
4611
4612 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4613
4614 else
4615
4616 cf_ncuhdr_root=ncursesw
4617
4618 test -n "$cf_cv_curses_dir" && \
4619 test "$cf_cv_curses_dir" != "no" && { \
4620
4621 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4622   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4623   do
4624         while test $cf_add_incdir != /usr/include
4625         do
4626           if test -d $cf_add_incdir
4627           then
4628                 cf_have_incdir=no
4629                 if test -n "$CFLAGS$CPPFLAGS" ; then
4630                   # a loop is needed to ensure we can add subdirs of existing dirs
4631                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4632                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4633                           cf_have_incdir=yes; break
4634                         fi
4635                   done
4636                 fi
4637
4638                 if test "$cf_have_incdir" = no ; then
4639                   if test "$cf_add_incdir" = /usr/local/include ; then
4640                         if test "$GCC" = yes
4641                         then
4642                           cf_save_CPPFLAGS=$CPPFLAGS
4643                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4644                           cat >conftest.$ac_ext <<_ACEOF
4645 #line 4645 "configure"
4646 #include "confdefs.h"
4647 #include <stdio.h>
4648 int
4649 main ()
4650 {
4651 printf("Hello")
4652   ;
4653   return 0;
4654 }
4655 _ACEOF
4656 rm -f conftest.$ac_objext
4657 if { (eval echo "$as_me:4657: \"$ac_compile\"") >&5
4658   (eval $ac_compile) 2>&5
4659   ac_status=$?
4660   echo "$as_me:4660: \$? = $ac_status" >&5
4661   (exit $ac_status); } &&
4662          { ac_try='test -s conftest.$ac_objext'
4663   { (eval echo "$as_me:4663: \"$ac_try\"") >&5
4664   (eval $ac_try) 2>&5
4665   ac_status=$?
4666   echo "$as_me:4666: \$? = $ac_status" >&5
4667   (exit $ac_status); }; }; then
4668   :
4669 else
4670   echo "$as_me: failed program was:" >&5
4671 cat conftest.$ac_ext >&5
4672 cf_have_incdir=yes
4673 fi
4674 rm -f conftest.$ac_objext conftest.$ac_ext
4675                           CPPFLAGS=$cf_save_CPPFLAGS
4676                         fi
4677                   fi
4678                 fi
4679
4680                 if test "$cf_have_incdir" = no ; then
4681                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4682
4683 echo "${as_me:-configure}:4683: testing adding $cf_add_incdir to include-path ..." 1>&5
4684
4685                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4686
4687                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4688                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4689                   cf_add_incdir="$cf_top_incdir"
4690                 else
4691                   break
4692                 fi
4693           fi
4694         done
4695   done
4696 fi
4697
4698 }
4699
4700 echo "$as_me:4700: checking for $cf_ncuhdr_root header in include-path" >&5
4701 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4702 if test "${cf_cv_ncurses_h+set}" = set; then
4703   echo $ECHO_N "(cached) $ECHO_C" >&6
4704 else
4705
4706         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4707         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4708         for cf_header in $cf_header_list
4709         do
4710
4711         cat >conftest.$ac_ext <<_ACEOF
4712 #line 4712 "configure"
4713 #include "confdefs.h"
4714
4715 #define _XOPEN_SOURCE_EXTENDED
4716 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4717 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4718
4719 #include <$cf_header>
4720 int
4721 main ()
4722 {
4723
4724 #ifdef NCURSES_VERSION
4725
4726 #ifndef WACS_BSSB
4727         make an error
4728 #endif
4729
4730 printf("%s\n", NCURSES_VERSION);
4731 #else
4732 #ifdef __NCURSES_H
4733 printf("old\n");
4734 #else
4735         make an error
4736 #endif
4737 #endif
4738
4739   ;
4740   return 0;
4741 }
4742 _ACEOF
4743 rm -f conftest.$ac_objext
4744 if { (eval echo "$as_me:4744: \"$ac_compile\"") >&5
4745   (eval $ac_compile) 2>&5
4746   ac_status=$?
4747   echo "$as_me:4747: \$? = $ac_status" >&5
4748   (exit $ac_status); } &&
4749          { ac_try='test -s conftest.$ac_objext'
4750   { (eval echo "$as_me:4750: \"$ac_try\"") >&5
4751   (eval $ac_try) 2>&5
4752   ac_status=$?
4753   echo "$as_me:4753: \$? = $ac_status" >&5
4754   (exit $ac_status); }; }; then
4755   cf_cv_ncurses_h=$cf_header
4756
4757 else
4758   echo "$as_me: failed program was:" >&5
4759 cat conftest.$ac_ext >&5
4760 cf_cv_ncurses_h=no
4761 fi
4762 rm -f conftest.$ac_objext conftest.$ac_ext
4763
4764                 test "$cf_cv_ncurses_h" != no && break
4765         done
4766
4767 fi
4768 echo "$as_me:4768: result: $cf_cv_ncurses_h" >&5
4769 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4770
4771 if test "$cf_cv_ncurses_h" != no ; then
4772         cf_cv_ncurses_header=$cf_cv_ncurses_h
4773 else
4774
4775 echo "$as_me:4775: checking for $cf_ncuhdr_root include-path" >&5
4776 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4777 if test "${cf_cv_ncurses_h2+set}" = set; then
4778   echo $ECHO_N "(cached) $ECHO_C" >&6
4779 else
4780
4781         test -n "$verbose" && echo
4782
4783 cf_search=
4784
4785 # collect the current set of include-directories from compiler flags
4786 cf_header_path_list=""
4787 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4788         for cf_header_path in $CPPFLAGS $CFLAGS
4789         do
4790                 case $cf_header_path in #(vi
4791                 -I*)
4792                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4793
4794 test "$cf_header_path" != "NONE" && \
4795 test -d "$cf_header_path" && \
4796  {
4797         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4798         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4799         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4800         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4801         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4802         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"
4803 }
4804
4805                         cf_header_path_list="$cf_header_path_list $cf_search"
4806                         ;;
4807                 esac
4808         done
4809 fi
4810
4811 # add the variations for the package we are looking for
4812
4813 cf_search=
4814
4815 test "/usr" != "$prefix" && \
4816 test -d "/usr" && \
4817 (test $prefix = NONE || test "/usr" != "$prefix") && {
4818         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4819         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4820         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
4821         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
4822         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
4823         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4824 }
4825
4826 test "$prefix" != "NONE" && \
4827 test -d "$prefix" && \
4828  {
4829         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4830         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4831         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4832         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4833         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4834         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4835 }
4836
4837 test "/usr/local" != "$prefix" && \
4838 test -d "/usr/local" && \
4839 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4840         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4841         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4842         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
4843         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
4844         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
4845         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4846 }
4847
4848 test "/opt" != "$prefix" && \
4849 test -d "/opt" && \
4850 (test $prefix = NONE || test "/opt" != "$prefix") && {
4851         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4852         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4853         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
4854         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
4855         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
4856         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4857 }
4858
4859 test "$HOME" != "$prefix" && \
4860 test -d "$HOME" && \
4861 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4862         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4863         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4864         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
4865         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
4866         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
4867         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4868 }
4869
4870 test "$includedir" != NONE && \
4871 test "$includedir" != "/usr/include" && \
4872 test -d "$includedir" && {
4873         test -d $includedir &&    cf_search="$cf_search $includedir"
4874         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4875 }
4876
4877 test "$oldincludedir" != NONE && \
4878 test "$oldincludedir" != "/usr/include" && \
4879 test -d "$oldincludedir" && {
4880         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4881         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4882 }
4883
4884 cf_search="$cf_search $cf_header_path_list"
4885
4886         test -n "$verbose" && echo search path $cf_search
4887         cf_save2_CPPFLAGS="$CPPFLAGS"
4888         for cf_incdir in $cf_search
4889         do
4890
4891 if test -n "$cf_incdir" ; then
4892   for cf_add_incdir in $cf_incdir
4893   do
4894         while test $cf_add_incdir != /usr/include
4895         do
4896           if test -d $cf_add_incdir
4897           then
4898                 cf_have_incdir=no
4899                 if test -n "$CFLAGS$CPPFLAGS" ; then
4900                   # a loop is needed to ensure we can add subdirs of existing dirs
4901                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4902                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4903                           cf_have_incdir=yes; break
4904                         fi
4905                   done
4906                 fi
4907
4908                 if test "$cf_have_incdir" = no ; then
4909                   if test "$cf_add_incdir" = /usr/local/include ; then
4910                         if test "$GCC" = yes
4911                         then
4912                           cf_save_CPPFLAGS=$CPPFLAGS
4913                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4914                           cat >conftest.$ac_ext <<_ACEOF
4915 #line 4915 "configure"
4916 #include "confdefs.h"
4917 #include <stdio.h>
4918 int
4919 main ()
4920 {
4921 printf("Hello")
4922   ;
4923   return 0;
4924 }
4925 _ACEOF
4926 rm -f conftest.$ac_objext
4927 if { (eval echo "$as_me:4927: \"$ac_compile\"") >&5
4928   (eval $ac_compile) 2>&5
4929   ac_status=$?
4930   echo "$as_me:4930: \$? = $ac_status" >&5
4931   (exit $ac_status); } &&
4932          { ac_try='test -s conftest.$ac_objext'
4933   { (eval echo "$as_me:4933: \"$ac_try\"") >&5
4934   (eval $ac_try) 2>&5
4935   ac_status=$?
4936   echo "$as_me:4936: \$? = $ac_status" >&5
4937   (exit $ac_status); }; }; then
4938   :
4939 else
4940   echo "$as_me: failed program was:" >&5
4941 cat conftest.$ac_ext >&5
4942 cf_have_incdir=yes
4943 fi
4944 rm -f conftest.$ac_objext conftest.$ac_ext
4945                           CPPFLAGS=$cf_save_CPPFLAGS
4946                         fi
4947                   fi
4948                 fi
4949
4950                 if test "$cf_have_incdir" = no ; then
4951                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4952
4953 echo "${as_me:-configure}:4953: testing adding $cf_add_incdir to include-path ..." 1>&5
4954
4955                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4956
4957                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4958                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4959                   cf_add_incdir="$cf_top_incdir"
4960                 else
4961                   break
4962                 fi
4963           fi
4964         done
4965   done
4966 fi
4967
4968                 for cf_header in \
4969                         ncurses.h \
4970                         curses.h
4971                 do
4972
4973         cat >conftest.$ac_ext <<_ACEOF
4974 #line 4974 "configure"
4975 #include "confdefs.h"
4976
4977 #include <$cf_header>
4978 int
4979 main ()
4980 {
4981
4982 #ifdef NCURSES_VERSION
4983
4984 printf("%s\n", NCURSES_VERSION);
4985 #else
4986 #ifdef __NCURSES_H
4987 printf("old\n");
4988 #else
4989         make an error
4990 #endif
4991 #endif
4992
4993   ;
4994   return 0;
4995 }
4996 _ACEOF
4997 rm -f conftest.$ac_objext
4998 if { (eval echo "$as_me:4998: \"$ac_compile\"") >&5
4999   (eval $ac_compile) 2>&5
5000   ac_status=$?
5001   echo "$as_me:5001: \$? = $ac_status" >&5
5002   (exit $ac_status); } &&
5003          { ac_try='test -s conftest.$ac_objext'
5004   { (eval echo "$as_me:5004: \"$ac_try\"") >&5
5005   (eval $ac_try) 2>&5
5006   ac_status=$?
5007   echo "$as_me:5007: \$? = $ac_status" >&5
5008   (exit $ac_status); }; }; then
5009   cf_cv_ncurses_h2=$cf_header
5010
5011 else
5012   echo "$as_me: failed program was:" >&5
5013 cat conftest.$ac_ext >&5
5014 cf_cv_ncurses_h2=no
5015 fi
5016 rm -f conftest.$ac_objext conftest.$ac_ext
5017
5018                         if test "$cf_cv_ncurses_h2" != no ; then
5019                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5020                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5021                                 break
5022                         fi
5023                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5024                 done
5025                 CPPFLAGS="$cf_save2_CPPFLAGS"
5026                 test "$cf_cv_ncurses_h2" != no && break
5027         done
5028         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5028: error: not found" >&5
5029 echo "$as_me: error: not found" >&2;}
5030    { (exit 1); exit 1; }; }
5031
5032 fi
5033 echo "$as_me:5033: result: $cf_cv_ncurses_h2" >&5
5034 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5035
5036         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5037         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5038         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5039                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5040         fi
5041
5042 if test -n "$cf_1st_incdir" ; then
5043   for cf_add_incdir in $cf_1st_incdir
5044   do
5045         while test $cf_add_incdir != /usr/include
5046         do
5047           if test -d $cf_add_incdir
5048           then
5049                 cf_have_incdir=no
5050                 if test -n "$CFLAGS$CPPFLAGS" ; then
5051                   # a loop is needed to ensure we can add subdirs of existing dirs
5052                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5053                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5054                           cf_have_incdir=yes; break
5055                         fi
5056                   done
5057                 fi
5058
5059                 if test "$cf_have_incdir" = no ; then
5060                   if test "$cf_add_incdir" = /usr/local/include ; then
5061                         if test "$GCC" = yes
5062                         then
5063                           cf_save_CPPFLAGS=$CPPFLAGS
5064                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5065                           cat >conftest.$ac_ext <<_ACEOF
5066 #line 5066 "configure"
5067 #include "confdefs.h"
5068 #include <stdio.h>
5069 int
5070 main ()
5071 {
5072 printf("Hello")
5073   ;
5074   return 0;
5075 }
5076 _ACEOF
5077 rm -f conftest.$ac_objext
5078 if { (eval echo "$as_me:5078: \"$ac_compile\"") >&5
5079   (eval $ac_compile) 2>&5
5080   ac_status=$?
5081   echo "$as_me:5081: \$? = $ac_status" >&5
5082   (exit $ac_status); } &&
5083          { ac_try='test -s conftest.$ac_objext'
5084   { (eval echo "$as_me:5084: \"$ac_try\"") >&5
5085   (eval $ac_try) 2>&5
5086   ac_status=$?
5087   echo "$as_me:5087: \$? = $ac_status" >&5
5088   (exit $ac_status); }; }; then
5089   :
5090 else
5091   echo "$as_me: failed program was:" >&5
5092 cat conftest.$ac_ext >&5
5093 cf_have_incdir=yes
5094 fi
5095 rm -f conftest.$ac_objext conftest.$ac_ext
5096                           CPPFLAGS=$cf_save_CPPFLAGS
5097                         fi
5098                   fi
5099                 fi
5100
5101                 if test "$cf_have_incdir" = no ; then
5102                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5103
5104 echo "${as_me:-configure}:5104: testing adding $cf_add_incdir to include-path ..." 1>&5
5105
5106                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5107
5108                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5109                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5110                   cf_add_incdir="$cf_top_incdir"
5111                 else
5112                   break
5113                 fi
5114           fi
5115         done
5116   done
5117 fi
5118
5119 fi
5120
5121 # Set definitions to allow ifdef'ing for ncurses.h
5122
5123 case $cf_cv_ncurses_header in # (vi
5124 *ncurses.h)
5125         cat >>confdefs.h <<\EOF
5126 #define HAVE_NCURSES_H 1
5127 EOF
5128
5129         ;;
5130 esac
5131
5132 case $cf_cv_ncurses_header in # (vi
5133 ncurses/curses.h|ncurses/ncurses.h)
5134         cat >>confdefs.h <<\EOF
5135 #define HAVE_NCURSES_NCURSES_H 1
5136 EOF
5137
5138         ;;
5139 ncursesw/curses.h|ncursesw/ncurses.h)
5140         cat >>confdefs.h <<\EOF
5141 #define HAVE_NCURSESW_NCURSES_H 1
5142 EOF
5143
5144         ;;
5145 esac
5146
5147 echo "$as_me:5147: checking for terminfo header" >&5
5148 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5149 if test "${cf_cv_term_header+set}" = set; then
5150   echo $ECHO_N "(cached) $ECHO_C" >&6
5151 else
5152
5153 case ${cf_cv_ncurses_header} in #(vi
5154 */ncurses.h|*/ncursesw.h) #(vi
5155         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5156         ;;
5157 *)
5158         cf_term_header=term.h
5159         ;;
5160 esac
5161
5162 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5163 do
5164 cat >conftest.$ac_ext <<_ACEOF
5165 #line 5165 "configure"
5166 #include "confdefs.h"
5167 #include <stdio.h>
5168 #include <${cf_cv_ncurses_header:-curses.h}>
5169 #include <$cf_test>
5170
5171 int
5172 main ()
5173 {
5174 int x = auto_left_margin
5175   ;
5176   return 0;
5177 }
5178 _ACEOF
5179 rm -f conftest.$ac_objext
5180 if { (eval echo "$as_me:5180: \"$ac_compile\"") >&5
5181   (eval $ac_compile) 2>&5
5182   ac_status=$?
5183   echo "$as_me:5183: \$? = $ac_status" >&5
5184   (exit $ac_status); } &&
5185          { ac_try='test -s conftest.$ac_objext'
5186   { (eval echo "$as_me:5186: \"$ac_try\"") >&5
5187   (eval $ac_try) 2>&5
5188   ac_status=$?
5189   echo "$as_me:5189: \$? = $ac_status" >&5
5190   (exit $ac_status); }; }; then
5191
5192         cf_cv_term_header="$cf_test"
5193 else
5194   echo "$as_me: failed program was:" >&5
5195 cat conftest.$ac_ext >&5
5196
5197         cf_cv_term_header=unknown
5198
5199 fi
5200 rm -f conftest.$ac_objext conftest.$ac_ext
5201         test "$cf_cv_term_header" != unknown && break
5202 done
5203
5204 fi
5205 echo "$as_me:5205: result: $cf_cv_term_header" >&5
5206 echo "${ECHO_T}$cf_cv_term_header" >&6
5207
5208 # Set definitions to allow ifdef'ing to accommodate subdirectories
5209
5210 case $cf_cv_term_header in # (vi
5211 *term.h)
5212         cat >>confdefs.h <<\EOF
5213 #define HAVE_TERM_H 1
5214 EOF
5215
5216         ;;
5217 esac
5218
5219 case $cf_cv_term_header in # (vi
5220 ncurses/term.h) #(vi
5221         cat >>confdefs.h <<\EOF
5222 #define HAVE_NCURSES_TERM_H 1
5223 EOF
5224
5225         ;;
5226 ncursesw/term.h)
5227         cat >>confdefs.h <<\EOF
5228 #define HAVE_NCURSESW_TERM_H 1
5229 EOF
5230
5231         ;;
5232 esac
5233
5234 # some applications need this, but should check for NCURSES_VERSION
5235 cat >>confdefs.h <<\EOF
5236 #define NCURSES 1
5237 EOF
5238
5239 echo "$as_me:5239: checking for ncurses version" >&5
5240 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5241 if test "${cf_cv_ncurses_version+set}" = set; then
5242   echo $ECHO_N "(cached) $ECHO_C" >&6
5243 else
5244
5245         cf_cv_ncurses_version=no
5246         cf_tempfile=out$$
5247         rm -f $cf_tempfile
5248         if test "$cross_compiling" = yes; then
5249
5250         # This will not work if the preprocessor splits the line after the
5251         # Autoconf token.  The 'unproto' program does that.
5252         cat > conftest.$ac_ext <<EOF
5253 #include <${cf_cv_ncurses_header:-curses.h}>
5254 #undef Autoconf
5255 #ifdef NCURSES_VERSION
5256 Autoconf NCURSES_VERSION
5257 #else
5258 #ifdef __NCURSES_H
5259 Autoconf "old"
5260 #endif
5261 ;
5262 #endif
5263 EOF
5264         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5265         { (eval echo "$as_me:5265: \"$cf_try\"") >&5
5266   (eval $cf_try) 2>&5
5267   ac_status=$?
5268   echo "$as_me:5268: \$? = $ac_status" >&5
5269   (exit $ac_status); }
5270         if test -f conftest.out ; then
5271                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5272                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5273                 rm -f conftest.out
5274         fi
5275
5276 else
5277   cat >conftest.$ac_ext <<_ACEOF
5278 #line 5278 "configure"
5279 #include "confdefs.h"
5280
5281 #include <${cf_cv_ncurses_header:-curses.h}>
5282 #include <stdio.h>
5283 int main()
5284 {
5285         FILE *fp = fopen("$cf_tempfile", "w");
5286 #ifdef NCURSES_VERSION
5287 # ifdef NCURSES_VERSION_PATCH
5288         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5289 # else
5290         fprintf(fp, "%s\n", NCURSES_VERSION);
5291 # endif
5292 #else
5293 # ifdef __NCURSES_H
5294         fprintf(fp, "old\n");
5295 # else
5296         make an error
5297 # endif
5298 #endif
5299         ${cf_cv_main_return:-return}(0);
5300 }
5301 _ACEOF
5302 rm -f conftest$ac_exeext
5303 if { (eval echo "$as_me:5303: \"$ac_link\"") >&5
5304   (eval $ac_link) 2>&5
5305   ac_status=$?
5306   echo "$as_me:5306: \$? = $ac_status" >&5
5307   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5308   { (eval echo "$as_me:5308: \"$ac_try\"") >&5
5309   (eval $ac_try) 2>&5
5310   ac_status=$?
5311   echo "$as_me:5311: \$? = $ac_status" >&5
5312   (exit $ac_status); }; }; then
5313
5314         cf_cv_ncurses_version=`cat $cf_tempfile`
5315 else
5316   echo "$as_me: program exited with status $ac_status" >&5
5317 echo "$as_me: failed program was:" >&5
5318 cat conftest.$ac_ext >&5
5319 fi
5320 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5321 fi
5322         rm -f $cf_tempfile
5323
5324 fi
5325 echo "$as_me:5325: result: $cf_cv_ncurses_version" >&5
5326 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5327 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5328 #define NCURSES 1
5329 EOF
5330
5331 cf_nculib_root=ncursesw
5332         # This works, except for the special case where we find gpm, but
5333         # ncurses is in a nonstandard location via $LIBS, and we really want
5334         # to link gpm.
5335 cf_ncurses_LIBS=""
5336 cf_ncurses_SAVE="$LIBS"
5337 echo "$as_me:5337: checking for Gpm_Open in -lgpm" >&5
5338 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5339 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5340   echo $ECHO_N "(cached) $ECHO_C" >&6
5341 else
5342   ac_check_lib_save_LIBS=$LIBS
5343 LIBS="-lgpm  $LIBS"
5344 cat >conftest.$ac_ext <<_ACEOF
5345 #line 5345 "configure"
5346 #include "confdefs.h"
5347
5348 /* Override any gcc2 internal prototype to avoid an error.  */
5349 #ifdef __cplusplus
5350 extern "C"
5351 #endif
5352 /* We use char because int might match the return type of a gcc2
5353    builtin and then its argument prototype would still apply.  */
5354 char Gpm_Open ();
5355 int
5356 main ()
5357 {
5358 Gpm_Open ();
5359   ;
5360   return 0;
5361 }
5362 _ACEOF
5363 rm -f conftest.$ac_objext conftest$ac_exeext
5364 if { (eval echo "$as_me:5364: \"$ac_link\"") >&5
5365   (eval $ac_link) 2>&5
5366   ac_status=$?
5367   echo "$as_me:5367: \$? = $ac_status" >&5
5368   (exit $ac_status); } &&
5369          { ac_try='test -s conftest$ac_exeext'
5370   { (eval echo "$as_me:5370: \"$ac_try\"") >&5
5371   (eval $ac_try) 2>&5
5372   ac_status=$?
5373   echo "$as_me:5373: \$? = $ac_status" >&5
5374   (exit $ac_status); }; }; then
5375   ac_cv_lib_gpm_Gpm_Open=yes
5376 else
5377   echo "$as_me: failed program was:" >&5
5378 cat conftest.$ac_ext >&5
5379 ac_cv_lib_gpm_Gpm_Open=no
5380 fi
5381 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5382 LIBS=$ac_check_lib_save_LIBS
5383 fi
5384 echo "$as_me:5384: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5385 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5386 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5387   echo "$as_me:5387: checking for initscr in -lgpm" >&5
5388 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5389 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5390   echo $ECHO_N "(cached) $ECHO_C" >&6
5391 else
5392   ac_check_lib_save_LIBS=$LIBS
5393 LIBS="-lgpm  $LIBS"
5394 cat >conftest.$ac_ext <<_ACEOF
5395 #line 5395 "configure"
5396 #include "confdefs.h"
5397
5398 /* Override any gcc2 internal prototype to avoid an error.  */
5399 #ifdef __cplusplus
5400 extern "C"
5401 #endif
5402 /* We use char because int might match the return type of a gcc2
5403    builtin and then its argument prototype would still apply.  */
5404 char initscr ();
5405 int
5406 main ()
5407 {
5408 initscr ();
5409   ;
5410   return 0;
5411 }
5412 _ACEOF
5413 rm -f conftest.$ac_objext conftest$ac_exeext
5414 if { (eval echo "$as_me:5414: \"$ac_link\"") >&5
5415   (eval $ac_link) 2>&5
5416   ac_status=$?
5417   echo "$as_me:5417: \$? = $ac_status" >&5
5418   (exit $ac_status); } &&
5419          { ac_try='test -s conftest$ac_exeext'
5420   { (eval echo "$as_me:5420: \"$ac_try\"") >&5
5421   (eval $ac_try) 2>&5
5422   ac_status=$?
5423   echo "$as_me:5423: \$? = $ac_status" >&5
5424   (exit $ac_status); }; }; then
5425   ac_cv_lib_gpm_initscr=yes
5426 else
5427   echo "$as_me: failed program was:" >&5
5428 cat conftest.$ac_ext >&5
5429 ac_cv_lib_gpm_initscr=no
5430 fi
5431 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5432 LIBS=$ac_check_lib_save_LIBS
5433 fi
5434 echo "$as_me:5434: result: $ac_cv_lib_gpm_initscr" >&5
5435 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5436 if test $ac_cv_lib_gpm_initscr = yes; then
5437   LIBS="$cf_ncurses_SAVE"
5438 else
5439   cf_ncurses_LIBS="-lgpm"
5440 fi
5441
5442 fi
5443
5444 case $host_os in #(vi
5445 freebsd*)
5446         # This is only necessary if you are linking against an obsolete
5447         # version of ncurses (but it should do no harm, since it's static).
5448         if test "$cf_nculib_root" = ncurses ; then
5449                 echo "$as_me:5449: checking for tgoto in -lmytinfo" >&5
5450 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5451 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5452   echo $ECHO_N "(cached) $ECHO_C" >&6
5453 else
5454   ac_check_lib_save_LIBS=$LIBS
5455 LIBS="-lmytinfo  $LIBS"
5456 cat >conftest.$ac_ext <<_ACEOF
5457 #line 5457 "configure"
5458 #include "confdefs.h"
5459
5460 /* Override any gcc2 internal prototype to avoid an error.  */
5461 #ifdef __cplusplus
5462 extern "C"
5463 #endif
5464 /* We use char because int might match the return type of a gcc2
5465    builtin and then its argument prototype would still apply.  */
5466 char tgoto ();
5467 int
5468 main ()
5469 {
5470 tgoto ();
5471   ;
5472   return 0;
5473 }
5474 _ACEOF
5475 rm -f conftest.$ac_objext conftest$ac_exeext
5476 if { (eval echo "$as_me:5476: \"$ac_link\"") >&5
5477   (eval $ac_link) 2>&5
5478   ac_status=$?
5479   echo "$as_me:5479: \$? = $ac_status" >&5
5480   (exit $ac_status); } &&
5481          { ac_try='test -s conftest$ac_exeext'
5482   { (eval echo "$as_me:5482: \"$ac_try\"") >&5
5483   (eval $ac_try) 2>&5
5484   ac_status=$?
5485   echo "$as_me:5485: \$? = $ac_status" >&5
5486   (exit $ac_status); }; }; then
5487   ac_cv_lib_mytinfo_tgoto=yes
5488 else
5489   echo "$as_me: failed program was:" >&5
5490 cat conftest.$ac_ext >&5
5491 ac_cv_lib_mytinfo_tgoto=no
5492 fi
5493 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5494 LIBS=$ac_check_lib_save_LIBS
5495 fi
5496 echo "$as_me:5496: result: $ac_cv_lib_mytinfo_tgoto" >&5
5497 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5498 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5499   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5500 fi
5501
5502         fi
5503         ;;
5504 esac
5505
5506 LIBS="$cf_ncurses_LIBS $LIBS"
5507
5508 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5509 then
5510         LIBS="-l$cf_nculib_root $LIBS"
5511 else
5512
5513         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5514         cf_libdir=""
5515         echo "$as_me:5515: checking for initscr" >&5
5516 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5517 if test "${ac_cv_func_initscr+set}" = set; then
5518   echo $ECHO_N "(cached) $ECHO_C" >&6
5519 else
5520   cat >conftest.$ac_ext <<_ACEOF
5521 #line 5521 "configure"
5522 #include "confdefs.h"
5523 /* System header to define __stub macros and hopefully few prototypes,
5524     which can conflict with char initscr (); below.  */
5525 #include <assert.h>
5526 /* Override any gcc2 internal prototype to avoid an error.  */
5527 #ifdef __cplusplus
5528 extern "C"
5529 #endif
5530 /* We use char because int might match the return type of a gcc2
5531    builtin and then its argument prototype would still apply.  */
5532 char initscr ();
5533 char (*f) ();
5534
5535 int
5536 main ()
5537 {
5538 /* The GNU C library defines this for functions which it implements
5539     to always fail with ENOSYS.  Some functions are actually named
5540     something starting with __ and the normal name is an alias.  */
5541 #if defined (__stub_initscr) || defined (__stub___initscr)
5542 choke me
5543 #else
5544 f = initscr;
5545 #endif
5546
5547   ;
5548   return 0;
5549 }
5550 _ACEOF
5551 rm -f conftest.$ac_objext conftest$ac_exeext
5552 if { (eval echo "$as_me:5552: \"$ac_link\"") >&5
5553   (eval $ac_link) 2>&5
5554   ac_status=$?
5555   echo "$as_me:5555: \$? = $ac_status" >&5
5556   (exit $ac_status); } &&
5557          { ac_try='test -s conftest$ac_exeext'
5558   { (eval echo "$as_me:5558: \"$ac_try\"") >&5
5559   (eval $ac_try) 2>&5
5560   ac_status=$?
5561   echo "$as_me:5561: \$? = $ac_status" >&5
5562   (exit $ac_status); }; }; then
5563   ac_cv_func_initscr=yes
5564 else
5565   echo "$as_me: failed program was:" >&5
5566 cat conftest.$ac_ext >&5
5567 ac_cv_func_initscr=no
5568 fi
5569 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5570 fi
5571 echo "$as_me:5571: result: $ac_cv_func_initscr" >&5
5572 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5573 if test $ac_cv_func_initscr = yes; then
5574   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5575 else
5576
5577                 cf_save_LIBS="$LIBS"
5578                 echo "$as_me:5578: checking for initscr in -l$cf_nculib_root" >&5
5579 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5580                 LIBS="-l$cf_nculib_root $LIBS"
5581                 cat >conftest.$ac_ext <<_ACEOF
5582 #line 5582 "configure"
5583 #include "confdefs.h"
5584 #include <${cf_cv_ncurses_header:-curses.h}>
5585 int
5586 main ()
5587 {
5588 initscr()
5589   ;
5590   return 0;
5591 }
5592 _ACEOF
5593 rm -f conftest.$ac_objext conftest$ac_exeext
5594 if { (eval echo "$as_me:5594: \"$ac_link\"") >&5
5595   (eval $ac_link) 2>&5
5596   ac_status=$?
5597   echo "$as_me:5597: \$? = $ac_status" >&5
5598   (exit $ac_status); } &&
5599          { ac_try='test -s conftest$ac_exeext'
5600   { (eval echo "$as_me:5600: \"$ac_try\"") >&5
5601   (eval $ac_try) 2>&5
5602   ac_status=$?
5603   echo "$as_me:5603: \$? = $ac_status" >&5
5604   (exit $ac_status); }; }; then
5605   echo "$as_me:5605: result: yes" >&5
5606 echo "${ECHO_T}yes" >&6
5607                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5608
5609 else
5610   echo "$as_me: failed program was:" >&5
5611 cat conftest.$ac_ext >&5
5612 echo "$as_me:5612: result: no" >&5
5613 echo "${ECHO_T}no" >&6
5614
5615 cf_search=
5616 cf_library_path_list=""
5617 if test -n "${LDFLAGS}${LIBS}" ; then
5618         for cf_library_path in $LDFLAGS $LIBS
5619         do
5620                 case $cf_library_path in #(vi
5621                 -L*)
5622                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5623
5624 test "$cf_library_path" != "NONE" && \
5625 test -d "$cf_library_path" && \
5626  {
5627         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5628         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5629         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5630         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5631         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5632         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"
5633 }
5634
5635                         cf_library_path_list="$cf_library_path_list $cf_search"
5636                         ;;
5637                 esac
5638         done
5639 fi
5640
5641 cf_search=
5642
5643 test "/usr" != "$prefix" && \
5644 test -d "/usr" && \
5645 (test $prefix = NONE || test "/usr" != "$prefix") && {
5646         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
5647         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
5648         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
5649         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
5650         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
5651         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
5652 }
5653
5654 test "$prefix" != "NONE" && \
5655 test -d "$prefix" && \
5656  {
5657         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5658         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5659         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5660         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5661         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5662         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5663 }
5664
5665 test "/usr/local" != "$prefix" && \
5666 test -d "/usr/local" && \
5667 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
5668         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
5669         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
5670         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
5671         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
5672         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
5673         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
5674 }
5675
5676 test "/opt" != "$prefix" && \
5677 test -d "/opt" && \
5678 (test $prefix = NONE || test "/opt" != "$prefix") && {
5679         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
5680         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
5681         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
5682         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
5683         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
5684         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
5685 }
5686
5687 test "$HOME" != "$prefix" && \
5688 test -d "$HOME" && \
5689 (test $prefix = NONE || test "$HOME" != "$prefix") && {
5690         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
5691         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
5692         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
5693         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
5694         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
5695         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
5696 }
5697
5698 cf_search="$cf_library_path_list $cf_search"
5699
5700                         for cf_libdir in $cf_search
5701                         do
5702                                 echo "$as_me:5702: checking for -l$cf_nculib_root in $cf_libdir" >&5
5703 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5704                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5705                                 cat >conftest.$ac_ext <<_ACEOF
5706 #line 5706 "configure"
5707 #include "confdefs.h"
5708 #include <${cf_cv_ncurses_header:-curses.h}>
5709 int
5710 main ()
5711 {
5712 initscr()
5713   ;
5714   return 0;
5715 }
5716 _ACEOF
5717 rm -f conftest.$ac_objext conftest$ac_exeext
5718 if { (eval echo "$as_me:5718: \"$ac_link\"") >&5
5719   (eval $ac_link) 2>&5
5720   ac_status=$?
5721   echo "$as_me:5721: \$? = $ac_status" >&5
5722   (exit $ac_status); } &&
5723          { ac_try='test -s conftest$ac_exeext'
5724   { (eval echo "$as_me:5724: \"$ac_try\"") >&5
5725   (eval $ac_try) 2>&5
5726   ac_status=$?
5727   echo "$as_me:5727: \$? = $ac_status" >&5
5728   (exit $ac_status); }; }; then
5729   echo "$as_me:5729: result: yes" >&5
5730 echo "${ECHO_T}yes" >&6
5731                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5732                                          break
5733 else
5734   echo "$as_me: failed program was:" >&5
5735 cat conftest.$ac_ext >&5
5736 echo "$as_me:5736: result: no" >&5
5737 echo "${ECHO_T}no" >&6
5738                                          LIBS="$cf_save_LIBS"
5739 fi
5740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5741                         done
5742
5743 fi
5744 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5745
5746 fi
5747
5748 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5749
5750 if test $cf_found_library = no ; then
5751         { { echo "$as_me:5751: error: Cannot link $cf_nculib_root library" >&5
5752 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5753    { (exit 1); exit 1; }; }
5754 fi
5755
5756 fi
5757
5758 if test -n "$cf_ncurses_LIBS" ; then
5759         echo "$as_me:5759: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5760 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5761         cf_ncurses_SAVE="$LIBS"
5762         for p in $cf_ncurses_LIBS ; do
5763                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5764                 if test "$q" != "$LIBS" ; then
5765                         LIBS="$q"
5766                 fi
5767         done
5768         cat >conftest.$ac_ext <<_ACEOF
5769 #line 5769 "configure"
5770 #include "confdefs.h"
5771 #include <${cf_cv_ncurses_header:-curses.h}>
5772 int
5773 main ()
5774 {
5775 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5776   ;
5777   return 0;
5778 }
5779 _ACEOF
5780 rm -f conftest.$ac_objext conftest$ac_exeext
5781 if { (eval echo "$as_me:5781: \"$ac_link\"") >&5
5782   (eval $ac_link) 2>&5
5783   ac_status=$?
5784   echo "$as_me:5784: \$? = $ac_status" >&5
5785   (exit $ac_status); } &&
5786          { ac_try='test -s conftest$ac_exeext'
5787   { (eval echo "$as_me:5787: \"$ac_try\"") >&5
5788   (eval $ac_try) 2>&5
5789   ac_status=$?
5790   echo "$as_me:5790: \$? = $ac_status" >&5
5791   (exit $ac_status); }; }; then
5792   echo "$as_me:5792: result: yes" >&5
5793 echo "${ECHO_T}yes" >&6
5794 else
5795   echo "$as_me: failed program was:" >&5
5796 cat conftest.$ac_ext >&5
5797 echo "$as_me:5797: result: no" >&5
5798 echo "${ECHO_T}no" >&6
5799                  LIBS="$cf_ncurses_SAVE"
5800 fi
5801 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5802 fi
5803
5804 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5805
5806 cat >>confdefs.h <<EOF
5807 #define $cf_nculib_ROOT 1
5808 EOF
5809
5810 fi
5811
5812 else
5813
5814 cf_ncuconfig_root=ncurses
5815
5816 echo "Looking for ${cf_ncuconfig_root}-config"
5817 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5818 do
5819   # Extract the first word of "$ac_prog", so it can be a program name with args.
5820 set dummy $ac_prog; ac_word=$2
5821 echo "$as_me:5821: checking for $ac_word" >&5
5822 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5823 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
5824   echo $ECHO_N "(cached) $ECHO_C" >&6
5825 else
5826   case $NCURSES_CONFIG in
5827   [\\/]* | ?:[\\/]*)
5828   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
5829   ;;
5830   *)
5831   ac_save_IFS=$IFS; IFS=$ac_path_separator
5832 ac_dummy="$PATH"
5833 for ac_dir in $ac_dummy; do
5834   IFS=$ac_save_IFS
5835   test -z "$ac_dir" && ac_dir=.
5836   if $as_executable_p "$ac_dir/$ac_word"; then
5837    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
5838    echo "$as_me:5838: found $ac_dir/$ac_word" >&5
5839    break
5840 fi
5841 done
5842
5843   ;;
5844 esac
5845 fi
5846 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
5847
5848 if test -n "$NCURSES_CONFIG"; then
5849   echo "$as_me:5849: result: $NCURSES_CONFIG" >&5
5850 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5851 else
5852   echo "$as_me:5852: result: no" >&5
5853 echo "${ECHO_T}no" >&6
5854 fi
5855
5856   test -n "$NCURSES_CONFIG" && break
5857 done
5858 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
5859
5860 if test "$NCURSES_CONFIG" != none ; then
5861
5862 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5863 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5864
5865 # even with config script, some packages use no-override for curses.h
5866
5867 echo "$as_me:5867: checking if we have identified curses headers" >&5
5868 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5869 if test "${cf_cv_ncurses_header+set}" = set; then
5870   echo $ECHO_N "(cached) $ECHO_C" >&6
5871 else
5872
5873 cf_cv_ncurses_header=none
5874 for cf_header in  \
5875     ncurses/curses.h \
5876         ncurses/ncurses.h \
5877         curses.h \
5878         ncurses.h
5879 do
5880 cat >conftest.$ac_ext <<_ACEOF
5881 #line 5881 "configure"
5882 #include "confdefs.h"
5883 #include <${cf_header}>
5884 int
5885 main ()
5886 {
5887 initscr(); tgoto("?", 0,0)
5888   ;
5889   return 0;
5890 }
5891 _ACEOF
5892 rm -f conftest.$ac_objext
5893 if { (eval echo "$as_me:5893: \"$ac_compile\"") >&5
5894   (eval $ac_compile) 2>&5
5895   ac_status=$?
5896   echo "$as_me:5896: \$? = $ac_status" >&5
5897   (exit $ac_status); } &&
5898          { ac_try='test -s conftest.$ac_objext'
5899   { (eval echo "$as_me:5899: \"$ac_try\"") >&5
5900   (eval $ac_try) 2>&5
5901   ac_status=$?
5902   echo "$as_me:5902: \$? = $ac_status" >&5
5903   (exit $ac_status); }; }; then
5904   cf_cv_ncurses_header=$cf_header; break
5905 else
5906   echo "$as_me: failed program was:" >&5
5907 cat conftest.$ac_ext >&5
5908 fi
5909 rm -f conftest.$ac_objext conftest.$ac_ext
5910 done
5911
5912 fi
5913 echo "$as_me:5913: result: $cf_cv_ncurses_header" >&5
5914 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5915
5916 if test "$cf_cv_ncurses_header" = none ; then
5917         { { echo "$as_me:5917: error: No curses header-files found" >&5
5918 echo "$as_me: error: No curses header-files found" >&2;}
5919    { (exit 1); exit 1; }; }
5920 fi
5921
5922 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5923
5924 for ac_header in $cf_cv_ncurses_header
5925 do
5926 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5927 echo "$as_me:5927: checking for $ac_header" >&5
5928 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5929 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5930   echo $ECHO_N "(cached) $ECHO_C" >&6
5931 else
5932   cat >conftest.$ac_ext <<_ACEOF
5933 #line 5933 "configure"
5934 #include "confdefs.h"
5935 #include <$ac_header>
5936 _ACEOF
5937 if { (eval echo "$as_me:5937: \"$ac_cpp conftest.$ac_ext\"") >&5
5938   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5939   ac_status=$?
5940   egrep -v '^ *\+' conftest.er1 >conftest.err
5941   rm -f conftest.er1
5942   cat conftest.err >&5
5943   echo "$as_me:5943: \$? = $ac_status" >&5
5944   (exit $ac_status); } >/dev/null; then
5945   if test -s conftest.err; then
5946     ac_cpp_err=$ac_c_preproc_warn_flag
5947   else
5948     ac_cpp_err=
5949   fi
5950 else
5951   ac_cpp_err=yes
5952 fi
5953 if test -z "$ac_cpp_err"; then
5954   eval "$as_ac_Header=yes"
5955 else
5956   echo "$as_me: failed program was:" >&5
5957   cat conftest.$ac_ext >&5
5958   eval "$as_ac_Header=no"
5959 fi
5960 rm -f conftest.err conftest.$ac_ext
5961 fi
5962 echo "$as_me:5962: result: `eval echo '${'$as_ac_Header'}'`" >&5
5963 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5964 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5965   cat >>confdefs.h <<EOF
5966 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5967 EOF
5968
5969 fi
5970 done
5971
5972 cat >>confdefs.h <<\EOF
5973 #define NCURSES 1
5974 EOF
5975
5976 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5977
5978 cat >>confdefs.h <<EOF
5979 #define $cf_nculib_ROOT 1
5980 EOF
5981
5982 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5983
5984 else
5985
5986 cf_ncuhdr_root=ncurses
5987
5988 test -n "$cf_cv_curses_dir" && \
5989 test "$cf_cv_curses_dir" != "no" && { \
5990
5991 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5992   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5993   do
5994         while test $cf_add_incdir != /usr/include
5995         do
5996           if test -d $cf_add_incdir
5997           then
5998                 cf_have_incdir=no
5999                 if test -n "$CFLAGS$CPPFLAGS" ; then
6000                   # a loop is needed to ensure we can add subdirs of existing dirs
6001                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6002                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6003                           cf_have_incdir=yes; break
6004                         fi
6005                   done
6006                 fi
6007
6008                 if test "$cf_have_incdir" = no ; then
6009                   if test "$cf_add_incdir" = /usr/local/include ; then
6010                         if test "$GCC" = yes
6011                         then
6012                           cf_save_CPPFLAGS=$CPPFLAGS
6013                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6014                           cat >conftest.$ac_ext <<_ACEOF
6015 #line 6015 "configure"
6016 #include "confdefs.h"
6017 #include <stdio.h>
6018 int
6019 main ()
6020 {
6021 printf("Hello")
6022   ;
6023   return 0;
6024 }
6025 _ACEOF
6026 rm -f conftest.$ac_objext
6027 if { (eval echo "$as_me:6027: \"$ac_compile\"") >&5
6028   (eval $ac_compile) 2>&5
6029   ac_status=$?
6030   echo "$as_me:6030: \$? = $ac_status" >&5
6031   (exit $ac_status); } &&
6032          { ac_try='test -s conftest.$ac_objext'
6033   { (eval echo "$as_me:6033: \"$ac_try\"") >&5
6034   (eval $ac_try) 2>&5
6035   ac_status=$?
6036   echo "$as_me:6036: \$? = $ac_status" >&5
6037   (exit $ac_status); }; }; then
6038   :
6039 else
6040   echo "$as_me: failed program was:" >&5
6041 cat conftest.$ac_ext >&5
6042 cf_have_incdir=yes
6043 fi
6044 rm -f conftest.$ac_objext conftest.$ac_ext
6045                           CPPFLAGS=$cf_save_CPPFLAGS
6046                         fi
6047                   fi
6048                 fi
6049
6050                 if test "$cf_have_incdir" = no ; then
6051                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6052
6053 echo "${as_me:-configure}:6053: testing adding $cf_add_incdir to include-path ..." 1>&5
6054
6055                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6056
6057                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6058                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6059                   cf_add_incdir="$cf_top_incdir"
6060                 else
6061                   break
6062                 fi
6063           fi
6064         done
6065   done
6066 fi
6067
6068 }
6069
6070 echo "$as_me:6070: checking for $cf_ncuhdr_root header in include-path" >&5
6071 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6072 if test "${cf_cv_ncurses_h+set}" = set; then
6073   echo $ECHO_N "(cached) $ECHO_C" >&6
6074 else
6075
6076         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6077         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6078         for cf_header in $cf_header_list
6079         do
6080
6081         cat >conftest.$ac_ext <<_ACEOF
6082 #line 6082 "configure"
6083 #include "confdefs.h"
6084
6085 #include <$cf_header>
6086 int
6087 main ()
6088 {
6089
6090 #ifdef NCURSES_VERSION
6091
6092 printf("%s\n", NCURSES_VERSION);
6093 #else
6094 #ifdef __NCURSES_H
6095 printf("old\n");
6096 #else
6097         make an error
6098 #endif
6099 #endif
6100
6101   ;
6102   return 0;
6103 }
6104 _ACEOF
6105 rm -f conftest.$ac_objext
6106 if { (eval echo "$as_me:6106: \"$ac_compile\"") >&5
6107   (eval $ac_compile) 2>&5
6108   ac_status=$?
6109   echo "$as_me:6109: \$? = $ac_status" >&5
6110   (exit $ac_status); } &&
6111          { ac_try='test -s conftest.$ac_objext'
6112   { (eval echo "$as_me:6112: \"$ac_try\"") >&5
6113   (eval $ac_try) 2>&5
6114   ac_status=$?
6115   echo "$as_me:6115: \$? = $ac_status" >&5
6116   (exit $ac_status); }; }; then
6117   cf_cv_ncurses_h=$cf_header
6118
6119 else
6120   echo "$as_me: failed program was:" >&5
6121 cat conftest.$ac_ext >&5
6122 cf_cv_ncurses_h=no
6123 fi
6124 rm -f conftest.$ac_objext conftest.$ac_ext
6125
6126                 test "$cf_cv_ncurses_h" != no && break
6127         done
6128
6129 fi
6130 echo "$as_me:6130: result: $cf_cv_ncurses_h" >&5
6131 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6132
6133 if test "$cf_cv_ncurses_h" != no ; then
6134         cf_cv_ncurses_header=$cf_cv_ncurses_h
6135 else
6136
6137 echo "$as_me:6137: checking for $cf_ncuhdr_root include-path" >&5
6138 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6139 if test "${cf_cv_ncurses_h2+set}" = set; then
6140   echo $ECHO_N "(cached) $ECHO_C" >&6
6141 else
6142
6143         test -n "$verbose" && echo
6144
6145 cf_search=
6146
6147 # collect the current set of include-directories from compiler flags
6148 cf_header_path_list=""
6149 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6150         for cf_header_path in $CPPFLAGS $CFLAGS
6151         do
6152                 case $cf_header_path in #(vi
6153                 -I*)
6154                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6155
6156 test "$cf_header_path" != "NONE" && \
6157 test -d "$cf_header_path" && \
6158  {
6159         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6160         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6161         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6162         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6163         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6164         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"
6165 }
6166
6167                         cf_header_path_list="$cf_header_path_list $cf_search"
6168                         ;;
6169                 esac
6170         done
6171 fi
6172
6173 # add the variations for the package we are looking for
6174
6175 cf_search=
6176
6177 test "/usr" != "$prefix" && \
6178 test -d "/usr" && \
6179 (test $prefix = NONE || test "/usr" != "$prefix") && {
6180         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6181         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6182         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6183         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6184         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6185         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6186 }
6187
6188 test "$prefix" != "NONE" && \
6189 test -d "$prefix" && \
6190  {
6191         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6192         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6193         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6194         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6195         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6196         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6197 }
6198
6199 test "/usr/local" != "$prefix" && \
6200 test -d "/usr/local" && \
6201 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6202         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6203         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6204         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6205         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6206         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6207         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6208 }
6209
6210 test "/opt" != "$prefix" && \
6211 test -d "/opt" && \
6212 (test $prefix = NONE || test "/opt" != "$prefix") && {
6213         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6214         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6215         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6216         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6217         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6218         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6219 }
6220
6221 test "$HOME" != "$prefix" && \
6222 test -d "$HOME" && \
6223 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6224         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6225         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6226         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6227         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6228         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6229         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6230 }
6231
6232 test "$includedir" != NONE && \
6233 test "$includedir" != "/usr/include" && \
6234 test -d "$includedir" && {
6235         test -d $includedir &&    cf_search="$cf_search $includedir"
6236         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6237 }
6238
6239 test "$oldincludedir" != NONE && \
6240 test "$oldincludedir" != "/usr/include" && \
6241 test -d "$oldincludedir" && {
6242         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6243         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6244 }
6245
6246 cf_search="$cf_search $cf_header_path_list"
6247
6248         test -n "$verbose" && echo search path $cf_search
6249         cf_save2_CPPFLAGS="$CPPFLAGS"
6250         for cf_incdir in $cf_search
6251         do
6252
6253 if test -n "$cf_incdir" ; then
6254   for cf_add_incdir in $cf_incdir
6255   do
6256         while test $cf_add_incdir != /usr/include
6257         do
6258           if test -d $cf_add_incdir
6259           then
6260                 cf_have_incdir=no
6261                 if test -n "$CFLAGS$CPPFLAGS" ; then
6262                   # a loop is needed to ensure we can add subdirs of existing dirs
6263                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6264                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6265                           cf_have_incdir=yes; break
6266                         fi
6267                   done
6268                 fi
6269
6270                 if test "$cf_have_incdir" = no ; then
6271                   if test "$cf_add_incdir" = /usr/local/include ; then
6272                         if test "$GCC" = yes
6273                         then
6274                           cf_save_CPPFLAGS=$CPPFLAGS
6275                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6276                           cat >conftest.$ac_ext <<_ACEOF
6277 #line 6277 "configure"
6278 #include "confdefs.h"
6279 #include <stdio.h>
6280 int
6281 main ()
6282 {
6283 printf("Hello")
6284   ;
6285   return 0;
6286 }
6287 _ACEOF
6288 rm -f conftest.$ac_objext
6289 if { (eval echo "$as_me:6289: \"$ac_compile\"") >&5
6290   (eval $ac_compile) 2>&5
6291   ac_status=$?
6292   echo "$as_me:6292: \$? = $ac_status" >&5
6293   (exit $ac_status); } &&
6294          { ac_try='test -s conftest.$ac_objext'
6295   { (eval echo "$as_me:6295: \"$ac_try\"") >&5
6296   (eval $ac_try) 2>&5
6297   ac_status=$?
6298   echo "$as_me:6298: \$? = $ac_status" >&5
6299   (exit $ac_status); }; }; then
6300   :
6301 else
6302   echo "$as_me: failed program was:" >&5
6303 cat conftest.$ac_ext >&5
6304 cf_have_incdir=yes
6305 fi
6306 rm -f conftest.$ac_objext conftest.$ac_ext
6307                           CPPFLAGS=$cf_save_CPPFLAGS
6308                         fi
6309                   fi
6310                 fi
6311
6312                 if test "$cf_have_incdir" = no ; then
6313                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6314
6315 echo "${as_me:-configure}:6315: testing adding $cf_add_incdir to include-path ..." 1>&5
6316
6317                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6318
6319                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6320                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6321                   cf_add_incdir="$cf_top_incdir"
6322                 else
6323                   break
6324                 fi
6325           fi
6326         done
6327   done
6328 fi
6329
6330                 for cf_header in \
6331                         ncurses.h \
6332                         curses.h
6333                 do
6334
6335         cat >conftest.$ac_ext <<_ACEOF
6336 #line 6336 "configure"
6337 #include "confdefs.h"
6338
6339 #include <$cf_header>
6340 int
6341 main ()
6342 {
6343
6344 #ifdef NCURSES_VERSION
6345
6346 printf("%s\n", NCURSES_VERSION);
6347 #else
6348 #ifdef __NCURSES_H
6349 printf("old\n");
6350 #else
6351         make an error
6352 #endif
6353 #endif
6354
6355   ;
6356   return 0;
6357 }
6358 _ACEOF
6359 rm -f conftest.$ac_objext
6360 if { (eval echo "$as_me:6360: \"$ac_compile\"") >&5
6361   (eval $ac_compile) 2>&5
6362   ac_status=$?
6363   echo "$as_me:6363: \$? = $ac_status" >&5
6364   (exit $ac_status); } &&
6365          { ac_try='test -s conftest.$ac_objext'
6366   { (eval echo "$as_me:6366: \"$ac_try\"") >&5
6367   (eval $ac_try) 2>&5
6368   ac_status=$?
6369   echo "$as_me:6369: \$? = $ac_status" >&5
6370   (exit $ac_status); }; }; then
6371   cf_cv_ncurses_h2=$cf_header
6372
6373 else
6374   echo "$as_me: failed program was:" >&5
6375 cat conftest.$ac_ext >&5
6376 cf_cv_ncurses_h2=no
6377 fi
6378 rm -f conftest.$ac_objext conftest.$ac_ext
6379
6380                         if test "$cf_cv_ncurses_h2" != no ; then
6381                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6382                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6383                                 break
6384                         fi
6385                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6386                 done
6387                 CPPFLAGS="$cf_save2_CPPFLAGS"
6388                 test "$cf_cv_ncurses_h2" != no && break
6389         done
6390         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6390: error: not found" >&5
6391 echo "$as_me: error: not found" >&2;}
6392    { (exit 1); exit 1; }; }
6393
6394 fi
6395 echo "$as_me:6395: result: $cf_cv_ncurses_h2" >&5
6396 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6397
6398         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6399         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6400         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6401                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6402         fi
6403
6404 if test -n "$cf_1st_incdir" ; then
6405   for cf_add_incdir in $cf_1st_incdir
6406   do
6407         while test $cf_add_incdir != /usr/include
6408         do
6409           if test -d $cf_add_incdir
6410           then
6411                 cf_have_incdir=no
6412                 if test -n "$CFLAGS$CPPFLAGS" ; then
6413                   # a loop is needed to ensure we can add subdirs of existing dirs
6414                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6415                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6416                           cf_have_incdir=yes; break
6417                         fi
6418                   done
6419                 fi
6420
6421                 if test "$cf_have_incdir" = no ; then
6422                   if test "$cf_add_incdir" = /usr/local/include ; then
6423                         if test "$GCC" = yes
6424                         then
6425                           cf_save_CPPFLAGS=$CPPFLAGS
6426                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6427                           cat >conftest.$ac_ext <<_ACEOF
6428 #line 6428 "configure"
6429 #include "confdefs.h"
6430 #include <stdio.h>
6431 int
6432 main ()
6433 {
6434 printf("Hello")
6435   ;
6436   return 0;
6437 }
6438 _ACEOF
6439 rm -f conftest.$ac_objext
6440 if { (eval echo "$as_me:6440: \"$ac_compile\"") >&5
6441   (eval $ac_compile) 2>&5
6442   ac_status=$?
6443   echo "$as_me:6443: \$? = $ac_status" >&5
6444   (exit $ac_status); } &&
6445          { ac_try='test -s conftest.$ac_objext'
6446   { (eval echo "$as_me:6446: \"$ac_try\"") >&5
6447   (eval $ac_try) 2>&5
6448   ac_status=$?
6449   echo "$as_me:6449: \$? = $ac_status" >&5
6450   (exit $ac_status); }; }; then
6451   :
6452 else
6453   echo "$as_me: failed program was:" >&5
6454 cat conftest.$ac_ext >&5
6455 cf_have_incdir=yes
6456 fi
6457 rm -f conftest.$ac_objext conftest.$ac_ext
6458                           CPPFLAGS=$cf_save_CPPFLAGS
6459                         fi
6460                   fi
6461                 fi
6462
6463                 if test "$cf_have_incdir" = no ; then
6464                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6465
6466 echo "${as_me:-configure}:6466: testing adding $cf_add_incdir to include-path ..." 1>&5
6467
6468                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6469
6470                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6471                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6472                   cf_add_incdir="$cf_top_incdir"
6473                 else
6474                   break
6475                 fi
6476           fi
6477         done
6478   done
6479 fi
6480
6481 fi
6482
6483 # Set definitions to allow ifdef'ing for ncurses.h
6484
6485 case $cf_cv_ncurses_header in # (vi
6486 *ncurses.h)
6487         cat >>confdefs.h <<\EOF
6488 #define HAVE_NCURSES_H 1
6489 EOF
6490
6491         ;;
6492 esac
6493
6494 case $cf_cv_ncurses_header in # (vi
6495 ncurses/curses.h|ncurses/ncurses.h)
6496         cat >>confdefs.h <<\EOF
6497 #define HAVE_NCURSES_NCURSES_H 1
6498 EOF
6499
6500         ;;
6501 ncursesw/curses.h|ncursesw/ncurses.h)
6502         cat >>confdefs.h <<\EOF
6503 #define HAVE_NCURSESW_NCURSES_H 1
6504 EOF
6505
6506         ;;
6507 esac
6508
6509 echo "$as_me:6509: checking for terminfo header" >&5
6510 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6511 if test "${cf_cv_term_header+set}" = set; then
6512   echo $ECHO_N "(cached) $ECHO_C" >&6
6513 else
6514
6515 case ${cf_cv_ncurses_header} in #(vi
6516 */ncurses.h|*/ncursesw.h) #(vi
6517         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6518         ;;
6519 *)
6520         cf_term_header=term.h
6521         ;;
6522 esac
6523
6524 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6525 do
6526 cat >conftest.$ac_ext <<_ACEOF
6527 #line 6527 "configure"
6528 #include "confdefs.h"
6529 #include <stdio.h>
6530 #include <${cf_cv_ncurses_header:-curses.h}>
6531 #include <$cf_test>
6532
6533 int
6534 main ()
6535 {
6536 int x = auto_left_margin
6537   ;
6538   return 0;
6539 }
6540 _ACEOF
6541 rm -f conftest.$ac_objext
6542 if { (eval echo "$as_me:6542: \"$ac_compile\"") >&5
6543   (eval $ac_compile) 2>&5
6544   ac_status=$?
6545   echo "$as_me:6545: \$? = $ac_status" >&5
6546   (exit $ac_status); } &&
6547          { ac_try='test -s conftest.$ac_objext'
6548   { (eval echo "$as_me:6548: \"$ac_try\"") >&5
6549   (eval $ac_try) 2>&5
6550   ac_status=$?
6551   echo "$as_me:6551: \$? = $ac_status" >&5
6552   (exit $ac_status); }; }; then
6553
6554         cf_cv_term_header="$cf_test"
6555 else
6556   echo "$as_me: failed program was:" >&5
6557 cat conftest.$ac_ext >&5
6558
6559         cf_cv_term_header=unknown
6560
6561 fi
6562 rm -f conftest.$ac_objext conftest.$ac_ext
6563         test "$cf_cv_term_header" != unknown && break
6564 done
6565
6566 fi
6567 echo "$as_me:6567: result: $cf_cv_term_header" >&5
6568 echo "${ECHO_T}$cf_cv_term_header" >&6
6569
6570 # Set definitions to allow ifdef'ing to accommodate subdirectories
6571
6572 case $cf_cv_term_header in # (vi
6573 *term.h)
6574         cat >>confdefs.h <<\EOF
6575 #define HAVE_TERM_H 1
6576 EOF
6577
6578         ;;
6579 esac
6580
6581 case $cf_cv_term_header in # (vi
6582 ncurses/term.h) #(vi
6583         cat >>confdefs.h <<\EOF
6584 #define HAVE_NCURSES_TERM_H 1
6585 EOF
6586
6587         ;;
6588 ncursesw/term.h)
6589         cat >>confdefs.h <<\EOF
6590 #define HAVE_NCURSESW_TERM_H 1
6591 EOF
6592
6593         ;;
6594 esac
6595
6596 # some applications need this, but should check for NCURSES_VERSION
6597 cat >>confdefs.h <<\EOF
6598 #define NCURSES 1
6599 EOF
6600
6601 echo "$as_me:6601: checking for ncurses version" >&5
6602 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6603 if test "${cf_cv_ncurses_version+set}" = set; then
6604   echo $ECHO_N "(cached) $ECHO_C" >&6
6605 else
6606
6607         cf_cv_ncurses_version=no
6608         cf_tempfile=out$$
6609         rm -f $cf_tempfile
6610         if test "$cross_compiling" = yes; then
6611
6612         # This will not work if the preprocessor splits the line after the
6613         # Autoconf token.  The 'unproto' program does that.
6614         cat > conftest.$ac_ext <<EOF
6615 #include <${cf_cv_ncurses_header:-curses.h}>
6616 #undef Autoconf
6617 #ifdef NCURSES_VERSION
6618 Autoconf NCURSES_VERSION
6619 #else
6620 #ifdef __NCURSES_H
6621 Autoconf "old"
6622 #endif
6623 ;
6624 #endif
6625 EOF
6626         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6627         { (eval echo "$as_me:6627: \"$cf_try\"") >&5
6628   (eval $cf_try) 2>&5
6629   ac_status=$?
6630   echo "$as_me:6630: \$? = $ac_status" >&5
6631   (exit $ac_status); }
6632         if test -f conftest.out ; then
6633                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6634                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6635                 rm -f conftest.out
6636         fi
6637
6638 else
6639   cat >conftest.$ac_ext <<_ACEOF
6640 #line 6640 "configure"
6641 #include "confdefs.h"
6642
6643 #include <${cf_cv_ncurses_header:-curses.h}>
6644 #include <stdio.h>
6645 int main()
6646 {
6647         FILE *fp = fopen("$cf_tempfile", "w");
6648 #ifdef NCURSES_VERSION
6649 # ifdef NCURSES_VERSION_PATCH
6650         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6651 # else
6652         fprintf(fp, "%s\n", NCURSES_VERSION);
6653 # endif
6654 #else
6655 # ifdef __NCURSES_H
6656         fprintf(fp, "old\n");
6657 # else
6658         make an error
6659 # endif
6660 #endif
6661         ${cf_cv_main_return:-return}(0);
6662 }
6663 _ACEOF
6664 rm -f conftest$ac_exeext
6665 if { (eval echo "$as_me:6665: \"$ac_link\"") >&5
6666   (eval $ac_link) 2>&5
6667   ac_status=$?
6668   echo "$as_me:6668: \$? = $ac_status" >&5
6669   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6670   { (eval echo "$as_me:6670: \"$ac_try\"") >&5
6671   (eval $ac_try) 2>&5
6672   ac_status=$?
6673   echo "$as_me:6673: \$? = $ac_status" >&5
6674   (exit $ac_status); }; }; then
6675
6676         cf_cv_ncurses_version=`cat $cf_tempfile`
6677 else
6678   echo "$as_me: program exited with status $ac_status" >&5
6679 echo "$as_me: failed program was:" >&5
6680 cat conftest.$ac_ext >&5
6681 fi
6682 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6683 fi
6684         rm -f $cf_tempfile
6685
6686 fi
6687 echo "$as_me:6687: result: $cf_cv_ncurses_version" >&5
6688 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6689 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
6690 #define NCURSES 1
6691 EOF
6692
6693 cf_nculib_root=ncurses
6694         # This works, except for the special case where we find gpm, but
6695         # ncurses is in a nonstandard location via $LIBS, and we really want
6696         # to link gpm.
6697 cf_ncurses_LIBS=""
6698 cf_ncurses_SAVE="$LIBS"
6699 echo "$as_me:6699: checking for Gpm_Open in -lgpm" >&5
6700 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6701 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6702   echo $ECHO_N "(cached) $ECHO_C" >&6
6703 else
6704   ac_check_lib_save_LIBS=$LIBS
6705 LIBS="-lgpm  $LIBS"
6706 cat >conftest.$ac_ext <<_ACEOF
6707 #line 6707 "configure"
6708 #include "confdefs.h"
6709
6710 /* Override any gcc2 internal prototype to avoid an error.  */
6711 #ifdef __cplusplus
6712 extern "C"
6713 #endif
6714 /* We use char because int might match the return type of a gcc2
6715    builtin and then its argument prototype would still apply.  */
6716 char Gpm_Open ();
6717 int
6718 main ()
6719 {
6720 Gpm_Open ();
6721   ;
6722   return 0;
6723 }
6724 _ACEOF
6725 rm -f conftest.$ac_objext conftest$ac_exeext
6726 if { (eval echo "$as_me:6726: \"$ac_link\"") >&5
6727   (eval $ac_link) 2>&5
6728   ac_status=$?
6729   echo "$as_me:6729: \$? = $ac_status" >&5
6730   (exit $ac_status); } &&
6731          { ac_try='test -s conftest$ac_exeext'
6732   { (eval echo "$as_me:6732: \"$ac_try\"") >&5
6733   (eval $ac_try) 2>&5
6734   ac_status=$?
6735   echo "$as_me:6735: \$? = $ac_status" >&5
6736   (exit $ac_status); }; }; then
6737   ac_cv_lib_gpm_Gpm_Open=yes
6738 else
6739   echo "$as_me: failed program was:" >&5
6740 cat conftest.$ac_ext >&5
6741 ac_cv_lib_gpm_Gpm_Open=no
6742 fi
6743 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6744 LIBS=$ac_check_lib_save_LIBS
6745 fi
6746 echo "$as_me:6746: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6747 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6748 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6749   echo "$as_me:6749: checking for initscr in -lgpm" >&5
6750 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6751 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6752   echo $ECHO_N "(cached) $ECHO_C" >&6
6753 else
6754   ac_check_lib_save_LIBS=$LIBS
6755 LIBS="-lgpm  $LIBS"
6756 cat >conftest.$ac_ext <<_ACEOF
6757 #line 6757 "configure"
6758 #include "confdefs.h"
6759
6760 /* Override any gcc2 internal prototype to avoid an error.  */
6761 #ifdef __cplusplus
6762 extern "C"
6763 #endif
6764 /* We use char because int might match the return type of a gcc2
6765    builtin and then its argument prototype would still apply.  */
6766 char initscr ();
6767 int
6768 main ()
6769 {
6770 initscr ();
6771   ;
6772   return 0;
6773 }
6774 _ACEOF
6775 rm -f conftest.$ac_objext conftest$ac_exeext
6776 if { (eval echo "$as_me:6776: \"$ac_link\"") >&5
6777   (eval $ac_link) 2>&5
6778   ac_status=$?
6779   echo "$as_me:6779: \$? = $ac_status" >&5
6780   (exit $ac_status); } &&
6781          { ac_try='test -s conftest$ac_exeext'
6782   { (eval echo "$as_me:6782: \"$ac_try\"") >&5
6783   (eval $ac_try) 2>&5
6784   ac_status=$?
6785   echo "$as_me:6785: \$? = $ac_status" >&5
6786   (exit $ac_status); }; }; then
6787   ac_cv_lib_gpm_initscr=yes
6788 else
6789   echo "$as_me: failed program was:" >&5
6790 cat conftest.$ac_ext >&5
6791 ac_cv_lib_gpm_initscr=no
6792 fi
6793 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6794 LIBS=$ac_check_lib_save_LIBS
6795 fi
6796 echo "$as_me:6796: result: $ac_cv_lib_gpm_initscr" >&5
6797 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6798 if test $ac_cv_lib_gpm_initscr = yes; then
6799   LIBS="$cf_ncurses_SAVE"
6800 else
6801   cf_ncurses_LIBS="-lgpm"
6802 fi
6803
6804 fi
6805
6806 case $host_os in #(vi
6807 freebsd*)
6808         # This is only necessary if you are linking against an obsolete
6809         # version of ncurses (but it should do no harm, since it's static).
6810         if test "$cf_nculib_root" = ncurses ; then
6811                 echo "$as_me:6811: checking for tgoto in -lmytinfo" >&5
6812 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6813 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6814   echo $ECHO_N "(cached) $ECHO_C" >&6
6815 else
6816   ac_check_lib_save_LIBS=$LIBS
6817 LIBS="-lmytinfo  $LIBS"
6818 cat >conftest.$ac_ext <<_ACEOF
6819 #line 6819 "configure"
6820 #include "confdefs.h"
6821
6822 /* Override any gcc2 internal prototype to avoid an error.  */
6823 #ifdef __cplusplus
6824 extern "C"
6825 #endif
6826 /* We use char because int might match the return type of a gcc2
6827    builtin and then its argument prototype would still apply.  */
6828 char tgoto ();
6829 int
6830 main ()
6831 {
6832 tgoto ();
6833   ;
6834   return 0;
6835 }
6836 _ACEOF
6837 rm -f conftest.$ac_objext conftest$ac_exeext
6838 if { (eval echo "$as_me:6838: \"$ac_link\"") >&5
6839   (eval $ac_link) 2>&5
6840   ac_status=$?
6841   echo "$as_me:6841: \$? = $ac_status" >&5
6842   (exit $ac_status); } &&
6843          { ac_try='test -s conftest$ac_exeext'
6844   { (eval echo "$as_me:6844: \"$ac_try\"") >&5
6845   (eval $ac_try) 2>&5
6846   ac_status=$?
6847   echo "$as_me:6847: \$? = $ac_status" >&5
6848   (exit $ac_status); }; }; then
6849   ac_cv_lib_mytinfo_tgoto=yes
6850 else
6851   echo "$as_me: failed program was:" >&5
6852 cat conftest.$ac_ext >&5
6853 ac_cv_lib_mytinfo_tgoto=no
6854 fi
6855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6856 LIBS=$ac_check_lib_save_LIBS
6857 fi
6858 echo "$as_me:6858: result: $ac_cv_lib_mytinfo_tgoto" >&5
6859 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6860 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6861   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6862 fi
6863
6864         fi
6865         ;;
6866 esac
6867
6868 LIBS="$cf_ncurses_LIBS $LIBS"
6869
6870 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6871 then
6872         LIBS="-l$cf_nculib_root $LIBS"
6873 else
6874
6875         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6876         cf_libdir=""
6877         echo "$as_me:6877: checking for initscr" >&5
6878 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6879 if test "${ac_cv_func_initscr+set}" = set; then
6880   echo $ECHO_N "(cached) $ECHO_C" >&6
6881 else
6882   cat >conftest.$ac_ext <<_ACEOF
6883 #line 6883 "configure"
6884 #include "confdefs.h"
6885 /* System header to define __stub macros and hopefully few prototypes,
6886     which can conflict with char initscr (); below.  */
6887 #include <assert.h>
6888 /* Override any gcc2 internal prototype to avoid an error.  */
6889 #ifdef __cplusplus
6890 extern "C"
6891 #endif
6892 /* We use char because int might match the return type of a gcc2
6893    builtin and then its argument prototype would still apply.  */
6894 char initscr ();
6895 char (*f) ();
6896
6897 int
6898 main ()
6899 {
6900 /* The GNU C library defines this for functions which it implements
6901     to always fail with ENOSYS.  Some functions are actually named
6902     something starting with __ and the normal name is an alias.  */
6903 #if defined (__stub_initscr) || defined (__stub___initscr)
6904 choke me
6905 #else
6906 f = initscr;
6907 #endif
6908
6909   ;
6910   return 0;
6911 }
6912 _ACEOF
6913 rm -f conftest.$ac_objext conftest$ac_exeext
6914 if { (eval echo "$as_me:6914: \"$ac_link\"") >&5
6915   (eval $ac_link) 2>&5
6916   ac_status=$?
6917   echo "$as_me:6917: \$? = $ac_status" >&5
6918   (exit $ac_status); } &&
6919          { ac_try='test -s conftest$ac_exeext'
6920   { (eval echo "$as_me:6920: \"$ac_try\"") >&5
6921   (eval $ac_try) 2>&5
6922   ac_status=$?
6923   echo "$as_me:6923: \$? = $ac_status" >&5
6924   (exit $ac_status); }; }; then
6925   ac_cv_func_initscr=yes
6926 else
6927   echo "$as_me: failed program was:" >&5
6928 cat conftest.$ac_ext >&5
6929 ac_cv_func_initscr=no
6930 fi
6931 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6932 fi
6933 echo "$as_me:6933: result: $ac_cv_func_initscr" >&5
6934 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6935 if test $ac_cv_func_initscr = yes; then
6936   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6937 else
6938
6939                 cf_save_LIBS="$LIBS"
6940                 echo "$as_me:6940: checking for initscr in -l$cf_nculib_root" >&5
6941 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6942                 LIBS="-l$cf_nculib_root $LIBS"
6943                 cat >conftest.$ac_ext <<_ACEOF
6944 #line 6944 "configure"
6945 #include "confdefs.h"
6946 #include <${cf_cv_ncurses_header:-curses.h}>
6947 int
6948 main ()
6949 {
6950 initscr()
6951   ;
6952   return 0;
6953 }
6954 _ACEOF
6955 rm -f conftest.$ac_objext conftest$ac_exeext
6956 if { (eval echo "$as_me:6956: \"$ac_link\"") >&5
6957   (eval $ac_link) 2>&5
6958   ac_status=$?
6959   echo "$as_me:6959: \$? = $ac_status" >&5
6960   (exit $ac_status); } &&
6961          { ac_try='test -s conftest$ac_exeext'
6962   { (eval echo "$as_me:6962: \"$ac_try\"") >&5
6963   (eval $ac_try) 2>&5
6964   ac_status=$?
6965   echo "$as_me:6965: \$? = $ac_status" >&5
6966   (exit $ac_status); }; }; then
6967   echo "$as_me:6967: result: yes" >&5
6968 echo "${ECHO_T}yes" >&6
6969                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6970
6971 else
6972   echo "$as_me: failed program was:" >&5
6973 cat conftest.$ac_ext >&5
6974 echo "$as_me:6974: result: no" >&5
6975 echo "${ECHO_T}no" >&6
6976
6977 cf_search=
6978 cf_library_path_list=""
6979 if test -n "${LDFLAGS}${LIBS}" ; then
6980         for cf_library_path in $LDFLAGS $LIBS
6981         do
6982                 case $cf_library_path in #(vi
6983                 -L*)
6984                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6985
6986 test "$cf_library_path" != "NONE" && \
6987 test -d "$cf_library_path" && \
6988  {
6989         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6990         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6991         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6992         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6993         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6994         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"
6995 }
6996
6997                         cf_library_path_list="$cf_library_path_list $cf_search"
6998                         ;;
6999                 esac
7000         done
7001 fi
7002
7003 cf_search=
7004
7005 test "/usr" != "$prefix" && \
7006 test -d "/usr" && \
7007 (test $prefix = NONE || test "/usr" != "$prefix") && {
7008         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7009         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7010         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7011         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7012         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7013         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7014 }
7015
7016 test "$prefix" != "NONE" && \
7017 test -d "$prefix" && \
7018  {
7019         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7020         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7021         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7022         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7023         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7024         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7025 }
7026
7027 test "/usr/local" != "$prefix" && \
7028 test -d "/usr/local" && \
7029 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7030         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7031         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7032         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7033         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7034         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7035         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7036 }
7037
7038 test "/opt" != "$prefix" && \
7039 test -d "/opt" && \
7040 (test $prefix = NONE || test "/opt" != "$prefix") && {
7041         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7042         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7043         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7044         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7045         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7046         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7047 }
7048
7049 test "$HOME" != "$prefix" && \
7050 test -d "$HOME" && \
7051 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7052         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7053         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7054         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7055         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7056         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7057         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7058 }
7059
7060 cf_search="$cf_library_path_list $cf_search"
7061
7062                         for cf_libdir in $cf_search
7063                         do
7064                                 echo "$as_me:7064: checking for -l$cf_nculib_root in $cf_libdir" >&5
7065 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7066                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7067                                 cat >conftest.$ac_ext <<_ACEOF
7068 #line 7068 "configure"
7069 #include "confdefs.h"
7070 #include <${cf_cv_ncurses_header:-curses.h}>
7071 int
7072 main ()
7073 {
7074 initscr()
7075   ;
7076   return 0;
7077 }
7078 _ACEOF
7079 rm -f conftest.$ac_objext conftest$ac_exeext
7080 if { (eval echo "$as_me:7080: \"$ac_link\"") >&5
7081   (eval $ac_link) 2>&5
7082   ac_status=$?
7083   echo "$as_me:7083: \$? = $ac_status" >&5
7084   (exit $ac_status); } &&
7085          { ac_try='test -s conftest$ac_exeext'
7086   { (eval echo "$as_me:7086: \"$ac_try\"") >&5
7087   (eval $ac_try) 2>&5
7088   ac_status=$?
7089   echo "$as_me:7089: \$? = $ac_status" >&5
7090   (exit $ac_status); }; }; then
7091   echo "$as_me:7091: result: yes" >&5
7092 echo "${ECHO_T}yes" >&6
7093                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7094                                          break
7095 else
7096   echo "$as_me: failed program was:" >&5
7097 cat conftest.$ac_ext >&5
7098 echo "$as_me:7098: result: no" >&5
7099 echo "${ECHO_T}no" >&6
7100                                          LIBS="$cf_save_LIBS"
7101 fi
7102 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7103                         done
7104
7105 fi
7106 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7107
7108 fi
7109
7110 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7111
7112 if test $cf_found_library = no ; then
7113         { { echo "$as_me:7113: error: Cannot link $cf_nculib_root library" >&5
7114 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7115    { (exit 1); exit 1; }; }
7116 fi
7117
7118 fi
7119
7120 if test -n "$cf_ncurses_LIBS" ; then
7121         echo "$as_me:7121: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7122 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7123         cf_ncurses_SAVE="$LIBS"
7124         for p in $cf_ncurses_LIBS ; do
7125                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7126                 if test "$q" != "$LIBS" ; then
7127                         LIBS="$q"
7128                 fi
7129         done
7130         cat >conftest.$ac_ext <<_ACEOF
7131 #line 7131 "configure"
7132 #include "confdefs.h"
7133 #include <${cf_cv_ncurses_header:-curses.h}>
7134 int
7135 main ()
7136 {
7137 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7138   ;
7139   return 0;
7140 }
7141 _ACEOF
7142 rm -f conftest.$ac_objext conftest$ac_exeext
7143 if { (eval echo "$as_me:7143: \"$ac_link\"") >&5
7144   (eval $ac_link) 2>&5
7145   ac_status=$?
7146   echo "$as_me:7146: \$? = $ac_status" >&5
7147   (exit $ac_status); } &&
7148          { ac_try='test -s conftest$ac_exeext'
7149   { (eval echo "$as_me:7149: \"$ac_try\"") >&5
7150   (eval $ac_try) 2>&5
7151   ac_status=$?
7152   echo "$as_me:7152: \$? = $ac_status" >&5
7153   (exit $ac_status); }; }; then
7154   echo "$as_me:7154: result: yes" >&5
7155 echo "${ECHO_T}yes" >&6
7156 else
7157   echo "$as_me: failed program was:" >&5
7158 cat conftest.$ac_ext >&5
7159 echo "$as_me:7159: result: no" >&5
7160 echo "${ECHO_T}no" >&6
7161                  LIBS="$cf_ncurses_SAVE"
7162 fi
7163 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7164 fi
7165
7166 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7167
7168 cat >>confdefs.h <<EOF
7169 #define $cf_nculib_ROOT 1
7170 EOF
7171
7172 fi
7173
7174 fi
7175
7176 if test "$NCURSES_CONFIG" != none ; then
7177
7178 cf_version=`$NCURSES_CONFIG --version`
7179
7180 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7181 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9]\+\.//' -e 's/\..*//'`
7182 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9]\+\.[0-9]\+\.//'`
7183
7184 # ABI version is not available from headers
7185 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7186
7187 else
7188
7189 for cf_name in MAJOR MINOR PATCH
7190 do
7191 cat >conftest.$ac_ext <<CF_EOF
7192 #include <${cf_cv_ncurses_header:-curses.h}>
7193 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7194 CF_EOF
7195         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7196         { (eval echo "$as_me:7196: \"$cf_try\"") >&5
7197   (eval $cf_try) 2>&5
7198   ac_status=$?
7199   echo "$as_me:7199: \$? = $ac_status" >&5
7200   (exit $ac_status); }
7201         if test -f conftest.out ; then
7202                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ]\+//"`
7203                 eval NCURSES_$cf_name=$cf_result
7204                 cat conftest.$ac_ext
7205                 cat conftest.out
7206         fi
7207 done
7208
7209 cf_cv_abi_version=${NCURSES_MAJOR}
7210
7211 fi
7212
7213 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7214
7215 cf_cv_timestamp=`date`
7216
7217 echo "$as_me:7217: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7218 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7219
7220         case $cf_cv_system_name in #(vi
7221         OS/2*|os2*) #(vi
7222         LIB_PREFIX=''
7223         ;;
7224         *)      LIB_PREFIX='lib'
7225         ;;
7226         esac
7227 cf_prefix=$LIB_PREFIX
7228
7229 LIB_PREFIX=$cf_prefix
7230
7231 LIB_SUFFIX=
7232
7233 ###############################################################################
7234
7235 if test X"$CC_G_OPT" = X"" ; then
7236         CC_G_OPT='-g'
7237         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7238 fi
7239
7240 echo "$as_me:7240: checking for default loader flags" >&5
7241 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7242 case $DFT_LWR_MODEL in
7243 normal)  LD_MODEL=''   ;;
7244 debug)   LD_MODEL=$CC_G_OPT ;;
7245 profile) LD_MODEL='-pg';;
7246 shared)  LD_MODEL=''   ;;
7247 esac
7248 echo "$as_me:7248: result: $LD_MODEL" >&5
7249 echo "${ECHO_T}$LD_MODEL" >&6
7250
7251 LD_RPATH_OPT=
7252 echo "$as_me:7252: checking for an rpath option" >&5
7253 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7254 case $cf_cv_system_name in #(vi
7255 irix*) #(vi
7256         if test "$GCC" = yes; then
7257                 LD_RPATH_OPT="-Wl,-rpath,"
7258         else
7259                 LD_RPATH_OPT="-rpath "
7260         fi
7261         ;;
7262 linux*|gnu*|k*bsd*-gnu) #(vi
7263         LD_RPATH_OPT="-Wl,-rpath,"
7264         ;;
7265 openbsd[2-9].*) #(vi
7266         LD_RPATH_OPT="-Wl,-rpath,"
7267         ;;
7268 freebsd*) #(vi
7269         LD_RPATH_OPT="-rpath "
7270         ;;
7271 netbsd*) #(vi
7272         LD_RPATH_OPT="-Wl,-rpath,"
7273         ;;
7274 osf*|mls+*) #(vi
7275         LD_RPATH_OPT="-rpath "
7276         ;;
7277 solaris2*) #(vi
7278         LD_RPATH_OPT="-R"
7279         ;;
7280 *)
7281         ;;
7282 esac
7283 echo "$as_me:7283: result: $LD_RPATH_OPT" >&5
7284 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7285
7286 case "x$LD_RPATH_OPT" in #(vi
7287 x-R*)
7288         echo "$as_me:7288: checking if we need a space after rpath option" >&5
7289 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7290         cf_save_LIBS="$LIBS"
7291         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
7292         cat >conftest.$ac_ext <<_ACEOF
7293 #line 7293 "configure"
7294 #include "confdefs.h"
7295
7296 int
7297 main ()
7298 {
7299
7300   ;
7301   return 0;
7302 }
7303 _ACEOF
7304 rm -f conftest.$ac_objext conftest$ac_exeext
7305 if { (eval echo "$as_me:7305: \"$ac_link\"") >&5
7306   (eval $ac_link) 2>&5
7307   ac_status=$?
7308   echo "$as_me:7308: \$? = $ac_status" >&5
7309   (exit $ac_status); } &&
7310          { ac_try='test -s conftest$ac_exeext'
7311   { (eval echo "$as_me:7311: \"$ac_try\"") >&5
7312   (eval $ac_try) 2>&5
7313   ac_status=$?
7314   echo "$as_me:7314: \$? = $ac_status" >&5
7315   (exit $ac_status); }; }; then
7316   cf_rpath_space=no
7317 else
7318   echo "$as_me: failed program was:" >&5
7319 cat conftest.$ac_ext >&5
7320 cf_rpath_space=yes
7321 fi
7322 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7323         LIBS="$cf_save_LIBS"
7324         echo "$as_me:7324: result: $cf_rpath_space" >&5
7325 echo "${ECHO_T}$cf_rpath_space" >&6
7326         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7327         ;;
7328 esac
7329
7330         LOCAL_LDFLAGS=
7331         LOCAL_LDFLAGS2=
7332         LD_SHARED_OPTS=
7333         INSTALL_LIB="-m 644"
7334
7335         cf_cv_do_symlinks=no
7336         cf_ld_rpath_opt=
7337         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7338
7339         echo "$as_me:7339: checking if release/abi version should be used for shared libs" >&5
7340 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7341
7342 # Check whether --with-shlib-version or --without-shlib-version was given.
7343 if test "${with_shlib_version+set}" = set; then
7344   withval="$with_shlib_version"
7345   test -z "$withval" && withval=auto
7346         case $withval in #(vi
7347         yes) #(vi
7348                 cf_cv_shlib_version=auto
7349                 ;;
7350         rel|abi|auto|no) #(vi
7351                 cf_cv_shlib_version=$withval
7352                 ;;
7353         *)
7354                 { { echo "$as_me:7354: error: option value must be one of: rel, abi, auto or no" >&5
7355 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7356    { (exit 1); exit 1; }; }
7357                 ;;
7358         esac
7359
7360 else
7361   cf_cv_shlib_version=auto
7362 fi;
7363         echo "$as_me:7363: result: $cf_cv_shlib_version" >&5
7364 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7365
7366         cf_cv_rm_so_locs=no
7367
7368         # Some less-capable ports of gcc support only -fpic
7369         CC_SHARED_OPTS=
7370         if test "$GCC" = yes
7371         then
7372                 echo "$as_me:7372: checking which $CC option to use" >&5
7373 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7374                 cf_save_CFLAGS="$CFLAGS"
7375                 for CC_SHARED_OPTS in -fPIC -fpic ''
7376                 do
7377                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7378                         cat >conftest.$ac_ext <<_ACEOF
7379 #line 7379 "configure"
7380 #include "confdefs.h"
7381 #include <stdio.h>
7382 int
7383 main ()
7384 {
7385 int x = 1
7386   ;
7387   return 0;
7388 }
7389 _ACEOF
7390 rm -f conftest.$ac_objext
7391 if { (eval echo "$as_me:7391: \"$ac_compile\"") >&5
7392   (eval $ac_compile) 2>&5
7393   ac_status=$?
7394   echo "$as_me:7394: \$? = $ac_status" >&5
7395   (exit $ac_status); } &&
7396          { ac_try='test -s conftest.$ac_objext'
7397   { (eval echo "$as_me:7397: \"$ac_try\"") >&5
7398   (eval $ac_try) 2>&5
7399   ac_status=$?
7400   echo "$as_me:7400: \$? = $ac_status" >&5
7401   (exit $ac_status); }; }; then
7402   break
7403 else
7404   echo "$as_me: failed program was:" >&5
7405 cat conftest.$ac_ext >&5
7406 fi
7407 rm -f conftest.$ac_objext conftest.$ac_ext
7408                 done
7409                 echo "$as_me:7409: result: $CC_SHARED_OPTS" >&5
7410 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7411                 CFLAGS="$cf_save_CFLAGS"
7412         fi
7413
7414         cf_cv_shlib_version_infix=no
7415
7416         case $cf_cv_system_name in #(vi
7417         aix[56]*) #(vi
7418                 if test "$GCC" = yes; then
7419                         CC_SHARED_OPTS=
7420                         MK_SHARED_LIB='$(CC) -shared'
7421                 fi
7422                 ;;
7423         beos*) #(vi
7424                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7425                 ;;
7426         cygwin*) #(vi
7427                 CC_SHARED_OPTS=
7428                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7429                 cf_cv_shlib_version=cygdll
7430                 cf_cv_shlib_version_infix=cygdll
7431                 cat >mk_shared_lib.sh <<-CF_EOF
7432                 #!/bin/sh
7433                 SHARED_LIB=\$1
7434                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7435                 shift
7436                 cat <<-EOF
7437                 Linking shared library
7438                 ** SHARED_LIB \$SHARED_LIB
7439                 ** IMPORT_LIB \$IMPORT_LIB
7440 EOF
7441                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7442 CF_EOF
7443                 chmod +x mk_shared_lib.sh
7444                 ;;
7445         darwin*) #(vi
7446                 EXTRA_CFLAGS="-no-cpp-precomp"
7447                 CC_SHARED_OPTS="-dynamic"
7448                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7449                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7450                 cf_cv_shlib_version_infix=yes
7451                 echo "$as_me:7451: checking if ld -search_paths_first works" >&5
7452 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7453 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7454   echo $ECHO_N "(cached) $ECHO_C" >&6
7455 else
7456
7457                         cf_save_LDFLAGS=$LDFLAGS
7458                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7459                         cat >conftest.$ac_ext <<_ACEOF
7460 #line 7460 "configure"
7461 #include "confdefs.h"
7462
7463 int
7464 main ()
7465 {
7466 int i;
7467   ;
7468   return 0;
7469 }
7470 _ACEOF
7471 rm -f conftest.$ac_objext conftest$ac_exeext
7472 if { (eval echo "$as_me:7472: \"$ac_link\"") >&5
7473   (eval $ac_link) 2>&5
7474   ac_status=$?
7475   echo "$as_me:7475: \$? = $ac_status" >&5
7476   (exit $ac_status); } &&
7477          { ac_try='test -s conftest$ac_exeext'
7478   { (eval echo "$as_me:7478: \"$ac_try\"") >&5
7479   (eval $ac_try) 2>&5
7480   ac_status=$?
7481   echo "$as_me:7481: \$? = $ac_status" >&5
7482   (exit $ac_status); }; }; then
7483   cf_cv_ldflags_search_paths_first=yes
7484 else
7485   echo "$as_me: failed program was:" >&5
7486 cat conftest.$ac_ext >&5
7487 cf_cv_ldflags_search_paths_first=no
7488 fi
7489 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7490                                 LDFLAGS=$cf_save_LDFLAGS
7491 fi
7492 echo "$as_me:7492: result: $cf_cv_ldflags_search_paths_first" >&5
7493 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7494                 if test $cf_cv_ldflags_search_paths_first = yes; then
7495                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7496                 fi
7497                 ;;
7498         hpux*) #(vi
7499                 # (tested with gcc 2.7.2 -- I don't have c89)
7500                 if test "$GCC" = yes; then
7501                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7502                 else
7503                         CC_SHARED_OPTS='+Z'
7504                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7505                 fi
7506                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7507                 # HP-UX shared libraries must be executable, and should be
7508                 # readonly to exploit a quirk in the memory manager.
7509                 INSTALL_LIB="-m 555"
7510                 ;;
7511         irix*) #(vi
7512                 if test "$cf_cv_enable_rpath" = yes ; then
7513                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7514                 fi
7515                 # tested with IRIX 5.2 and 'cc'.
7516                 if test "$GCC" != yes; then
7517                         CC_SHARED_OPTS='-KPIC'
7518                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7519                 else
7520                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7521                 fi
7522                 cf_cv_rm_so_locs=yes
7523                 ;;
7524         linux*|gnu*|k*bsd*-gnu) #(vi
7525                 if test "$DFT_LWR_MODEL" = "shared" ; then
7526                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7527                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7528                 fi
7529                 if test "$cf_cv_enable_rpath" = yes ; then
7530                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7531                 fi
7532
7533         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7534         if test "$cf_cv_shlib_version" = rel; then
7535                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7536         else
7537                 cf_cv_shared_soname='`basename $@`'
7538         fi
7539
7540                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7541                 ;;
7542         openbsd[2-9].*) #(vi
7543                 if test "$DFT_LWR_MODEL" = "shared" ; then
7544                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7545                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7546                 fi
7547                 if test "$cf_cv_enable_rpath" = yes ; then
7548                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7549                 fi
7550                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7551
7552         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7553         if test "$cf_cv_shlib_version" = rel; then
7554                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7555         else
7556                 cf_cv_shared_soname='`basename $@`'
7557         fi
7558
7559                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7560                 ;;
7561         nto-qnx*|openbsd*|freebsd[12].*) #(vi
7562                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7563                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7564                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7565                 ;;
7566         freebsd*) #(vi
7567                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7568                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7569                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7570                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
7571                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7572                 fi
7573
7574         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7575         if test "$cf_cv_shlib_version" = rel; then
7576                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7577         else
7578                 cf_cv_shared_soname='`basename $@`'
7579         fi
7580
7581                 MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
7582                 ;;
7583         netbsd*) #(vi
7584                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7585                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7586                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7587                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7588                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7589                         if test "$cf_cv_shlib_version" = auto; then
7590                         if test -f /usr/libexec/ld.elf_so; then
7591                                 cf_cv_shlib_version=abi
7592                         else
7593                                 cf_cv_shlib_version=rel
7594                         fi
7595                         fi
7596
7597         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7598         if test "$cf_cv_shlib_version" = rel; then
7599                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7600         else
7601                 cf_cv_shared_soname='`basename $@`'
7602         fi
7603
7604                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7605                 else
7606                         MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
7607                 fi
7608                 ;;
7609         osf*|mls+*) #(vi
7610                 # tested with OSF/1 V3.2 and 'cc'
7611                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7612                 # link with shared libs).
7613                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7614                 case $host_os in #(vi
7615                 osf4*)
7616                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7617                         ;;
7618                 esac
7619                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7620                 if test "$DFT_LWR_MODEL" = "shared" ; then
7621                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7622                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7623                 fi
7624                 cf_cv_rm_so_locs=yes
7625                 ;;
7626         sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
7627                 # tested with osr5.0.5
7628                 if test "$GCC" != yes; then
7629                         CC_SHARED_OPTS='-belf -KPIC'
7630                 fi
7631                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7632                 if test "$cf_cv_enable_rpath" = yes ; then
7633                         # only way is to set LD_RUN_PATH but no switch for it
7634                         RUN_PATH=$libdir
7635                 fi
7636                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7637                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7638                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7639                 ;;
7640         sunos4*) #(vi
7641                 # tested with SunOS 4.1.1 and gcc 2.7.0
7642                 if test "$GCC" != yes; then
7643                         CC_SHARED_OPTS='-KPIC'
7644                 fi
7645                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7646                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7647                 ;;
7648         solaris2*) #(vi
7649                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7650                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7651                 if test "$DFT_LWR_MODEL" = "shared" ; then
7652                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7653                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7654                 fi
7655                 if test "$cf_cv_enable_rpath" = yes ; then
7656                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7657                 fi
7658
7659         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7660         if test "$cf_cv_shlib_version" = rel; then
7661                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7662         else
7663                 cf_cv_shared_soname='`basename $@`'
7664         fi
7665
7666                 if test "$GCC" != yes; then
7667                         cf_save_CFLAGS="$CFLAGS"
7668                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7669                         do
7670                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7671                                 cat >conftest.$ac_ext <<_ACEOF
7672 #line 7672 "configure"
7673 #include "confdefs.h"
7674 #include <stdio.h>
7675 int
7676 main ()
7677 {
7678 printf("Hello\n");
7679   ;
7680   return 0;
7681 }
7682 _ACEOF
7683 rm -f conftest.$ac_objext
7684 if { (eval echo "$as_me:7684: \"$ac_compile\"") >&5
7685   (eval $ac_compile) 2>&5
7686   ac_status=$?
7687   echo "$as_me:7687: \$? = $ac_status" >&5
7688   (exit $ac_status); } &&
7689          { ac_try='test -s conftest.$ac_objext'
7690   { (eval echo "$as_me:7690: \"$ac_try\"") >&5
7691   (eval $ac_try) 2>&5
7692   ac_status=$?
7693   echo "$as_me:7693: \$? = $ac_status" >&5
7694   (exit $ac_status); }; }; then
7695   break
7696 else
7697   echo "$as_me: failed program was:" >&5
7698 cat conftest.$ac_ext >&5
7699 fi
7700 rm -f conftest.$ac_objext conftest.$ac_ext
7701                         done
7702                         CFLAGS="$cf_save_CFLAGS"
7703                         CC_SHARED_OPTS=$cf_shared_opts
7704                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7705                 else
7706                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7707                 fi
7708                 ;;
7709         sysv5uw7*|unix_sv*) #(vi
7710                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7711                 if test "$GCC" != yes; then
7712                         CC_SHARED_OPTS='-KPIC'
7713                 fi
7714                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7715                 ;;
7716         *)
7717                 CC_SHARED_OPTS='unknown'
7718                 MK_SHARED_LIB='echo unknown'
7719                 ;;
7720         esac
7721
7722         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7723         case "$cf_cv_shlib_version" in #(vi
7724         rel|abi)
7725                 case "$MK_SHARED_LIB" in #(vi
7726                 *'-o $@') #(vi
7727                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7728                         ;;
7729                 *)
7730                         { echo "$as_me:7730: WARNING: ignored --with-shlib-version" >&5
7731 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7732                         ;;
7733                 esac
7734                 ;;
7735         esac
7736
7737         if test -n "$cf_ld_rpath_opt" ; then
7738                 MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
7739         fi
7740
7741 ###############################################################################
7742
7743         case $cf_cv_system_name in
7744         os2*)   PATH_SEPARATOR=';'  ;;
7745         *)      PATH_SEPARATOR=':'  ;;
7746         esac
7747
7748 ###   use option --enable-broken-linker to force on use of broken-linker support
7749 echo "$as_me:7749: checking if you want broken-linker support code" >&5
7750 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7751
7752 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7753 if test "${enable_broken_linker+set}" = set; then
7754   enableval="$enable_broken_linker"
7755   with_broken_linker=$enableval
7756 else
7757   with_broken_linker=${BROKEN_LINKER:-no}
7758 fi;
7759 echo "$as_me:7759: result: $with_broken_linker" >&5
7760 echo "${ECHO_T}$with_broken_linker" >&6
7761
7762 BROKEN_LINKER=0
7763 if test "$with_broken_linker" = yes ; then
7764         cat >>confdefs.h <<\EOF
7765 #define BROKEN_LINKER 1
7766 EOF
7767
7768         BROKEN_LINKER=1
7769 elif test "$DFT_LWR_MODEL" = shared ; then
7770         case $cf_cv_system_name in #(vi
7771         cygwin*)
7772                 cat >>confdefs.h <<\EOF
7773 #define BROKEN_LINKER 1
7774 EOF
7775
7776                 BROKEN_LINKER=1
7777                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7778
7779 echo "${as_me:-configure}:7779: testing cygwin linker is broken anyway ..." 1>&5
7780
7781                 ;;
7782         esac
7783 fi
7784
7785 # Check to define _XOPEN_SOURCE "automatically"
7786
7787 cf_XOPEN_SOURCE=500
7788 cf_POSIX_C_SOURCE=199506L
7789 cf_xopen_source=
7790
7791 case $host_os in #(vi
7792 aix[456]*) #(vi
7793         cf_xopen_source="-D_ALL_SOURCE"
7794         ;;
7795 cygwin) #(vi
7796         cf_XOPEN_SOURCE=600
7797         ;;
7798 darwin[0-8].*) #(vi
7799         cf_xopen_source="-D_APPLE_C_SOURCE"
7800         ;;
7801 darwin*) #(vi
7802         cf_xopen_source="-D_DARWIN_C_SOURCE"
7803         ;;
7804 freebsd*|dragonfly*) #(vi
7805         # 5.x headers associate
7806         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7807         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7808         cf_POSIX_C_SOURCE=200112L
7809         cf_XOPEN_SOURCE=600
7810         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7811         ;;
7812 hpux11*) #(vi
7813         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7814         ;;
7815 hpux*) #(vi
7816         cf_xopen_source="-D_HPUX_SOURCE"
7817         ;;
7818 irix[56].*) #(vi
7819         cf_xopen_source="-D_SGI_SOURCE"
7820         ;;
7821 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
7822
7823 echo "$as_me:7823: checking if we must define _GNU_SOURCE" >&5
7824 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7825 if test "${cf_cv_gnu_source+set}" = set; then
7826   echo $ECHO_N "(cached) $ECHO_C" >&6
7827 else
7828
7829 cat >conftest.$ac_ext <<_ACEOF
7830 #line 7830 "configure"
7831 #include "confdefs.h"
7832 #include <sys/types.h>
7833 int
7834 main ()
7835 {
7836
7837 #ifndef _XOPEN_SOURCE
7838 make an error
7839 #endif
7840   ;
7841   return 0;
7842 }
7843 _ACEOF
7844 rm -f conftest.$ac_objext
7845 if { (eval echo "$as_me:7845: \"$ac_compile\"") >&5
7846   (eval $ac_compile) 2>&5
7847   ac_status=$?
7848   echo "$as_me:7848: \$? = $ac_status" >&5
7849   (exit $ac_status); } &&
7850          { ac_try='test -s conftest.$ac_objext'
7851   { (eval echo "$as_me:7851: \"$ac_try\"") >&5
7852   (eval $ac_try) 2>&5
7853   ac_status=$?
7854   echo "$as_me:7854: \$? = $ac_status" >&5
7855   (exit $ac_status); }; }; then
7856   cf_cv_gnu_source=no
7857 else
7858   echo "$as_me: failed program was:" >&5
7859 cat conftest.$ac_ext >&5
7860 cf_save="$CPPFLAGS"
7861          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7862          cat >conftest.$ac_ext <<_ACEOF
7863 #line 7863 "configure"
7864 #include "confdefs.h"
7865 #include <sys/types.h>
7866 int
7867 main ()
7868 {
7869
7870 #ifdef _XOPEN_SOURCE
7871 make an error
7872 #endif
7873   ;
7874   return 0;
7875 }
7876 _ACEOF
7877 rm -f conftest.$ac_objext
7878 if { (eval echo "$as_me:7878: \"$ac_compile\"") >&5
7879   (eval $ac_compile) 2>&5
7880   ac_status=$?
7881   echo "$as_me:7881: \$? = $ac_status" >&5
7882   (exit $ac_status); } &&
7883          { ac_try='test -s conftest.$ac_objext'
7884   { (eval echo "$as_me:7884: \"$ac_try\"") >&5
7885   (eval $ac_try) 2>&5
7886   ac_status=$?
7887   echo "$as_me:7887: \$? = $ac_status" >&5
7888   (exit $ac_status); }; }; then
7889   cf_cv_gnu_source=no
7890 else
7891   echo "$as_me: failed program was:" >&5
7892 cat conftest.$ac_ext >&5
7893 cf_cv_gnu_source=yes
7894 fi
7895 rm -f conftest.$ac_objext conftest.$ac_ext
7896         CPPFLAGS="$cf_save"
7897
7898 fi
7899 rm -f conftest.$ac_objext conftest.$ac_ext
7900
7901 fi
7902 echo "$as_me:7902: result: $cf_cv_gnu_source" >&5
7903 echo "${ECHO_T}$cf_cv_gnu_source" >&6
7904 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7905
7906         ;;
7907 mirbsd*) #(vi
7908         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
7909         ;;
7910 netbsd*) #(vi
7911         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
7912         ;;
7913 openbsd*) #(vi
7914         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
7915         ;;
7916 osf[45]*) #(vi
7917         cf_xopen_source="-D_OSF_SOURCE"
7918         ;;
7919 nto-qnx*) #(vi
7920         cf_xopen_source="-D_QNX_SOURCE"
7921         ;;
7922 sco*) #(vi
7923         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
7924         ;;
7925 solaris2.1[0-9]) #(vi
7926         cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7927         ;;
7928 solaris2.[1-9]) #(vi
7929         cf_xopen_source="-D__EXTENSIONS__"
7930         ;;
7931 *)
7932         echo "$as_me:7932: checking if we should define _XOPEN_SOURCE" >&5
7933 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
7934 if test "${cf_cv_xopen_source+set}" = set; then
7935   echo $ECHO_N "(cached) $ECHO_C" >&6
7936 else
7937
7938         cat >conftest.$ac_ext <<_ACEOF
7939 #line 7939 "configure"
7940 #include "confdefs.h"
7941 #include <sys/types.h>
7942 int
7943 main ()
7944 {
7945
7946 #ifndef _XOPEN_SOURCE
7947 make an error
7948 #endif
7949   ;
7950   return 0;
7951 }
7952 _ACEOF
7953 rm -f conftest.$ac_objext
7954 if { (eval echo "$as_me:7954: \"$ac_compile\"") >&5
7955   (eval $ac_compile) 2>&5
7956   ac_status=$?
7957   echo "$as_me:7957: \$? = $ac_status" >&5
7958   (exit $ac_status); } &&
7959          { ac_try='test -s conftest.$ac_objext'
7960   { (eval echo "$as_me:7960: \"$ac_try\"") >&5
7961   (eval $ac_try) 2>&5
7962   ac_status=$?
7963   echo "$as_me:7963: \$? = $ac_status" >&5
7964   (exit $ac_status); }; }; then
7965   cf_cv_xopen_source=no
7966 else
7967   echo "$as_me: failed program was:" >&5
7968 cat conftest.$ac_ext >&5
7969 cf_save="$CPPFLAGS"
7970          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7971          cat >conftest.$ac_ext <<_ACEOF
7972 #line 7972 "configure"
7973 #include "confdefs.h"
7974 #include <sys/types.h>
7975 int
7976 main ()
7977 {
7978
7979 #ifdef _XOPEN_SOURCE
7980 make an error
7981 #endif
7982   ;
7983   return 0;
7984 }
7985 _ACEOF
7986 rm -f conftest.$ac_objext
7987 if { (eval echo "$as_me:7987: \"$ac_compile\"") >&5
7988   (eval $ac_compile) 2>&5
7989   ac_status=$?
7990   echo "$as_me:7990: \$? = $ac_status" >&5
7991   (exit $ac_status); } &&
7992          { ac_try='test -s conftest.$ac_objext'
7993   { (eval echo "$as_me:7993: \"$ac_try\"") >&5
7994   (eval $ac_try) 2>&5
7995   ac_status=$?
7996   echo "$as_me:7996: \$? = $ac_status" >&5
7997   (exit $ac_status); }; }; then
7998   cf_cv_xopen_source=no
7999 else
8000   echo "$as_me: failed program was:" >&5
8001 cat conftest.$ac_ext >&5
8002 cf_cv_xopen_source=$cf_XOPEN_SOURCE
8003 fi
8004 rm -f conftest.$ac_objext conftest.$ac_ext
8005         CPPFLAGS="$cf_save"
8006
8007 fi
8008 rm -f conftest.$ac_objext conftest.$ac_ext
8009
8010 fi
8011 echo "$as_me:8011: result: $cf_cv_xopen_source" >&5
8012 echo "${ECHO_T}$cf_cv_xopen_source" >&6
8013         if test "$cf_cv_xopen_source" != no ; then
8014
8015 CFLAGS=`echo "$CFLAGS" | \
8016         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8017                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8018
8019 CPPFLAGS=`echo "$CPPFLAGS" | \
8020         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
8021                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
8022
8023                 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
8024
8025 cf_fix_cppflags=no
8026 cf_new_cflags=
8027 cf_new_cppflags=
8028 cf_new_extra_cppflags=
8029
8030 for cf_add_cflags in $cf_temp_xopen_source
8031 do
8032 case $cf_fix_cppflags in
8033 no)
8034         case $cf_add_cflags in #(vi
8035         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8036                 case $cf_add_cflags in
8037                 -D*)
8038                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8039
8040                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8041                                 && test -z "${cf_tst_cflags}" \
8042                                 && cf_fix_cppflags=yes
8043
8044                         if test $cf_fix_cppflags = yes ; then
8045                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8046                                 continue
8047                         elif test "${cf_tst_cflags}" = "\"'" ; then
8048                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8049                                 continue
8050                         fi
8051                         ;;
8052                 esac
8053                 case "$CPPFLAGS" in
8054                 *$cf_add_cflags) #(vi
8055                         ;;
8056                 *) #(vi
8057                         case $cf_add_cflags in #(vi
8058                         -D*)
8059                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8060
8061 CPPFLAGS=`echo "$CPPFLAGS" | \
8062         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8063                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8064
8065                                 ;;
8066                         esac
8067                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8068                         ;;
8069                 esac
8070                 ;;
8071         *)
8072                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8073                 ;;
8074         esac
8075         ;;
8076 yes)
8077         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8078
8079         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8080
8081         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8082                 && test -z "${cf_tst_cflags}" \
8083                 && cf_fix_cppflags=no
8084         ;;
8085 esac
8086 done
8087
8088 if test -n "$cf_new_cflags" ; then
8089
8090         CFLAGS="$CFLAGS $cf_new_cflags"
8091 fi
8092
8093 if test -n "$cf_new_cppflags" ; then
8094
8095         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8096 fi
8097
8098 if test -n "$cf_new_extra_cppflags" ; then
8099
8100         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8101 fi
8102
8103         fi
8104
8105 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
8106
8107 cf_save_CFLAGS="$CFLAGS"
8108 cf_save_CPPFLAGS="$CPPFLAGS"
8109
8110 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
8111         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8112                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8113
8114 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
8115         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
8116                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
8117
8118 echo "$as_me:8118: checking if we should define _POSIX_C_SOURCE" >&5
8119 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
8120 if test "${cf_cv_posix_c_source+set}" = set; then
8121   echo $ECHO_N "(cached) $ECHO_C" >&6
8122 else
8123
8124 echo "${as_me:-configure}:8124: testing if the symbol is already defined go no further ..." 1>&5
8125
8126         cat >conftest.$ac_ext <<_ACEOF
8127 #line 8127 "configure"
8128 #include "confdefs.h"
8129 #include <sys/types.h>
8130 int
8131 main ()
8132 {
8133
8134 #ifndef _POSIX_C_SOURCE
8135 make an error
8136 #endif
8137   ;
8138   return 0;
8139 }
8140 _ACEOF
8141 rm -f conftest.$ac_objext
8142 if { (eval echo "$as_me:8142: \"$ac_compile\"") >&5
8143   (eval $ac_compile) 2>&5
8144   ac_status=$?
8145   echo "$as_me:8145: \$? = $ac_status" >&5
8146   (exit $ac_status); } &&
8147          { ac_try='test -s conftest.$ac_objext'
8148   { (eval echo "$as_me:8148: \"$ac_try\"") >&5
8149   (eval $ac_try) 2>&5
8150   ac_status=$?
8151   echo "$as_me:8151: \$? = $ac_status" >&5
8152   (exit $ac_status); }; }; then
8153   cf_cv_posix_c_source=no
8154 else
8155   echo "$as_me: failed program was:" >&5
8156 cat conftest.$ac_ext >&5
8157 cf_want_posix_source=no
8158          case .$cf_POSIX_C_SOURCE in #(vi
8159          .[12]??*) #(vi
8160                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8161                 ;;
8162          .2) #(vi
8163                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8164                 cf_want_posix_source=yes
8165                 ;;
8166          .*)
8167                 cf_want_posix_source=yes
8168                 ;;
8169          esac
8170          if test "$cf_want_posix_source" = yes ; then
8171                 cat >conftest.$ac_ext <<_ACEOF
8172 #line 8172 "configure"
8173 #include "confdefs.h"
8174 #include <sys/types.h>
8175 int
8176 main ()
8177 {
8178
8179 #ifdef _POSIX_SOURCE
8180 make an error
8181 #endif
8182   ;
8183   return 0;
8184 }
8185 _ACEOF
8186 rm -f conftest.$ac_objext
8187 if { (eval echo "$as_me:8187: \"$ac_compile\"") >&5
8188   (eval $ac_compile) 2>&5
8189   ac_status=$?
8190   echo "$as_me:8190: \$? = $ac_status" >&5
8191   (exit $ac_status); } &&
8192          { ac_try='test -s conftest.$ac_objext'
8193   { (eval echo "$as_me:8193: \"$ac_try\"") >&5
8194   (eval $ac_try) 2>&5
8195   ac_status=$?
8196   echo "$as_me:8196: \$? = $ac_status" >&5
8197   (exit $ac_status); }; }; then
8198   :
8199 else
8200   echo "$as_me: failed program was:" >&5
8201 cat conftest.$ac_ext >&5
8202 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8203 fi
8204 rm -f conftest.$ac_objext conftest.$ac_ext
8205          fi
8206
8207 echo "${as_me:-configure}:8207: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8208
8209          CFLAGS="$cf_trim_CFLAGS"
8210          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8211
8212 echo "${as_me:-configure}:8212: testing if the second compile does not leave our definition intact error ..." 1>&5
8213
8214          cat >conftest.$ac_ext <<_ACEOF
8215 #line 8215 "configure"
8216 #include "confdefs.h"
8217 #include <sys/types.h>
8218 int
8219 main ()
8220 {
8221
8222 #ifndef _POSIX_C_SOURCE
8223 make an error
8224 #endif
8225   ;
8226   return 0;
8227 }
8228 _ACEOF
8229 rm -f conftest.$ac_objext
8230 if { (eval echo "$as_me:8230: \"$ac_compile\"") >&5
8231   (eval $ac_compile) 2>&5
8232   ac_status=$?
8233   echo "$as_me:8233: \$? = $ac_status" >&5
8234   (exit $ac_status); } &&
8235          { ac_try='test -s conftest.$ac_objext'
8236   { (eval echo "$as_me:8236: \"$ac_try\"") >&5
8237   (eval $ac_try) 2>&5
8238   ac_status=$?
8239   echo "$as_me:8239: \$? = $ac_status" >&5
8240   (exit $ac_status); }; }; then
8241   :
8242 else
8243   echo "$as_me: failed program was:" >&5
8244 cat conftest.$ac_ext >&5
8245 cf_cv_posix_c_source=no
8246 fi
8247 rm -f conftest.$ac_objext conftest.$ac_ext
8248          CFLAGS="$cf_save_CFLAGS"
8249          CPPFLAGS="$cf_save_CPPFLAGS"
8250
8251 fi
8252 rm -f conftest.$ac_objext conftest.$ac_ext
8253
8254 fi
8255 echo "$as_me:8255: result: $cf_cv_posix_c_source" >&5
8256 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8257
8258 if test "$cf_cv_posix_c_source" != no ; then
8259         CFLAGS="$cf_trim_CFLAGS"
8260         CPPFLAGS="$cf_trim_CPPFLAGS"
8261
8262 cf_fix_cppflags=no
8263 cf_new_cflags=
8264 cf_new_cppflags=
8265 cf_new_extra_cppflags=
8266
8267 for cf_add_cflags in $cf_cv_posix_c_source
8268 do
8269 case $cf_fix_cppflags in
8270 no)
8271         case $cf_add_cflags in #(vi
8272         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8273                 case $cf_add_cflags in
8274                 -D*)
8275                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8276
8277                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8278                                 && test -z "${cf_tst_cflags}" \
8279                                 && cf_fix_cppflags=yes
8280
8281                         if test $cf_fix_cppflags = yes ; then
8282                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8283                                 continue
8284                         elif test "${cf_tst_cflags}" = "\"'" ; then
8285                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8286                                 continue
8287                         fi
8288                         ;;
8289                 esac
8290                 case "$CPPFLAGS" in
8291                 *$cf_add_cflags) #(vi
8292                         ;;
8293                 *) #(vi
8294                         case $cf_add_cflags in #(vi
8295                         -D*)
8296                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8297
8298 CPPFLAGS=`echo "$CPPFLAGS" | \
8299         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8300                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8301
8302                                 ;;
8303                         esac
8304                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8305                         ;;
8306                 esac
8307                 ;;
8308         *)
8309                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8310                 ;;
8311         esac
8312         ;;
8313 yes)
8314         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8315
8316         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8317
8318         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8319                 && test -z "${cf_tst_cflags}" \
8320                 && cf_fix_cppflags=no
8321         ;;
8322 esac
8323 done
8324
8325 if test -n "$cf_new_cflags" ; then
8326
8327         CFLAGS="$CFLAGS $cf_new_cflags"
8328 fi
8329
8330 if test -n "$cf_new_cppflags" ; then
8331
8332         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8333 fi
8334
8335 if test -n "$cf_new_extra_cppflags" ; then
8336
8337         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8338 fi
8339
8340 fi
8341
8342         ;;
8343 esac
8344
8345 if test -n "$cf_xopen_source" ; then
8346
8347 cf_fix_cppflags=no
8348 cf_new_cflags=
8349 cf_new_cppflags=
8350 cf_new_extra_cppflags=
8351
8352 for cf_add_cflags in $cf_xopen_source
8353 do
8354 case $cf_fix_cppflags in
8355 no)
8356         case $cf_add_cflags in #(vi
8357         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8358                 case $cf_add_cflags in
8359                 -D*)
8360                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8361
8362                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8363                                 && test -z "${cf_tst_cflags}" \
8364                                 && cf_fix_cppflags=yes
8365
8366                         if test $cf_fix_cppflags = yes ; then
8367                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8368                                 continue
8369                         elif test "${cf_tst_cflags}" = "\"'" ; then
8370                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8371                                 continue
8372                         fi
8373                         ;;
8374                 esac
8375                 case "$CPPFLAGS" in
8376                 *$cf_add_cflags) #(vi
8377                         ;;
8378                 *) #(vi
8379                         case $cf_add_cflags in #(vi
8380                         -D*)
8381                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8382
8383 CPPFLAGS=`echo "$CPPFLAGS" | \
8384         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8385                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8386
8387                                 ;;
8388                         esac
8389                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8390                         ;;
8391                 esac
8392                 ;;
8393         *)
8394                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8395                 ;;
8396         esac
8397         ;;
8398 yes)
8399         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8400
8401         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8402
8403         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8404                 && test -z "${cf_tst_cflags}" \
8405                 && cf_fix_cppflags=no
8406         ;;
8407 esac
8408 done
8409
8410 if test -n "$cf_new_cflags" ; then
8411
8412         CFLAGS="$CFLAGS $cf_new_cflags"
8413 fi
8414
8415 if test -n "$cf_new_cppflags" ; then
8416
8417         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8418 fi
8419
8420 if test -n "$cf_new_extra_cppflags" ; then
8421
8422         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8423 fi
8424
8425 fi
8426
8427 # Check whether --enable-largefile or --disable-largefile was given.
8428 if test "${enable_largefile+set}" = set; then
8429   enableval="$enable_largefile"
8430
8431 fi;
8432 if test "$enable_largefile" != no; then
8433
8434   echo "$as_me:8434: checking for special C compiler options needed for large files" >&5
8435 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
8436 if test "${ac_cv_sys_largefile_CC+set}" = set; then
8437   echo $ECHO_N "(cached) $ECHO_C" >&6
8438 else
8439   ac_cv_sys_largefile_CC=no
8440      if test "$GCC" != yes; then
8441        ac_save_CC=$CC
8442        while :; do
8443          # IRIX 6.2 and later do not support large files by default,
8444          # so use the C compiler's -n32 option if that helps.
8445          cat >conftest.$ac_ext <<_ACEOF
8446 #line 8446 "configure"
8447 #include "confdefs.h"
8448 #include <sys/types.h>
8449  /* Check that off_t can represent 2**63 - 1 correctly.
8450     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8451     since some C++ compilers masquerading as C compilers
8452     incorrectly reject 9223372036854775807.  */
8453 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8454   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8455                        && LARGE_OFF_T % 2147483647 == 1)
8456                       ? 1 : -1];
8457 int
8458 main ()
8459 {
8460
8461   ;
8462   return 0;
8463 }
8464 _ACEOF
8465          rm -f conftest.$ac_objext
8466 if { (eval echo "$as_me:8466: \"$ac_compile\"") >&5
8467   (eval $ac_compile) 2>&5
8468   ac_status=$?
8469   echo "$as_me:8469: \$? = $ac_status" >&5
8470   (exit $ac_status); } &&
8471          { ac_try='test -s conftest.$ac_objext'
8472   { (eval echo "$as_me:8472: \"$ac_try\"") >&5
8473   (eval $ac_try) 2>&5
8474   ac_status=$?
8475   echo "$as_me:8475: \$? = $ac_status" >&5
8476   (exit $ac_status); }; }; then
8477   break
8478 else
8479   echo "$as_me: failed program was:" >&5
8480 cat conftest.$ac_ext >&5
8481 fi
8482 rm -f conftest.$ac_objext
8483          CC="$CC -n32"
8484          rm -f conftest.$ac_objext
8485 if { (eval echo "$as_me:8485: \"$ac_compile\"") >&5
8486   (eval $ac_compile) 2>&5
8487   ac_status=$?
8488   echo "$as_me:8488: \$? = $ac_status" >&5
8489   (exit $ac_status); } &&
8490          { ac_try='test -s conftest.$ac_objext'
8491   { (eval echo "$as_me:8491: \"$ac_try\"") >&5
8492   (eval $ac_try) 2>&5
8493   ac_status=$?
8494   echo "$as_me:8494: \$? = $ac_status" >&5
8495   (exit $ac_status); }; }; then
8496   ac_cv_sys_largefile_CC=' -n32'; break
8497 else
8498   echo "$as_me: failed program was:" >&5
8499 cat conftest.$ac_ext >&5
8500 fi
8501 rm -f conftest.$ac_objext
8502          break
8503        done
8504        CC=$ac_save_CC
8505        rm -f conftest.$ac_ext
8506     fi
8507 fi
8508 echo "$as_me:8508: result: $ac_cv_sys_largefile_CC" >&5
8509 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
8510   if test "$ac_cv_sys_largefile_CC" != no; then
8511     CC=$CC$ac_cv_sys_largefile_CC
8512   fi
8513
8514   echo "$as_me:8514: checking for _FILE_OFFSET_BITS value needed for large files" >&5
8515 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
8516 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
8517   echo $ECHO_N "(cached) $ECHO_C" >&6
8518 else
8519   while :; do
8520   ac_cv_sys_file_offset_bits=no
8521   cat >conftest.$ac_ext <<_ACEOF
8522 #line 8522 "configure"
8523 #include "confdefs.h"
8524 #include <sys/types.h>
8525  /* Check that off_t can represent 2**63 - 1 correctly.
8526     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8527     since some C++ compilers masquerading as C compilers
8528     incorrectly reject 9223372036854775807.  */
8529 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8530   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8531                        && LARGE_OFF_T % 2147483647 == 1)
8532                       ? 1 : -1];
8533 int
8534 main ()
8535 {
8536
8537   ;
8538   return 0;
8539 }
8540 _ACEOF
8541 rm -f conftest.$ac_objext
8542 if { (eval echo "$as_me:8542: \"$ac_compile\"") >&5
8543   (eval $ac_compile) 2>&5
8544   ac_status=$?
8545   echo "$as_me:8545: \$? = $ac_status" >&5
8546   (exit $ac_status); } &&
8547          { ac_try='test -s conftest.$ac_objext'
8548   { (eval echo "$as_me:8548: \"$ac_try\"") >&5
8549   (eval $ac_try) 2>&5
8550   ac_status=$?
8551   echo "$as_me:8551: \$? = $ac_status" >&5
8552   (exit $ac_status); }; }; then
8553   break
8554 else
8555   echo "$as_me: failed program was:" >&5
8556 cat conftest.$ac_ext >&5
8557 fi
8558 rm -f conftest.$ac_objext conftest.$ac_ext
8559   cat >conftest.$ac_ext <<_ACEOF
8560 #line 8560 "configure"
8561 #include "confdefs.h"
8562 #define _FILE_OFFSET_BITS 64
8563 #include <sys/types.h>
8564  /* Check that off_t can represent 2**63 - 1 correctly.
8565     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8566     since some C++ compilers masquerading as C compilers
8567     incorrectly reject 9223372036854775807.  */
8568 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8569   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8570                        && LARGE_OFF_T % 2147483647 == 1)
8571                       ? 1 : -1];
8572 int
8573 main ()
8574 {
8575
8576   ;
8577   return 0;
8578 }
8579 _ACEOF
8580 rm -f conftest.$ac_objext
8581 if { (eval echo "$as_me:8581: \"$ac_compile\"") >&5
8582   (eval $ac_compile) 2>&5
8583   ac_status=$?
8584   echo "$as_me:8584: \$? = $ac_status" >&5
8585   (exit $ac_status); } &&
8586          { ac_try='test -s conftest.$ac_objext'
8587   { (eval echo "$as_me:8587: \"$ac_try\"") >&5
8588   (eval $ac_try) 2>&5
8589   ac_status=$?
8590   echo "$as_me:8590: \$? = $ac_status" >&5
8591   (exit $ac_status); }; }; then
8592   ac_cv_sys_file_offset_bits=64; break
8593 else
8594   echo "$as_me: failed program was:" >&5
8595 cat conftest.$ac_ext >&5
8596 fi
8597 rm -f conftest.$ac_objext conftest.$ac_ext
8598   break
8599 done
8600 fi
8601 echo "$as_me:8601: result: $ac_cv_sys_file_offset_bits" >&5
8602 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
8603 if test "$ac_cv_sys_file_offset_bits" != no; then
8604
8605 cat >>confdefs.h <<EOF
8606 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
8607 EOF
8608
8609 fi
8610 rm -rf conftest*
8611   echo "$as_me:8611: checking for _LARGE_FILES value needed for large files" >&5
8612 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
8613 if test "${ac_cv_sys_large_files+set}" = set; then
8614   echo $ECHO_N "(cached) $ECHO_C" >&6
8615 else
8616   while :; do
8617   ac_cv_sys_large_files=no
8618   cat >conftest.$ac_ext <<_ACEOF
8619 #line 8619 "configure"
8620 #include "confdefs.h"
8621 #include <sys/types.h>
8622  /* Check that off_t can represent 2**63 - 1 correctly.
8623     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8624     since some C++ compilers masquerading as C compilers
8625     incorrectly reject 9223372036854775807.  */
8626 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8627   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8628                        && LARGE_OFF_T % 2147483647 == 1)
8629                       ? 1 : -1];
8630 int
8631 main ()
8632 {
8633
8634   ;
8635   return 0;
8636 }
8637 _ACEOF
8638 rm -f conftest.$ac_objext
8639 if { (eval echo "$as_me:8639: \"$ac_compile\"") >&5
8640   (eval $ac_compile) 2>&5
8641   ac_status=$?
8642   echo "$as_me:8642: \$? = $ac_status" >&5
8643   (exit $ac_status); } &&
8644          { ac_try='test -s conftest.$ac_objext'
8645   { (eval echo "$as_me:8645: \"$ac_try\"") >&5
8646   (eval $ac_try) 2>&5
8647   ac_status=$?
8648   echo "$as_me:8648: \$? = $ac_status" >&5
8649   (exit $ac_status); }; }; then
8650   break
8651 else
8652   echo "$as_me: failed program was:" >&5
8653 cat conftest.$ac_ext >&5
8654 fi
8655 rm -f conftest.$ac_objext conftest.$ac_ext
8656   cat >conftest.$ac_ext <<_ACEOF
8657 #line 8657 "configure"
8658 #include "confdefs.h"
8659 #define _LARGE_FILES 1
8660 #include <sys/types.h>
8661  /* Check that off_t can represent 2**63 - 1 correctly.
8662     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8663     since some C++ compilers masquerading as C compilers
8664     incorrectly reject 9223372036854775807.  */
8665 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8666   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8667                        && LARGE_OFF_T % 2147483647 == 1)
8668                       ? 1 : -1];
8669 int
8670 main ()
8671 {
8672
8673   ;
8674   return 0;
8675 }
8676 _ACEOF
8677 rm -f conftest.$ac_objext
8678 if { (eval echo "$as_me:8678: \"$ac_compile\"") >&5
8679   (eval $ac_compile) 2>&5
8680   ac_status=$?
8681   echo "$as_me:8681: \$? = $ac_status" >&5
8682   (exit $ac_status); } &&
8683          { ac_try='test -s conftest.$ac_objext'
8684   { (eval echo "$as_me:8684: \"$ac_try\"") >&5
8685   (eval $ac_try) 2>&5
8686   ac_status=$?
8687   echo "$as_me:8687: \$? = $ac_status" >&5
8688   (exit $ac_status); }; }; then
8689   ac_cv_sys_large_files=1; break
8690 else
8691   echo "$as_me: failed program was:" >&5
8692 cat conftest.$ac_ext >&5
8693 fi
8694 rm -f conftest.$ac_objext conftest.$ac_ext
8695   break
8696 done
8697 fi
8698 echo "$as_me:8698: result: $ac_cv_sys_large_files" >&5
8699 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
8700 if test "$ac_cv_sys_large_files" != no; then
8701
8702 cat >>confdefs.h <<EOF
8703 #define _LARGE_FILES $ac_cv_sys_large_files
8704 EOF
8705
8706 fi
8707 rm -rf conftest*
8708 fi
8709
8710     if test "$enable_largefile" != no ; then
8711         echo "$as_me:8711: checking for _LARGEFILE_SOURCE value needed for large files" >&5
8712 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
8713 if test "${ac_cv_sys_largefile_source+set}" = set; then
8714   echo $ECHO_N "(cached) $ECHO_C" >&6
8715 else
8716   while :; do
8717   ac_cv_sys_largefile_source=no
8718   cat >conftest.$ac_ext <<_ACEOF
8719 #line 8719 "configure"
8720 #include "confdefs.h"
8721 #include <stdio.h>
8722 int
8723 main ()
8724 {
8725 return !fseeko;
8726   ;
8727   return 0;
8728 }
8729 _ACEOF
8730 rm -f conftest.$ac_objext
8731 if { (eval echo "$as_me:8731: \"$ac_compile\"") >&5
8732   (eval $ac_compile) 2>&5
8733   ac_status=$?
8734   echo "$as_me:8734: \$? = $ac_status" >&5
8735   (exit $ac_status); } &&
8736          { ac_try='test -s conftest.$ac_objext'
8737   { (eval echo "$as_me:8737: \"$ac_try\"") >&5
8738   (eval $ac_try) 2>&5
8739   ac_status=$?
8740   echo "$as_me:8740: \$? = $ac_status" >&5
8741   (exit $ac_status); }; }; then
8742   break
8743 else
8744   echo "$as_me: failed program was:" >&5
8745 cat conftest.$ac_ext >&5
8746 fi
8747 rm -f conftest.$ac_objext conftest.$ac_ext
8748   cat >conftest.$ac_ext <<_ACEOF
8749 #line 8749 "configure"
8750 #include "confdefs.h"
8751 #define _LARGEFILE_SOURCE 1
8752 #include <stdio.h>
8753 int
8754 main ()
8755 {
8756 return !fseeko;
8757   ;
8758   return 0;
8759 }
8760 _ACEOF
8761 rm -f conftest.$ac_objext
8762 if { (eval echo "$as_me:8762: \"$ac_compile\"") >&5
8763   (eval $ac_compile) 2>&5
8764   ac_status=$?
8765   echo "$as_me:8765: \$? = $ac_status" >&5
8766   (exit $ac_status); } &&
8767          { ac_try='test -s conftest.$ac_objext'
8768   { (eval echo "$as_me:8768: \"$ac_try\"") >&5
8769   (eval $ac_try) 2>&5
8770   ac_status=$?
8771   echo "$as_me:8771: \$? = $ac_status" >&5
8772   (exit $ac_status); }; }; then
8773   ac_cv_sys_largefile_source=1; break
8774 else
8775   echo "$as_me: failed program was:" >&5
8776 cat conftest.$ac_ext >&5
8777 fi
8778 rm -f conftest.$ac_objext conftest.$ac_ext
8779   break
8780 done
8781 fi
8782 echo "$as_me:8782: result: $ac_cv_sys_largefile_source" >&5
8783 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
8784 if test "$ac_cv_sys_largefile_source" != no; then
8785
8786 cat >>confdefs.h <<EOF
8787 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
8788 EOF
8789
8790 fi
8791 rm -rf conftest*
8792
8793 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
8794 # in glibc 2.1.3, but that breaks too many other things.
8795 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
8796 echo "$as_me:8796: checking for fseeko" >&5
8797 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
8798 if test "${ac_cv_func_fseeko+set}" = set; then
8799   echo $ECHO_N "(cached) $ECHO_C" >&6
8800 else
8801   cat >conftest.$ac_ext <<_ACEOF
8802 #line 8802 "configure"
8803 #include "confdefs.h"
8804 #include <stdio.h>
8805 int
8806 main ()
8807 {
8808 return fseeko && fseeko (stdin, 0, 0);
8809   ;
8810   return 0;
8811 }
8812 _ACEOF
8813 rm -f conftest.$ac_objext conftest$ac_exeext
8814 if { (eval echo "$as_me:8814: \"$ac_link\"") >&5
8815   (eval $ac_link) 2>&5
8816   ac_status=$?
8817   echo "$as_me:8817: \$? = $ac_status" >&5
8818   (exit $ac_status); } &&
8819          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_func_fseeko=yes
8826 else
8827   echo "$as_me: failed program was:" >&5
8828 cat conftest.$ac_ext >&5
8829 ac_cv_func_fseeko=no
8830 fi
8831 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8832 fi
8833 echo "$as_me:8833: result: $ac_cv_func_fseeko" >&5
8834 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
8835 if test $ac_cv_func_fseeko = yes; then
8836
8837 cat >>confdefs.h <<\EOF
8838 #define HAVE_FSEEKO 1
8839 EOF
8840
8841 fi
8842
8843         # Normally we would collect these definitions in the config.h,
8844         # but (like _XOPEN_SOURCE), some environments rely on having these
8845         # defined before any of the system headers are included.  Another
8846         # case comes up with C++, e.g., on AIX the compiler compiles the
8847         # header files by themselves before looking at the body files it is
8848         # told to compile.  For ncurses, those header files do not include
8849         # the config.h
8850         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
8851         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
8852         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
8853
8854         echo "$as_me:8854: checking whether to use struct dirent64" >&5
8855 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
8856 if test "${cf_cv_struct_dirent64+set}" = set; then
8857   echo $ECHO_N "(cached) $ECHO_C" >&6
8858 else
8859
8860                 cat >conftest.$ac_ext <<_ACEOF
8861 #line 8861 "configure"
8862 #include "confdefs.h"
8863
8864 #include <sys/types.h>
8865 #include <dirent.h>
8866
8867 int
8868 main ()
8869 {
8870
8871                 /* if transitional largefile support is setup, this is true */
8872                 extern struct dirent64 * readdir(DIR *);
8873                 struct dirent64 *x = readdir((DIR *)0);
8874                 struct dirent *y = readdir((DIR *)0);
8875                 int z = x - y;
8876
8877   ;
8878   return 0;
8879 }
8880 _ACEOF
8881 rm -f conftest.$ac_objext
8882 if { (eval echo "$as_me:8882: \"$ac_compile\"") >&5
8883   (eval $ac_compile) 2>&5
8884   ac_status=$?
8885   echo "$as_me:8885: \$? = $ac_status" >&5
8886   (exit $ac_status); } &&
8887          { ac_try='test -s conftest.$ac_objext'
8888   { (eval echo "$as_me:8888: \"$ac_try\"") >&5
8889   (eval $ac_try) 2>&5
8890   ac_status=$?
8891   echo "$as_me:8891: \$? = $ac_status" >&5
8892   (exit $ac_status); }; }; then
8893   cf_cv_struct_dirent64=yes
8894 else
8895   echo "$as_me: failed program was:" >&5
8896 cat conftest.$ac_ext >&5
8897 cf_cv_struct_dirent64=no
8898 fi
8899 rm -f conftest.$ac_objext conftest.$ac_ext
8900
8901 fi
8902 echo "$as_me:8902: result: $cf_cv_struct_dirent64" >&5
8903 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
8904         test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
8905 #define HAVE_STRUCT_DIRENT64 1
8906 EOF
8907
8908     fi
8909
8910 ### Enable compiling-in rcs id's
8911 echo "$as_me:8911: checking if RCS identifiers should be compiled-in" >&5
8912 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
8913
8914 # Check whether --with-rcs-ids or --without-rcs-ids was given.
8915 if test "${with_rcs_ids+set}" = set; then
8916   withval="$with_rcs_ids"
8917   with_rcs_ids=$withval
8918 else
8919   with_rcs_ids=no
8920 fi;
8921 echo "$as_me:8921: result: $with_rcs_ids" >&5
8922 echo "${ECHO_T}$with_rcs_ids" >&6
8923 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF
8924 #define USE_RCS_IDS 1
8925 EOF
8926
8927 ###############################################################################
8928
8929 ### Note that some functions (such as const) are normally disabled anyway.
8930 echo "$as_me:8930: checking if you want to build with function extensions" >&5
8931 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
8932
8933 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
8934 if test "${enable_ext_funcs+set}" = set; then
8935   enableval="$enable_ext_funcs"
8936   with_ext_funcs=$enableval
8937 else
8938   with_ext_funcs=yes
8939 fi;
8940 echo "$as_me:8940: result: $with_ext_funcs" >&5
8941 echo "${ECHO_T}$with_ext_funcs" >&6
8942 if test "$with_ext_funcs" = yes ; then
8943         NCURSES_EXT_FUNCS=1
8944         cat >>confdefs.h <<\EOF
8945 #define HAVE_USE_DEFAULT_COLORS 1
8946 EOF
8947
8948         cat >>confdefs.h <<\EOF
8949 #define NCURSES_EXT_FUNCS 1
8950 EOF
8951
8952 else
8953         NCURSES_EXT_FUNCS=0
8954 fi
8955
8956 ###   use option --enable-const to turn on use of const beyond that in XSI.
8957 echo "$as_me:8957: checking for extended use of const keyword" >&5
8958 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
8959
8960 # Check whether --enable-const or --disable-const was given.
8961 if test "${enable_const+set}" = set; then
8962   enableval="$enable_const"
8963   with_ext_const=$enableval
8964 else
8965   with_ext_const=no
8966 fi;
8967 echo "$as_me:8967: result: $with_ext_const" >&5
8968 echo "${ECHO_T}$with_ext_const" >&6
8969 NCURSES_CONST='/*nothing*/'
8970 if test "$with_ext_const" = yes ; then
8971         NCURSES_CONST=const
8972 fi
8973
8974 ###############################################################################
8975 # These options are relatively safe to experiment with.
8976
8977 echo "$as_me:8977: checking if you want all development code" >&5
8978 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
8979
8980 # Check whether --with-develop or --without-develop was given.
8981 if test "${with_develop+set}" = set; then
8982   withval="$with_develop"
8983   with_develop=$withval
8984 else
8985   with_develop=no
8986 fi;
8987 echo "$as_me:8987: result: $with_develop" >&5
8988 echo "${ECHO_T}$with_develop" >&6
8989
8990 ###############################################################################
8991 # These are just experimental, probably should not be in a package:
8992
8993 # This is still experimental (20080329), but should ultimately be moved to
8994 # the script-block --with-normal, etc.
8995
8996 echo "$as_me:8996: checking if you want to link with the pthread library" >&5
8997 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
8998
8999 # Check whether --with-pthread or --without-pthread was given.
9000 if test "${with_pthread+set}" = set; then
9001   withval="$with_pthread"
9002   with_pthread=$withval
9003 else
9004   with_pthread=no
9005 fi;
9006 echo "$as_me:9006: result: $with_pthread" >&5
9007 echo "${ECHO_T}$with_pthread" >&6
9008
9009 if test "$with_pthread" != no ; then
9010     echo "$as_me:9010: checking for pthread.h" >&5
9011 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
9012 if test "${ac_cv_header_pthread_h+set}" = set; then
9013   echo $ECHO_N "(cached) $ECHO_C" >&6
9014 else
9015   cat >conftest.$ac_ext <<_ACEOF
9016 #line 9016 "configure"
9017 #include "confdefs.h"
9018 #include <pthread.h>
9019 _ACEOF
9020 if { (eval echo "$as_me:9020: \"$ac_cpp conftest.$ac_ext\"") >&5
9021   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9022   ac_status=$?
9023   egrep -v '^ *\+' conftest.er1 >conftest.err
9024   rm -f conftest.er1
9025   cat conftest.err >&5
9026   echo "$as_me:9026: \$? = $ac_status" >&5
9027   (exit $ac_status); } >/dev/null; then
9028   if test -s conftest.err; then
9029     ac_cpp_err=$ac_c_preproc_warn_flag
9030   else
9031     ac_cpp_err=
9032   fi
9033 else
9034   ac_cpp_err=yes
9035 fi
9036 if test -z "$ac_cpp_err"; then
9037   ac_cv_header_pthread_h=yes
9038 else
9039   echo "$as_me: failed program was:" >&5
9040   cat conftest.$ac_ext >&5
9041   ac_cv_header_pthread_h=no
9042 fi
9043 rm -f conftest.err conftest.$ac_ext
9044 fi
9045 echo "$as_me:9045: result: $ac_cv_header_pthread_h" >&5
9046 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
9047 if test $ac_cv_header_pthread_h = yes; then
9048
9049         cat >>confdefs.h <<\EOF
9050 #define HAVE_PTHREADS_H 1
9051 EOF
9052
9053         echo "$as_me:9053: checking if we can link with the pthread library" >&5
9054 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6
9055         cf_save_LIBS="$LIBS"
9056         LIBS="-lpthread $LIBS"
9057         cat >conftest.$ac_ext <<_ACEOF
9058 #line 9058 "configure"
9059 #include "confdefs.h"
9060
9061 #include <pthread.h>
9062
9063 int
9064 main ()
9065 {
9066
9067         int rc = pthread_create(0,0,0,0);
9068
9069   ;
9070   return 0;
9071 }
9072 _ACEOF
9073 rm -f conftest.$ac_objext conftest$ac_exeext
9074 if { (eval echo "$as_me:9074: \"$ac_link\"") >&5
9075   (eval $ac_link) 2>&5
9076   ac_status=$?
9077   echo "$as_me:9077: \$? = $ac_status" >&5
9078   (exit $ac_status); } &&
9079          { ac_try='test -s conftest$ac_exeext'
9080   { (eval echo "$as_me:9080: \"$ac_try\"") >&5
9081   (eval $ac_try) 2>&5
9082   ac_status=$?
9083   echo "$as_me:9083: \$? = $ac_status" >&5
9084   (exit $ac_status); }; }; then
9085   with_pthread=yes
9086 else
9087   echo "$as_me: failed program was:" >&5
9088 cat conftest.$ac_ext >&5
9089 with_pthread=no
9090 fi
9091 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9092         LIBS="$cf_save_LIBS"
9093         echo "$as_me:9093: result: $with_pthread" >&5
9094 echo "${ECHO_T}$with_pthread" >&6
9095
9096         if test "$with_pthread" = yes ; then
9097             LIBS="-lpthread $LIBS"
9098             cat >>confdefs.h <<\EOF
9099 #define HAVE_LIBPTHREADS 1
9100 EOF
9101
9102         else
9103             { { echo "$as_me:9103: error: Cannot link with pthread library" >&5
9104 echo "$as_me: error: Cannot link with pthread library" >&2;}
9105    { (exit 1); exit 1; }; }
9106         fi
9107
9108 fi
9109
9110 fi
9111
9112 echo "$as_me:9112: checking if you want to use weak-symbols for pthreads" >&5
9113 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
9114
9115 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
9116 if test "${enable_weak_symbols+set}" = set; then
9117   enableval="$enable_weak_symbols"
9118   use_weak_symbols=$withval
9119 else
9120   use_weak_symbols=no
9121 fi;
9122 echo "$as_me:9122: result: $use_weak_symbols" >&5
9123 echo "${ECHO_T}$use_weak_symbols" >&6
9124 if test "$use_weak_symbols" = yes ; then
9125
9126 echo "$as_me:9126: checking if $CC supports weak symbols" >&5
9127 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9128 if test "${cf_cv_weak_symbols+set}" = set; then
9129   echo $ECHO_N "(cached) $ECHO_C" >&6
9130 else
9131
9132 cat >conftest.$ac_ext <<_ACEOF
9133 #line 9133 "configure"
9134 #include "confdefs.h"
9135
9136 #include <stdio.h>
9137 int
9138 main ()
9139 {
9140
9141 #if defined(__GNUC__)
9142 #  if defined __USE_ISOC99
9143 #    define _cat_pragma(exp)    _Pragma(#exp)
9144 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9145 #  else
9146 #    define _weak_pragma(exp)
9147 #  endif
9148 #  define _declare(name)        __extension__ extern __typeof__(name) name
9149 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9150 #endif
9151
9152 weak_symbol(fopen);
9153
9154   ;
9155   return 0;
9156 }
9157 _ACEOF
9158 rm -f conftest.$ac_objext
9159 if { (eval echo "$as_me:9159: \"$ac_compile\"") >&5
9160   (eval $ac_compile) 2>&5
9161   ac_status=$?
9162   echo "$as_me:9162: \$? = $ac_status" >&5
9163   (exit $ac_status); } &&
9164          { ac_try='test -s conftest.$ac_objext'
9165   { (eval echo "$as_me:9165: \"$ac_try\"") >&5
9166   (eval $ac_try) 2>&5
9167   ac_status=$?
9168   echo "$as_me:9168: \$? = $ac_status" >&5
9169   (exit $ac_status); }; }; then
9170   cf_cv_weak_symbols=yes
9171 else
9172   echo "$as_me: failed program was:" >&5
9173 cat conftest.$ac_ext >&5
9174 cf_cv_weak_symbols=no
9175 fi
9176 rm -f conftest.$ac_objext conftest.$ac_ext
9177
9178 fi
9179 echo "$as_me:9179: result: $cf_cv_weak_symbols" >&5
9180 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9181
9182 else
9183     cf_cv_weak_symbols=no
9184 fi
9185
9186 if test $cf_cv_weak_symbols = yes ; then
9187     cat >>confdefs.h <<\EOF
9188 #define USE_WEAK_SYMBOLS 1
9189 EOF
9190
9191 fi
9192
9193 PTHREAD=
9194 if test "$with_pthread" = "yes" ; then
9195     cat >>confdefs.h <<\EOF
9196 #define USE_PTHREADS 1
9197 EOF
9198
9199     enable_reentrant=yes
9200     if test $cf_cv_weak_symbols = yes ; then
9201         PTHREAD=-lpthread
9202     fi
9203 fi
9204
9205 # OpenSUSE is installing ncurses6, using reentrant option.
9206 echo "$as_me:9206: checking for _nc_TABSIZE" >&5
9207 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
9208 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
9209   echo $ECHO_N "(cached) $ECHO_C" >&6
9210 else
9211   cat >conftest.$ac_ext <<_ACEOF
9212 #line 9212 "configure"
9213 #include "confdefs.h"
9214 /* System header to define __stub macros and hopefully few prototypes,
9215     which can conflict with char _nc_TABSIZE (); below.  */
9216 #include <assert.h>
9217 /* Override any gcc2 internal prototype to avoid an error.  */
9218 #ifdef __cplusplus
9219 extern "C"
9220 #endif
9221 /* We use char because int might match the return type of a gcc2
9222    builtin and then its argument prototype would still apply.  */
9223 char _nc_TABSIZE ();
9224 char (*f) ();
9225
9226 int
9227 main ()
9228 {
9229 /* The GNU C library defines this for functions which it implements
9230     to always fail with ENOSYS.  Some functions are actually named
9231     something starting with __ and the normal name is an alias.  */
9232 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
9233 choke me
9234 #else
9235 f = _nc_TABSIZE;
9236 #endif
9237
9238   ;
9239   return 0;
9240 }
9241 _ACEOF
9242 rm -f conftest.$ac_objext conftest$ac_exeext
9243 if { (eval echo "$as_me:9243: \"$ac_link\"") >&5
9244   (eval $ac_link) 2>&5
9245   ac_status=$?
9246   echo "$as_me:9246: \$? = $ac_status" >&5
9247   (exit $ac_status); } &&
9248          { ac_try='test -s conftest$ac_exeext'
9249   { (eval echo "$as_me:9249: \"$ac_try\"") >&5
9250   (eval $ac_try) 2>&5
9251   ac_status=$?
9252   echo "$as_me:9252: \$? = $ac_status" >&5
9253   (exit $ac_status); }; }; then
9254   ac_cv_func__nc_TABSIZE=yes
9255 else
9256   echo "$as_me: failed program was:" >&5
9257 cat conftest.$ac_ext >&5
9258 ac_cv_func__nc_TABSIZE=no
9259 fi
9260 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9261 fi
9262 echo "$as_me:9262: result: $ac_cv_func__nc_TABSIZE" >&5
9263 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
9264 if test $ac_cv_func__nc_TABSIZE = yes; then
9265   assume_reentrant=yes
9266 else
9267   assume_reentrant=no
9268 fi
9269
9270 # Reentrant code has to be opaque; there's little advantage to making ncurses
9271 # opaque outside of that, so there is no --enable-opaque option.  We can use
9272 # this option without --with-pthreads, but this will be always set for
9273 # pthreads.
9274 echo "$as_me:9274: checking if you want experimental reentrant code" >&5
9275 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9276
9277 # Check whether --enable-reentrant or --disable-reentrant was given.
9278 if test "${enable_reentrant+set}" = set; then
9279   enableval="$enable_reentrant"
9280   with_reentrant=$enableval
9281 else
9282   with_reentrant=$assume_reentrant
9283 fi;
9284 echo "$as_me:9284: result: $with_reentrant" >&5
9285 echo "${ECHO_T}$with_reentrant" >&6
9286 if test "$with_reentrant" = yes ; then
9287         cf_cv_enable_reentrant=1
9288         if test $cf_cv_weak_symbols = yes ; then
9289
9290 # remove pthread library from $LIBS
9291 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9292
9293         elif test "$assume_reentrant" = no ; then
9294                 LIB_SUFFIX="t${LIB_SUFFIX}"
9295         fi
9296         cat >>confdefs.h <<\EOF
9297 #define USE_REENTRANT 1
9298 EOF
9299
9300 else
9301         cf_cv_enable_reentrant=0
9302 fi
9303
9304 ### Allow using a different wrap-prefix
9305 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9306         echo "$as_me:9306: checking for prefix used to wrap public variables" >&5
9307 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9308
9309 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9310 if test "${with_wrap_prefix+set}" = set; then
9311   withval="$with_wrap_prefix"
9312   NCURSES_WRAP_PREFIX=$withval
9313 else
9314   NCURSES_WRAP_PREFIX=_nc_
9315 fi;
9316         echo "$as_me:9316: result: $NCURSES_WRAP_PREFIX" >&5
9317 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9318 else
9319         NCURSES_WRAP_PREFIX=_nc_
9320 fi
9321
9322 cat >>confdefs.h <<EOF
9323 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9324 EOF
9325
9326 ###############################################################################
9327
9328 ###     use option --disable-echo to suppress full display compiling commands
9329 echo "$as_me:9329: checking if you want to display full commands during build" >&5
9330 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6
9331
9332 # Check whether --enable-echo or --disable-echo was given.
9333 if test "${enable_echo+set}" = set; then
9334   enableval="$enable_echo"
9335   with_echo=$enableval
9336 else
9337   with_echo=yes
9338 fi;
9339 if test "$with_echo" = yes; then
9340         ECHO_LINK=
9341 else
9342         ECHO_LINK='@ echo linking $@ ... ;'
9343 fi
9344 echo "$as_me:9344: result: $with_echo" >&5
9345 echo "${ECHO_T}$with_echo" >&6
9346
9347 ###     use option --enable-warnings to turn on all gcc warnings
9348 echo "$as_me:9348: checking if you want to see compiler warnings" >&5
9349 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
9350
9351 # Check whether --enable-warnings or --disable-warnings was given.
9352 if test "${enable_warnings+set}" = set; then
9353   enableval="$enable_warnings"
9354   with_warnings=$enableval
9355 fi;
9356 echo "$as_me:9356: result: $with_warnings" >&5
9357 echo "${ECHO_T}$with_warnings" >&6
9358
9359 if test "x$with_warnings" = "xyes"; then
9360
9361         ADAFLAGS="$ADAFLAGS -gnatg"
9362
9363 INTEL_COMPILER=no
9364
9365 if test "$GCC" = yes ; then
9366         case $host_os in
9367         linux*|gnu*)
9368                 echo "$as_me:9368: checking if this is really Intel C compiler" >&5
9369 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
9370                 cf_save_CFLAGS="$CFLAGS"
9371                 CFLAGS="$CFLAGS -no-gcc"
9372                 cat >conftest.$ac_ext <<_ACEOF
9373 #line 9373 "configure"
9374 #include "confdefs.h"
9375
9376 int
9377 main ()
9378 {
9379
9380 #ifdef __INTEL_COMPILER
9381 #else
9382 make an error
9383 #endif
9384
9385   ;
9386   return 0;
9387 }
9388 _ACEOF
9389 rm -f conftest.$ac_objext
9390 if { (eval echo "$as_me:9390: \"$ac_compile\"") >&5
9391   (eval $ac_compile) 2>&5
9392   ac_status=$?
9393   echo "$as_me:9393: \$? = $ac_status" >&5
9394   (exit $ac_status); } &&
9395          { ac_try='test -s conftest.$ac_objext'
9396   { (eval echo "$as_me:9396: \"$ac_try\"") >&5
9397   (eval $ac_try) 2>&5
9398   ac_status=$?
9399   echo "$as_me:9399: \$? = $ac_status" >&5
9400   (exit $ac_status); }; }; then
9401   INTEL_COMPILER=yes
9402 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
9403
9404 else
9405   echo "$as_me: failed program was:" >&5
9406 cat conftest.$ac_ext >&5
9407 fi
9408 rm -f conftest.$ac_objext conftest.$ac_ext
9409                 CFLAGS="$cf_save_CFLAGS"
9410                 echo "$as_me:9410: result: $INTEL_COMPILER" >&5
9411 echo "${ECHO_T}$INTEL_COMPILER" >&6
9412                 ;;
9413         esac
9414 fi
9415
9416 cat > conftest.$ac_ext <<EOF
9417 #line 9417 "${as_me:-configure}"
9418 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
9419 EOF
9420
9421 if test "$INTEL_COMPILER" = yes
9422 then
9423 # The "-wdXXX" options suppress warnings:
9424 # remark #1419: external declaration in primary source file
9425 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
9426 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
9427 # remark #193: zero used for undefined preprocessing identifier
9428 # remark #593: variable "curs_sb_left_arrow" was set but never used
9429 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
9430 # remark #869: parameter "tw" was never referenced
9431 # remark #981: operands are evaluated in unspecified order
9432 # warning #279: controlling expression is constant
9433
9434         { echo "$as_me:9434: checking for $CC warning options..." >&5
9435 echo "$as_me: checking for $CC warning options..." >&6;}
9436         cf_save_CFLAGS="$CFLAGS"
9437         EXTRA_CFLAGS="-Wall"
9438         for cf_opt in \
9439                 wd1419 \
9440                 wd1683 \
9441                 wd1684 \
9442                 wd193 \
9443                 wd593 \
9444                 wd279 \
9445                 wd810 \
9446                 wd869 \
9447                 wd981
9448         do
9449                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
9450                 if { (eval echo "$as_me:9450: \"$ac_compile\"") >&5
9451   (eval $ac_compile) 2>&5
9452   ac_status=$?
9453   echo "$as_me:9453: \$? = $ac_status" >&5
9454   (exit $ac_status); }; then
9455                         test -n "$verbose" && echo "$as_me:9455: result: ... -$cf_opt" >&5
9456 echo "${ECHO_T}... -$cf_opt" >&6
9457                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
9458                 fi
9459         done
9460         CFLAGS="$cf_save_CFLAGS"
9461
9462 elif test "$GCC" = yes
9463 then
9464         { echo "$as_me:9464: checking for $CC warning options..." >&5
9465 echo "$as_me: checking for $CC warning options..." >&6;}
9466         cf_save_CFLAGS="$CFLAGS"
9467         EXTRA_CFLAGS=
9468         cf_warn_CONST=""
9469         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
9470         for cf_opt in W Wall \
9471                 Wbad-function-cast \
9472                 Wcast-align \
9473                 Wcast-qual \
9474                 Winline \
9475                 Wmissing-declarations \
9476                 Wmissing-prototypes \
9477                 Wnested-externs \
9478                 Wpointer-arith \
9479                 Wshadow \
9480                 Wstrict-prototypes \
9481                 Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
9482         do
9483                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
9484                 if { (eval echo "$as_me:9484: \"$ac_compile\"") >&5
9485   (eval $ac_compile) 2>&5
9486   ac_status=$?
9487   echo "$as_me:9487: \$? = $ac_status" >&5
9488   (exit $ac_status); }; then
9489                         test -n "$verbose" && echo "$as_me:9489: result: ... -$cf_opt" >&5
9490 echo "${ECHO_T}... -$cf_opt" >&6
9491                         case $cf_opt in #(vi
9492                         Wcast-qual) #(vi
9493                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
9494                                 ;;
9495                         Winline) #(vi
9496                                 case $GCC_VERSION in
9497                                 [34].*)
9498                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
9499
9500 echo "${as_me:-configure}:9500: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
9501
9502                                         continue;;
9503                                 esac
9504                                 ;;
9505                         esac
9506                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
9507                 fi
9508         done
9509         CFLAGS="$cf_save_CFLAGS"
9510 fi
9511 rm -rf conftest*
9512
9513 fi
9514
9515 if test "$GCC" = yes
9516 then
9517 cat > conftest.i <<EOF
9518 #ifndef GCC_PRINTF
9519 #define GCC_PRINTF 0
9520 #endif
9521 #ifndef GCC_SCANF
9522 #define GCC_SCANF 0
9523 #endif
9524 #ifndef GCC_NORETURN
9525 #define GCC_NORETURN /* nothing */
9526 #endif
9527 #ifndef GCC_UNUSED
9528 #define GCC_UNUSED /* nothing */
9529 #endif
9530 EOF
9531 if test "$GCC" = yes
9532 then
9533         { echo "$as_me:9533: checking for $CC __attribute__ directives..." >&5
9534 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
9535 cat > conftest.$ac_ext <<EOF
9536 #line 9536 "${as_me:-configure}"
9537 #include "confdefs.h"
9538 #include "conftest.h"
9539 #include "conftest.i"
9540 #if     GCC_PRINTF
9541 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
9542 #else
9543 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
9544 #endif
9545 #if     GCC_SCANF
9546 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
9547 #else
9548 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
9549 #endif
9550 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
9551 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
9552 extern void foo(void) GCC_NORETURN;
9553 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
9554 EOF
9555         cf_printf_attribute=no
9556         cf_scanf_attribute=no
9557         for cf_attribute in scanf printf unused noreturn
9558         do
9559
9560 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9561
9562                 cf_directive="__attribute__(($cf_attribute))"
9563                 echo "checking for $CC $cf_directive" 1>&5
9564
9565                 case $cf_attribute in #(vi
9566                 printf) #(vi
9567                         cf_printf_attribute=yes
9568                         cat >conftest.h <<EOF
9569 #define GCC_$cf_ATTRIBUTE 1
9570 EOF
9571                         ;;
9572                 scanf) #(vi
9573                         cf_scanf_attribute=yes
9574                         cat >conftest.h <<EOF
9575 #define GCC_$cf_ATTRIBUTE 1
9576 EOF
9577                         ;;
9578                 *) #(vi
9579                         cat >conftest.h <<EOF
9580 #define GCC_$cf_ATTRIBUTE $cf_directive
9581 EOF
9582                         ;;
9583                 esac
9584
9585                 if { (eval echo "$as_me:9585: \"$ac_compile\"") >&5
9586   (eval $ac_compile) 2>&5
9587   ac_status=$?
9588   echo "$as_me:9588: \$? = $ac_status" >&5
9589   (exit $ac_status); }; then
9590                         test -n "$verbose" && echo "$as_me:9590: result: ... $cf_attribute" >&5
9591 echo "${ECHO_T}... $cf_attribute" >&6
9592                         cat conftest.h >>confdefs.h
9593                         case $cf_attribute in #(vi
9594                         printf) #(vi
9595                                 if test "$cf_printf_attribute" = no ; then
9596                                         cat >>confdefs.h <<EOF
9597 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
9598 EOF
9599                                 else
9600                                         cat >>confdefs.h <<EOF
9601 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
9602 EOF
9603                                 fi
9604                                 ;;
9605                         scanf) #(vi
9606                                 if test "$cf_scanf_attribute" = no ; then
9607                                         cat >>confdefs.h <<EOF
9608 #define GCC_SCANFLIKE(fmt,var) /* nothing */
9609 EOF
9610                                 else
9611                                         cat >>confdefs.h <<EOF
9612 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
9613 EOF
9614                                 fi
9615                                 ;;
9616                         esac
9617                 fi
9618         done
9619 else
9620         fgrep define conftest.i >>confdefs.h
9621 fi
9622 rm -rf conftest*
9623 fi
9624
9625 ###     use option --enable-assertions to turn on generation of assertion code
9626 echo "$as_me:9626: checking if you want to enable runtime assertions" >&5
9627 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
9628
9629 # Check whether --enable-assertions or --disable-assertions was given.
9630 if test "${enable_assertions+set}" = set; then
9631   enableval="$enable_assertions"
9632   with_assertions=$enableval
9633 else
9634   with_assertions=no
9635 fi;
9636 echo "$as_me:9636: result: $with_assertions" >&5
9637 echo "${ECHO_T}$with_assertions" >&6
9638 if test -n "$GCC"
9639 then
9640         if test "$with_assertions" = no
9641         then
9642                 cat >>confdefs.h <<\EOF
9643 #define NDEBUG 1
9644 EOF
9645
9646                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
9647         else
9648
9649         ADAFLAGS="$ADAFLAGS -gnata"
9650
9651         fi
9652 fi
9653
9654 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
9655 cat >>confdefs.h <<\EOF
9656 #define HAVE_NC_ALLOC_H 1
9657 EOF
9658
9659 ###     use option --enable-expanded to generate certain macros as functions
9660
9661 # Check whether --enable-expanded or --disable-expanded was given.
9662 if test "${enable_expanded+set}" = set; then
9663   enableval="$enable_expanded"
9664   test "$enableval" = yes && cat >>confdefs.h <<\EOF
9665 #define NCURSES_EXPANDED 1
9666 EOF
9667
9668 fi;
9669
9670 ###     use option --disable-macros to suppress macros in favor of functions
9671
9672 # Check whether --enable-macros or --disable-macros was given.
9673 if test "${enable_macros+set}" = set; then
9674   enableval="$enable_macros"
9675   test "$enableval" = no && cat >>confdefs.h <<\EOF
9676 #define NCURSES_NOMACROS 1
9677 EOF
9678
9679 fi;
9680
9681 # Normally we only add trace() to the debug-library.  Allow this to be
9682 # extended to all models of the ncurses library:
9683 cf_all_traces=no
9684 case "$CFLAGS $CPPFLAGS" in
9685 *-DTRACE*)
9686         cf_all_traces=yes
9687         ;;
9688 esac
9689
9690 echo "$as_me:9690: checking whether to add trace feature to all models" >&5
9691 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
9692
9693 # Check whether --with-trace or --without-trace was given.
9694 if test "${with_trace+set}" = set; then
9695   withval="$with_trace"
9696   cf_with_trace=$withval
9697 else
9698   cf_with_trace=$cf_all_traces
9699 fi;
9700 echo "$as_me:9700: result: $cf_with_trace" >&5
9701 echo "${ECHO_T}$cf_with_trace" >&6
9702
9703 if test "$cf_with_trace" = yes ; then
9704         ADA_TRACE=TRUE
9705
9706 cf_fix_cppflags=no
9707 cf_new_cflags=
9708 cf_new_cppflags=
9709 cf_new_extra_cppflags=
9710
9711 for cf_add_cflags in -DTRACE
9712 do
9713 case $cf_fix_cppflags in
9714 no)
9715         case $cf_add_cflags in #(vi
9716         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9717                 case $cf_add_cflags in
9718                 -D*)
9719                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9720
9721                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9722                                 && test -z "${cf_tst_cflags}" \
9723                                 && cf_fix_cppflags=yes
9724
9725                         if test $cf_fix_cppflags = yes ; then
9726                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9727                                 continue
9728                         elif test "${cf_tst_cflags}" = "\"'" ; then
9729                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9730                                 continue
9731                         fi
9732                         ;;
9733                 esac
9734                 case "$CPPFLAGS" in
9735                 *$cf_add_cflags) #(vi
9736                         ;;
9737                 *) #(vi
9738                         case $cf_add_cflags in #(vi
9739                         -D*)
9740                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9741
9742 CPPFLAGS=`echo "$CPPFLAGS" | \
9743         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9744                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9745
9746                                 ;;
9747                         esac
9748                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9749                         ;;
9750                 esac
9751                 ;;
9752         *)
9753                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9754                 ;;
9755         esac
9756         ;;
9757 yes)
9758         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9759
9760         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9761
9762         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9763                 && test -z "${cf_tst_cflags}" \
9764                 && cf_fix_cppflags=no
9765         ;;
9766 esac
9767 done
9768
9769 if test -n "$cf_new_cflags" ; then
9770
9771         CFLAGS="$CFLAGS $cf_new_cflags"
9772 fi
9773
9774 if test -n "$cf_new_cppflags" ; then
9775
9776         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9777 fi
9778
9779 if test -n "$cf_new_extra_cppflags" ; then
9780
9781         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9782 fi
9783
9784 else
9785         ADA_TRACE=FALSE
9786 fi
9787
9788 ###     Checks for libraries.
9789 case $cf_cv_system_name in #(vi
9790 *mingw32*) #(vi
9791         ;;
9792 *)
9793 echo "$as_me:9793: checking for gettimeofday" >&5
9794 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
9795 if test "${ac_cv_func_gettimeofday+set}" = set; then
9796   echo $ECHO_N "(cached) $ECHO_C" >&6
9797 else
9798   cat >conftest.$ac_ext <<_ACEOF
9799 #line 9799 "configure"
9800 #include "confdefs.h"
9801 /* System header to define __stub macros and hopefully few prototypes,
9802     which can conflict with char gettimeofday (); below.  */
9803 #include <assert.h>
9804 /* Override any gcc2 internal prototype to avoid an error.  */
9805 #ifdef __cplusplus
9806 extern "C"
9807 #endif
9808 /* We use char because int might match the return type of a gcc2
9809    builtin and then its argument prototype would still apply.  */
9810 char gettimeofday ();
9811 char (*f) ();
9812
9813 int
9814 main ()
9815 {
9816 /* The GNU C library defines this for functions which it implements
9817     to always fail with ENOSYS.  Some functions are actually named
9818     something starting with __ and the normal name is an alias.  */
9819 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
9820 choke me
9821 #else
9822 f = gettimeofday;
9823 #endif
9824
9825   ;
9826   return 0;
9827 }
9828 _ACEOF
9829 rm -f conftest.$ac_objext conftest$ac_exeext
9830 if { (eval echo "$as_me:9830: \"$ac_link\"") >&5
9831   (eval $ac_link) 2>&5
9832   ac_status=$?
9833   echo "$as_me:9833: \$? = $ac_status" >&5
9834   (exit $ac_status); } &&
9835          { ac_try='test -s conftest$ac_exeext'
9836   { (eval echo "$as_me:9836: \"$ac_try\"") >&5
9837   (eval $ac_try) 2>&5
9838   ac_status=$?
9839   echo "$as_me:9839: \$? = $ac_status" >&5
9840   (exit $ac_status); }; }; then
9841   ac_cv_func_gettimeofday=yes
9842 else
9843   echo "$as_me: failed program was:" >&5
9844 cat conftest.$ac_ext >&5
9845 ac_cv_func_gettimeofday=no
9846 fi
9847 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9848 fi
9849 echo "$as_me:9849: result: $ac_cv_func_gettimeofday" >&5
9850 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
9851 if test $ac_cv_func_gettimeofday = yes; then
9852   cat >>confdefs.h <<\EOF
9853 #define HAVE_GETTIMEOFDAY 1
9854 EOF
9855
9856 else
9857
9858 echo "$as_me:9858: checking for gettimeofday in -lbsd" >&5
9859 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
9860 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
9861   echo $ECHO_N "(cached) $ECHO_C" >&6
9862 else
9863   ac_check_lib_save_LIBS=$LIBS
9864 LIBS="-lbsd  $LIBS"
9865 cat >conftest.$ac_ext <<_ACEOF
9866 #line 9866 "configure"
9867 #include "confdefs.h"
9868
9869 /* Override any gcc2 internal prototype to avoid an error.  */
9870 #ifdef __cplusplus
9871 extern "C"
9872 #endif
9873 /* We use char because int might match the return type of a gcc2
9874    builtin and then its argument prototype would still apply.  */
9875 char gettimeofday ();
9876 int
9877 main ()
9878 {
9879 gettimeofday ();
9880   ;
9881   return 0;
9882 }
9883 _ACEOF
9884 rm -f conftest.$ac_objext conftest$ac_exeext
9885 if { (eval echo "$as_me:9885: \"$ac_link\"") >&5
9886   (eval $ac_link) 2>&5
9887   ac_status=$?
9888   echo "$as_me:9888: \$? = $ac_status" >&5
9889   (exit $ac_status); } &&
9890          { ac_try='test -s conftest$ac_exeext'
9891   { (eval echo "$as_me:9891: \"$ac_try\"") >&5
9892   (eval $ac_try) 2>&5
9893   ac_status=$?
9894   echo "$as_me:9894: \$? = $ac_status" >&5
9895   (exit $ac_status); }; }; then
9896   ac_cv_lib_bsd_gettimeofday=yes
9897 else
9898   echo "$as_me: failed program was:" >&5
9899 cat conftest.$ac_ext >&5
9900 ac_cv_lib_bsd_gettimeofday=no
9901 fi
9902 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9903 LIBS=$ac_check_lib_save_LIBS
9904 fi
9905 echo "$as_me:9905: result: $ac_cv_lib_bsd_gettimeofday" >&5
9906 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
9907 if test $ac_cv_lib_bsd_gettimeofday = yes; then
9908   cat >>confdefs.h <<\EOF
9909 #define HAVE_GETTIMEOFDAY 1
9910 EOF
9911
9912         LIBS="$LIBS -lbsd"
9913 fi
9914
9915 fi
9916         ;;
9917 esac
9918
9919 ###     Checks for header files.
9920 echo "$as_me:9920: checking for ANSI C header files" >&5
9921 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
9922 if test "${ac_cv_header_stdc+set}" = set; then
9923   echo $ECHO_N "(cached) $ECHO_C" >&6
9924 else
9925   cat >conftest.$ac_ext <<_ACEOF
9926 #line 9926 "configure"
9927 #include "confdefs.h"
9928 #include <stdlib.h>
9929 #include <stdarg.h>
9930 #include <string.h>
9931 #include <float.h>
9932
9933 _ACEOF
9934 if { (eval echo "$as_me:9934: \"$ac_cpp conftest.$ac_ext\"") >&5
9935   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9936   ac_status=$?
9937   egrep -v '^ *\+' conftest.er1 >conftest.err
9938   rm -f conftest.er1
9939   cat conftest.err >&5
9940   echo "$as_me:9940: \$? = $ac_status" >&5
9941   (exit $ac_status); } >/dev/null; then
9942   if test -s conftest.err; then
9943     ac_cpp_err=$ac_c_preproc_warn_flag
9944   else
9945     ac_cpp_err=
9946   fi
9947 else
9948   ac_cpp_err=yes
9949 fi
9950 if test -z "$ac_cpp_err"; then
9951   ac_cv_header_stdc=yes
9952 else
9953   echo "$as_me: failed program was:" >&5
9954   cat conftest.$ac_ext >&5
9955   ac_cv_header_stdc=no
9956 fi
9957 rm -f conftest.err conftest.$ac_ext
9958
9959 if test $ac_cv_header_stdc = yes; then
9960   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9961   cat >conftest.$ac_ext <<_ACEOF
9962 #line 9962 "configure"
9963 #include "confdefs.h"
9964 #include <string.h>
9965
9966 _ACEOF
9967 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9968   egrep "memchr" >/dev/null 2>&1; then
9969   :
9970 else
9971   ac_cv_header_stdc=no
9972 fi
9973 rm -rf conftest*
9974
9975 fi
9976
9977 if test $ac_cv_header_stdc = yes; then
9978   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9979   cat >conftest.$ac_ext <<_ACEOF
9980 #line 9980 "configure"
9981 #include "confdefs.h"
9982 #include <stdlib.h>
9983
9984 _ACEOF
9985 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9986   egrep "free" >/dev/null 2>&1; then
9987   :
9988 else
9989   ac_cv_header_stdc=no
9990 fi
9991 rm -rf conftest*
9992
9993 fi
9994
9995 if test $ac_cv_header_stdc = yes; then
9996   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9997   if test "$cross_compiling" = yes; then
9998   :
9999 else
10000   cat >conftest.$ac_ext <<_ACEOF
10001 #line 10001 "configure"
10002 #include "confdefs.h"
10003 #include <ctype.h>
10004 #if ((' ' & 0x0FF) == 0x020)
10005 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10006 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10007 #else
10008 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
10009                      || ('j' <= (c) && (c) <= 'r') \
10010                      || ('s' <= (c) && (c) <= 'z'))
10011 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
10012 #endif
10013
10014 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10015 int
10016 main ()
10017 {
10018   int i;
10019   for (i = 0; i < 256; i++)
10020     if (XOR (islower (i), ISLOWER (i))
10021         || toupper (i) != TOUPPER (i))
10022       $ac_main_return(2);
10023   $ac_main_return (0);
10024 }
10025 _ACEOF
10026 rm -f conftest$ac_exeext
10027 if { (eval echo "$as_me:10027: \"$ac_link\"") >&5
10028   (eval $ac_link) 2>&5
10029   ac_status=$?
10030   echo "$as_me:10030: \$? = $ac_status" >&5
10031   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10032   { (eval echo "$as_me:10032: \"$ac_try\"") >&5
10033   (eval $ac_try) 2>&5
10034   ac_status=$?
10035   echo "$as_me:10035: \$? = $ac_status" >&5
10036   (exit $ac_status); }; }; then
10037   :
10038 else
10039   echo "$as_me: program exited with status $ac_status" >&5
10040 echo "$as_me: failed program was:" >&5
10041 cat conftest.$ac_ext >&5
10042 ac_cv_header_stdc=no
10043 fi
10044 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10045 fi
10046 fi
10047 fi
10048 echo "$as_me:10048: result: $ac_cv_header_stdc" >&5
10049 echo "${ECHO_T}$ac_cv_header_stdc" >&6
10050 if test $ac_cv_header_stdc = yes; then
10051
10052 cat >>confdefs.h <<\EOF
10053 #define STDC_HEADERS 1
10054 EOF
10055
10056 fi
10057
10058 ac_header_dirent=no
10059 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
10060   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
10061 echo "$as_me:10061: checking for $ac_hdr that defines DIR" >&5
10062 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
10063 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10064   echo $ECHO_N "(cached) $ECHO_C" >&6
10065 else
10066   cat >conftest.$ac_ext <<_ACEOF
10067 #line 10067 "configure"
10068 #include "confdefs.h"
10069 #include <sys/types.h>
10070 #include <$ac_hdr>
10071
10072 int
10073 main ()
10074 {
10075 if ((DIR *) 0)
10076 return 0;
10077   ;
10078   return 0;
10079 }
10080 _ACEOF
10081 rm -f conftest.$ac_objext
10082 if { (eval echo "$as_me:10082: \"$ac_compile\"") >&5
10083   (eval $ac_compile) 2>&5
10084   ac_status=$?
10085   echo "$as_me:10085: \$? = $ac_status" >&5
10086   (exit $ac_status); } &&
10087          { ac_try='test -s conftest.$ac_objext'
10088   { (eval echo "$as_me:10088: \"$ac_try\"") >&5
10089   (eval $ac_try) 2>&5
10090   ac_status=$?
10091   echo "$as_me:10091: \$? = $ac_status" >&5
10092   (exit $ac_status); }; }; then
10093   eval "$as_ac_Header=yes"
10094 else
10095   echo "$as_me: failed program was:" >&5
10096 cat conftest.$ac_ext >&5
10097 eval "$as_ac_Header=no"
10098 fi
10099 rm -f conftest.$ac_objext conftest.$ac_ext
10100 fi
10101 echo "$as_me:10101: result: `eval echo '${'$as_ac_Header'}'`" >&5
10102 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10103 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10104   cat >>confdefs.h <<EOF
10105 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
10106 EOF
10107
10108 ac_header_dirent=$ac_hdr; break
10109 fi
10110
10111 done
10112 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
10113 if test $ac_header_dirent = dirent.h; then
10114   echo "$as_me:10114: checking for opendir in -ldir" >&5
10115 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
10116 if test "${ac_cv_lib_dir_opendir+set}" = set; then
10117   echo $ECHO_N "(cached) $ECHO_C" >&6
10118 else
10119   ac_check_lib_save_LIBS=$LIBS
10120 LIBS="-ldir  $LIBS"
10121 cat >conftest.$ac_ext <<_ACEOF
10122 #line 10122 "configure"
10123 #include "confdefs.h"
10124
10125 /* Override any gcc2 internal prototype to avoid an error.  */
10126 #ifdef __cplusplus
10127 extern "C"
10128 #endif
10129 /* We use char because int might match the return type of a gcc2
10130    builtin and then its argument prototype would still apply.  */
10131 char opendir ();
10132 int
10133 main ()
10134 {
10135 opendir ();
10136   ;
10137   return 0;
10138 }
10139 _ACEOF
10140 rm -f conftest.$ac_objext conftest$ac_exeext
10141 if { (eval echo "$as_me:10141: \"$ac_link\"") >&5
10142   (eval $ac_link) 2>&5
10143   ac_status=$?
10144   echo "$as_me:10144: \$? = $ac_status" >&5
10145   (exit $ac_status); } &&
10146          { ac_try='test -s conftest$ac_exeext'
10147   { (eval echo "$as_me:10147: \"$ac_try\"") >&5
10148   (eval $ac_try) 2>&5
10149   ac_status=$?
10150   echo "$as_me:10150: \$? = $ac_status" >&5
10151   (exit $ac_status); }; }; then
10152   ac_cv_lib_dir_opendir=yes
10153 else
10154   echo "$as_me: failed program was:" >&5
10155 cat conftest.$ac_ext >&5
10156 ac_cv_lib_dir_opendir=no
10157 fi
10158 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10159 LIBS=$ac_check_lib_save_LIBS
10160 fi
10161 echo "$as_me:10161: result: $ac_cv_lib_dir_opendir" >&5
10162 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
10163 if test $ac_cv_lib_dir_opendir = yes; then
10164   LIBS="$LIBS -ldir"
10165 fi
10166
10167 else
10168   echo "$as_me:10168: checking for opendir in -lx" >&5
10169 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
10170 if test "${ac_cv_lib_x_opendir+set}" = set; then
10171   echo $ECHO_N "(cached) $ECHO_C" >&6
10172 else
10173   ac_check_lib_save_LIBS=$LIBS
10174 LIBS="-lx  $LIBS"
10175 cat >conftest.$ac_ext <<_ACEOF
10176 #line 10176 "configure"
10177 #include "confdefs.h"
10178
10179 /* Override any gcc2 internal prototype to avoid an error.  */
10180 #ifdef __cplusplus
10181 extern "C"
10182 #endif
10183 /* We use char because int might match the return type of a gcc2
10184    builtin and then its argument prototype would still apply.  */
10185 char opendir ();
10186 int
10187 main ()
10188 {
10189 opendir ();
10190   ;
10191   return 0;
10192 }
10193 _ACEOF
10194 rm -f conftest.$ac_objext conftest$ac_exeext
10195 if { (eval echo "$as_me:10195: \"$ac_link\"") >&5
10196   (eval $ac_link) 2>&5
10197   ac_status=$?
10198   echo "$as_me:10198: \$? = $ac_status" >&5
10199   (exit $ac_status); } &&
10200          { ac_try='test -s conftest$ac_exeext'
10201   { (eval echo "$as_me:10201: \"$ac_try\"") >&5
10202   (eval $ac_try) 2>&5
10203   ac_status=$?
10204   echo "$as_me:10204: \$? = $ac_status" >&5
10205   (exit $ac_status); }; }; then
10206   ac_cv_lib_x_opendir=yes
10207 else
10208   echo "$as_me: failed program was:" >&5
10209 cat conftest.$ac_ext >&5
10210 ac_cv_lib_x_opendir=no
10211 fi
10212 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10213 LIBS=$ac_check_lib_save_LIBS
10214 fi
10215 echo "$as_me:10215: result: $ac_cv_lib_x_opendir" >&5
10216 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10217 if test $ac_cv_lib_x_opendir = yes; then
10218   LIBS="$LIBS -lx"
10219 fi
10220
10221 fi
10222
10223 echo "$as_me:10223: checking whether time.h and sys/time.h may both be included" >&5
10224 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10225 if test "${ac_cv_header_time+set}" = set; then
10226   echo $ECHO_N "(cached) $ECHO_C" >&6
10227 else
10228   cat >conftest.$ac_ext <<_ACEOF
10229 #line 10229 "configure"
10230 #include "confdefs.h"
10231 #include <sys/types.h>
10232 #include <sys/time.h>
10233 #include <time.h>
10234
10235 int
10236 main ()
10237 {
10238 if ((struct tm *) 0)
10239 return 0;
10240   ;
10241   return 0;
10242 }
10243 _ACEOF
10244 rm -f conftest.$ac_objext
10245 if { (eval echo "$as_me:10245: \"$ac_compile\"") >&5
10246   (eval $ac_compile) 2>&5
10247   ac_status=$?
10248   echo "$as_me:10248: \$? = $ac_status" >&5
10249   (exit $ac_status); } &&
10250          { ac_try='test -s conftest.$ac_objext'
10251   { (eval echo "$as_me:10251: \"$ac_try\"") >&5
10252   (eval $ac_try) 2>&5
10253   ac_status=$?
10254   echo "$as_me:10254: \$? = $ac_status" >&5
10255   (exit $ac_status); }; }; then
10256   ac_cv_header_time=yes
10257 else
10258   echo "$as_me: failed program was:" >&5
10259 cat conftest.$ac_ext >&5
10260 ac_cv_header_time=no
10261 fi
10262 rm -f conftest.$ac_objext conftest.$ac_ext
10263 fi
10264 echo "$as_me:10264: result: $ac_cv_header_time" >&5
10265 echo "${ECHO_T}$ac_cv_header_time" >&6
10266 if test $ac_cv_header_time = yes; then
10267
10268 cat >>confdefs.h <<\EOF
10269 #define TIME_WITH_SYS_TIME 1
10270 EOF
10271
10272 fi
10273
10274 ###     checks for compiler characteristics
10275 ac_ext=c
10276 ac_cpp='$CPP $CPPFLAGS'
10277 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10278 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10279 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10280 ac_main_return=return
10281
10282 echo "$as_me:10282: checking for $CC option to accept ANSI C" >&5
10283 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
10284 if test "${ac_cv_prog_cc_stdc+set}" = set; then
10285   echo $ECHO_N "(cached) $ECHO_C" >&6
10286 else
10287   ac_cv_prog_cc_stdc=no
10288 ac_save_CC=$CC
10289 cat >conftest.$ac_ext <<_ACEOF
10290 #line 10290 "configure"
10291 #include "confdefs.h"
10292 #include <stdarg.h>
10293 #include <stdio.h>
10294 #include <sys/types.h>
10295 #include <sys/stat.h>
10296 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
10297 struct buf { int x; };
10298 FILE * (*rcsopen) (struct buf *, struct stat *, int);
10299 static char *e (p, i)
10300      char **p;
10301      int i;
10302 {
10303   return p[i];
10304 }
10305 static char *f (char * (*g) (char **, int), char **p, ...)
10306 {
10307   char *s;
10308   va_list v;
10309   va_start (v,p);
10310   s = g (p, va_arg (v,int));
10311   va_end (v);
10312   return s;
10313 }
10314 int test (int i, double x);
10315 struct s1 {int (*f) (int a);};
10316 struct s2 {int (*f) (double a);};
10317 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
10318 int argc;
10319 char **argv;
10320 int
10321 main ()
10322 {
10323 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
10324   ;
10325   return 0;
10326 }
10327 _ACEOF
10328 # Don't try gcc -ansi; that turns off useful extensions and
10329 # breaks some systems' header files.
10330 # AIX                   -qlanglvl=ansi
10331 # Ultrix and OSF/1      -std1
10332 # HP-UX 10.20 and later -Ae
10333 # HP-UX older versions  -Aa -D_HPUX_SOURCE
10334 # SVR4                  -Xc -D__EXTENSIONS__
10335 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
10336 do
10337   CC="$ac_save_CC $ac_arg"
10338   rm -f conftest.$ac_objext
10339 if { (eval echo "$as_me:10339: \"$ac_compile\"") >&5
10340   (eval $ac_compile) 2>&5
10341   ac_status=$?
10342   echo "$as_me:10342: \$? = $ac_status" >&5
10343   (exit $ac_status); } &&
10344          { ac_try='test -s conftest.$ac_objext'
10345   { (eval echo "$as_me:10345: \"$ac_try\"") >&5
10346   (eval $ac_try) 2>&5
10347   ac_status=$?
10348   echo "$as_me:10348: \$? = $ac_status" >&5
10349   (exit $ac_status); }; }; then
10350   ac_cv_prog_cc_stdc=$ac_arg
10351 break
10352 else
10353   echo "$as_me: failed program was:" >&5
10354 cat conftest.$ac_ext >&5
10355 fi
10356 rm -f conftest.$ac_objext
10357 done
10358 rm -f conftest.$ac_ext conftest.$ac_objext
10359 CC=$ac_save_CC
10360
10361 fi
10362
10363 case "x$ac_cv_prog_cc_stdc" in
10364   x|xno)
10365     echo "$as_me:10365: result: none needed" >&5
10366 echo "${ECHO_T}none needed" >&6 ;;
10367   *)
10368     echo "$as_me:10368: result: $ac_cv_prog_cc_stdc" >&5
10369 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
10370     CC="$CC $ac_cv_prog_cc_stdc" ;;
10371 esac
10372
10373 echo "$as_me:10373: checking for an ANSI C-conforming const" >&5
10374 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
10375 if test "${ac_cv_c_const+set}" = set; then
10376   echo $ECHO_N "(cached) $ECHO_C" >&6
10377 else
10378   cat >conftest.$ac_ext <<_ACEOF
10379 #line 10379 "configure"
10380 #include "confdefs.h"
10381
10382 int
10383 main ()
10384 {
10385 /* FIXME: Include the comments suggested by Paul. */
10386 #ifndef __cplusplus
10387   /* Ultrix mips cc rejects this.  */
10388   typedef int charset[2];
10389   const charset x;
10390   /* SunOS 4.1.1 cc rejects this.  */
10391   char const *const *ccp;
10392   char **p;
10393   /* NEC SVR4.0.2 mips cc rejects this.  */
10394   struct point {int x, y;};
10395   static struct point const zero = {0,0};
10396   /* AIX XL C 1.02.0.0 rejects this.
10397      It does not let you subtract one const X* pointer from another in
10398      an arm of an if-expression whose if-part is not a constant
10399      expression */
10400   const char *g = "string";
10401   ccp = &g + (g ? g-g : 0);
10402   /* HPUX 7.0 cc rejects these. */
10403   ++ccp;
10404   p = (char**) ccp;
10405   ccp = (char const *const *) p;
10406   { /* SCO 3.2v4 cc rejects this.  */
10407     char *t;
10408     char const *s = 0 ? (char *) 0 : (char const *) 0;
10409
10410     *t++ = 0;
10411   }
10412   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10413     int x[] = {25, 17};
10414     const int *foo = &x[0];
10415     ++foo;
10416   }
10417   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10418     typedef const int *iptr;
10419     iptr p = 0;
10420     ++p;
10421   }
10422   { /* AIX XL C 1.02.0.0 rejects this saying
10423        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10424     struct s { int j; const int *ap[3]; };
10425     struct s *b; b->j = 5;
10426   }
10427   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10428     const int foo = 10;
10429   }
10430 #endif
10431
10432   ;
10433   return 0;
10434 }
10435 _ACEOF
10436 rm -f conftest.$ac_objext
10437 if { (eval echo "$as_me:10437: \"$ac_compile\"") >&5
10438   (eval $ac_compile) 2>&5
10439   ac_status=$?
10440   echo "$as_me:10440: \$? = $ac_status" >&5
10441   (exit $ac_status); } &&
10442          { ac_try='test -s conftest.$ac_objext'
10443   { (eval echo "$as_me:10443: \"$ac_try\"") >&5
10444   (eval $ac_try) 2>&5
10445   ac_status=$?
10446   echo "$as_me:10446: \$? = $ac_status" >&5
10447   (exit $ac_status); }; }; then
10448   ac_cv_c_const=yes
10449 else
10450   echo "$as_me: failed program was:" >&5
10451 cat conftest.$ac_ext >&5
10452 ac_cv_c_const=no
10453 fi
10454 rm -f conftest.$ac_objext conftest.$ac_ext
10455 fi
10456 echo "$as_me:10456: result: $ac_cv_c_const" >&5
10457 echo "${ECHO_T}$ac_cv_c_const" >&6
10458 if test $ac_cv_c_const = no; then
10459
10460 cat >>confdefs.h <<\EOF
10461 #define const
10462 EOF
10463
10464 fi
10465
10466 ###     Checks for external-data
10467
10468 echo "$as_me:10468: checking if data-only library module links" >&5
10469 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
10470 if test "${cf_cv_link_dataonly+set}" = set; then
10471   echo $ECHO_N "(cached) $ECHO_C" >&6
10472 else
10473
10474         rm -f conftest.a
10475         cat >conftest.$ac_ext <<EOF
10476 #line 10476 "configure"
10477 int     testdata[3] = { 123, 456, 789 };
10478 EOF
10479         if { (eval echo "$as_me:10479: \"$ac_compile\"") >&5
10480   (eval $ac_compile) 2>&5
10481   ac_status=$?
10482   echo "$as_me:10482: \$? = $ac_status" >&5
10483   (exit $ac_status); } ; then
10484                 mv conftest.o data.o && \
10485                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
10486         fi
10487         rm -f conftest.$ac_ext data.o
10488         cat >conftest.$ac_ext <<EOF
10489 #line 10489 "configure"
10490 int     testfunc()
10491 {
10492 #if defined(NeXT)
10493         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
10494 #else
10495         extern int testdata[3];
10496         return testdata[0] == 123
10497            &&  testdata[1] == 456
10498            &&  testdata[2] == 789;
10499 #endif
10500 }
10501 EOF
10502         if { (eval echo "$as_me:10502: \"$ac_compile\"") >&5
10503   (eval $ac_compile) 2>&5
10504   ac_status=$?
10505   echo "$as_me:10505: \$? = $ac_status" >&5
10506   (exit $ac_status); }; then
10507                 mv conftest.o func.o && \
10508                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
10509         fi
10510         rm -f conftest.$ac_ext func.o
10511         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
10512         cf_saveLIBS="$LIBS"
10513         LIBS="conftest.a $LIBS"
10514         if test "$cross_compiling" = yes; then
10515   cf_cv_link_dataonly=unknown
10516 else
10517   cat >conftest.$ac_ext <<_ACEOF
10518 #line 10518 "configure"
10519 #include "confdefs.h"
10520
10521         int main()
10522         {
10523                 extern int testfunc();
10524                 ${cf_cv_main_return:-return} (!testfunc());
10525         }
10526
10527 _ACEOF
10528 rm -f conftest$ac_exeext
10529 if { (eval echo "$as_me:10529: \"$ac_link\"") >&5
10530   (eval $ac_link) 2>&5
10531   ac_status=$?
10532   echo "$as_me:10532: \$? = $ac_status" >&5
10533   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10534   { (eval echo "$as_me:10534: \"$ac_try\"") >&5
10535   (eval $ac_try) 2>&5
10536   ac_status=$?
10537   echo "$as_me:10537: \$? = $ac_status" >&5
10538   (exit $ac_status); }; }; then
10539   cf_cv_link_dataonly=yes
10540 else
10541   echo "$as_me: program exited with status $ac_status" >&5
10542 echo "$as_me: failed program was:" >&5
10543 cat conftest.$ac_ext >&5
10544 cf_cv_link_dataonly=no
10545 fi
10546 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10547 fi
10548         LIBS="$cf_saveLIBS"
10549
10550 fi
10551
10552 echo "$as_me:10552: result: $cf_cv_link_dataonly" >&5
10553 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
10554
10555 if test "$cf_cv_link_dataonly" = no ; then
10556         cat >>confdefs.h <<\EOF
10557 #define BROKEN_LINKER 1
10558 EOF
10559
10560         BROKEN_LINKER=1
10561 fi
10562
10563 ###     Checks for library functions.
10564
10565 echo "$as_me:10565: checking for working mkstemp" >&5
10566 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
10567 if test "${cf_cv_func_mkstemp+set}" = set; then
10568   echo $ECHO_N "(cached) $ECHO_C" >&6
10569 else
10570
10571 rm -rf conftest*
10572 if test "$cross_compiling" = yes; then
10573   echo "$as_me:10573: checking for mkstemp" >&5
10574 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
10575 if test "${ac_cv_func_mkstemp+set}" = set; then
10576   echo $ECHO_N "(cached) $ECHO_C" >&6
10577 else
10578   cat >conftest.$ac_ext <<_ACEOF
10579 #line 10579 "configure"
10580 #include "confdefs.h"
10581 /* System header to define __stub macros and hopefully few prototypes,
10582     which can conflict with char mkstemp (); below.  */
10583 #include <assert.h>
10584 /* Override any gcc2 internal prototype to avoid an error.  */
10585 #ifdef __cplusplus
10586 extern "C"
10587 #endif
10588 /* We use char because int might match the return type of a gcc2
10589    builtin and then its argument prototype would still apply.  */
10590 char mkstemp ();
10591 char (*f) ();
10592
10593 int
10594 main ()
10595 {
10596 /* The GNU C library defines this for functions which it implements
10597     to always fail with ENOSYS.  Some functions are actually named
10598     something starting with __ and the normal name is an alias.  */
10599 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
10600 choke me
10601 #else
10602 f = mkstemp;
10603 #endif
10604
10605   ;
10606   return 0;
10607 }
10608 _ACEOF
10609 rm -f conftest.$ac_objext conftest$ac_exeext
10610 if { (eval echo "$as_me:10610: \"$ac_link\"") >&5
10611   (eval $ac_link) 2>&5
10612   ac_status=$?
10613   echo "$as_me:10613: \$? = $ac_status" >&5
10614   (exit $ac_status); } &&
10615          { ac_try='test -s conftest$ac_exeext'
10616   { (eval echo "$as_me:10616: \"$ac_try\"") >&5
10617   (eval $ac_try) 2>&5
10618   ac_status=$?
10619   echo "$as_me:10619: \$? = $ac_status" >&5
10620   (exit $ac_status); }; }; then
10621   ac_cv_func_mkstemp=yes
10622 else
10623   echo "$as_me: failed program was:" >&5
10624 cat conftest.$ac_ext >&5
10625 ac_cv_func_mkstemp=no
10626 fi
10627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10628 fi
10629 echo "$as_me:10629: result: $ac_cv_func_mkstemp" >&5
10630 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
10631
10632 else
10633   cat >conftest.$ac_ext <<_ACEOF
10634 #line 10634 "configure"
10635 #include "confdefs.h"
10636
10637 #include <sys/types.h>
10638 #include <stdlib.h>
10639 #include <stdio.h>
10640 #include <string.h>
10641 #include <sys/stat.h>
10642 int main()
10643 {
10644         char *tmpl = "conftestXXXXXX";
10645         char name[2][80];
10646         int n;
10647         int result = 0;
10648         int fd;
10649         struct stat sb;
10650
10651         umask(077);
10652         for (n = 0; n < 2; ++n) {
10653                 strcpy(name[n], tmpl);
10654                 if ((fd = mkstemp(name[n])) >= 0) {
10655                         if (!strcmp(name[n], tmpl)
10656                          || stat(name[n], &sb) != 0
10657                          || (sb.st_mode & S_IFMT) != S_IFREG
10658                          || (sb.st_mode & 077) != 0) {
10659                                 result = 1;
10660                         }
10661                         close(fd);
10662                 }
10663         }
10664         if (result == 0
10665          && !strcmp(name[0], name[1]))
10666                 result = 1;
10667         ${cf_cv_main_return:-return}(result);
10668 }
10669
10670 _ACEOF
10671 rm -f conftest$ac_exeext
10672 if { (eval echo "$as_me:10672: \"$ac_link\"") >&5
10673   (eval $ac_link) 2>&5
10674   ac_status=$?
10675   echo "$as_me:10675: \$? = $ac_status" >&5
10676   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10677   { (eval echo "$as_me:10677: \"$ac_try\"") >&5
10678   (eval $ac_try) 2>&5
10679   ac_status=$?
10680   echo "$as_me:10680: \$? = $ac_status" >&5
10681   (exit $ac_status); }; }; then
10682   cf_cv_func_mkstemp=yes
10683
10684 else
10685   echo "$as_me: program exited with status $ac_status" >&5
10686 echo "$as_me: failed program was:" >&5
10687 cat conftest.$ac_ext >&5
10688 cf_cv_func_mkstemp=no
10689
10690 fi
10691 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10692 fi
10693
10694 fi
10695 echo "$as_me:10695: result: $cf_cv_func_mkstemp" >&5
10696 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
10697 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
10698         cat >>confdefs.h <<\EOF
10699 #define HAVE_MKSTEMP 1
10700 EOF
10701
10702 fi
10703
10704 echo "$as_me:10704: checking return type of signal handlers" >&5
10705 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
10706 if test "${ac_cv_type_signal+set}" = set; then
10707   echo $ECHO_N "(cached) $ECHO_C" >&6
10708 else
10709   cat >conftest.$ac_ext <<_ACEOF
10710 #line 10710 "configure"
10711 #include "confdefs.h"
10712 #include <sys/types.h>
10713 #include <signal.h>
10714 #ifdef signal
10715 # undef signal
10716 #endif
10717 #ifdef __cplusplus
10718 extern "C" void (*signal (int, void (*)(int)))(int);
10719 #else
10720 void (*signal ()) ();
10721 #endif
10722
10723 int
10724 main ()
10725 {
10726 int i;
10727   ;
10728   return 0;
10729 }
10730 _ACEOF
10731 rm -f conftest.$ac_objext
10732 if { (eval echo "$as_me:10732: \"$ac_compile\"") >&5
10733   (eval $ac_compile) 2>&5
10734   ac_status=$?
10735   echo "$as_me:10735: \$? = $ac_status" >&5
10736   (exit $ac_status); } &&
10737          { ac_try='test -s conftest.$ac_objext'
10738   { (eval echo "$as_me:10738: \"$ac_try\"") >&5
10739   (eval $ac_try) 2>&5
10740   ac_status=$?
10741   echo "$as_me:10741: \$? = $ac_status" >&5
10742   (exit $ac_status); }; }; then
10743   ac_cv_type_signal=void
10744 else
10745   echo "$as_me: failed program was:" >&5
10746 cat conftest.$ac_ext >&5
10747 ac_cv_type_signal=int
10748 fi
10749 rm -f conftest.$ac_objext conftest.$ac_ext
10750 fi
10751 echo "$as_me:10751: result: $ac_cv_type_signal" >&5
10752 echo "${ECHO_T}$ac_cv_type_signal" >&6
10753
10754 cat >>confdefs.h <<EOF
10755 #define RETSIGTYPE $ac_cv_type_signal
10756 EOF
10757
10758 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
10759         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
10760         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
10761 fi
10762
10763 if test "$cf_with_ada" != "no" ; then
10764
10765 cf_ada_make=gnatmake
10766 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
10767 set dummy $cf_ada_make; ac_word=$2
10768 echo "$as_me:10768: checking for $ac_word" >&5
10769 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10770 if test "${ac_cv_prog_gnat_exists+set}" = set; then
10771   echo $ECHO_N "(cached) $ECHO_C" >&6
10772 else
10773   if test -n "$gnat_exists"; then
10774   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
10775 else
10776   ac_save_IFS=$IFS; IFS=$ac_path_separator
10777 ac_dummy="$PATH"
10778 for ac_dir in $ac_dummy; do
10779   IFS=$ac_save_IFS
10780   test -z "$ac_dir" && ac_dir=.
10781   $as_executable_p "$ac_dir/$ac_word" || continue
10782 ac_cv_prog_gnat_exists="yes"
10783 echo "$as_me:10783: found $ac_dir/$ac_word" >&5
10784 break
10785 done
10786
10787   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
10788 fi
10789 fi
10790 gnat_exists=$ac_cv_prog_gnat_exists
10791 if test -n "$gnat_exists"; then
10792   echo "$as_me:10792: result: $gnat_exists" >&5
10793 echo "${ECHO_T}$gnat_exists" >&6
10794 else
10795   echo "$as_me:10795: result: no" >&5
10796 echo "${ECHO_T}no" >&6
10797 fi
10798
10799 if test "$ac_cv_prog_gnat_exists" = no; then
10800    cf_ada_make=
10801 else
10802
10803 echo "$as_me:10803: checking for gnat version" >&5
10804 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
10805 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
10806         grep '[0-9].[0-9][0-9]*' |\
10807     sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
10808 echo "$as_me:10808: result: $cf_gnat_version" >&5
10809 echo "${ECHO_T}$cf_gnat_version" >&6
10810
10811 case $cf_gnat_version in #(vi
10812 3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi
10813         cf_cv_prog_gnat_correct=yes
10814         ;;
10815 *)
10816         { echo "$as_me:10816: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
10817 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
10818         cf_cv_prog_gnat_correct=no
10819         ;;
10820 esac
10821
10822    # Extract the first word of "m4", so it can be a program name with args.
10823 set dummy m4; ac_word=$2
10824 echo "$as_me:10824: checking for $ac_word" >&5
10825 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10826 if test "${ac_cv_prog_M4_exists+set}" = set; then
10827   echo $ECHO_N "(cached) $ECHO_C" >&6
10828 else
10829   if test -n "$M4_exists"; then
10830   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
10831 else
10832   ac_save_IFS=$IFS; IFS=$ac_path_separator
10833 ac_dummy="$PATH"
10834 for ac_dir in $ac_dummy; do
10835   IFS=$ac_save_IFS
10836   test -z "$ac_dir" && ac_dir=.
10837   $as_executable_p "$ac_dir/$ac_word" || continue
10838 ac_cv_prog_M4_exists="yes"
10839 echo "$as_me:10839: found $ac_dir/$ac_word" >&5
10840 break
10841 done
10842
10843   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
10844 fi
10845 fi
10846 M4_exists=$ac_cv_prog_M4_exists
10847 if test -n "$M4_exists"; then
10848   echo "$as_me:10848: result: $M4_exists" >&5
10849 echo "${ECHO_T}$M4_exists" >&6
10850 else
10851   echo "$as_me:10851: result: no" >&5
10852 echo "${ECHO_T}no" >&6
10853 fi
10854
10855    if test "$ac_cv_prog_M4_exists" = no; then
10856       cf_cv_prog_gnat_correct=no
10857       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
10858    fi
10859    if test "$cf_cv_prog_gnat_correct" = yes; then
10860       echo "$as_me:10860: checking if GNAT works" >&5
10861 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
10862
10863 rm -rf conftest* *~conftest*
10864 cat >>conftest.ads <<CF_EOF
10865 procedure conftest;
10866 CF_EOF
10867 cat >>conftest.adb <<CF_EOF
10868 with Text_IO;
10869 with GNAT.OS_Lib;
10870 procedure conftest is
10871 begin
10872    Text_IO.Put ("Hello World");
10873    Text_IO.New_Line;
10874    GNAT.OS_Lib.OS_Exit (0);
10875 end conftest;
10876 CF_EOF
10877 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
10878    if ( ./conftest 1>&5 2>&1 ) ; then
10879       cf_cv_prog_gnat_correct=yes
10880    else
10881       cf_cv_prog_gnat_correct=no
10882    fi
10883 else
10884    cf_cv_prog_gnat_correct=no
10885 fi
10886 rm -rf conftest* *~conftest*
10887
10888       echo "$as_me:10888: result: $cf_cv_prog_gnat_correct" >&5
10889 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
10890    fi
10891 fi
10892
10893         if test "$cf_cv_prog_gnat_correct" = yes; then
10894
10895                 # make ADAFLAGS consistent with CFLAGS
10896                 case "$CFLAGS" in
10897                 *-g*)
10898
10899         ADAFLAGS="$ADAFLAGS -g"
10900
10901                         ;;
10902                 esac
10903                 case "$CFLAGS" in
10904                 *-O*)
10905
10906         ADAFLAGS="$ADAFLAGS -O3"
10907
10908                         ;;
10909                 esac
10910
10911 echo "$as_me:10911: checking if GNAT supports generics" >&5
10912 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
10913 case $cf_gnat_version in #(vi
10914 3.[1-9]*|[4-9].*) #(vi
10915         cf_gnat_generics=yes
10916         ;;
10917 *)
10918         cf_gnat_generics=no
10919         ;;
10920 esac
10921 echo "$as_me:10921: result: $cf_gnat_generics" >&5
10922 echo "${ECHO_T}$cf_gnat_generics" >&6
10923
10924 if test "$cf_gnat_generics" = yes
10925 then
10926         cf_compile_generics=generics
10927         cf_generic_objects="\${GENOBJS}"
10928 else
10929         cf_compile_generics=
10930         cf_generic_objects=
10931 fi
10932
10933 echo "$as_me:10933: checking if GNAT pragma Unreferenced works" >&5
10934 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
10935 if test "${cf_cv_pragma_unreferenced+set}" = set; then
10936   echo $ECHO_N "(cached) $ECHO_C" >&6
10937 else
10938
10939 rm -rf conftest* *~conftest*
10940 cat >>conftest.ads <<CF_EOF
10941 procedure conftest;
10942 CF_EOF
10943 cat >>conftest.adb <<CF_EOF
10944 with Text_IO;
10945 with GNAT.OS_Lib;
10946 procedure conftest is
10947    test : Integer;
10948    pragma Unreferenced (test);
10949 begin
10950    test := 1;
10951    Text_IO.Put ("Hello World");
10952    Text_IO.New_Line;
10953    GNAT.OS_Lib.OS_Exit (0);
10954 end conftest;
10955 CF_EOF
10956 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
10957       cf_cv_pragma_unreferenced=yes
10958 else
10959    cf_cv_pragma_unreferenced=no
10960 fi
10961 rm -rf conftest* *~conftest*
10962
10963 fi
10964 echo "$as_me:10964: result: $cf_cv_pragma_unreferenced" >&5
10965 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
10966
10967 # if the pragma is supported, use it (needed in the Trace code).
10968 if test $cf_cv_pragma_unreferenced = yes ; then
10969         PRAGMA_UNREF=TRUE
10970 else
10971         PRAGMA_UNREF=FALSE
10972 fi
10973
10974 cf_gnat_libraries=no
10975 cf_gnat_projects=no
10976
10977 echo "$as_me:10977: checking if GNAT supports project files" >&5
10978 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
10979 case $cf_gnat_version in #(vi
10980 3.[0-9]*) #(vi
10981         ;;
10982 *)
10983         case $cf_cv_system_name in #(vi
10984         cygwin*) #(vi
10985                 ;;
10986         *)
10987                 mkdir conftest.src conftest.bin conftest.lib
10988                 cd conftest.src
10989                 rm -rf conftest* *~conftest*
10990                 cat >>library.gpr <<CF_EOF
10991 project Library is
10992   Kind := External ("LIB_KIND");
10993   for Library_Name use "ConfTest";
10994   for Object_Dir use ".";
10995   for Library_ALI_Dir use External("LIBRARY_DIR");
10996   for Library_Version use External ("SONAME");
10997   for Library_Kind use Kind;
10998   for Library_Dir use External("BUILD_DIR");
10999   Source_Dir := External ("SOURCE_DIR");
11000   for Source_Dirs use (Source_Dir);
11001   package Compiler is
11002      for Default_Switches ("Ada") use
11003        ("-g",
11004         "-O2",
11005         "-gnatafno",
11006         "-gnatVa",   -- All validity checks
11007         "-gnatwa");  -- Activate all optional errors
11008   end Compiler;
11009 end Library;
11010 CF_EOF
11011                 cat >>confpackage.ads <<CF_EOF
11012 package ConfPackage is
11013    procedure conftest;
11014 end ConfPackage;
11015 CF_EOF
11016                 cat >>confpackage.adb <<CF_EOF
11017 with Text_IO;
11018 package body ConfPackage is
11019    procedure conftest is
11020    begin
11021       Text_IO.Put ("Hello World");
11022       Text_IO.New_Line;
11023    end conftest;
11024 end ConfPackage;
11025 CF_EOF
11026                 if ( $cf_ada_make $ADAFLAGS \
11027                                 -Plibrary.gpr \
11028                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
11029                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
11030                                 -XSOURCE_DIR=`pwd` \
11031                                 -XSONAME=libConfTest.so.1 \
11032                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
11033                         cf_gnat_projects=yes
11034                 fi
11035                 cd ..
11036                 if test -f conftest.lib/confpackage.ali
11037                 then
11038                         cf_gnat_libraries=yes
11039                 fi
11040                 rm -rf conftest* *~conftest*
11041                 ;;
11042         esac
11043         ;;
11044 esac
11045 echo "$as_me:11045: result: $cf_gnat_projects" >&5
11046 echo "${ECHO_T}$cf_gnat_projects" >&6
11047
11048 if test $cf_gnat_projects = yes
11049 then
11050         echo "$as_me:11050: checking if GNAT supports libraries" >&5
11051 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
11052         echo "$as_me:11052: result: $cf_gnat_libraries" >&5
11053 echo "${ECHO_T}$cf_gnat_libraries" >&6
11054 fi
11055
11056 if test "$cf_gnat_projects" = yes
11057 then
11058         USE_OLD_MAKERULES="#"
11059         USE_GNAT_PROJECTS=""
11060 else
11061         USE_OLD_MAKERULES=""
11062         USE_GNAT_PROJECTS="#"
11063 fi
11064
11065 if test "$cf_gnat_libraries" = yes
11066 then
11067         USE_GNAT_LIBRARIES=""
11068 else
11069         USE_GNAT_LIBRARIES="#"
11070 fi
11071
11072 echo "$as_me:11072: checking for ada-compiler" >&5
11073 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
11074
11075 # Check whether --with-ada-compiler or --without-ada-compiler was given.
11076 if test "${with_ada_compiler+set}" = set; then
11077   withval="$with_ada_compiler"
11078   cf_ada_compiler=$withval
11079 else
11080   cf_ada_compiler=gnatmake
11081 fi;
11082
11083 echo "$as_me:11083: result: $cf_ada_compiler" >&5
11084 echo "${ECHO_T}$cf_ada_compiler" >&6
11085
11086                 cf_ada_package=terminal_interface
11087
11088 echo "$as_me:11088: checking for ada-include" >&5
11089 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
11090
11091 # Check whether --with-ada-include or --without-ada-include was given.
11092 if test "${with_ada_include+set}" = set; then
11093   withval="$with_ada_include"
11094
11095 else
11096   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
11097 fi; if test -n "$prefix/share/ada/adainclude" ; then
11098
11099 if test "x$prefix" != xNONE; then
11100   cf_path_syntax="$prefix"
11101 else
11102   cf_path_syntax="$ac_default_prefix"
11103 fi
11104
11105 case ".$withval" in #(vi
11106 .\$\(*\)*|.\'*\'*) #(vi
11107   ;;
11108 ..|./*|.\\*) #(vi
11109   ;;
11110 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11111   ;;
11112 .\${*prefix}*) #(vi
11113   eval withval="$withval"
11114   case ".$withval" in #(vi
11115   .NONE/*)
11116     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11117     ;;
11118   esac
11119   ;; #(vi
11120 .no|.NONE/*)
11121   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11122   ;;
11123 *)
11124   { { echo "$as_me:11124: error: expected a pathname, not \"$withval\"" >&5
11125 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11126    { (exit 1); exit 1; }; }
11127   ;;
11128 esac
11129
11130 fi
11131 ADA_INCLUDE="$withval"
11132
11133 echo "$as_me:11133: result: $ADA_INCLUDE" >&5
11134 echo "${ECHO_T}$ADA_INCLUDE" >&6
11135
11136 echo "$as_me:11136: checking for ada-objects" >&5
11137 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
11138
11139 # Check whether --with-ada-objects or --without-ada-objects was given.
11140 if test "${with_ada_objects+set}" = set; then
11141   withval="$with_ada_objects"
11142
11143 else
11144   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
11145 fi; if test -n "$prefix/lib/ada/adalib" ; then
11146
11147 if test "x$prefix" != xNONE; then
11148   cf_path_syntax="$prefix"
11149 else
11150   cf_path_syntax="$ac_default_prefix"
11151 fi
11152
11153 case ".$withval" in #(vi
11154 .\$\(*\)*|.\'*\'*) #(vi
11155   ;;
11156 ..|./*|.\\*) #(vi
11157   ;;
11158 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
11159   ;;
11160 .\${*prefix}*) #(vi
11161   eval withval="$withval"
11162   case ".$withval" in #(vi
11163   .NONE/*)
11164     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11165     ;;
11166   esac
11167   ;; #(vi
11168 .no|.NONE/*)
11169   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
11170   ;;
11171 *)
11172   { { echo "$as_me:11172: error: expected a pathname, not \"$withval\"" >&5
11173 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
11174    { (exit 1); exit 1; }; }
11175   ;;
11176 esac
11177
11178 fi
11179 ADA_OBJECTS="$withval"
11180
11181 echo "$as_me:11181: result: $ADA_OBJECTS" >&5
11182 echo "${ECHO_T}$ADA_OBJECTS" >&6
11183
11184 echo "$as_me:11184: checking if an Ada95 shared-library should be built" >&5
11185 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
11186
11187 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
11188 if test "${with_ada_sharedlib+set}" = set; then
11189   withval="$with_ada_sharedlib"
11190   with_ada_sharedlib=$withval
11191 else
11192   with_ada_sharedlib=no
11193 fi;
11194 echo "$as_me:11194: result: $with_ada_sharedlib" >&5
11195 echo "${ECHO_T}$with_ada_sharedlib" >&6
11196
11197 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
11198 MAKE_ADA_SHAREDLIB="#"
11199
11200 if test "x$with_ada_sharedlib" != xno
11201 then
11202         MAKE_ADA_SHAREDLIB=
11203         if test "x$with_ada_sharedlib" != xyes
11204         then
11205                 ADA_SHAREDLIB="$with_ada_sharedlib"
11206         fi
11207 fi
11208
11209         else
11210                 { { echo "$as_me:11210: error: No usable Ada compiler found" >&5
11211 echo "$as_me: error: No usable Ada compiler found" >&2;}
11212    { (exit 1); exit 1; }; }
11213         fi
11214 else
11215         { { echo "$as_me:11215: error: The Ada compiler is needed for this package" >&5
11216 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
11217    { (exit 1); exit 1; }; }
11218 fi
11219
11220 ################################################################################
11221
11222 # not needed
11223 TINFO_ARGS2=
11224
11225 ### Construct the list of include-directories to be generated
11226
11227 CPPFLAGS="$CPPFLAGS -I. -I../include"
11228 if test "$srcdir" != "."; then
11229         CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
11230 fi
11231 if test "$GCC" != yes; then
11232         CPPFLAGS="$CPPFLAGS -I\${includedir}"
11233 elif test "$includedir" != "/usr/include"; then
11234         if test "$includedir" = '${prefix}/include' ; then
11235                 if test $prefix != /usr ; then
11236                         CPPFLAGS="$CPPFLAGS -I\${includedir}"
11237                 fi
11238         else
11239                 CPPFLAGS="$CPPFLAGS -I\${includedir}"
11240         fi
11241 fi
11242
11243 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
11244 if test "$srcdir" != "."; then
11245         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
11246 fi
11247 if test "$GCC" != yes; then
11248         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11249 elif test "$includedir" != "/usr/include"; then
11250         if test "$includedir" = '${prefix}/include' ; then
11251                 if test $prefix != /usr ; then
11252                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11253                 fi
11254         else
11255                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
11256         fi
11257 fi
11258
11259 ### Build up pieces for makefile rules
11260 echo "$as_me:11260: checking default library suffix" >&5
11261 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
11262
11263         case $DFT_LWR_MODEL in
11264         libtool) DFT_ARG_SUFFIX=''   ;;
11265         normal)  DFT_ARG_SUFFIX=''   ;;
11266         debug)   DFT_ARG_SUFFIX='_g' ;;
11267         profile) DFT_ARG_SUFFIX='_p' ;;
11268         shared)  DFT_ARG_SUFFIX=''   ;;
11269         esac
11270         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
11271 echo "$as_me:11271: result: $DFT_ARG_SUFFIX" >&5
11272 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
11273
11274 echo "$as_me:11274: checking default library-dependency suffix" >&5
11275 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
11276
11277         case $DFT_LWR_MODEL in #(vi
11278         libtool) #(vi
11279                 DFT_LIB_SUFFIX='.la'
11280                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11281                 ;;
11282         normal) #(vi
11283                 DFT_LIB_SUFFIX='.a'
11284                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11285                 ;;
11286         debug) #(vi
11287                 DFT_LIB_SUFFIX='_g.a'
11288                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11289                 ;;
11290         profile) #(vi
11291                 DFT_LIB_SUFFIX='_p.a'
11292                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11293                 ;;
11294         shared) #(vi
11295                 case $cf_cv_system_name in
11296                 aix[56]*) #(vi
11297                         DFT_LIB_SUFFIX='.a'
11298                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11299                         ;;
11300                 cygwin*) #(vi
11301                         DFT_LIB_SUFFIX='.dll'
11302                         DFT_DEP_SUFFIX='.dll.a'
11303                         ;;
11304                 darwin*) #(vi
11305                         DFT_LIB_SUFFIX='.dylib'
11306                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11307                         ;;
11308                 hpux*) #(vi
11309                         case $target in
11310                         ia64*) #(vi
11311                                 DFT_LIB_SUFFIX='.so'
11312                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11313                                 ;;
11314                         *) #(vi
11315                                 DFT_LIB_SUFFIX='.sl'
11316                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11317                                 ;;
11318                         esac
11319                         ;;
11320                 *)      DFT_LIB_SUFFIX='.so'
11321                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11322                         ;;
11323                 esac
11324         esac
11325         test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
11326         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
11327 echo "$as_me:11327: result: $DFT_DEP_SUFFIX" >&5
11328 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
11329
11330 echo "$as_me:11330: checking default object directory" >&5
11331 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
11332
11333         case $DFT_LWR_MODEL in
11334         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
11335         normal)  DFT_OBJ_SUBDIR='objects' ;;
11336         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
11337         profile) DFT_OBJ_SUBDIR='obj_p' ;;
11338         shared)
11339                 case $cf_cv_system_name in #(vi
11340                 cygwin) #(vi
11341                         DFT_OBJ_SUBDIR='objects' ;;
11342                 *)
11343                         DFT_OBJ_SUBDIR='obj_s' ;;
11344                 esac
11345         esac
11346 echo "$as_me:11346: result: $DFT_OBJ_SUBDIR" >&5
11347 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
11348
11349 ### Set up low-level terminfo dependencies for makefiles.
11350
11351 if test "$DFT_LWR_MODEL" = shared ; then
11352         case $cf_cv_system_name in #(vi
11353         cygwin*)
11354                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
11355                 ;;
11356         esac
11357 fi
11358
11359 ### Construct the list of subdirectories for which we'll customize makefiles
11360 ### with the appropriate compile-rules.
11361
11362 SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
11363
11364 cat >>confdefs.h <<EOF
11365 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
11366 EOF
11367
11368 ### Now that we're done running tests, add the compiler-warnings, if any
11369
11370 cf_fix_cppflags=no
11371 cf_new_cflags=
11372 cf_new_cppflags=
11373 cf_new_extra_cppflags=
11374
11375 for cf_add_cflags in $EXTRA_CFLAGS
11376 do
11377 case $cf_fix_cppflags in
11378 no)
11379         case $cf_add_cflags in #(vi
11380         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11381                 case $cf_add_cflags in
11382                 -D*)
11383                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11384
11385                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11386                                 && test -z "${cf_tst_cflags}" \
11387                                 && cf_fix_cppflags=yes
11388
11389                         if test $cf_fix_cppflags = yes ; then
11390                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11391                                 continue
11392                         elif test "${cf_tst_cflags}" = "\"'" ; then
11393                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11394                                 continue
11395                         fi
11396                         ;;
11397                 esac
11398                 case "$CPPFLAGS" in
11399                 *$cf_add_cflags) #(vi
11400                         ;;
11401                 *) #(vi
11402                         case $cf_add_cflags in #(vi
11403                         -D*)
11404                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11405
11406 CPPFLAGS=`echo "$CPPFLAGS" | \
11407         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11408                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11409
11410                                 ;;
11411                         esac
11412                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11413                         ;;
11414                 esac
11415                 ;;
11416         *)
11417                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11418                 ;;
11419         esac
11420         ;;
11421 yes)
11422         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11423
11424         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11425
11426         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11427                 && test -z "${cf_tst_cflags}" \
11428                 && cf_fix_cppflags=no
11429         ;;
11430 esac
11431 done
11432
11433 if test -n "$cf_new_cflags" ; then
11434
11435         CFLAGS="$CFLAGS $cf_new_cflags"
11436 fi
11437
11438 if test -n "$cf_new_cppflags" ; then
11439
11440         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11441 fi
11442
11443 if test -n "$cf_new_extra_cppflags" ; then
11444
11445         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11446 fi
11447
11448 ################################################################################
11449
11450 if test x"$enable_pc_files" = xyes ; then \
11451 SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
11452 MAKE_PC_FILES=
11453 else
11454 MAKE_PC_FILES="#"
11455 fi
11456
11457 ################################################################################
11458
11459 TEST_ARG2=
11460
11461 TEST_LIBS2=
11462
11463 NCURSES_SHLIB2="sh -c"
11464
11465 ADA_SUBDIRS="include gen src doc"
11466 if test "x$cf_with_tests" != "xno" ; then
11467         ADA_SUBDIRS="$ADA_SUBDIRS samples"
11468 fi
11469 for cf_dir in $ADA_SUBDIRS
11470 do
11471         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
11472 done
11473
11474 NCURSES_TREE="#"
11475
11476 EXTERNAL_TREE=
11477
11478 # match layout used by make-tar.sh
11479 ADAHTML_DIR=../doc/ada
11480
11481 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
11482 ac_config_commands="$ac_config_commands default"
11483 cat >confcache <<\_ACEOF
11484 # This file is a shell script that caches the results of configure
11485 # tests run on this system so they can be shared between configure
11486 # scripts and configure runs, see configure's option --config-cache.
11487 # It is not useful on other systems.  If it contains results you don't
11488 # want to keep, you may remove or edit it.
11489 #
11490 # config.status only pays attention to the cache file if you give it
11491 # the --recheck option to rerun configure.
11492 #
11493 # `ac_cv_env_foo' variables (set or unset) will be overriden when
11494 # loading this file, other *unset* `ac_cv_foo' will be assigned the
11495 # following values.
11496
11497 _ACEOF
11498
11499 # The following way of writing the cache mishandles newlines in values,
11500 # but we know of no workaround that is simple, portable, and efficient.
11501 # So, don't put newlines in cache variables' values.
11502 # Ultrix sh set writes to stderr and can't be redirected directly,
11503 # and sets the high bit in the cache file unless we assign to the vars.
11504 {
11505   (set) 2>&1 |
11506     case `(ac_space=' '; set | grep ac_space) 2>&1` in
11507     *ac_space=\ *)
11508       # `set' does not quote correctly, so add quotes (double-quote
11509       # substitution turns \\\\ into \\, and sed turns \\ into \).
11510       sed -n \
11511         "s/'/'\\\\''/g;
11512           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
11513       ;;
11514     *)
11515       # `set' quotes correctly as required by POSIX, so do not add quotes.
11516       sed -n \
11517         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
11518       ;;
11519     esac;
11520 } |
11521   sed '
11522      t clear
11523      : clear
11524      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
11525      t end
11526      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
11527      : end' >>confcache
11528 if cmp -s $cache_file confcache; then :; else
11529   if test -w $cache_file; then
11530     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
11531     cat confcache >$cache_file
11532   else
11533     echo "not updating unwritable cache $cache_file"
11534   fi
11535 fi
11536 rm -f confcache
11537
11538 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11539 # Let make expand exec_prefix.
11540 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11541
11542 # VPATH may cause trouble with some makes, so we remove $(srcdir),
11543 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
11544 # trailing colons and then remove the whole line if VPATH becomes empty
11545 # (actually we leave an empty line to preserve line numbers).
11546 if test "x$srcdir" = x.; then
11547   ac_vpsub='/^[         ]*VPATH[        ]*=/{
11548 s/:*\$(srcdir):*/:/;
11549 s/:*\${srcdir}:*/:/;
11550 s/:*@srcdir@:*/:/;
11551 s/^\([^=]*=[    ]*\):*/\1/;
11552 s/:*$//;
11553 s/^[^=]*=[      ]*$//;
11554 }'
11555 fi
11556
11557 DEFS=-DHAVE_CONFIG_H
11558
11559 : ${CONFIG_STATUS=./config.status}
11560 ac_clean_files_save=$ac_clean_files
11561 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
11562 { echo "$as_me:11562: creating $CONFIG_STATUS" >&5
11563 echo "$as_me: creating $CONFIG_STATUS" >&6;}
11564 cat >$CONFIG_STATUS <<_ACEOF
11565 #! $SHELL
11566 # Generated automatically by configure.
11567 # Run this file to recreate the current configuration.
11568 # Compiler output produced by configure, useful for debugging
11569 # configure, is in config.log if it exists.
11570
11571 debug=false
11572 SHELL=\${CONFIG_SHELL-$SHELL}
11573 ac_cs_invocation="\$0 \$@"
11574
11575 _ACEOF
11576
11577 cat >>$CONFIG_STATUS <<\_ACEOF
11578 # Be Bourne compatible
11579 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
11580   emulate sh
11581   NULLCMD=:
11582 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
11583   set -o posix
11584 fi
11585
11586 # Name of the executable.
11587 as_me=`echo "$0" |sed 's,.*[\\/],,'`
11588
11589 if expr a : '\(a\)' >/dev/null 2>&1; then
11590   as_expr=expr
11591 else
11592   as_expr=false
11593 fi
11594
11595 rm -f conf$$ conf$$.exe conf$$.file
11596 echo >conf$$.file
11597 if ln -s conf$$.file conf$$ 2>/dev/null; then
11598   # We could just check for DJGPP; but this test a) works b) is more generic
11599   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
11600   if test -f conf$$.exe; then
11601     # Don't use ln at all; we don't have any links
11602     as_ln_s='cp -p'
11603   else
11604     as_ln_s='ln -s'
11605   fi
11606 elif ln conf$$.file conf$$ 2>/dev/null; then
11607   as_ln_s=ln
11608 else
11609   as_ln_s='cp -p'
11610 fi
11611 rm -f conf$$ conf$$.exe conf$$.file
11612
11613 as_executable_p="test -f"
11614
11615 # Support unset when possible.
11616 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
11617   as_unset=unset
11618 else
11619   as_unset=false
11620 fi
11621
11622 # NLS nuisances.
11623 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
11624 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
11625 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
11626 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
11627 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
11628 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
11629 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
11630 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
11631
11632 # IFS
11633 # We need space, tab and new line, in precisely that order.
11634 as_nl='
11635 '
11636 IFS="   $as_nl"
11637
11638 # CDPATH.
11639 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
11640
11641 exec 6>&1
11642
11643 _ACEOF
11644
11645 # Files that config.status was made for.
11646 if test -n "$ac_config_files"; then
11647   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
11648 fi
11649
11650 if test -n "$ac_config_headers"; then
11651   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
11652 fi
11653
11654 if test -n "$ac_config_links"; then
11655   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
11656 fi
11657
11658 if test -n "$ac_config_commands"; then
11659   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
11660 fi
11661
11662 cat >>$CONFIG_STATUS <<\EOF
11663
11664 ac_cs_usage="\
11665 \`$as_me' instantiates files from templates according to the
11666 current configuration.
11667
11668 Usage: $0 [OPTIONS] [FILE]...
11669
11670   -h, --help       print this help, then exit
11671   -V, --version    print version number, then exit
11672   -d, --debug      don't remove temporary files
11673       --recheck    update $as_me by reconfiguring in the same conditions
11674   --file=FILE[:TEMPLATE]
11675                    instantiate the configuration file FILE
11676   --header=FILE[:TEMPLATE]
11677                    instantiate the configuration header FILE
11678
11679 Configuration files:
11680 $config_files
11681
11682 Configuration headers:
11683 $config_headers
11684
11685 Configuration commands:
11686 $config_commands
11687
11688 Report bugs to <dickey@invisible-island.net>."
11689 EOF
11690
11691 cat >>$CONFIG_STATUS <<EOF
11692 ac_cs_version="\\
11693 config.status
11694 configured by $0, generated by GNU Autoconf 2.52.20101002,
11695   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
11696
11697 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
11698 Free Software Foundation, Inc.
11699 This config.status script is free software; the Free Software Foundation
11700 gives unlimited permission to copy, distribute and modify it."
11701 srcdir=$srcdir
11702 INSTALL="$INSTALL"
11703 EOF
11704
11705 cat >>$CONFIG_STATUS <<\EOF
11706 # If no file are specified by the user, then we need to provide default
11707 # value.  By we need to know if files were specified by the user.
11708 ac_need_defaults=:
11709 while test $# != 0
11710 do
11711   case $1 in
11712   --*=*)
11713     ac_option=`expr "x$1" : 'x\([^=]*\)='`
11714     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
11715     shift
11716     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
11717     shift
11718     ;;
11719   -*);;
11720   *) # This is not an option, so the user has probably given explicit
11721      # arguments.
11722      ac_need_defaults=false;;
11723   esac
11724
11725   case $1 in
11726   # Handling of the options.
11727 EOF
11728 cat >>$CONFIG_STATUS <<EOF
11729   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11730     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
11731     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
11732 EOF
11733 cat >>$CONFIG_STATUS <<\EOF
11734   --version | --vers* | -V )
11735     echo "$ac_cs_version"; exit 0 ;;
11736   --he | --h)
11737     # Conflict between --help and --header
11738     { { echo "$as_me:11738: error: ambiguous option: $1
11739 Try \`$0 --help' for more information." >&5
11740 echo "$as_me: error: ambiguous option: $1
11741 Try \`$0 --help' for more information." >&2;}
11742    { (exit 1); exit 1; }; };;
11743   --help | --hel | -h )
11744     echo "$ac_cs_usage"; exit 0 ;;
11745   --debug | --d* | -d )
11746     debug=: ;;
11747   --file | --fil | --fi | --f )
11748     shift
11749     CONFIG_FILES="$CONFIG_FILES $1"
11750     ac_need_defaults=false;;
11751   --header | --heade | --head | --hea )
11752     shift
11753     CONFIG_HEADERS="$CONFIG_HEADERS $1"
11754     ac_need_defaults=false;;
11755
11756   # This is an error.
11757   -*) { { echo "$as_me:11757: error: unrecognized option: $1
11758 Try \`$0 --help' for more information." >&5
11759 echo "$as_me: error: unrecognized option: $1
11760 Try \`$0 --help' for more information." >&2;}
11761    { (exit 1); exit 1; }; } ;;
11762
11763   *) ac_config_targets="$ac_config_targets $1" ;;
11764
11765   esac
11766   shift
11767 done
11768
11769 exec 5>>config.log
11770 cat >&5 << _ACEOF
11771
11772 ## ----------------------- ##
11773 ## Running config.status.  ##
11774 ## ----------------------- ##
11775
11776 This file was extended by $as_me 2.52.20101002, executed with
11777   CONFIG_FILES    = $CONFIG_FILES
11778   CONFIG_HEADERS  = $CONFIG_HEADERS
11779   CONFIG_LINKS    = $CONFIG_LINKS
11780   CONFIG_COMMANDS = $CONFIG_COMMANDS
11781   > $ac_cs_invocation
11782 on `(hostname || uname -n) 2>/dev/null | sed 1q`
11783
11784 _ACEOF
11785 EOF
11786
11787 cat >>$CONFIG_STATUS <<EOF
11788 #
11789 # INIT-COMMANDS section.
11790 #
11791
11792 ### Special initialization commands, used to pass information from the
11793 ### configuration-run into config.status
11794
11795 AWK="$AWK"
11796 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
11797 DFT_LWR_MODEL="$DFT_LWR_MODEL"
11798 ECHO_LINK="$ECHO_LINK"
11799 LIB_NAME="$LIB_NAME"
11800 LIB_SUFFIX="$LIB_SUFFIX"
11801 LN_S="$LN_S"
11802 NCURSES_MAJOR="$NCURSES_MAJOR"
11803 NCURSES_MINOR="$NCURSES_MINOR"
11804 NCURSES_PATCH="$NCURSES_PATCH"
11805 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
11806 cf_cv_abi_version="$cf_cv_abi_version"
11807 cf_cv_rel_version="$cf_cv_rel_version"
11808 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
11809 cf_cv_shared_soname='$cf_cv_shared_soname'
11810 cf_cv_shlib_version="$cf_cv_shlib_version"
11811 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
11812 cf_cv_system_name="$cf_cv_system_name"
11813 host="$host"
11814 target="$target"
11815
11816 EOF
11817
11818 cat >>$CONFIG_STATUS <<\EOF
11819 for ac_config_target in $ac_config_targets
11820 do
11821   case "$ac_config_target" in
11822   # Handling of arguments.
11823   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
11824   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
11825   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
11826   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
11827   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
11828   *) { { echo "$as_me:11828: error: invalid argument: $ac_config_target" >&5
11829 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
11830    { (exit 1); exit 1; }; };;
11831   esac
11832 done
11833
11834 # If the user did not use the arguments to specify the items to instantiate,
11835 # then the envvar interface is used.  Set only those that are not.
11836 # We use the long form for the default assignment because of an extremely
11837 # bizarre bug on SunOS 4.1.3.
11838 if $ac_need_defaults; then
11839   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
11840   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
11841   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
11842 fi
11843
11844 # Create a temporary directory, and hook for its removal unless debugging.
11845 $debug ||
11846 {
11847   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
11848   trap '{ (exit 1); exit 1; }' 1 2 13 15
11849 }
11850
11851 # Create a (secure) tmp directory for tmp files.
11852 : ${TMPDIR=/tmp}
11853 {
11854   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
11855   test -n "$tmp" && test -d "$tmp"
11856 }  ||
11857 {
11858   tmp=$TMPDIR/cs$$-$RANDOM
11859   (umask 077 && mkdir $tmp)
11860 } ||
11861 {
11862    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
11863    { (exit 1); exit 1; }
11864 }
11865
11866 EOF
11867
11868 cat >>$CONFIG_STATUS <<EOF
11869
11870 #
11871 # CONFIG_FILES section.
11872 #
11873
11874 # No need to generate the scripts if there are no CONFIG_FILES.
11875 # This happens for instance when ./config.status config.h
11876 if test -n "\$CONFIG_FILES"; then
11877   # Protect against being on the right side of a sed subst in config.status.
11878   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
11879    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
11880 s,@SHELL@,$SHELL,;t t
11881 s,@exec_prefix@,$exec_prefix,;t t
11882 s,@prefix@,$prefix,;t t
11883 s,@program_transform_name@,$program_transform_name,;t t
11884 s,@bindir@,$bindir,;t t
11885 s,@sbindir@,$sbindir,;t t
11886 s,@libexecdir@,$libexecdir,;t t
11887 s,@datadir@,$datadir,;t t
11888 s,@sysconfdir@,$sysconfdir,;t t
11889 s,@sharedstatedir@,$sharedstatedir,;t t
11890 s,@localstatedir@,$localstatedir,;t t
11891 s,@libdir@,$libdir,;t t
11892 s,@includedir@,$includedir,;t t
11893 s,@oldincludedir@,$oldincludedir,;t t
11894 s,@infodir@,$infodir,;t t
11895 s,@mandir@,$mandir,;t t
11896 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
11897 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
11898 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
11899 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
11900 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
11901 s,@build_alias@,$build_alias,;t t
11902 s,@host_alias@,$host_alias,;t t
11903 s,@target_alias@,$target_alias,;t t
11904 s,@ECHO_C@,$ECHO_C,;t t
11905 s,@ECHO_N@,$ECHO_N,;t t
11906 s,@ECHO_T@,$ECHO_T,;t t
11907 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
11908 s,@DEFS@,$DEFS,;t t
11909 s,@LIBS@,$LIBS,;t t
11910 s,@top_builddir@,$top_builddir,;t t
11911 s,@build@,$build,;t t
11912 s,@build_cpu@,$build_cpu,;t t
11913 s,@build_vendor@,$build_vendor,;t t
11914 s,@build_os@,$build_os,;t t
11915 s,@host@,$host,;t t
11916 s,@host_cpu@,$host_cpu,;t t
11917 s,@host_vendor@,$host_vendor,;t t
11918 s,@host_os@,$host_os,;t t
11919 s,@target@,$target,;t t
11920 s,@target_cpu@,$target_cpu,;t t
11921 s,@target_vendor@,$target_vendor,;t t
11922 s,@target_os@,$target_os,;t t
11923 s,@CC@,$CC,;t t
11924 s,@CFLAGS@,$CFLAGS,;t t
11925 s,@LDFLAGS@,$LDFLAGS,;t t
11926 s,@CPPFLAGS@,$CPPFLAGS,;t t
11927 s,@ac_ct_CC@,$ac_ct_CC,;t t
11928 s,@EXEEXT@,$EXEEXT,;t t
11929 s,@OBJEXT@,$OBJEXT,;t t
11930 s,@CPP@,$CPP,;t t
11931 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
11932 s,@PROG_EXT@,$PROG_EXT,;t t
11933 s,@AWK@,$AWK,;t t
11934 s,@EGREP@,$EGREP,;t t
11935 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
11936 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
11937 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
11938 s,@LN_S@,$LN_S,;t t
11939 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
11940 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
11941 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
11942 s,@SET_MAKE@,$SET_MAKE,;t t
11943 s,@CTAGS@,$CTAGS,;t t
11944 s,@ETAGS@,$ETAGS,;t t
11945 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
11946 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
11947 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
11948 s,@RANLIB@,$RANLIB,;t t
11949 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
11950 s,@LD@,$LD,;t t
11951 s,@ac_ct_LD@,$ac_ct_LD,;t t
11952 s,@AR@,$AR,;t t
11953 s,@ac_ct_AR@,$ac_ct_AR,;t t
11954 s,@ARFLAGS@,$ARFLAGS,;t t
11955 s,@DESTDIR@,$DESTDIR,;t t
11956 s,@BUILD_CC@,$BUILD_CC,;t t
11957 s,@BUILD_CPP@,$BUILD_CPP,;t t
11958 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
11959 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
11960 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
11961 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
11962 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
11963 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
11964 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
11965 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
11966 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
11967 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
11968 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
11969 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
11970 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
11971 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
11972 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
11973 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
11974 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
11975 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
11976 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
11977 s,@CC_G_OPT@,$CC_G_OPT,;t t
11978 s,@LD_MODEL@,$LD_MODEL,;t t
11979 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
11980 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
11981 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
11982 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
11983 s,@LINK_PROGS@,$LINK_PROGS,;t t
11984 s,@LINK_TESTS@,$LINK_TESTS,;t t
11985 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
11986 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
11987 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
11988 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
11989 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
11990 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
11991 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
11992 s,@PTHREAD@,$PTHREAD,;t t
11993 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
11994 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
11995 s,@ECHO_LINK@,$ECHO_LINK,;t t
11996 s,@ADAFLAGS@,$ADAFLAGS,;t t
11997 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
11998 s,@ADA_TRACE@,$ADA_TRACE,;t t
11999 s,@gnat_exists@,$gnat_exists,;t t
12000 s,@M4_exists@,$M4_exists,;t t
12001 s,@cf_ada_make@,$cf_ada_make,;t t
12002 s,@cf_compile_generics@,$cf_compile_generics,;t t
12003 s,@cf_generic_objects@,$cf_generic_objects,;t t
12004 s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
12005 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
12006 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
12007 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
12008 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
12009 s,@cf_ada_package@,$cf_ada_package,;t t
12010 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
12011 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
12012 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
12013 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
12014 s,@TINFO_ARGS2@,$TINFO_ARGS2,;t t
12015 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
12016 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
12017 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
12018 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
12019 s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
12020 s,@cross_compiling@,$cross_compiling,;t t
12021 s,@TEST_ARG2@,$TEST_ARG2,;t t
12022 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
12023 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
12024 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
12025 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
12026 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
12027 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
12028 CEOF
12029
12030 EOF
12031
12032   cat >>$CONFIG_STATUS <<\EOF
12033   # Split the substitutions into bite-sized pieces for seds with
12034   # small command number limits, like on Digital OSF/1 and HP-UX.
12035   ac_max_sed_lines=48
12036   ac_sed_frag=1 # Number of current file.
12037   ac_beg=1 # First line for current file.
12038   ac_end=$ac_max_sed_lines # Line after last line for current file.
12039   ac_more_lines=:
12040   ac_sed_cmds=
12041   while $ac_more_lines; do
12042     if test $ac_beg -gt 1; then
12043       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12044     else
12045       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
12046     fi
12047     if test ! -s $tmp/subs.frag; then
12048       ac_more_lines=false
12049     else
12050       # The purpose of the label and of the branching condition is to
12051       # speed up the sed processing (if there are no `@' at all, there
12052       # is no need to browse any of the substitutions).
12053       # These are the two extra sed commands mentioned above.
12054       (echo ':t
12055   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
12056       if test -z "$ac_sed_cmds"; then
12057         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
12058       else
12059         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
12060       fi
12061       ac_sed_frag=`expr $ac_sed_frag + 1`
12062       ac_beg=$ac_end
12063       ac_end=`expr $ac_end + $ac_max_sed_lines`
12064     fi
12065   done
12066   if test -z "$ac_sed_cmds"; then
12067     ac_sed_cmds=cat
12068   fi
12069 fi # test -n "$CONFIG_FILES"
12070
12071 EOF
12072 cat >>$CONFIG_STATUS <<\EOF
12073 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12074   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12075   case $ac_file in
12076   - | *:- | *:-:* ) # input from stdin
12077         cat >$tmp/stdin
12078         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12079         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12080   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12081         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12082   * )   ac_file_in=$ac_file.in ;;
12083   esac
12084
12085   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12086   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12087          X"$ac_file" : 'X\(//\)[^/]' \| \
12088          X"$ac_file" : 'X\(//\)$' \| \
12089          X"$ac_file" : 'X\(/\)' \| \
12090          .     : '\(.\)' 2>/dev/null ||
12091 echo X"$ac_file" |
12092     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12093           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12094           /^X\(\/\/\)$/{ s//\1/; q; }
12095           /^X\(\/\).*/{ s//\1/; q; }
12096           s/.*/./; q'`
12097   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12098     { case "$ac_dir" in
12099   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12100   *)                      as_incr_dir=.;;
12101 esac
12102 as_dummy="$ac_dir"
12103 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12104   case $as_mkdir_dir in
12105     # Skip DOS drivespec
12106     ?:) as_incr_dir=$as_mkdir_dir ;;
12107     *)
12108       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12109       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12110     ;;
12111   esac
12112 done; }
12113
12114     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
12115     # A "../" for each directory in $ac_dir_suffix.
12116     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
12117   else
12118     ac_dir_suffix= ac_dots=
12119   fi
12120
12121   case $srcdir in
12122   .)  ac_srcdir=.
12123       if test -z "$ac_dots"; then
12124          ac_top_srcdir=.
12125       else
12126          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
12127       fi ;;
12128   [\\/]* | ?:[\\/]* )
12129       ac_srcdir=$srcdir$ac_dir_suffix;
12130       ac_top_srcdir=$srcdir ;;
12131   *) # Relative path.
12132     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
12133     ac_top_srcdir=$ac_dots$srcdir ;;
12134   esac
12135
12136   case $INSTALL in
12137   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
12138   *) ac_INSTALL=$ac_dots$INSTALL ;;
12139   esac
12140
12141   if test x"$ac_file" != x-; then
12142     { echo "$as_me:12142: creating $ac_file" >&5
12143 echo "$as_me: creating $ac_file" >&6;}
12144     rm -f "$ac_file"
12145   fi
12146   # Let's still pretend it is `configure' which instantiates (i.e., don't
12147   # use $as_me), people would be surprised to read:
12148   #    /* config.h.  Generated automatically by config.status.  */
12149   configure_input="Generated automatically from `echo $ac_file_in |
12150                                                  sed 's,.*/,,'` by configure."
12151
12152   # First look for the input files in the build tree, otherwise in the
12153   # src tree.
12154   ac_file_inputs=`IFS=:
12155     for f in $ac_file_in; do
12156       case $f in
12157       -) echo $tmp/stdin ;;
12158       [\\/$]*)
12159          # Absolute (can't be DOS-style, as IFS=:)
12160          test -f "$f" || { { echo "$as_me:12160: error: cannot find input file: $f" >&5
12161 echo "$as_me: error: cannot find input file: $f" >&2;}
12162    { (exit 1); exit 1; }; }
12163          echo $f;;
12164       *) # Relative
12165          if test -f "$f"; then
12166            # Build tree
12167            echo $f
12168          elif test -f "$srcdir/$f"; then
12169            # Source tree
12170            echo $srcdir/$f
12171          else
12172            # /dev/null tree
12173            { { echo "$as_me:12173: error: cannot find input file: $f" >&5
12174 echo "$as_me: error: cannot find input file: $f" >&2;}
12175    { (exit 1); exit 1; }; }
12176          fi;;
12177       esac
12178     done` || { (exit 1); exit 1; }
12179 EOF
12180 cat >>$CONFIG_STATUS <<EOF
12181   sed "$ac_vpsub
12182 $extrasub
12183 EOF
12184 cat >>$CONFIG_STATUS <<\EOF
12185 :t
12186 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
12187 s,@configure_input@,$configure_input,;t t
12188 s,@srcdir@,$ac_srcdir,;t t
12189 s,@top_srcdir@,$ac_top_srcdir,;t t
12190 s,@INSTALL@,$ac_INSTALL,;t t
12191 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
12192   rm -f $tmp/stdin
12193   if test x"$ac_file" != x-; then
12194     mv $tmp/out $ac_file
12195   else
12196     cat $tmp/out
12197     rm -f $tmp/out
12198   fi
12199
12200 done
12201 EOF
12202 cat >>$CONFIG_STATUS <<\EOF
12203
12204 #
12205 # CONFIG_HEADER section.
12206 #
12207
12208 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12209 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12210 #
12211 # ac_d sets the value in "#define NAME VALUE" lines.
12212 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12213 ac_dB='[        ].*$,\1#\2'
12214 ac_dC=' '
12215 ac_dD=',;t'
12216 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12217 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12218 ac_iB='\([      ]\),\1#\2define\3'
12219 ac_iC=' '
12220 ac_iD='\4,;t'
12221 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12222 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12223 ac_uB='$,\1#\2define\3'
12224 ac_uC=' '
12225 ac_uD=',;t'
12226
12227 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
12228   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12229   case $ac_file in
12230   - | *:- | *:-:* ) # input from stdin
12231         cat >$tmp/stdin
12232         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12233         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12234   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12235         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12236   * )   ac_file_in=$ac_file.in ;;
12237   esac
12238
12239   test x"$ac_file" != x- && { echo "$as_me:12239: creating $ac_file" >&5
12240 echo "$as_me: creating $ac_file" >&6;}
12241
12242   # First look for the input files in the build tree, otherwise in the
12243   # src tree.
12244   ac_file_inputs=`IFS=:
12245     for f in $ac_file_in; do
12246       case $f in
12247       -) echo $tmp/stdin ;;
12248       [\\/$]*)
12249          # Absolute (can't be DOS-style, as IFS=:)
12250          test -f "$f" || { { echo "$as_me:12250: error: cannot find input file: $f" >&5
12251 echo "$as_me: error: cannot find input file: $f" >&2;}
12252    { (exit 1); exit 1; }; }
12253          echo $f;;
12254       *) # Relative
12255          if test -f "$f"; then
12256            # Build tree
12257            echo $f
12258          elif test -f "$srcdir/$f"; then
12259            # Source tree
12260            echo $srcdir/$f
12261          else
12262            # /dev/null tree
12263            { { echo "$as_me:12263: error: cannot find input file: $f" >&5
12264 echo "$as_me: error: cannot find input file: $f" >&2;}
12265    { (exit 1); exit 1; }; }
12266          fi;;
12267       esac
12268     done` || { (exit 1); exit 1; }
12269   # Remove the trailing spaces.
12270   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
12271
12272 EOF
12273
12274 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
12275 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
12276 # be either 'cat' or 'sort'.
12277 cat confdefs.h | uniq >conftest.vals
12278
12279 # Break up conftest.vals because some shells have a limit on
12280 # the size of here documents, and old seds have small limits too.
12281
12282 rm -f conftest.tail
12283 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
12284 while grep . conftest.vals >/dev/null
12285 do
12286   # Write chunks of a limited-size here document to conftest.frag.
12287   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
12288   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
12289   echo 'CEOF' >> $CONFIG_STATUS
12290   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12291   rm -f conftest.vals
12292   mv conftest.tail conftest.vals
12293 done
12294 rm -f conftest.vals
12295
12296 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
12297 # marker @DEFS@.
12298 echo '  cat >> conftest.edit <<CEOF
12299 /@DEFS@/r conftest.frag
12300 /@DEFS@/d
12301 CEOF
12302 sed -f conftest.edit $tmp/in > $tmp/out
12303 rm -f $tmp/in
12304 mv $tmp/out $tmp/in
12305 rm -f conftest.edit conftest.frag
12306 ' >> $CONFIG_STATUS
12307
12308 cat >>$CONFIG_STATUS <<\EOF
12309   # Let's still pretend it is `configure' which instantiates (i.e., don't
12310   # use $as_me), people would be surprised to read:
12311   #    /* config.h.  Generated automatically by config.status.  */
12312   if test x"$ac_file" = x-; then
12313     echo "/* Generated automatically by configure.  */" >$tmp/config.h
12314   else
12315     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
12316   fi
12317   cat $tmp/in >>$tmp/config.h
12318   rm -f $tmp/in
12319   if test x"$ac_file" != x-; then
12320     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
12321       { echo "$as_me:12321: $ac_file is unchanged" >&5
12322 echo "$as_me: $ac_file is unchanged" >&6;}
12323     else
12324       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12325          X"$ac_file" : 'X\(//\)[^/]' \| \
12326          X"$ac_file" : 'X\(//\)$' \| \
12327          X"$ac_file" : 'X\(/\)' \| \
12328          .     : '\(.\)' 2>/dev/null ||
12329 echo X"$ac_file" |
12330     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12331           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12332           /^X\(\/\/\)$/{ s//\1/; q; }
12333           /^X\(\/\).*/{ s//\1/; q; }
12334           s/.*/./; q'`
12335       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12336         { case "$ac_dir" in
12337   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12338   *)                      as_incr_dir=.;;
12339 esac
12340 as_dummy="$ac_dir"
12341 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12342   case $as_mkdir_dir in
12343     # Skip DOS drivespec
12344     ?:) as_incr_dir=$as_mkdir_dir ;;
12345     *)
12346       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12347       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12348     ;;
12349   esac
12350 done; }
12351
12352       fi
12353       rm -f $ac_file
12354       mv $tmp/config.h $ac_file
12355     fi
12356   else
12357     cat $tmp/config.h
12358     rm -f $tmp/config.h
12359   fi
12360 done
12361 EOF
12362 cat >>$CONFIG_STATUS <<\EOF
12363 #
12364 # CONFIG_COMMANDS section.
12365 #
12366 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
12367   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
12368   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
12369
12370   case $ac_dest in
12371     default )
12372 if test -z "$USE_OLD_MAKERULES" ; then
12373         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
12374 fi
12375  ;;
12376   esac
12377 done
12378 EOF
12379
12380 cat >>$CONFIG_STATUS <<\EOF
12381
12382 { (exit 0); exit 0; }
12383 EOF
12384 chmod +x $CONFIG_STATUS
12385 ac_clean_files=$ac_clean_files_save
12386
12387 # configure is writing to config.log, and then calls config.status.
12388 # config.status does its own redirection, appending to config.log.
12389 # Unfortunately, on DOS this fails, as config.log is still kept open
12390 # by configure, so config.status won't be able to write to it; its
12391 # output is simply discarded.  So we exec the FD to /dev/null,
12392 # effectively closing config.log, so it can be properly (re)opened and
12393 # appended to by config.status.  When coming back to configure, we
12394 # need to make the FD available again.
12395 if test "$no_create" != yes; then
12396   ac_cs_success=:
12397   exec 5>/dev/null
12398   $SHELL $CONFIG_STATUS || ac_cs_success=false
12399   exec 5>>config.log
12400   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
12401   # would make configure fail if this is the last instruction.
12402   $ac_cs_success || { (exit 1); exit 1; }
12403 fi
12404 ${MAKE:-make} preinstall