]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 5.7 - patch 20100724
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.18 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20100530.
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   --enable-mixed-case     tic should assume mixed-case filenames
650   --with-install-prefix   prefixes actual install-location ($DESTDIR)
651 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
652   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
653   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
654   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
655   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
656   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
657   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
658 Options to Specify the Libraries Built/Used:
659   --enable-widec          compile with wide-char/UTF-8 code
660   --with-curses-dir=DIR   directory in which (n)curses is installed
661   --with-shlib-version=X  Specify rel or abi version for shared libs
662 Fine-Tuning Your Configuration:
663   --enable-broken_linker  compile with broken-linker support code
664   --disable-largefile     omit support for large files
665   --with-rcs-ids          compile-in RCS identifiers
666 Extensions:
667   --disable-ext-funcs     disable function-extensions
668   --enable-const          compile with extra/non-standard const
669 Development Code:
670   --without-develop       disable development options
671 Experimental Code:
672   --with-pthread          use POSIX thread library
673   --enable-weak-symbols   enable weak-symbols for pthreads
674   --enable-reentrant      compile with experimental reentrant code
675   --with-wrap-prefix=XXX  override prefix used for public variables
676 Testing/development Options:
677   --enable-echo           build: display "compiling" commands (default)
678   --enable-warnings       build: turn on GCC compiler warnings
679   --enable-assertions     test: turn on generation of assertion code
680   --enable-expanded       test: generate functions for certain macros
681   --disable-macros        test: use functions rather than macros
682   --with-trace            test: add trace() function to all models of ncurses
683 Ada95 Binding Options:
684   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
685   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
686   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
687   --with-ada-sharedlib=XX build Ada95 shared-library
688
689 Some influential environment variables:
690   CC          C compiler command
691   CFLAGS      C compiler flags
692   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
693               nonstandard directory <lib dir>
694   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
695               headers in a nonstandard directory <include dir>
696   CPP         C preprocessor
697
698 Use these variables to override the choices made by `configure' or to help
699 it to find libraries and programs with nonstandard names/locations.
700
701 EOF
702 fi
703
704 if test "$ac_init_help" = "recursive"; then
705   # If there are subdirs, report their specific --help.
706   ac_popdir=`pwd`
707   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
708     cd $ac_subdir
709     # A "../" for each directory in /$ac_subdir.
710     ac_dots=`echo $ac_subdir |
711              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
712
713     case $srcdir in
714     .) # No --srcdir option.  We are building in place.
715       ac_sub_srcdir=$srcdir ;;
716     [\\/]* | ?:[\\/]* ) # Absolute path.
717       ac_sub_srcdir=$srcdir/$ac_subdir ;;
718     *) # Relative path.
719       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
720     esac
721
722     # Check for guested configure; otherwise get Cygnus style configure.
723     if test -f $ac_sub_srcdir/configure.gnu; then
724       echo
725       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
726     elif test -f $ac_sub_srcdir/configure; then
727       echo
728       $SHELL $ac_sub_srcdir/configure  --help=recursive
729     elif test -f $ac_sub_srcdir/configure.ac ||
730            test -f $ac_sub_srcdir/configure.in; then
731       echo
732       $ac_configure --help
733     else
734       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
735     fi
736     cd $ac_popdir
737   done
738 fi
739
740 test -n "$ac_init_help" && exit 0
741 if $ac_init_version; then
742   cat <<\EOF
743
744 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
745 Free Software Foundation, Inc.
746 This configure script is free software; the Free Software Foundation
747 gives unlimited permission to copy, distribute and modify it.
748 EOF
749   exit 0
750 fi
751 exec 5>config.log
752 cat >&5 <<EOF
753 This file contains any messages produced by compilers while
754 running configure, to aid debugging if configure makes a mistake.
755
756 It was created by $as_me, which was
757 generated by GNU Autoconf 2.52.20100530.  Invocation command line was
758
759   $ $0 $@
760
761 EOF
762 {
763 cat <<_ASUNAME
764 ## ---------- ##
765 ## Platform.  ##
766 ## ---------- ##
767
768 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
769 uname -m = `(uname -m) 2>/dev/null || echo unknown`
770 uname -r = `(uname -r) 2>/dev/null || echo unknown`
771 uname -s = `(uname -s) 2>/dev/null || echo unknown`
772 uname -v = `(uname -v) 2>/dev/null || echo unknown`
773
774 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
775 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
776
777 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
778 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
779 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
780 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
781 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
782 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
783 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
784
785 PATH = $PATH
786
787 _ASUNAME
788 } >&5
789
790 cat >&5 <<EOF
791 ## ------------ ##
792 ## Core tests.  ##
793 ## ------------ ##
794
795 EOF
796
797 # Keep a trace of the command line.
798 # Strip out --no-create and --no-recursion so they do not pile up.
799 # Also quote any args containing shell meta-characters.
800 ac_configure_args=
801 ac_sep=
802 for ac_arg
803 do
804   case $ac_arg in
805   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
806   | --no-cr | --no-c) ;;
807   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
808   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
809   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
810     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
811     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
812     ac_sep=" " ;;
813   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
814      ac_sep=" " ;;
815   esac
816   # Get rid of the leading space.
817 done
818
819 # When interrupted or exit'd, cleanup temporary files, and complete
820 # config.log.  We remove comments because anyway the quotes in there
821 # would cause problems or look ugly.
822 trap 'exit_status=$?
823   # Save into config.log some information that might help in debugging.
824   echo >&5
825   echo "## ----------------- ##" >&5
826   echo "## Cache variables.  ##" >&5
827   echo "## ----------------- ##" >&5
828   echo >&5
829   # The following way of writing the cache mishandles newlines in values,
830 {
831   (set) 2>&1 |
832     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
833     *ac_space=\ *)
834       sed -n \
835         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
836           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
837       ;;
838     *)
839       sed -n \
840         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
841       ;;
842     esac;
843 } >&5
844   sed "/^$/d" confdefs.h >conftest.log
845   if test -s conftest.log; then
846     echo >&5
847     echo "## ------------ ##" >&5
848     echo "## confdefs.h.  ##" >&5
849     echo "## ------------ ##" >&5
850     echo >&5
851     cat conftest.log >&5
852   fi
853   (echo; echo) >&5
854   test "$ac_signal" != 0 &&
855     echo "$as_me: caught signal $ac_signal" >&5
856   echo "$as_me: exit $exit_status" >&5
857   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
858     exit $exit_status
859      ' 0
860 for ac_signal in 1 2 13 15; do
861   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
862 done
863 ac_signal=0
864
865 # confdefs.h avoids OS command line length limits that DEFS can exceed.
866 rm -rf conftest* confdefs.h
867 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
868 echo >confdefs.h
869
870 # Let the site file select an alternate cache file if it wants to.
871 # Prefer explicitly selected file to automatically selected ones.
872 if test -z "$CONFIG_SITE"; then
873   if test "x$prefix" != xNONE; then
874     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
875   else
876     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
877   fi
878 fi
879 for ac_site_file in $CONFIG_SITE; do
880   if test -r "$ac_site_file"; then
881     { echo "$as_me:881: loading site script $ac_site_file" >&5
882 echo "$as_me: loading site script $ac_site_file" >&6;}
883     cat "$ac_site_file" >&5
884     . "$ac_site_file"
885   fi
886 done
887
888 if test -r "$cache_file"; then
889   # Some versions of bash will fail to source /dev/null (special
890   # files actually), so we avoid doing that.
891   if test -f "$cache_file"; then
892     { echo "$as_me:892: loading cache $cache_file" >&5
893 echo "$as_me: loading cache $cache_file" >&6;}
894     case $cache_file in
895       [\\/]* | ?:[\\/]* ) . $cache_file;;
896       *)                      . ./$cache_file;;
897     esac
898   fi
899 else
900   { echo "$as_me:900: creating cache $cache_file" >&5
901 echo "$as_me: creating cache $cache_file" >&6;}
902   >$cache_file
903 fi
904
905 # Check that the precious variables saved in the cache have kept the same
906 # value.
907 ac_cache_corrupted=false
908 for ac_var in `(set) 2>&1 |
909                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
910   eval ac_old_set=\$ac_cv_env_${ac_var}_set
911   eval ac_new_set=\$ac_env_${ac_var}_set
912   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
913   eval ac_new_val="\$ac_env_${ac_var}_value"
914   case $ac_old_set,$ac_new_set in
915     set,)
916       { echo "$as_me:916: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
917 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
918       ac_cache_corrupted=: ;;
919     ,set)
920       { echo "$as_me:920: error: \`$ac_var' was not set in the previous run" >&5
921 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
922       ac_cache_corrupted=: ;;
923     ,);;
924     *)
925       if test "x$ac_old_val" != "x$ac_new_val"; then
926         { echo "$as_me:926: error: \`$ac_var' has changed since the previous run:" >&5
927 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
928         { echo "$as_me:928:   former value:  $ac_old_val" >&5
929 echo "$as_me:   former value:  $ac_old_val" >&2;}
930         { echo "$as_me:930:   current value: $ac_new_val" >&5
931 echo "$as_me:   current value: $ac_new_val" >&2;}
932         ac_cache_corrupted=:
933       fi;;
934   esac
935   # Pass precious variables to config.status.  It doesn't matter if
936   # we pass some twice (in addition to the command line arguments).
937   if test "$ac_new_set" = set; then
938     case $ac_new_val in
939     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
940       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
941       ac_configure_args="$ac_configure_args '$ac_arg'"
942       ;;
943     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
944        ;;
945     esac
946   fi
947 done
948 if $ac_cache_corrupted; then
949   { echo "$as_me:949: error: changes in the environment can compromise the build" >&5
950 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
951   { { echo "$as_me:951: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
952 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
953    { (exit 1); exit 1; }; }
954 fi
955
956 ac_ext=c
957 ac_cpp='$CPP $CPPFLAGS'
958 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
959 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
960 ac_compiler_gnu=$ac_cv_c_compiler_gnu
961 ac_main_return=return
962
963 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
964   *c*,-n*) ECHO_N= ECHO_C='
965 ' ECHO_T='      ' ;;
966   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
967   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
968 esac
969 echo "#! $SHELL" >conftest.sh
970 echo  "exit 0"   >>conftest.sh
971 chmod +x conftest.sh
972 if { (echo "$as_me:972: PATH=\".;.\"; conftest.sh") >&5
973   (PATH=".;."; conftest.sh) 2>&5
974   ac_status=$?
975   echo "$as_me:975: \$? = $ac_status" >&5
976   (exit $ac_status); }; then
977   ac_path_separator=';'
978 else
979   ac_path_separator=:
980 fi
981 PATH_SEPARATOR="$ac_path_separator"
982 rm -f conftest.sh
983
984 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
985
986 top_builddir=`pwd`
987
988 ac_aux_dir=
989 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
990   if test -f $ac_dir/install-sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install-sh -c"
993     break
994   elif test -f $ac_dir/install.sh; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/install.sh -c"
997     break
998   elif test -f $ac_dir/shtool; then
999     ac_aux_dir=$ac_dir
1000     ac_install_sh="$ac_aux_dir/shtool install -c"
1001     break
1002   fi
1003 done
1004 if test -z "$ac_aux_dir"; then
1005   { { echo "$as_me:1005: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1006 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1007    { (exit 1); exit 1; }; }
1008 fi
1009 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1010 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1011 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1012
1013 # Make sure we can run config.sub.
1014 $ac_config_sub sun4 >/dev/null 2>&1 ||
1015   { { echo "$as_me:1015: error: cannot run $ac_config_sub" >&5
1016 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1017    { (exit 1); exit 1; }; }
1018
1019 echo "$as_me:1019: checking build system type" >&5
1020 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1021 if test "${ac_cv_build+set}" = set; then
1022   echo $ECHO_N "(cached) $ECHO_C" >&6
1023 else
1024   ac_cv_build_alias=$build_alias
1025 test -z "$ac_cv_build_alias" &&
1026   ac_cv_build_alias=`$ac_config_guess`
1027 test -z "$ac_cv_build_alias" &&
1028   { { echo "$as_me:1028: error: cannot guess build type; you must specify one" >&5
1029 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1030    { (exit 1); exit 1; }; }
1031 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1032   { { echo "$as_me:1032: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1033 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1034    { (exit 1); exit 1; }; }
1035
1036 fi
1037 echo "$as_me:1037: result: $ac_cv_build" >&5
1038 echo "${ECHO_T}$ac_cv_build" >&6
1039 build=$ac_cv_build
1040 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1041 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1042 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1043
1044 echo "$as_me:1044: checking host system type" >&5
1045 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1046 if test "${ac_cv_host+set}" = set; then
1047   echo $ECHO_N "(cached) $ECHO_C" >&6
1048 else
1049   ac_cv_host_alias=$host_alias
1050 test -z "$ac_cv_host_alias" &&
1051   ac_cv_host_alias=$ac_cv_build_alias
1052 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1053   { { echo "$as_me:1053: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1054 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1055    { (exit 1); exit 1; }; }
1056
1057 fi
1058 echo "$as_me:1058: result: $ac_cv_host" >&5
1059 echo "${ECHO_T}$ac_cv_host" >&6
1060 host=$ac_cv_host
1061 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1062 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1063 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1064
1065 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1066         echo "$as_me:1066: checking target system type" >&5
1067 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1068 if test "${ac_cv_target+set}" = set; then
1069   echo $ECHO_N "(cached) $ECHO_C" >&6
1070 else
1071   ac_cv_target_alias=$target_alias
1072 test "x$ac_cv_target_alias" = "x" &&
1073   ac_cv_target_alias=$ac_cv_host_alias
1074 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1075   { { echo "$as_me:1075: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1076 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1077    { (exit 1); exit 1; }; }
1078
1079 fi
1080 echo "$as_me:1080: result: $ac_cv_target" >&5
1081 echo "${ECHO_T}$ac_cv_target" >&6
1082 target=$ac_cv_target
1083 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1084 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1085 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1086
1087 # The aliases save the names the user supplied, while $host etc.
1088 # will get canonicalized.
1089 test -n "$target_alias" &&
1090   test "$program_prefix$program_suffix$program_transform_name" = \
1091     NONENONEs,x,x, &&
1092   program_prefix=${target_alias}-
1093         system_name="$host_os"
1094 else
1095         system_name="`(uname -s -r) 2>/dev/null`"
1096         if test -z "$system_name" ; then
1097                 system_name="`(hostname) 2>/dev/null`"
1098         fi
1099 fi
1100 test -n "$system_name" && cat >>confdefs.h <<EOF
1101 #define SYSTEM_NAME "$system_name"
1102 EOF
1103
1104 if test "${cf_cv_system_name+set}" = set; then
1105   echo $ECHO_N "(cached) $ECHO_C" >&6
1106 else
1107   cf_cv_system_name="$system_name"
1108 fi
1109
1110 test -z "$system_name" && system_name="$cf_cv_system_name"
1111 test -n "$cf_cv_system_name" && echo "$as_me:1111: result: Configuring for $cf_cv_system_name" >&5
1112 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1113
1114 if test ".$system_name" != ".$cf_cv_system_name" ; then
1115         echo "$as_me:1115: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1116 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1117         { { echo "$as_me:1117: error: \"Please remove config.cache and try again.\"" >&5
1118 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1119    { (exit 1); exit 1; }; }
1120 fi
1121
1122 # Check whether --with-system-type or --without-system-type was given.
1123 if test "${with_system_type+set}" = set; then
1124   withval="$with_system_type"
1125   { echo "$as_me:1125: WARNING: overriding system type to $withval" >&5
1126 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1127  cf_cv_system_name=$withval
1128 fi;
1129
1130 ###     Save the given $CFLAGS to allow user-override.
1131 cf_user_CFLAGS="$CFLAGS"
1132
1133 ###     Default install-location
1134
1135 echo "$as_me:1135: checking for prefix" >&5
1136 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1137 if test "x$prefix" = "xNONE" ; then
1138         case "$cf_cv_system_name" in
1139                 # non-vendor systems don't have a conflict
1140         openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu)
1141                 prefix=/usr
1142                 ;;
1143         *)      prefix=$ac_default_prefix
1144                 ;;
1145         esac
1146 fi
1147 echo "$as_me:1147: result: $prefix" >&5
1148 echo "${ECHO_T}$prefix" >&6
1149
1150 if test "x$prefix" = "xNONE" ; then
1151 echo "$as_me:1151: checking for default include-directory" >&5
1152 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1153 test -n "$verbose" && echo 1>&6
1154 for cf_symbol in \
1155         $includedir \
1156         $includedir/ncurses \
1157         $prefix/include \
1158         $prefix/include/ncurses \
1159         /usr/local/include \
1160         /usr/local/include/ncurses \
1161         /usr/include \
1162         /usr/include/ncurses
1163 do
1164         cf_dir=`eval echo $cf_symbol`
1165         if test -f $cf_dir/curses.h ; then
1166         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1167                 includedir="$cf_symbol"
1168                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1169                 break
1170         fi
1171         fi
1172         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1173 done
1174 echo "$as_me:1174: result: $includedir" >&5
1175 echo "${ECHO_T}$includedir" >&6
1176 fi
1177
1178 ###     Checks for programs.
1179 ac_ext=c
1180 ac_cpp='$CPP $CPPFLAGS'
1181 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1182 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1183 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1184 ac_main_return=return
1185 if test -n "$ac_tool_prefix"; then
1186   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1187 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1188 echo "$as_me:1188: checking for $ac_word" >&5
1189 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1190 if test "${ac_cv_prog_CC+set}" = set; then
1191   echo $ECHO_N "(cached) $ECHO_C" >&6
1192 else
1193   if test -n "$CC"; then
1194   ac_cv_prog_CC="$CC" # Let the user override the test.
1195 else
1196   ac_save_IFS=$IFS; IFS=$ac_path_separator
1197 ac_dummy="$PATH"
1198 for ac_dir in $ac_dummy; do
1199   IFS=$ac_save_IFS
1200   test -z "$ac_dir" && ac_dir=.
1201   $as_executable_p "$ac_dir/$ac_word" || continue
1202 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1203 echo "$as_me:1203: found $ac_dir/$ac_word" >&5
1204 break
1205 done
1206
1207 fi
1208 fi
1209 CC=$ac_cv_prog_CC
1210 if test -n "$CC"; then
1211   echo "$as_me:1211: result: $CC" >&5
1212 echo "${ECHO_T}$CC" >&6
1213 else
1214   echo "$as_me:1214: result: no" >&5
1215 echo "${ECHO_T}no" >&6
1216 fi
1217
1218 fi
1219 if test -z "$ac_cv_prog_CC"; then
1220   ac_ct_CC=$CC
1221   # Extract the first word of "gcc", so it can be a program name with args.
1222 set dummy gcc; ac_word=$2
1223 echo "$as_me:1223: checking for $ac_word" >&5
1224 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1225 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1226   echo $ECHO_N "(cached) $ECHO_C" >&6
1227 else
1228   if test -n "$ac_ct_CC"; then
1229   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1230 else
1231   ac_save_IFS=$IFS; IFS=$ac_path_separator
1232 ac_dummy="$PATH"
1233 for ac_dir in $ac_dummy; do
1234   IFS=$ac_save_IFS
1235   test -z "$ac_dir" && ac_dir=.
1236   $as_executable_p "$ac_dir/$ac_word" || continue
1237 ac_cv_prog_ac_ct_CC="gcc"
1238 echo "$as_me:1238: found $ac_dir/$ac_word" >&5
1239 break
1240 done
1241
1242 fi
1243 fi
1244 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1245 if test -n "$ac_ct_CC"; then
1246   echo "$as_me:1246: result: $ac_ct_CC" >&5
1247 echo "${ECHO_T}$ac_ct_CC" >&6
1248 else
1249   echo "$as_me:1249: result: no" >&5
1250 echo "${ECHO_T}no" >&6
1251 fi
1252
1253   CC=$ac_ct_CC
1254 else
1255   CC="$ac_cv_prog_CC"
1256 fi
1257
1258 if test -z "$CC"; then
1259   if test -n "$ac_tool_prefix"; then
1260   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1261 set dummy ${ac_tool_prefix}cc; ac_word=$2
1262 echo "$as_me:1262: checking for $ac_word" >&5
1263 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1264 if test "${ac_cv_prog_CC+set}" = set; then
1265   echo $ECHO_N "(cached) $ECHO_C" >&6
1266 else
1267   if test -n "$CC"; then
1268   ac_cv_prog_CC="$CC" # Let the user override the test.
1269 else
1270   ac_save_IFS=$IFS; IFS=$ac_path_separator
1271 ac_dummy="$PATH"
1272 for ac_dir in $ac_dummy; do
1273   IFS=$ac_save_IFS
1274   test -z "$ac_dir" && ac_dir=.
1275   $as_executable_p "$ac_dir/$ac_word" || continue
1276 ac_cv_prog_CC="${ac_tool_prefix}cc"
1277 echo "$as_me:1277: found $ac_dir/$ac_word" >&5
1278 break
1279 done
1280
1281 fi
1282 fi
1283 CC=$ac_cv_prog_CC
1284 if test -n "$CC"; then
1285   echo "$as_me:1285: result: $CC" >&5
1286 echo "${ECHO_T}$CC" >&6
1287 else
1288   echo "$as_me:1288: result: no" >&5
1289 echo "${ECHO_T}no" >&6
1290 fi
1291
1292 fi
1293 if test -z "$ac_cv_prog_CC"; then
1294   ac_ct_CC=$CC
1295   # Extract the first word of "cc", so it can be a program name with args.
1296 set dummy cc; ac_word=$2
1297 echo "$as_me:1297: checking for $ac_word" >&5
1298 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1299 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1300   echo $ECHO_N "(cached) $ECHO_C" >&6
1301 else
1302   if test -n "$ac_ct_CC"; then
1303   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1304 else
1305   ac_save_IFS=$IFS; IFS=$ac_path_separator
1306 ac_dummy="$PATH"
1307 for ac_dir in $ac_dummy; do
1308   IFS=$ac_save_IFS
1309   test -z "$ac_dir" && ac_dir=.
1310   $as_executable_p "$ac_dir/$ac_word" || continue
1311 ac_cv_prog_ac_ct_CC="cc"
1312 echo "$as_me:1312: found $ac_dir/$ac_word" >&5
1313 break
1314 done
1315
1316 fi
1317 fi
1318 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1319 if test -n "$ac_ct_CC"; then
1320   echo "$as_me:1320: result: $ac_ct_CC" >&5
1321 echo "${ECHO_T}$ac_ct_CC" >&6
1322 else
1323   echo "$as_me:1323: result: no" >&5
1324 echo "${ECHO_T}no" >&6
1325 fi
1326
1327   CC=$ac_ct_CC
1328 else
1329   CC="$ac_cv_prog_CC"
1330 fi
1331
1332 fi
1333 if test -z "$CC"; then
1334   # Extract the first word of "cc", so it can be a program name with args.
1335 set dummy cc; ac_word=$2
1336 echo "$as_me:1336: checking for $ac_word" >&5
1337 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1338 if test "${ac_cv_prog_CC+set}" = set; then
1339   echo $ECHO_N "(cached) $ECHO_C" >&6
1340 else
1341   if test -n "$CC"; then
1342   ac_cv_prog_CC="$CC" # Let the user override the test.
1343 else
1344   ac_prog_rejected=no
1345   ac_save_IFS=$IFS; IFS=$ac_path_separator
1346 ac_dummy="$PATH"
1347 for ac_dir in $ac_dummy; do
1348   IFS=$ac_save_IFS
1349   test -z "$ac_dir" && ac_dir=.
1350   $as_executable_p "$ac_dir/$ac_word" || continue
1351 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1352   ac_prog_rejected=yes
1353   continue
1354 fi
1355 ac_cv_prog_CC="cc"
1356 echo "$as_me:1356: found $ac_dir/$ac_word" >&5
1357 break
1358 done
1359
1360 if test $ac_prog_rejected = yes; then
1361   # We found a bogon in the path, so make sure we never use it.
1362   set dummy $ac_cv_prog_CC
1363   shift
1364   if test $# != 0; then
1365     # We chose a different compiler from the bogus one.
1366     # However, it has the same basename, so the bogon will be chosen
1367     # first if we set CC to just the basename; use the full file name.
1368     shift
1369     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1370     shift
1371     ac_cv_prog_CC="$@"
1372   fi
1373 fi
1374 fi
1375 fi
1376 CC=$ac_cv_prog_CC
1377 if test -n "$CC"; then
1378   echo "$as_me:1378: result: $CC" >&5
1379 echo "${ECHO_T}$CC" >&6
1380 else
1381   echo "$as_me:1381: result: no" >&5
1382 echo "${ECHO_T}no" >&6
1383 fi
1384
1385 fi
1386 if test -z "$CC"; then
1387   if test -n "$ac_tool_prefix"; then
1388   for ac_prog in cl
1389   do
1390     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1391 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1392 echo "$as_me:1392: checking for $ac_word" >&5
1393 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1394 if test "${ac_cv_prog_CC+set}" = set; then
1395   echo $ECHO_N "(cached) $ECHO_C" >&6
1396 else
1397   if test -n "$CC"; then
1398   ac_cv_prog_CC="$CC" # Let the user override the test.
1399 else
1400   ac_save_IFS=$IFS; IFS=$ac_path_separator
1401 ac_dummy="$PATH"
1402 for ac_dir in $ac_dummy; do
1403   IFS=$ac_save_IFS
1404   test -z "$ac_dir" && ac_dir=.
1405   $as_executable_p "$ac_dir/$ac_word" || continue
1406 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1407 echo "$as_me:1407: found $ac_dir/$ac_word" >&5
1408 break
1409 done
1410
1411 fi
1412 fi
1413 CC=$ac_cv_prog_CC
1414 if test -n "$CC"; then
1415   echo "$as_me:1415: result: $CC" >&5
1416 echo "${ECHO_T}$CC" >&6
1417 else
1418   echo "$as_me:1418: result: no" >&5
1419 echo "${ECHO_T}no" >&6
1420 fi
1421
1422     test -n "$CC" && break
1423   done
1424 fi
1425 if test -z "$CC"; then
1426   ac_ct_CC=$CC
1427   for ac_prog in cl
1428 do
1429   # Extract the first word of "$ac_prog", so it can be a program name with args.
1430 set dummy $ac_prog; ac_word=$2
1431 echo "$as_me:1431: checking for $ac_word" >&5
1432 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1433 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1434   echo $ECHO_N "(cached) $ECHO_C" >&6
1435 else
1436   if test -n "$ac_ct_CC"; then
1437   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1438 else
1439   ac_save_IFS=$IFS; IFS=$ac_path_separator
1440 ac_dummy="$PATH"
1441 for ac_dir in $ac_dummy; do
1442   IFS=$ac_save_IFS
1443   test -z "$ac_dir" && ac_dir=.
1444   $as_executable_p "$ac_dir/$ac_word" || continue
1445 ac_cv_prog_ac_ct_CC="$ac_prog"
1446 echo "$as_me:1446: found $ac_dir/$ac_word" >&5
1447 break
1448 done
1449
1450 fi
1451 fi
1452 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1453 if test -n "$ac_ct_CC"; then
1454   echo "$as_me:1454: result: $ac_ct_CC" >&5
1455 echo "${ECHO_T}$ac_ct_CC" >&6
1456 else
1457   echo "$as_me:1457: result: no" >&5
1458 echo "${ECHO_T}no" >&6
1459 fi
1460
1461   test -n "$ac_ct_CC" && break
1462 done
1463
1464   CC=$ac_ct_CC
1465 fi
1466
1467 fi
1468
1469 test -z "$CC" && { { echo "$as_me:1469: error: no acceptable cc found in \$PATH" >&5
1470 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1471    { (exit 1); exit 1; }; }
1472
1473 # Provide some information about the compiler.
1474 echo "$as_me:1474:" \
1475      "checking for C compiler version" >&5
1476 ac_compiler=`set X $ac_compile; echo $2`
1477 { (eval echo "$as_me:1477: \"$ac_compiler --version </dev/null >&5\"") >&5
1478   (eval $ac_compiler --version </dev/null >&5) 2>&5
1479   ac_status=$?
1480   echo "$as_me:1480: \$? = $ac_status" >&5
1481   (exit $ac_status); }
1482 { (eval echo "$as_me:1482: \"$ac_compiler -v </dev/null >&5\"") >&5
1483   (eval $ac_compiler -v </dev/null >&5) 2>&5
1484   ac_status=$?
1485   echo "$as_me:1485: \$? = $ac_status" >&5
1486   (exit $ac_status); }
1487 { (eval echo "$as_me:1487: \"$ac_compiler -V </dev/null >&5\"") >&5
1488   (eval $ac_compiler -V </dev/null >&5) 2>&5
1489   ac_status=$?
1490   echo "$as_me:1490: \$? = $ac_status" >&5
1491   (exit $ac_status); }
1492
1493 cat >conftest.$ac_ext <<_ACEOF
1494 #line 1494 "configure"
1495 #include "confdefs.h"
1496
1497 int
1498 main ()
1499 {
1500
1501   ;
1502   return 0;
1503 }
1504 _ACEOF
1505 ac_clean_files_save=$ac_clean_files
1506 ac_clean_files="$ac_clean_files a.out a.exe"
1507 # Try to create an executable without -o first, disregard a.out.
1508 # It will help us diagnose broken compilers, and finding out an intuition
1509 # of exeext.
1510 echo "$as_me:1510: checking for C compiler default output" >&5
1511 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1512 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1513 if { (eval echo "$as_me:1513: \"$ac_link_default\"") >&5
1514   (eval $ac_link_default) 2>&5
1515   ac_status=$?
1516   echo "$as_me:1516: \$? = $ac_status" >&5
1517   (exit $ac_status); }; then
1518   # Find the output, starting from the most likely.  This scheme is
1519 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1520 # resort.
1521 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1522                 ls a.out conftest 2>/dev/null;
1523                 ls a.* conftest.* 2>/dev/null`; do
1524   case $ac_file in
1525     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1526     a.out ) # We found the default executable, but exeext='' is most
1527             # certainly right.
1528             break;;
1529     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1530           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1531           export ac_cv_exeext
1532           break;;
1533     * ) break;;
1534   esac
1535 done
1536 else
1537   echo "$as_me: failed program was:" >&5
1538 cat conftest.$ac_ext >&5
1539 { { echo "$as_me:1539: error: C compiler cannot create executables" >&5
1540 echo "$as_me: error: C compiler cannot create executables" >&2;}
1541    { (exit 77); exit 77; }; }
1542 fi
1543
1544 ac_exeext=$ac_cv_exeext
1545 echo "$as_me:1545: result: $ac_file" >&5
1546 echo "${ECHO_T}$ac_file" >&6
1547
1548 # Check the compiler produces executables we can run.  If not, either
1549 # the compiler is broken, or we cross compile.
1550 echo "$as_me:1550: checking whether the C compiler works" >&5
1551 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1552 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1553 # If not cross compiling, check that we can run a simple program.
1554 if test "$cross_compiling" != yes; then
1555   if { ac_try='./$ac_file'
1556   { (eval echo "$as_me:1556: \"$ac_try\"") >&5
1557   (eval $ac_try) 2>&5
1558   ac_status=$?
1559   echo "$as_me:1559: \$? = $ac_status" >&5
1560   (exit $ac_status); }; }; then
1561     cross_compiling=no
1562   else
1563     if test "$cross_compiling" = maybe; then
1564         cross_compiling=yes
1565     else
1566         { { echo "$as_me:1566: error: cannot run C compiled programs.
1567 If you meant to cross compile, use \`--host'." >&5
1568 echo "$as_me: error: cannot run C compiled programs.
1569 If you meant to cross compile, use \`--host'." >&2;}
1570    { (exit 1); exit 1; }; }
1571     fi
1572   fi
1573 fi
1574 echo "$as_me:1574: result: yes" >&5
1575 echo "${ECHO_T}yes" >&6
1576
1577 rm -f a.out a.exe conftest$ac_cv_exeext
1578 ac_clean_files=$ac_clean_files_save
1579 # Check the compiler produces executables we can run.  If not, either
1580 # the compiler is broken, or we cross compile.
1581 echo "$as_me:1581: checking whether we are cross compiling" >&5
1582 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1583 echo "$as_me:1583: result: $cross_compiling" >&5
1584 echo "${ECHO_T}$cross_compiling" >&6
1585
1586 echo "$as_me:1586: checking for executable suffix" >&5
1587 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1588 if { (eval echo "$as_me:1588: \"$ac_link\"") >&5
1589   (eval $ac_link) 2>&5
1590   ac_status=$?
1591   echo "$as_me:1591: \$? = $ac_status" >&5
1592   (exit $ac_status); }; then
1593   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1594 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1595 # work properly (i.e., refer to `conftest.exe'), while it won't with
1596 # `rm'.
1597 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1598   case $ac_file in
1599     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1600     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1601           export ac_cv_exeext
1602           break;;
1603     * ) break;;
1604   esac
1605 done
1606 else
1607   { { echo "$as_me:1607: error: cannot compute EXEEXT: cannot compile and link" >&5
1608 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1609    { (exit 1); exit 1; }; }
1610 fi
1611
1612 rm -f conftest$ac_cv_exeext
1613 echo "$as_me:1613: result: $ac_cv_exeext" >&5
1614 echo "${ECHO_T}$ac_cv_exeext" >&6
1615
1616 rm -f conftest.$ac_ext
1617 EXEEXT=$ac_cv_exeext
1618 ac_exeext=$EXEEXT
1619 echo "$as_me:1619: checking for object suffix" >&5
1620 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1621 if test "${ac_cv_objext+set}" = set; then
1622   echo $ECHO_N "(cached) $ECHO_C" >&6
1623 else
1624   cat >conftest.$ac_ext <<_ACEOF
1625 #line 1625 "configure"
1626 #include "confdefs.h"
1627
1628 int
1629 main ()
1630 {
1631
1632   ;
1633   return 0;
1634 }
1635 _ACEOF
1636 rm -f conftest.o conftest.obj
1637 if { (eval echo "$as_me:1637: \"$ac_compile\"") >&5
1638   (eval $ac_compile) 2>&5
1639   ac_status=$?
1640   echo "$as_me:1640: \$? = $ac_status" >&5
1641   (exit $ac_status); }; then
1642   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1643   case $ac_file in
1644     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1645     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1646        break;;
1647   esac
1648 done
1649 else
1650   echo "$as_me: failed program was:" >&5
1651 cat conftest.$ac_ext >&5
1652 { { echo "$as_me:1652: error: cannot compute OBJEXT: cannot compile" >&5
1653 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1654    { (exit 1); exit 1; }; }
1655 fi
1656
1657 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1658 fi
1659 echo "$as_me:1659: result: $ac_cv_objext" >&5
1660 echo "${ECHO_T}$ac_cv_objext" >&6
1661 OBJEXT=$ac_cv_objext
1662 ac_objext=$OBJEXT
1663 echo "$as_me:1663: checking whether we are using the GNU C compiler" >&5
1664 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1665 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1666   echo $ECHO_N "(cached) $ECHO_C" >&6
1667 else
1668   cat >conftest.$ac_ext <<_ACEOF
1669 #line 1669 "configure"
1670 #include "confdefs.h"
1671
1672 int
1673 main ()
1674 {
1675 #ifndef __GNUC__
1676        choke me
1677 #endif
1678
1679   ;
1680   return 0;
1681 }
1682 _ACEOF
1683 rm -f conftest.$ac_objext
1684 if { (eval echo "$as_me:1684: \"$ac_compile\"") >&5
1685   (eval $ac_compile) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); } &&
1689          { ac_try='test -s conftest.$ac_objext'
1690   { (eval echo "$as_me:1690: \"$ac_try\"") >&5
1691   (eval $ac_try) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); }; }; then
1695   ac_compiler_gnu=yes
1696 else
1697   echo "$as_me: failed program was:" >&5
1698 cat conftest.$ac_ext >&5
1699 ac_compiler_gnu=no
1700 fi
1701 rm -f conftest.$ac_objext conftest.$ac_ext
1702 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1703
1704 fi
1705 echo "$as_me:1705: result: $ac_cv_c_compiler_gnu" >&5
1706 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1707 GCC=`test $ac_compiler_gnu = yes && echo yes`
1708 ac_test_CFLAGS=${CFLAGS+set}
1709 ac_save_CFLAGS=$CFLAGS
1710 CFLAGS="-g"
1711 echo "$as_me:1711: checking whether $CC accepts -g" >&5
1712 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1713 if test "${ac_cv_prog_cc_g+set}" = set; then
1714   echo $ECHO_N "(cached) $ECHO_C" >&6
1715 else
1716   cat >conftest.$ac_ext <<_ACEOF
1717 #line 1717 "configure"
1718 #include "confdefs.h"
1719
1720 int
1721 main ()
1722 {
1723
1724   ;
1725   return 0;
1726 }
1727 _ACEOF
1728 rm -f conftest.$ac_objext
1729 if { (eval echo "$as_me:1729: \"$ac_compile\"") >&5
1730   (eval $ac_compile) 2>&5
1731   ac_status=$?
1732   echo "$as_me:1732: \$? = $ac_status" >&5
1733   (exit $ac_status); } &&
1734          { ac_try='test -s conftest.$ac_objext'
1735   { (eval echo "$as_me:1735: \"$ac_try\"") >&5
1736   (eval $ac_try) 2>&5
1737   ac_status=$?
1738   echo "$as_me:1738: \$? = $ac_status" >&5
1739   (exit $ac_status); }; }; then
1740   ac_cv_prog_cc_g=yes
1741 else
1742   echo "$as_me: failed program was:" >&5
1743 cat conftest.$ac_ext >&5
1744 ac_cv_prog_cc_g=no
1745 fi
1746 rm -f conftest.$ac_objext conftest.$ac_ext
1747 fi
1748 echo "$as_me:1748: result: $ac_cv_prog_cc_g" >&5
1749 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1750 if test "$ac_test_CFLAGS" = set; then
1751   CFLAGS=$ac_save_CFLAGS
1752 elif test $ac_cv_prog_cc_g = yes; then
1753   if test "$GCC" = yes; then
1754     CFLAGS="-g -O2"
1755   else
1756     CFLAGS="-g"
1757   fi
1758 else
1759   if test "$GCC" = yes; then
1760     CFLAGS="-O2"
1761   else
1762     CFLAGS=
1763   fi
1764 fi
1765 # Some people use a C++ compiler to compile C.  Since we use `exit',
1766 # in C++ we need to declare it.  In case someone uses the same compiler
1767 # for both compiling C and C++ we need to have the C++ compiler decide
1768 # the declaration of exit, since it's the most demanding environment.
1769 cat >conftest.$ac_ext <<_ACEOF
1770 #ifndef __cplusplus
1771   choke me
1772 #endif
1773 _ACEOF
1774 rm -f conftest.$ac_objext
1775 if { (eval echo "$as_me:1775: \"$ac_compile\"") >&5
1776   (eval $ac_compile) 2>&5
1777   ac_status=$?
1778   echo "$as_me:1778: \$? = $ac_status" >&5
1779   (exit $ac_status); } &&
1780          { ac_try='test -s conftest.$ac_objext'
1781   { (eval echo "$as_me:1781: \"$ac_try\"") >&5
1782   (eval $ac_try) 2>&5
1783   ac_status=$?
1784   echo "$as_me:1784: \$? = $ac_status" >&5
1785   (exit $ac_status); }; }; then
1786   for ac_declaration in \
1787    ''\
1788    '#include <stdlib.h>' \
1789    'extern "C" void std::exit (int) throw (); using std::exit;' \
1790    'extern "C" void std::exit (int); using std::exit;' \
1791    'extern "C" void exit (int) throw ();' \
1792    'extern "C" void exit (int);' \
1793    'void exit (int);'
1794 do
1795   cat >conftest.$ac_ext <<_ACEOF
1796 #line 1796 "configure"
1797 #include "confdefs.h"
1798 #include <stdlib.h>
1799 $ac_declaration
1800 int
1801 main ()
1802 {
1803 exit (42);
1804   ;
1805   return 0;
1806 }
1807 _ACEOF
1808 rm -f conftest.$ac_objext
1809 if { (eval echo "$as_me:1809: \"$ac_compile\"") >&5
1810   (eval $ac_compile) 2>&5
1811   ac_status=$?
1812   echo "$as_me:1812: \$? = $ac_status" >&5
1813   (exit $ac_status); } &&
1814          { ac_try='test -s conftest.$ac_objext'
1815   { (eval echo "$as_me:1815: \"$ac_try\"") >&5
1816   (eval $ac_try) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit $ac_status); }; }; then
1820   :
1821 else
1822   echo "$as_me: failed program was:" >&5
1823 cat conftest.$ac_ext >&5
1824 continue
1825 fi
1826 rm -f conftest.$ac_objext conftest.$ac_ext
1827   cat >conftest.$ac_ext <<_ACEOF
1828 #line 1828 "configure"
1829 #include "confdefs.h"
1830 $ac_declaration
1831 int
1832 main ()
1833 {
1834 exit (42);
1835   ;
1836   return 0;
1837 }
1838 _ACEOF
1839 rm -f conftest.$ac_objext
1840 if { (eval echo "$as_me:1840: \"$ac_compile\"") >&5
1841   (eval $ac_compile) 2>&5
1842   ac_status=$?
1843   echo "$as_me:1843: \$? = $ac_status" >&5
1844   (exit $ac_status); } &&
1845          { ac_try='test -s conftest.$ac_objext'
1846   { (eval echo "$as_me:1846: \"$ac_try\"") >&5
1847   (eval $ac_try) 2>&5
1848   ac_status=$?
1849   echo "$as_me:1849: \$? = $ac_status" >&5
1850   (exit $ac_status); }; }; then
1851   break
1852 else
1853   echo "$as_me: failed program was:" >&5
1854 cat conftest.$ac_ext >&5
1855 fi
1856 rm -f conftest.$ac_objext conftest.$ac_ext
1857 done
1858 rm -f conftest*
1859 if test -n "$ac_declaration"; then
1860   echo '#ifdef __cplusplus' >>confdefs.h
1861   echo $ac_declaration      >>confdefs.h
1862   echo '#endif'             >>confdefs.h
1863 fi
1864
1865 else
1866   echo "$as_me: failed program was:" >&5
1867 cat conftest.$ac_ext >&5
1868 fi
1869 rm -f conftest.$ac_objext conftest.$ac_ext
1870 ac_ext=c
1871 ac_cpp='$CPP $CPPFLAGS'
1872 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1873 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1874 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1875 ac_main_return=return
1876
1877 GCC_VERSION=none
1878 if test "$GCC" = yes ; then
1879         echo "$as_me:1879: checking version of $CC" >&5
1880 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1881         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1882         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1883         echo "$as_me:1883: result: $GCC_VERSION" >&5
1884 echo "${ECHO_T}$GCC_VERSION" >&6
1885 fi
1886
1887 ac_ext=c
1888 ac_cpp='$CPP $CPPFLAGS'
1889 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1890 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1891 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1892 ac_main_return=return
1893 echo "$as_me:1893: checking how to run the C preprocessor" >&5
1894 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1895 # On Suns, sometimes $CPP names a directory.
1896 if test -n "$CPP" && test -d "$CPP"; then
1897   CPP=
1898 fi
1899 if test -z "$CPP"; then
1900   if test "${ac_cv_prog_CPP+set}" = set; then
1901   echo $ECHO_N "(cached) $ECHO_C" >&6
1902 else
1903       # Double quotes because CPP needs to be expanded
1904     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1905     do
1906       ac_preproc_ok=false
1907 for ac_c_preproc_warn_flag in '' yes
1908 do
1909   # Use a header file that comes with gcc, so configuring glibc
1910   # with a fresh cross-compiler works.
1911   # On the NeXT, cc -E runs the code through the compiler's parser,
1912   # not just through cpp. "Syntax error" is here to catch this case.
1913   cat >conftest.$ac_ext <<_ACEOF
1914 #line 1914 "configure"
1915 #include "confdefs.h"
1916 #include <assert.h>
1917                      Syntax error
1918 _ACEOF
1919 if { (eval echo "$as_me:1919: \"$ac_cpp conftest.$ac_ext\"") >&5
1920   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1921   ac_status=$?
1922   egrep -v '^ *\+' conftest.er1 >conftest.err
1923   rm -f conftest.er1
1924   cat conftest.err >&5
1925   echo "$as_me:1925: \$? = $ac_status" >&5
1926   (exit $ac_status); } >/dev/null; then
1927   if test -s conftest.err; then
1928     ac_cpp_err=$ac_c_preproc_warn_flag
1929   else
1930     ac_cpp_err=
1931   fi
1932 else
1933   ac_cpp_err=yes
1934 fi
1935 if test -z "$ac_cpp_err"; then
1936   :
1937 else
1938   echo "$as_me: failed program was:" >&5
1939   cat conftest.$ac_ext >&5
1940   # Broken: fails on valid input.
1941 continue
1942 fi
1943 rm -f conftest.err conftest.$ac_ext
1944
1945   # OK, works on sane cases.  Now check whether non-existent headers
1946   # can be detected and how.
1947   cat >conftest.$ac_ext <<_ACEOF
1948 #line 1948 "configure"
1949 #include "confdefs.h"
1950 #include <ac_nonexistent.h>
1951 _ACEOF
1952 if { (eval echo "$as_me:1952: \"$ac_cpp conftest.$ac_ext\"") >&5
1953   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1954   ac_status=$?
1955   egrep -v '^ *\+' conftest.er1 >conftest.err
1956   rm -f conftest.er1
1957   cat conftest.err >&5
1958   echo "$as_me:1958: \$? = $ac_status" >&5
1959   (exit $ac_status); } >/dev/null; then
1960   if test -s conftest.err; then
1961     ac_cpp_err=$ac_c_preproc_warn_flag
1962   else
1963     ac_cpp_err=
1964   fi
1965 else
1966   ac_cpp_err=yes
1967 fi
1968 if test -z "$ac_cpp_err"; then
1969   # Broken: success on invalid input.
1970 continue
1971 else
1972   echo "$as_me: failed program was:" >&5
1973   cat conftest.$ac_ext >&5
1974   # Passes both tests.
1975 ac_preproc_ok=:
1976 break
1977 fi
1978 rm -f conftest.err conftest.$ac_ext
1979
1980 done
1981 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1982 rm -f conftest.err conftest.$ac_ext
1983 if $ac_preproc_ok; then
1984   break
1985 fi
1986
1987     done
1988     ac_cv_prog_CPP=$CPP
1989
1990 fi
1991   CPP=$ac_cv_prog_CPP
1992 else
1993   ac_cv_prog_CPP=$CPP
1994 fi
1995 echo "$as_me:1995: result: $CPP" >&5
1996 echo "${ECHO_T}$CPP" >&6
1997 ac_preproc_ok=false
1998 for ac_c_preproc_warn_flag in '' yes
1999 do
2000   # Use a header file that comes with gcc, so configuring glibc
2001   # with a fresh cross-compiler works.
2002   # On the NeXT, cc -E runs the code through the compiler's parser,
2003   # not just through cpp. "Syntax error" is here to catch this case.
2004   cat >conftest.$ac_ext <<_ACEOF
2005 #line 2005 "configure"
2006 #include "confdefs.h"
2007 #include <assert.h>
2008                      Syntax error
2009 _ACEOF
2010 if { (eval echo "$as_me:2010: \"$ac_cpp conftest.$ac_ext\"") >&5
2011   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2012   ac_status=$?
2013   egrep -v '^ *\+' conftest.er1 >conftest.err
2014   rm -f conftest.er1
2015   cat conftest.err >&5
2016   echo "$as_me:2016: \$? = $ac_status" >&5
2017   (exit $ac_status); } >/dev/null; then
2018   if test -s conftest.err; then
2019     ac_cpp_err=$ac_c_preproc_warn_flag
2020   else
2021     ac_cpp_err=
2022   fi
2023 else
2024   ac_cpp_err=yes
2025 fi
2026 if test -z "$ac_cpp_err"; then
2027   :
2028 else
2029   echo "$as_me: failed program was:" >&5
2030   cat conftest.$ac_ext >&5
2031   # Broken: fails on valid input.
2032 continue
2033 fi
2034 rm -f conftest.err conftest.$ac_ext
2035
2036   # OK, works on sane cases.  Now check whether non-existent headers
2037   # can be detected and how.
2038   cat >conftest.$ac_ext <<_ACEOF
2039 #line 2039 "configure"
2040 #include "confdefs.h"
2041 #include <ac_nonexistent.h>
2042 _ACEOF
2043 if { (eval echo "$as_me:2043: \"$ac_cpp conftest.$ac_ext\"") >&5
2044   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2045   ac_status=$?
2046   egrep -v '^ *\+' conftest.er1 >conftest.err
2047   rm -f conftest.er1
2048   cat conftest.err >&5
2049   echo "$as_me:2049: \$? = $ac_status" >&5
2050   (exit $ac_status); } >/dev/null; then
2051   if test -s conftest.err; then
2052     ac_cpp_err=$ac_c_preproc_warn_flag
2053   else
2054     ac_cpp_err=
2055   fi
2056 else
2057   ac_cpp_err=yes
2058 fi
2059 if test -z "$ac_cpp_err"; then
2060   # Broken: success on invalid input.
2061 continue
2062 else
2063   echo "$as_me: failed program was:" >&5
2064   cat conftest.$ac_ext >&5
2065   # Passes both tests.
2066 ac_preproc_ok=:
2067 break
2068 fi
2069 rm -f conftest.err conftest.$ac_ext
2070
2071 done
2072 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2073 rm -f conftest.err conftest.$ac_ext
2074 if $ac_preproc_ok; then
2075   :
2076 else
2077   { { echo "$as_me:2077: error: C preprocessor \"$CPP\" fails sanity check" >&5
2078 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2079    { (exit 1); exit 1; }; }
2080 fi
2081
2082 ac_ext=c
2083 ac_cpp='$CPP $CPPFLAGS'
2084 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2085 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2086 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2087 ac_main_return=return
2088
2089 if test $ac_cv_c_compiler_gnu = yes; then
2090     echo "$as_me:2090: checking whether $CC needs -traditional" >&5
2091 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2092 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2093   echo $ECHO_N "(cached) $ECHO_C" >&6
2094 else
2095     ac_pattern="Autoconf.*'x'"
2096   cat >conftest.$ac_ext <<_ACEOF
2097 #line 2097 "configure"
2098 #include "confdefs.h"
2099 #include <sgtty.h>
2100 int Autoconf = TIOCGETP;
2101 _ACEOF
2102 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2103   egrep "$ac_pattern" >/dev/null 2>&1; then
2104   ac_cv_prog_gcc_traditional=yes
2105 else
2106   ac_cv_prog_gcc_traditional=no
2107 fi
2108 rm -f conftest*
2109
2110   if test $ac_cv_prog_gcc_traditional = no; then
2111     cat >conftest.$ac_ext <<_ACEOF
2112 #line 2112 "configure"
2113 #include "confdefs.h"
2114 #include <termio.h>
2115 int Autoconf = TCGETA;
2116 _ACEOF
2117 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2118   egrep "$ac_pattern" >/dev/null 2>&1; then
2119   ac_cv_prog_gcc_traditional=yes
2120 fi
2121 rm -f conftest*
2122
2123   fi
2124 fi
2125 echo "$as_me:2125: result: $ac_cv_prog_gcc_traditional" >&5
2126 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2127   if test $ac_cv_prog_gcc_traditional = yes; then
2128     CC="$CC -traditional"
2129   fi
2130 fi
2131
2132 echo "$as_me:2132: checking whether $CC understands -c and -o together" >&5
2133 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2134 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2135   echo $ECHO_N "(cached) $ECHO_C" >&6
2136 else
2137
2138 cat > conftest.$ac_ext <<CF_EOF
2139 #include <stdio.h>
2140 int main()
2141 {
2142         ${cf_cv_main_return:-return}(0);
2143 }
2144 CF_EOF
2145 # We do the test twice because some compilers refuse to overwrite an
2146 # existing .o file with -o, though they will create one.
2147 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2148 if { (eval echo "$as_me:2148: \"$ac_try\"") >&5
2149   (eval $ac_try) 2>&5
2150   ac_status=$?
2151   echo "$as_me:2151: \$? = $ac_status" >&5
2152   (exit $ac_status); } &&
2153   test -f conftest2.$ac_objext && { (eval echo "$as_me:2153: \"$ac_try\"") >&5
2154   (eval $ac_try) 2>&5
2155   ac_status=$?
2156   echo "$as_me:2156: \$? = $ac_status" >&5
2157   (exit $ac_status); };
2158 then
2159   eval cf_cv_prog_CC_c_o=yes
2160 else
2161   eval cf_cv_prog_CC_c_o=no
2162 fi
2163 rm -f conftest*
2164
2165 fi
2166 if test $cf_cv_prog_CC_c_o = yes; then
2167   echo "$as_me:2167: result: yes" >&5
2168 echo "${ECHO_T}yes" >&6
2169 else
2170   echo "$as_me:2170: result: no" >&5
2171 echo "${ECHO_T}no" >&6
2172 fi
2173
2174 echo "$as_me:2174: checking for POSIXized ISC" >&5
2175 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6
2176 if test -d /etc/conf/kconfig.d &&
2177    grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2178 then
2179   echo "$as_me:2179: result: yes" >&5
2180 echo "${ECHO_T}yes" >&6
2181   ISC=yes # If later tests want to check for ISC.
2182
2183 cat >>confdefs.h <<\EOF
2184 #define _POSIX_SOURCE 1
2185 EOF
2186
2187   if test "$GCC" = yes; then
2188     CC="$CC -posix"
2189   else
2190     CC="$CC -Xp"
2191   fi
2192 else
2193   echo "$as_me:2193: result: no" >&5
2194 echo "${ECHO_T}no" >&6
2195   ISC=
2196 fi
2197
2198 echo "$as_me:2198: checking for ${CC-cc} option to accept ANSI C" >&5
2199 echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6
2200 if test "${cf_cv_ansi_cc+set}" = set; then
2201   echo $ECHO_N "(cached) $ECHO_C" >&6
2202 else
2203
2204 cf_cv_ansi_cc=no
2205 cf_save_CFLAGS="$CFLAGS"
2206 cf_save_CPPFLAGS="$CPPFLAGS"
2207 # Don't try gcc -ansi; that turns off useful extensions and
2208 # breaks some systems' header files.
2209 # AIX                   -qlanglvl=ansi
2210 # Ultrix and OSF/1      -std1
2211 # HP-UX                 -Aa -D_HPUX_SOURCE
2212 # SVR4                  -Xc
2213 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2214 for cf_arg in "-DCC_HAS_PROTOS" \
2215         "" \
2216         -qlanglvl=ansi \
2217         -std1 \
2218         -Ae \
2219         "-Aa -D_HPUX_SOURCE" \
2220         -Xc
2221 do
2222
2223 cf_fix_cppflags=no
2224 cf_new_cflags=
2225 cf_new_cppflags=
2226 cf_new_extra_cppflags=
2227
2228 for cf_add_cflags in $cf_arg
2229 do
2230 case $cf_fix_cppflags in
2231 no)
2232         case $cf_add_cflags in #(vi
2233         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2234                 case $cf_add_cflags in
2235                 -D*)
2236                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2237
2238                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2239                                 && test -z "${cf_tst_cflags}" \
2240                                 && cf_fix_cppflags=yes
2241
2242                         if test $cf_fix_cppflags = yes ; then
2243                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2244                                 continue
2245                         elif test "${cf_tst_cflags}" = "\"'" ; then
2246                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2247                                 continue
2248                         fi
2249                         ;;
2250                 esac
2251                 case "$CPPFLAGS" in
2252                 *$cf_add_cflags) #(vi
2253                         ;;
2254                 *) #(vi
2255                         case $cf_add_cflags in #(vi
2256                         -D*)
2257                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2258
2259 CPPFLAGS=`echo "$CPPFLAGS" | \
2260         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2261                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2262
2263                                 ;;
2264                         esac
2265                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2266                         ;;
2267                 esac
2268                 ;;
2269         *)
2270                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2271                 ;;
2272         esac
2273         ;;
2274 yes)
2275         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2276
2277         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2278
2279         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2280                 && test -z "${cf_tst_cflags}" \
2281                 && cf_fix_cppflags=no
2282         ;;
2283 esac
2284 done
2285
2286 if test -n "$cf_new_cflags" ; then
2287
2288         CFLAGS="$CFLAGS $cf_new_cflags"
2289 fi
2290
2291 if test -n "$cf_new_cppflags" ; then
2292
2293         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2294 fi
2295
2296 if test -n "$cf_new_extra_cppflags" ; then
2297
2298         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2299 fi
2300
2301         cat >conftest.$ac_ext <<_ACEOF
2302 #line 2302 "configure"
2303 #include "confdefs.h"
2304
2305 #ifndef CC_HAS_PROTOS
2306 #if !defined(__STDC__) || (__STDC__ != 1)
2307 choke me
2308 #endif
2309 #endif
2310
2311 int
2312 main ()
2313 {
2314
2315         int test (int i, double x);
2316         struct s1 {int (*f) (int a);};
2317         struct s2 {int (*f) (double a);};
2318   ;
2319   return 0;
2320 }
2321 _ACEOF
2322 rm -f conftest.$ac_objext
2323 if { (eval echo "$as_me:2323: \"$ac_compile\"") >&5
2324   (eval $ac_compile) 2>&5
2325   ac_status=$?
2326   echo "$as_me:2326: \$? = $ac_status" >&5
2327   (exit $ac_status); } &&
2328          { ac_try='test -s conftest.$ac_objext'
2329   { (eval echo "$as_me:2329: \"$ac_try\"") >&5
2330   (eval $ac_try) 2>&5
2331   ac_status=$?
2332   echo "$as_me:2332: \$? = $ac_status" >&5
2333   (exit $ac_status); }; }; then
2334   cf_cv_ansi_cc="$cf_arg"; break
2335 else
2336   echo "$as_me: failed program was:" >&5
2337 cat conftest.$ac_ext >&5
2338 fi
2339 rm -f conftest.$ac_objext conftest.$ac_ext
2340 done
2341 CFLAGS="$cf_save_CFLAGS"
2342 CPPFLAGS="$cf_save_CPPFLAGS"
2343
2344 fi
2345 echo "$as_me:2345: result: $cf_cv_ansi_cc" >&5
2346 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2347
2348 if test "$cf_cv_ansi_cc" != "no"; then
2349 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2350
2351 cf_fix_cppflags=no
2352 cf_new_cflags=
2353 cf_new_cppflags=
2354 cf_new_extra_cppflags=
2355
2356 for cf_add_cflags in $cf_cv_ansi_cc
2357 do
2358 case $cf_fix_cppflags in
2359 no)
2360         case $cf_add_cflags in #(vi
2361         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2362                 case $cf_add_cflags in
2363                 -D*)
2364                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2365
2366                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2367                                 && test -z "${cf_tst_cflags}" \
2368                                 && cf_fix_cppflags=yes
2369
2370                         if test $cf_fix_cppflags = yes ; then
2371                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2372                                 continue
2373                         elif test "${cf_tst_cflags}" = "\"'" ; then
2374                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2375                                 continue
2376                         fi
2377                         ;;
2378                 esac
2379                 case "$CPPFLAGS" in
2380                 *$cf_add_cflags) #(vi
2381                         ;;
2382                 *) #(vi
2383                         case $cf_add_cflags in #(vi
2384                         -D*)
2385                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2386
2387 CPPFLAGS=`echo "$CPPFLAGS" | \
2388         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2389                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2390
2391                                 ;;
2392                         esac
2393                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2394                         ;;
2395                 esac
2396                 ;;
2397         *)
2398                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2399                 ;;
2400         esac
2401         ;;
2402 yes)
2403         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2404
2405         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2406
2407         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2408                 && test -z "${cf_tst_cflags}" \
2409                 && cf_fix_cppflags=no
2410         ;;
2411 esac
2412 done
2413
2414 if test -n "$cf_new_cflags" ; then
2415
2416         CFLAGS="$CFLAGS $cf_new_cflags"
2417 fi
2418
2419 if test -n "$cf_new_cppflags" ; then
2420
2421         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2422 fi
2423
2424 if test -n "$cf_new_extra_cppflags" ; then
2425
2426         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2427 fi
2428
2429 else
2430         cat >>confdefs.h <<\EOF
2431 #define CC_HAS_PROTOS 1
2432 EOF
2433
2434 fi
2435 fi
2436
2437 if test "$cf_cv_ansi_cc" = "no"; then
2438         { { echo "$as_me:2438: error: Your compiler does not appear to recognize prototypes.
2439 You have the following choices:
2440         a. adjust your compiler options
2441         b. get an up-to-date compiler
2442         c. use a wrapper such as unproto" >&5
2443 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2444 You have the following choices:
2445         a. adjust your compiler options
2446         b. get an up-to-date compiler
2447         c. use a wrapper such as unproto" >&2;}
2448    { (exit 1); exit 1; }; }
2449 fi
2450
2451 case $cf_cv_system_name in
2452 os2*)
2453     CFLAGS="$CFLAGS -Zmt"
2454     CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
2455     CXXFLAGS="$CXXFLAGS -Zmt"
2456     # autoconf's macro sets -Zexe and suffix both, which conflict:w
2457     LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
2458     ac_cv_exeext=.exe
2459     ;;
2460 esac
2461
2462 PROG_EXT="$EXEEXT"
2463
2464 test -n "$PROG_EXT" && cat >>confdefs.h <<EOF
2465 #define PROG_EXT "$PROG_EXT"
2466 EOF
2467
2468 test "$program_prefix" != NONE &&
2469   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2470 # Use a double $ so make ignores it.
2471 test "$program_suffix" != NONE &&
2472   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2473 # Double any \ or $.  echo might interpret backslashes.
2474 # By default was `s,x,x', remove it if useless.
2475 cat <<\_ACEOF >conftest.sed
2476 s/[\\$]/&&/g;s/;s,x,x,$//
2477 _ACEOF
2478 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2479 rm conftest.sed
2480
2481 for ac_prog in mawk gawk nawk awk
2482 do
2483   # Extract the first word of "$ac_prog", so it can be a program name with args.
2484 set dummy $ac_prog; ac_word=$2
2485 echo "$as_me:2485: checking for $ac_word" >&5
2486 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2487 if test "${ac_cv_prog_AWK+set}" = set; then
2488   echo $ECHO_N "(cached) $ECHO_C" >&6
2489 else
2490   if test -n "$AWK"; then
2491   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2492 else
2493   ac_save_IFS=$IFS; IFS=$ac_path_separator
2494 ac_dummy="$PATH"
2495 for ac_dir in $ac_dummy; do
2496   IFS=$ac_save_IFS
2497   test -z "$ac_dir" && ac_dir=.
2498   $as_executable_p "$ac_dir/$ac_word" || continue
2499 ac_cv_prog_AWK="$ac_prog"
2500 echo "$as_me:2500: found $ac_dir/$ac_word" >&5
2501 break
2502 done
2503
2504 fi
2505 fi
2506 AWK=$ac_cv_prog_AWK
2507 if test -n "$AWK"; then
2508   echo "$as_me:2508: result: $AWK" >&5
2509 echo "${ECHO_T}$AWK" >&6
2510 else
2511   echo "$as_me:2511: result: no" >&5
2512 echo "${ECHO_T}no" >&6
2513 fi
2514
2515   test -n "$AWK" && break
2516 done
2517
2518 test -z "$AWK" && { { echo "$as_me:2518: error: No awk program found" >&5
2519 echo "$as_me: error: No awk program found" >&2;}
2520    { (exit 1); exit 1; }; }
2521
2522 echo "$as_me:2522: checking for egrep" >&5
2523 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2524 if test "${ac_cv_prog_egrep+set}" = set; then
2525   echo $ECHO_N "(cached) $ECHO_C" >&6
2526 else
2527   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2528     then ac_cv_prog_egrep='grep -E'
2529     else ac_cv_prog_egrep='egrep'
2530     fi
2531 fi
2532 echo "$as_me:2532: result: $ac_cv_prog_egrep" >&5
2533 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2534  EGREP=$ac_cv_prog_egrep
2535
2536 test -z "$EGREP" && { { echo "$as_me:2536: error: No egrep program found" >&5
2537 echo "$as_me: error: No egrep program found" >&2;}
2538    { (exit 1); exit 1; }; }
2539
2540 # Find a good install program.  We prefer a C program (faster),
2541 # so one script is as good as another.  But avoid the broken or
2542 # incompatible versions:
2543 # SysV /etc/install, /usr/sbin/install
2544 # SunOS /usr/etc/install
2545 # IRIX /sbin/install
2546 # AIX /bin/install
2547 # AmigaOS /C/install, which installs bootblocks on floppy discs
2548 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2549 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2550 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2551 # ./install, which can be erroneously created by make from ./install.sh.
2552 echo "$as_me:2552: checking for a BSD compatible install" >&5
2553 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2554 if test -z "$INSTALL"; then
2555 if test "${ac_cv_path_install+set}" = set; then
2556   echo $ECHO_N "(cached) $ECHO_C" >&6
2557 else
2558     ac_save_IFS=$IFS; IFS=$ac_path_separator
2559   for ac_dir in $PATH; do
2560     IFS=$ac_save_IFS
2561     # Account for people who put trailing slashes in PATH elements.
2562     case $ac_dir/ in
2563     / | ./ | .// | /cC/* \
2564     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2565     | /usr/ucb/* ) ;;
2566     *)
2567       # OSF1 and SCO ODT 3.0 have their own names for install.
2568       # Don't use installbsd from OSF since it installs stuff as root
2569       # by default.
2570       for ac_prog in ginstall scoinst install; do
2571         if $as_executable_p "$ac_dir/$ac_prog"; then
2572           if test $ac_prog = install &&
2573             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2574             # AIX install.  It has an incompatible calling convention.
2575             :
2576           elif test $ac_prog = install &&
2577             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2578             # program-specific install script used by HP pwplus--don't use.
2579             :
2580           else
2581             ac_cv_path_install="$ac_dir/$ac_prog -c"
2582             break 2
2583           fi
2584         fi
2585       done
2586       ;;
2587     esac
2588   done
2589
2590 fi
2591   if test "${ac_cv_path_install+set}" = set; then
2592     INSTALL=$ac_cv_path_install
2593   else
2594     # As a last resort, use the slow shell script.  We don't cache a
2595     # path for INSTALL within a source directory, because that will
2596     # break other packages using the cache if that directory is
2597     # removed, or if the path is relative.
2598     INSTALL=$ac_install_sh
2599   fi
2600 fi
2601 echo "$as_me:2601: result: $INSTALL" >&5
2602 echo "${ECHO_T}$INSTALL" >&6
2603
2604 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2605 # It thinks the first close brace ends the variable substitution.
2606 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2607
2608 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2609
2610 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2611
2612 echo "$as_me:2612: checking whether ln -s works" >&5
2613 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2614 LN_S=$as_ln_s
2615 if test "$LN_S" = "ln -s"; then
2616   echo "$as_me:2616: result: yes" >&5
2617 echo "${ECHO_T}yes" >&6
2618 else
2619   echo "$as_me:2619: result: no, using $LN_S" >&5
2620 echo "${ECHO_T}no, using $LN_S" >&6
2621 fi
2622
2623 echo "$as_me:2623: checking if $LN_S -f options work" >&5
2624 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2625
2626 rm -f conf$$.src conf$$dst
2627 echo >conf$$.dst
2628 echo first >conf$$.src
2629 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2630         cf_prog_ln_sf=yes
2631 else
2632         cf_prog_ln_sf=no
2633 fi
2634
2635 echo "$as_me:2635: result: $cf_prog_ln_sf" >&5
2636 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2637
2638 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2639
2640 echo "$as_me:2640: checking for long file names" >&5
2641 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2642 if test "${ac_cv_sys_long_file_names+set}" = set; then
2643   echo $ECHO_N "(cached) $ECHO_C" >&6
2644 else
2645   ac_cv_sys_long_file_names=yes
2646 # Test for long file names in all the places we know might matter:
2647 #      .                the current directory, where building will happen
2648 #      $prefix/lib      where we will be installing things
2649 #      $exec_prefix/lib likewise
2650 # eval it to expand exec_prefix.
2651 #      $TMPDIR          if set, where it might want to write temporary files
2652 # if $TMPDIR is not set:
2653 #      /tmp             where it might want to write temporary files
2654 #      /var/tmp         likewise
2655 #      /usr/tmp         likewise
2656 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2657   ac_tmpdirs=$TMPDIR
2658 else
2659   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2660 fi
2661 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2662   test -d $ac_dir || continue
2663   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2664   ac_xdir=$ac_dir/cf$$
2665   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2666   ac_tf1=$ac_xdir/conftest9012345
2667   ac_tf2=$ac_xdir/conftest9012346
2668   (echo 1 >$ac_tf1) 2>/dev/null
2669   (echo 2 >$ac_tf2) 2>/dev/null
2670   ac_val=`cat $ac_tf1 2>/dev/null`
2671   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2672     ac_cv_sys_long_file_names=no
2673     rm -rf $ac_xdir 2>/dev/null
2674     break
2675   fi
2676   rm -rf $ac_xdir 2>/dev/null
2677 done
2678 fi
2679 echo "$as_me:2679: result: $ac_cv_sys_long_file_names" >&5
2680 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2681 if test $ac_cv_sys_long_file_names = yes; then
2682
2683 cat >>confdefs.h <<\EOF
2684 #define HAVE_LONG_FILE_NAMES 1
2685 EOF
2686
2687 fi
2688
2689 # if we find pkg-config, check if we should install the ".pc" files.
2690
2691 echo "$as_me:2691: checking if you want to use pkg-config" >&5
2692 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2693
2694 # Check whether --with-pkg-config or --without-pkg-config was given.
2695 if test "${with_pkg_config+set}" = set; then
2696   withval="$with_pkg_config"
2697   cf_pkg_config=$withval
2698 else
2699   cf_pkg_config=yes
2700 fi;
2701 echo "$as_me:2701: result: $cf_pkg_config" >&5
2702 echo "${ECHO_T}$cf_pkg_config" >&6
2703
2704 case $cf_pkg_config in #(vi
2705 no) #(vi
2706         PKG_CONFIG=none
2707         ;;
2708 yes) #(vi
2709         # Extract the first word of "pkg-config", so it can be a program name with args.
2710 set dummy pkg-config; ac_word=$2
2711 echo "$as_me:2711: checking for $ac_word" >&5
2712 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2713 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2714   echo $ECHO_N "(cached) $ECHO_C" >&6
2715 else
2716   case $PKG_CONFIG in
2717   [\\/]* | ?:[\\/]*)
2718   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2719   ;;
2720   *)
2721   ac_save_IFS=$IFS; IFS=$ac_path_separator
2722 ac_dummy="$PATH"
2723 for ac_dir in $ac_dummy; do
2724   IFS=$ac_save_IFS
2725   test -z "$ac_dir" && ac_dir=.
2726   if $as_executable_p "$ac_dir/$ac_word"; then
2727    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2728    echo "$as_me:2728: found $ac_dir/$ac_word" >&5
2729    break
2730 fi
2731 done
2732
2733   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
2734   ;;
2735 esac
2736 fi
2737 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2738
2739 if test -n "$PKG_CONFIG"; then
2740   echo "$as_me:2740: result: $PKG_CONFIG" >&5
2741 echo "${ECHO_T}$PKG_CONFIG" >&6
2742 else
2743   echo "$as_me:2743: result: no" >&5
2744 echo "${ECHO_T}no" >&6
2745 fi
2746
2747         ;;
2748 *)
2749         PKG_CONFIG=$withval
2750         ;;
2751 esac
2752
2753 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2754 if test "$PKG_CONFIG" != none ; then
2755
2756 if test "x$prefix" != xNONE; then
2757   cf_path_syntax="$prefix"
2758 else
2759   cf_path_syntax="$ac_default_prefix"
2760 fi
2761
2762 case ".$PKG_CONFIG" in #(vi
2763 .\$\(*\)*|.\'*\'*) #(vi
2764   ;;
2765 ..|./*|.\\*) #(vi
2766   ;;
2767 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2768   ;;
2769 .\${*prefix}*) #(vi
2770   eval PKG_CONFIG="$PKG_CONFIG"
2771   case ".$PKG_CONFIG" in #(vi
2772   .NONE/*)
2773     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2774     ;;
2775   esac
2776   ;; #(vi
2777 .no|.NONE/*)
2778   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2779   ;;
2780 *)
2781   { { echo "$as_me:2781: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2782 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2783    { (exit 1); exit 1; }; }
2784   ;;
2785 esac
2786
2787 fi
2788
2789 if test "$PKG_CONFIG" != no ; then
2790         echo "$as_me:2790: checking if we should install .pc files for $PKG_CONFIG" >&5
2791 echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6
2792
2793         # Leave this as something that can be overridden in the environment.
2794         if test -z "$PKG_CONFIG_LIBDIR" ; then
2795                 PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
2796         fi
2797         PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
2798         if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
2799
2800 # Check whether --enable-pc-files or --disable-pc-files was given.
2801 if test "${enable_pc_files+set}" = set; then
2802   enableval="$enable_pc_files"
2803   enable_pc_files=$enableval
2804 else
2805   enable_pc_files=no
2806 fi;
2807                 echo "$as_me:2807: result: $enable_pc_files" >&5
2808 echo "${ECHO_T}$enable_pc_files" >&6
2809         else
2810                 echo "$as_me:2810: result: no" >&5
2811 echo "${ECHO_T}no" >&6
2812                 { echo "$as_me:2812: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5
2813 echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;}
2814                 enable_pc_files=no
2815         fi
2816 fi
2817
2818 echo "$as_me:2818: checking if we should assume mixed-case filenames" >&5
2819 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2820
2821 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2822 if test "${enable_mixed_case+set}" = set; then
2823   enableval="$enable_mixed_case"
2824   enable_mixedcase=$enableval
2825 else
2826   enable_mixedcase=auto
2827 fi;
2828 echo "$as_me:2828: result: $enable_mixedcase" >&5
2829 echo "${ECHO_T}$enable_mixedcase" >&6
2830 if test "$enable_mixedcase" = "auto" ; then
2831
2832 echo "$as_me:2832: checking if filesystem supports mixed-case filenames" >&5
2833 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2834 if test "${cf_cv_mixedcase+set}" = set; then
2835   echo $ECHO_N "(cached) $ECHO_C" >&6
2836 else
2837
2838 if test "$cross_compiling" = yes ; then
2839         case $target_alias in #(vi
2840         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2841                 cf_cv_mixedcase=no
2842                 ;;
2843         *)
2844                 cf_cv_mixedcase=yes
2845                 ;;
2846         esac
2847 else
2848         rm -f conftest CONFTEST
2849         echo test >conftest
2850         if test -f CONFTEST ; then
2851                 cf_cv_mixedcase=no
2852         else
2853                 cf_cv_mixedcase=yes
2854         fi
2855         rm -f conftest CONFTEST
2856 fi
2857
2858 fi
2859 echo "$as_me:2859: result: $cf_cv_mixedcase" >&5
2860 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2861 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2862 #define MIXEDCASE_FILENAMES 1
2863 EOF
2864
2865 else
2866     cf_cv_mixedcase=$enable_mixedcase
2867     if test "$enable_mixedcase" = "yes" ; then
2868         cat >>confdefs.h <<\EOF
2869 #define MIXEDCASE_FILENAMES 1
2870 EOF
2871
2872     fi
2873 fi
2874
2875 # do this after mixed-case option (tags/TAGS is not as important as tic).
2876 echo "$as_me:2876: checking whether ${MAKE-make} sets \${MAKE}" >&5
2877 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2878 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2879 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2880   echo $ECHO_N "(cached) $ECHO_C" >&6
2881 else
2882   cat >conftest.make <<\EOF
2883 all:
2884         @echo 'ac_maketemp="${MAKE}"'
2885 EOF
2886 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2887 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2888 if test -n "$ac_maketemp"; then
2889   eval ac_cv_prog_make_${ac_make}_set=yes
2890 else
2891   eval ac_cv_prog_make_${ac_make}_set=no
2892 fi
2893 rm -f conftest.make
2894 fi
2895 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2896   echo "$as_me:2896: result: yes" >&5
2897 echo "${ECHO_T}yes" >&6
2898   SET_MAKE=
2899 else
2900   echo "$as_me:2900: result: no" >&5
2901 echo "${ECHO_T}no" >&6
2902   SET_MAKE="MAKE=${MAKE-make}"
2903 fi
2904
2905 for ac_prog in exctags ctags
2906 do
2907   # Extract the first word of "$ac_prog", so it can be a program name with args.
2908 set dummy $ac_prog; ac_word=$2
2909 echo "$as_me:2909: checking for $ac_word" >&5
2910 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2911 if test "${ac_cv_prog_CTAGS+set}" = set; then
2912   echo $ECHO_N "(cached) $ECHO_C" >&6
2913 else
2914   if test -n "$CTAGS"; then
2915   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2916 else
2917   ac_save_IFS=$IFS; IFS=$ac_path_separator
2918 ac_dummy="$PATH"
2919 for ac_dir in $ac_dummy; do
2920   IFS=$ac_save_IFS
2921   test -z "$ac_dir" && ac_dir=.
2922   $as_executable_p "$ac_dir/$ac_word" || continue
2923 ac_cv_prog_CTAGS="$ac_prog"
2924 echo "$as_me:2924: found $ac_dir/$ac_word" >&5
2925 break
2926 done
2927
2928 fi
2929 fi
2930 CTAGS=$ac_cv_prog_CTAGS
2931 if test -n "$CTAGS"; then
2932   echo "$as_me:2932: result: $CTAGS" >&5
2933 echo "${ECHO_T}$CTAGS" >&6
2934 else
2935   echo "$as_me:2935: result: no" >&5
2936 echo "${ECHO_T}no" >&6
2937 fi
2938
2939   test -n "$CTAGS" && break
2940 done
2941
2942 for ac_prog in exetags etags
2943 do
2944   # Extract the first word of "$ac_prog", so it can be a program name with args.
2945 set dummy $ac_prog; ac_word=$2
2946 echo "$as_me:2946: checking for $ac_word" >&5
2947 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2948 if test "${ac_cv_prog_ETAGS+set}" = set; then
2949   echo $ECHO_N "(cached) $ECHO_C" >&6
2950 else
2951   if test -n "$ETAGS"; then
2952   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2953 else
2954   ac_save_IFS=$IFS; IFS=$ac_path_separator
2955 ac_dummy="$PATH"
2956 for ac_dir in $ac_dummy; do
2957   IFS=$ac_save_IFS
2958   test -z "$ac_dir" && ac_dir=.
2959   $as_executable_p "$ac_dir/$ac_word" || continue
2960 ac_cv_prog_ETAGS="$ac_prog"
2961 echo "$as_me:2961: found $ac_dir/$ac_word" >&5
2962 break
2963 done
2964
2965 fi
2966 fi
2967 ETAGS=$ac_cv_prog_ETAGS
2968 if test -n "$ETAGS"; then
2969   echo "$as_me:2969: result: $ETAGS" >&5
2970 echo "${ECHO_T}$ETAGS" >&6
2971 else
2972   echo "$as_me:2972: result: no" >&5
2973 echo "${ECHO_T}no" >&6
2974 fi
2975
2976   test -n "$ETAGS" && break
2977 done
2978
2979 # Extract the first word of "${CTAGS-ctags}", so it can be a program name with args.
2980 set dummy ${CTAGS-ctags}; ac_word=$2
2981 echo "$as_me:2981: checking for $ac_word" >&5
2982 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2983 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2984   echo $ECHO_N "(cached) $ECHO_C" >&6
2985 else
2986   if test -n "$MAKE_LOWER_TAGS"; then
2987   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2988 else
2989   ac_save_IFS=$IFS; IFS=$ac_path_separator
2990 ac_dummy="$PATH"
2991 for ac_dir in $ac_dummy; do
2992   IFS=$ac_save_IFS
2993   test -z "$ac_dir" && ac_dir=.
2994   $as_executable_p "$ac_dir/$ac_word" || continue
2995 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2996 echo "$as_me:2996: found $ac_dir/$ac_word" >&5
2997 break
2998 done
2999
3000   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3001 fi
3002 fi
3003 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3004 if test -n "$MAKE_LOWER_TAGS"; then
3005   echo "$as_me:3005: result: $MAKE_LOWER_TAGS" >&5
3006 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3007 else
3008   echo "$as_me:3008: result: no" >&5
3009 echo "${ECHO_T}no" >&6
3010 fi
3011
3012 if test "$cf_cv_mixedcase" = yes ; then
3013         # Extract the first word of "${ETAGS-etags}", so it can be a program name with args.
3014 set dummy ${ETAGS-etags}; ac_word=$2
3015 echo "$as_me:3015: checking for $ac_word" >&5
3016 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3017 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3018   echo $ECHO_N "(cached) $ECHO_C" >&6
3019 else
3020   if test -n "$MAKE_UPPER_TAGS"; then
3021   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3022 else
3023   ac_save_IFS=$IFS; IFS=$ac_path_separator
3024 ac_dummy="$PATH"
3025 for ac_dir in $ac_dummy; do
3026   IFS=$ac_save_IFS
3027   test -z "$ac_dir" && ac_dir=.
3028   $as_executable_p "$ac_dir/$ac_word" || continue
3029 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3030 echo "$as_me:3030: found $ac_dir/$ac_word" >&5
3031 break
3032 done
3033
3034   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3035 fi
3036 fi
3037 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3038 if test -n "$MAKE_UPPER_TAGS"; then
3039   echo "$as_me:3039: result: $MAKE_UPPER_TAGS" >&5
3040 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3041 else
3042   echo "$as_me:3042: result: no" >&5
3043 echo "${ECHO_T}no" >&6
3044 fi
3045
3046 else
3047         MAKE_UPPER_TAGS=no
3048 fi
3049
3050 if test "$MAKE_UPPER_TAGS" = yes ; then
3051         MAKE_UPPER_TAGS=
3052 else
3053         MAKE_UPPER_TAGS="#"
3054 fi
3055
3056 if test "$MAKE_LOWER_TAGS" = yes ; then
3057         MAKE_LOWER_TAGS=
3058 else
3059         MAKE_LOWER_TAGS="#"
3060 fi
3061
3062 echo "$as_me:3062: checking for makeflags variable" >&5
3063 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3064 if test "${cf_cv_makeflags+set}" = set; then
3065   echo $ECHO_N "(cached) $ECHO_C" >&6
3066 else
3067
3068         cf_cv_makeflags=''
3069         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3070         do
3071                 cat >cf_makeflags.tmp <<CF_EOF
3072 SHELL = /bin/sh
3073 all :
3074         @ echo '.$cf_option'
3075 CF_EOF
3076                 cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[        ]*$,,'`
3077                 case "$cf_result" in
3078                 .*k)
3079                         cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3080                         case "$cf_result" in
3081                         .*CC=*) cf_cv_makeflags=
3082                                 ;;
3083                         *)      cf_cv_makeflags=$cf_option
3084                                 ;;
3085                         esac
3086                         break
3087                         ;;
3088                 .-)     ;;
3089                 *)      echo "given option \"$cf_option\", no match \"$cf_result\""
3090                         ;;
3091                 esac
3092         done
3093         rm -f cf_makeflags.tmp
3094
3095 fi
3096 echo "$as_me:3096: result: $cf_cv_makeflags" >&5
3097 echo "${ECHO_T}$cf_cv_makeflags" >&6
3098
3099 if test -n "$ac_tool_prefix"; then
3100   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3101 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3102 echo "$as_me:3102: checking for $ac_word" >&5
3103 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3104 if test "${ac_cv_prog_RANLIB+set}" = set; then
3105   echo $ECHO_N "(cached) $ECHO_C" >&6
3106 else
3107   if test -n "$RANLIB"; then
3108   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3109 else
3110   ac_save_IFS=$IFS; IFS=$ac_path_separator
3111 ac_dummy="$PATH"
3112 for ac_dir in $ac_dummy; do
3113   IFS=$ac_save_IFS
3114   test -z "$ac_dir" && ac_dir=.
3115   $as_executable_p "$ac_dir/$ac_word" || continue
3116 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3117 echo "$as_me:3117: found $ac_dir/$ac_word" >&5
3118 break
3119 done
3120
3121 fi
3122 fi
3123 RANLIB=$ac_cv_prog_RANLIB
3124 if test -n "$RANLIB"; then
3125   echo "$as_me:3125: result: $RANLIB" >&5
3126 echo "${ECHO_T}$RANLIB" >&6
3127 else
3128   echo "$as_me:3128: result: no" >&5
3129 echo "${ECHO_T}no" >&6
3130 fi
3131
3132 fi
3133 if test -z "$ac_cv_prog_RANLIB"; then
3134   ac_ct_RANLIB=$RANLIB
3135   # Extract the first word of "ranlib", so it can be a program name with args.
3136 set dummy ranlib; ac_word=$2
3137 echo "$as_me:3137: checking for $ac_word" >&5
3138 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3139 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3140   echo $ECHO_N "(cached) $ECHO_C" >&6
3141 else
3142   if test -n "$ac_ct_RANLIB"; then
3143   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3144 else
3145   ac_save_IFS=$IFS; IFS=$ac_path_separator
3146 ac_dummy="$PATH"
3147 for ac_dir in $ac_dummy; do
3148   IFS=$ac_save_IFS
3149   test -z "$ac_dir" && ac_dir=.
3150   $as_executable_p "$ac_dir/$ac_word" || continue
3151 ac_cv_prog_ac_ct_RANLIB="ranlib"
3152 echo "$as_me:3152: found $ac_dir/$ac_word" >&5
3153 break
3154 done
3155
3156   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3157 fi
3158 fi
3159 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3160 if test -n "$ac_ct_RANLIB"; then
3161   echo "$as_me:3161: result: $ac_ct_RANLIB" >&5
3162 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3163 else
3164   echo "$as_me:3164: result: no" >&5
3165 echo "${ECHO_T}no" >&6
3166 fi
3167
3168   RANLIB=$ac_ct_RANLIB
3169 else
3170   RANLIB="$ac_cv_prog_RANLIB"
3171 fi
3172
3173 if test -n "$ac_tool_prefix"; then
3174   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3175 set dummy ${ac_tool_prefix}ld; ac_word=$2
3176 echo "$as_me:3176: checking for $ac_word" >&5
3177 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3178 if test "${ac_cv_prog_LD+set}" = set; then
3179   echo $ECHO_N "(cached) $ECHO_C" >&6
3180 else
3181   if test -n "$LD"; then
3182   ac_cv_prog_LD="$LD" # Let the user override the test.
3183 else
3184   ac_save_IFS=$IFS; IFS=$ac_path_separator
3185 ac_dummy="$PATH"
3186 for ac_dir in $ac_dummy; do
3187   IFS=$ac_save_IFS
3188   test -z "$ac_dir" && ac_dir=.
3189   $as_executable_p "$ac_dir/$ac_word" || continue
3190 ac_cv_prog_LD="${ac_tool_prefix}ld"
3191 echo "$as_me:3191: found $ac_dir/$ac_word" >&5
3192 break
3193 done
3194
3195 fi
3196 fi
3197 LD=$ac_cv_prog_LD
3198 if test -n "$LD"; then
3199   echo "$as_me:3199: result: $LD" >&5
3200 echo "${ECHO_T}$LD" >&6
3201 else
3202   echo "$as_me:3202: result: no" >&5
3203 echo "${ECHO_T}no" >&6
3204 fi
3205
3206 fi
3207 if test -z "$ac_cv_prog_LD"; then
3208   ac_ct_LD=$LD
3209   # Extract the first word of "ld", so it can be a program name with args.
3210 set dummy ld; ac_word=$2
3211 echo "$as_me:3211: checking for $ac_word" >&5
3212 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3213 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3214   echo $ECHO_N "(cached) $ECHO_C" >&6
3215 else
3216   if test -n "$ac_ct_LD"; then
3217   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3218 else
3219   ac_save_IFS=$IFS; IFS=$ac_path_separator
3220 ac_dummy="$PATH"
3221 for ac_dir in $ac_dummy; do
3222   IFS=$ac_save_IFS
3223   test -z "$ac_dir" && ac_dir=.
3224   $as_executable_p "$ac_dir/$ac_word" || continue
3225 ac_cv_prog_ac_ct_LD="ld"
3226 echo "$as_me:3226: found $ac_dir/$ac_word" >&5
3227 break
3228 done
3229
3230   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3231 fi
3232 fi
3233 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3234 if test -n "$ac_ct_LD"; then
3235   echo "$as_me:3235: result: $ac_ct_LD" >&5
3236 echo "${ECHO_T}$ac_ct_LD" >&6
3237 else
3238   echo "$as_me:3238: result: no" >&5
3239 echo "${ECHO_T}no" >&6
3240 fi
3241
3242   LD=$ac_ct_LD
3243 else
3244   LD="$ac_cv_prog_LD"
3245 fi
3246
3247 if test -n "$ac_tool_prefix"; then
3248   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3249 set dummy ${ac_tool_prefix}ar; ac_word=$2
3250 echo "$as_me:3250: checking for $ac_word" >&5
3251 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3252 if test "${ac_cv_prog_AR+set}" = set; then
3253   echo $ECHO_N "(cached) $ECHO_C" >&6
3254 else
3255   if test -n "$AR"; then
3256   ac_cv_prog_AR="$AR" # Let the user override the test.
3257 else
3258   ac_save_IFS=$IFS; IFS=$ac_path_separator
3259 ac_dummy="$PATH"
3260 for ac_dir in $ac_dummy; do
3261   IFS=$ac_save_IFS
3262   test -z "$ac_dir" && ac_dir=.
3263   $as_executable_p "$ac_dir/$ac_word" || continue
3264 ac_cv_prog_AR="${ac_tool_prefix}ar"
3265 echo "$as_me:3265: found $ac_dir/$ac_word" >&5
3266 break
3267 done
3268
3269 fi
3270 fi
3271 AR=$ac_cv_prog_AR
3272 if test -n "$AR"; then
3273   echo "$as_me:3273: result: $AR" >&5
3274 echo "${ECHO_T}$AR" >&6
3275 else
3276   echo "$as_me:3276: result: no" >&5
3277 echo "${ECHO_T}no" >&6
3278 fi
3279
3280 fi
3281 if test -z "$ac_cv_prog_AR"; then
3282   ac_ct_AR=$AR
3283   # Extract the first word of "ar", so it can be a program name with args.
3284 set dummy ar; ac_word=$2
3285 echo "$as_me:3285: checking for $ac_word" >&5
3286 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3287 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3288   echo $ECHO_N "(cached) $ECHO_C" >&6
3289 else
3290   if test -n "$ac_ct_AR"; then
3291   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3292 else
3293   ac_save_IFS=$IFS; IFS=$ac_path_separator
3294 ac_dummy="$PATH"
3295 for ac_dir in $ac_dummy; do
3296   IFS=$ac_save_IFS
3297   test -z "$ac_dir" && ac_dir=.
3298   $as_executable_p "$ac_dir/$ac_word" || continue
3299 ac_cv_prog_ac_ct_AR="ar"
3300 echo "$as_me:3300: found $ac_dir/$ac_word" >&5
3301 break
3302 done
3303
3304   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3305 fi
3306 fi
3307 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3308 if test -n "$ac_ct_AR"; then
3309   echo "$as_me:3309: result: $ac_ct_AR" >&5
3310 echo "${ECHO_T}$ac_ct_AR" >&6
3311 else
3312   echo "$as_me:3312: result: no" >&5
3313 echo "${ECHO_T}no" >&6
3314 fi
3315
3316   AR=$ac_ct_AR
3317 else
3318   AR="$ac_cv_prog_AR"
3319 fi
3320
3321 if test -n "$ac_tool_prefix"; then
3322   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3323 set dummy ${ac_tool_prefix}ar; ac_word=$2
3324 echo "$as_me:3324: checking for $ac_word" >&5
3325 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3326 if test "${ac_cv_prog_AR+set}" = set; then
3327   echo $ECHO_N "(cached) $ECHO_C" >&6
3328 else
3329   if test -n "$AR"; then
3330   ac_cv_prog_AR="$AR" # Let the user override the test.
3331 else
3332   ac_save_IFS=$IFS; IFS=$ac_path_separator
3333 ac_dummy="$PATH"
3334 for ac_dir in $ac_dummy; do
3335   IFS=$ac_save_IFS
3336   test -z "$ac_dir" && ac_dir=.
3337   $as_executable_p "$ac_dir/$ac_word" || continue
3338 ac_cv_prog_AR="${ac_tool_prefix}ar"
3339 echo "$as_me:3339: found $ac_dir/$ac_word" >&5
3340 break
3341 done
3342
3343 fi
3344 fi
3345 AR=$ac_cv_prog_AR
3346 if test -n "$AR"; then
3347   echo "$as_me:3347: result: $AR" >&5
3348 echo "${ECHO_T}$AR" >&6
3349 else
3350   echo "$as_me:3350: result: no" >&5
3351 echo "${ECHO_T}no" >&6
3352 fi
3353
3354 fi
3355 if test -z "$ac_cv_prog_AR"; then
3356   ac_ct_AR=$AR
3357   # Extract the first word of "ar", so it can be a program name with args.
3358 set dummy ar; ac_word=$2
3359 echo "$as_me:3359: checking for $ac_word" >&5
3360 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3361 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3362   echo $ECHO_N "(cached) $ECHO_C" >&6
3363 else
3364   if test -n "$ac_ct_AR"; then
3365   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3366 else
3367   ac_save_IFS=$IFS; IFS=$ac_path_separator
3368 ac_dummy="$PATH"
3369 for ac_dir in $ac_dummy; do
3370   IFS=$ac_save_IFS
3371   test -z "$ac_dir" && ac_dir=.
3372   $as_executable_p "$ac_dir/$ac_word" || continue
3373 ac_cv_prog_ac_ct_AR="ar"
3374 echo "$as_me:3374: found $ac_dir/$ac_word" >&5
3375 break
3376 done
3377
3378   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3379 fi
3380 fi
3381 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3382 if test -n "$ac_ct_AR"; then
3383   echo "$as_me:3383: result: $ac_ct_AR" >&5
3384 echo "${ECHO_T}$ac_ct_AR" >&6
3385 else
3386   echo "$as_me:3386: result: no" >&5
3387 echo "${ECHO_T}no" >&6
3388 fi
3389
3390   AR=$ac_ct_AR
3391 else
3392   AR="$ac_cv_prog_AR"
3393 fi
3394
3395 echo "$as_me:3395: checking for options to update archives" >&5
3396 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3397 if test "${cf_cv_ar_flags+set}" = set; then
3398   echo $ECHO_N "(cached) $ECHO_C" >&6
3399 else
3400
3401         cf_cv_ar_flags=unknown
3402         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3403         do
3404
3405                 # check if $ARFLAGS already contains this choice
3406                 if test "x$ARFLAGS" != "x" ; then
3407                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3408                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3409                                 cf_cv_ar_flags=
3410                                 break
3411                         fi
3412                 fi
3413
3414                 rm -f conftest.$ac_cv_objext
3415                 rm -f conftest.a
3416
3417                 cat >conftest.$ac_ext <<EOF
3418 #line 3418 "configure"
3419 int     testdata[3] = { 123, 456, 789 };
3420 EOF
3421                 if { (eval echo "$as_me:3421: \"$ac_compile\"") >&5
3422   (eval $ac_compile) 2>&5
3423   ac_status=$?
3424   echo "$as_me:3424: \$? = $ac_status" >&5
3425   (exit $ac_status); } ; then
3426                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3427                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3428                         if test -f conftest.a ; then
3429                                 cf_cv_ar_flags=$cf_ar_flags
3430                                 break
3431                         fi
3432                 else
3433                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3434
3435 echo "${as_me-configure}:3435: testing cannot compile test-program ..." 1>&5
3436
3437                         break
3438                 fi
3439         done
3440         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3441
3442 fi
3443 echo "$as_me:3443: result: $cf_cv_ar_flags" >&5
3444 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3445
3446 if test -n "$ARFLAGS" ; then
3447         if test -n "$cf_cv_ar_flags" ; then
3448                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3449         fi
3450 else
3451         ARFLAGS=$cf_cv_ar_flags
3452 fi
3453
3454 echo "$as_me:3454: checking if you have specified an install-prefix" >&5
3455 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3456
3457 # Check whether --with-install-prefix or --without-install-prefix was given.
3458 if test "${with_install_prefix+set}" = set; then
3459   withval="$with_install_prefix"
3460   case "$withval" in #(vi
3461         yes|no) #(vi
3462                 ;;
3463         *)      DESTDIR="$withval"
3464                 ;;
3465         esac
3466 fi;
3467 echo "$as_me:3467: result: $DESTDIR" >&5
3468 echo "${ECHO_T}$DESTDIR" >&6
3469
3470 ###############################################################################
3471
3472 # If we're cross-compiling, allow the user to override the tools and their
3473 # options.  The configure script is oriented toward identifying the host
3474 # compiler, etc., but we need a build compiler to generate parts of the source.
3475
3476 if test "$cross_compiling" = yes ; then
3477
3478         # defaults that we might want to override
3479         : ${BUILD_CFLAGS:=''}
3480         : ${BUILD_CPPFLAGS:=''}
3481         : ${BUILD_LDFLAGS:=''}
3482         : ${BUILD_LIBS:=''}
3483         : ${BUILD_EXEEXT:='$x'}
3484         : ${BUILD_OBJEXT:='o'}
3485
3486 # Check whether --with-build-cc or --without-build-cc was given.
3487 if test "${with_build_cc+set}" = set; then
3488   withval="$with_build_cc"
3489   BUILD_CC="$withval"
3490 else
3491   for ac_prog in gcc cc cl
3492 do
3493   # Extract the first word of "$ac_prog", so it can be a program name with args.
3494 set dummy $ac_prog; ac_word=$2
3495 echo "$as_me:3495: checking for $ac_word" >&5
3496 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3497 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3498   echo $ECHO_N "(cached) $ECHO_C" >&6
3499 else
3500   if test -n "$BUILD_CC"; then
3501   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3502 else
3503   ac_save_IFS=$IFS; IFS=$ac_path_separator
3504 ac_dummy="$PATH"
3505 for ac_dir in $ac_dummy; do
3506   IFS=$ac_save_IFS
3507   test -z "$ac_dir" && ac_dir=.
3508   $as_executable_p "$ac_dir/$ac_word" || continue
3509 ac_cv_prog_BUILD_CC="$ac_prog"
3510 echo "$as_me:3510: found $ac_dir/$ac_word" >&5
3511 break
3512 done
3513
3514 fi
3515 fi
3516 BUILD_CC=$ac_cv_prog_BUILD_CC
3517 if test -n "$BUILD_CC"; then
3518   echo "$as_me:3518: result: $BUILD_CC" >&5
3519 echo "${ECHO_T}$BUILD_CC" >&6
3520 else
3521   echo "$as_me:3521: result: no" >&5
3522 echo "${ECHO_T}no" >&6
3523 fi
3524
3525   test -n "$BUILD_CC" && break
3526 done
3527
3528 fi;
3529         echo "$as_me:3529: checking for native build C compiler" >&5
3530 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3531         echo "$as_me:3531: result: $BUILD_CC" >&5
3532 echo "${ECHO_T}$BUILD_CC" >&6
3533
3534         echo "$as_me:3534: checking for native build C preprocessor" >&5
3535 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3536
3537 # Check whether --with-build-cpp or --without-build-cpp was given.
3538 if test "${with_build_cpp+set}" = set; then
3539   withval="$with_build_cpp"
3540   BUILD_CPP="$withval"
3541 else
3542   BUILD_CPP='${BUILD_CC} -E'
3543 fi;
3544         echo "$as_me:3544: result: $BUILD_CPP" >&5
3545 echo "${ECHO_T}$BUILD_CPP" >&6
3546
3547         echo "$as_me:3547: checking for native build C flags" >&5
3548 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3549
3550 # Check whether --with-build-cflags or --without-build-cflags was given.
3551 if test "${with_build_cflags+set}" = set; then
3552   withval="$with_build_cflags"
3553   BUILD_CFLAGS="$withval"
3554 fi;
3555         echo "$as_me:3555: result: $BUILD_CFLAGS" >&5
3556 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3557
3558         echo "$as_me:3558: checking for native build C preprocessor-flags" >&5
3559 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3560
3561 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3562 if test "${with_build_cppflags+set}" = set; then
3563   withval="$with_build_cppflags"
3564   BUILD_CPPFLAGS="$withval"
3565 fi;
3566         echo "$as_me:3566: result: $BUILD_CPPFLAGS" >&5
3567 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3568
3569         echo "$as_me:3569: checking for native build linker-flags" >&5
3570 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3571
3572 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3573 if test "${with_build_ldflags+set}" = set; then
3574   withval="$with_build_ldflags"
3575   BUILD_LDFLAGS="$withval"
3576 fi;
3577         echo "$as_me:3577: result: $BUILD_LDFLAGS" >&5
3578 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3579
3580         echo "$as_me:3580: checking for native build linker-libraries" >&5
3581 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3582
3583 # Check whether --with-build-libs or --without-build-libs was given.
3584 if test "${with_build_libs+set}" = set; then
3585   withval="$with_build_libs"
3586   BUILD_LIBS="$withval"
3587 fi;
3588         echo "$as_me:3588: result: $BUILD_LIBS" >&5
3589 echo "${ECHO_T}$BUILD_LIBS" >&6
3590
3591         # this assumes we're on Unix.
3592         BUILD_EXEEXT=
3593         BUILD_OBJEXT=o
3594
3595         : ${BUILD_CC:='${CC}'}
3596
3597         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3598                 { { echo "$as_me:3598: error: Cross-build requires two compilers.
3599 Use --with-build-cc to specify the native compiler." >&5
3600 echo "$as_me: error: Cross-build requires two compilers.
3601 Use --with-build-cc to specify the native compiler." >&2;}
3602    { (exit 1); exit 1; }; }
3603         fi
3604
3605 else
3606         : ${BUILD_CC:='${CC}'}
3607         : ${BUILD_CPP:='${CPP}'}
3608         : ${BUILD_CFLAGS:='${CFLAGS}'}
3609         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3610         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3611         : ${BUILD_LIBS:='${LIBS}'}
3612         : ${BUILD_EXEEXT:='$x'}
3613         : ${BUILD_OBJEXT:='o'}
3614 fi
3615
3616 ###############################################################################
3617
3618 ### Options to allow the user to specify the set of libraries which are used.
3619 ### Use "--without-normal --with-shared" to allow the default model to be
3620 ### shared, for example.
3621 cf_list_models=""
3622 echo "$as_me:3622: checking for specified models" >&5
3623 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3624 test -z "$cf_list_models" && cf_list_models=normal
3625 echo "$as_me:3625: result: $cf_list_models" >&5
3626 echo "${ECHO_T}$cf_list_models" >&6
3627
3628 ### Use the first model as the default, and save its suffix for use in building
3629 ### up test-applications.
3630 echo "$as_me:3630: checking for default model" >&5
3631 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3632 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3633 echo "$as_me:3633: result: $DFT_LWR_MODEL" >&5
3634 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3635
3636 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3637
3638 # Check whether --with-curses-dir or --without-curses-dir was given.
3639 if test "${with_curses_dir+set}" = set; then
3640   withval="$with_curses_dir"
3641
3642 if test "x$prefix" != xNONE; then
3643   cf_path_syntax="$prefix"
3644 else
3645   cf_path_syntax="$ac_default_prefix"
3646 fi
3647
3648 case ".$withval" in #(vi
3649 .\$\(*\)*|.\'*\'*) #(vi
3650   ;;
3651 ..|./*|.\\*) #(vi
3652   ;;
3653 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
3654   ;;
3655 .\${*prefix}*) #(vi
3656   eval withval="$withval"
3657   case ".$withval" in #(vi
3658   .NONE/*)
3659     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3660     ;;
3661   esac
3662   ;; #(vi
3663 .no|.NONE/*)
3664   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3665   ;;
3666 *)
3667   { { echo "$as_me:3667: error: expected a pathname, not \"$withval\"" >&5
3668 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3669    { (exit 1); exit 1; }; }
3670   ;;
3671 esac
3672
3673          cf_cv_curses_dir=$withval
3674 else
3675   cf_cv_curses_dir=no
3676 fi;
3677
3678 echo "$as_me:3678: checking if you want wide-character code" >&5
3679 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3680
3681 # Check whether --enable-widec or --disable-widec was given.
3682 if test "${enable_widec+set}" = set; then
3683   enableval="$enable_widec"
3684   with_widec=$enableval
3685 else
3686   with_widec=no
3687 fi;
3688 echo "$as_me:3688: result: $with_widec" >&5
3689 echo "${ECHO_T}$with_widec" >&6
3690 if test "$with_widec" = yes ; then
3691
3692 echo "$as_me:3692: checking for multibyte character support" >&5
3693 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3694 if test "${cf_cv_utf8_lib+set}" = set; then
3695   echo $ECHO_N "(cached) $ECHO_C" >&6
3696 else
3697
3698         cf_save_LIBS="$LIBS"
3699         cat >conftest.$ac_ext <<_ACEOF
3700 #line 3700 "configure"
3701 #include "confdefs.h"
3702
3703 #include <stdlib.h>
3704 int
3705 main ()
3706 {
3707 putwc(0,0);
3708   ;
3709   return 0;
3710 }
3711 _ACEOF
3712 rm -f conftest.$ac_objext conftest$ac_exeext
3713 if { (eval echo "$as_me:3713: \"$ac_link\"") >&5
3714   (eval $ac_link) 2>&5
3715   ac_status=$?
3716   echo "$as_me:3716: \$? = $ac_status" >&5
3717   (exit $ac_status); } &&
3718          { ac_try='test -s conftest$ac_exeext'
3719   { (eval echo "$as_me:3719: \"$ac_try\"") >&5
3720   (eval $ac_try) 2>&5
3721   ac_status=$?
3722   echo "$as_me:3722: \$? = $ac_status" >&5
3723   (exit $ac_status); }; }; then
3724   cf_cv_utf8_lib=yes
3725 else
3726   echo "$as_me: failed program was:" >&5
3727 cat conftest.$ac_ext >&5
3728
3729 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3730 # will be set on completion of the AC_TRY_LINK below.
3731 cf_cv_header_path_utf8=
3732 cf_cv_library_path_utf8=
3733
3734 echo "${as_me-configure}:3734: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3735
3736 cf_save_LIBS="$LIBS"
3737
3738 cat >conftest.$ac_ext <<_ACEOF
3739 #line 3739 "configure"
3740 #include "confdefs.h"
3741
3742 #include <libutf8.h>
3743 int
3744 main ()
3745 {
3746 putwc(0,0);
3747   ;
3748   return 0;
3749 }
3750 _ACEOF
3751 rm -f conftest.$ac_objext conftest$ac_exeext
3752 if { (eval echo "$as_me:3752: \"$ac_link\"") >&5
3753   (eval $ac_link) 2>&5
3754   ac_status=$?
3755   echo "$as_me:3755: \$? = $ac_status" >&5
3756   (exit $ac_status); } &&
3757          { ac_try='test -s conftest$ac_exeext'
3758   { (eval echo "$as_me:3758: \"$ac_try\"") >&5
3759   (eval $ac_try) 2>&5
3760   ac_status=$?
3761   echo "$as_me:3761: \$? = $ac_status" >&5
3762   (exit $ac_status); }; }; then
3763
3764         cf_cv_find_linkage_utf8=yes
3765         cf_cv_header_path_utf8=/usr/include
3766         cf_cv_library_path_utf8=/usr/lib
3767
3768 else
3769   echo "$as_me: failed program was:" >&5
3770 cat conftest.$ac_ext >&5
3771
3772 LIBS="-lutf8  $cf_save_LIBS"
3773
3774 cat >conftest.$ac_ext <<_ACEOF
3775 #line 3775 "configure"
3776 #include "confdefs.h"
3777
3778 #include <libutf8.h>
3779 int
3780 main ()
3781 {
3782 putwc(0,0);
3783   ;
3784   return 0;
3785 }
3786 _ACEOF
3787 rm -f conftest.$ac_objext conftest$ac_exeext
3788 if { (eval echo "$as_me:3788: \"$ac_link\"") >&5
3789   (eval $ac_link) 2>&5
3790   ac_status=$?
3791   echo "$as_me:3791: \$? = $ac_status" >&5
3792   (exit $ac_status); } &&
3793          { ac_try='test -s conftest$ac_exeext'
3794   { (eval echo "$as_me:3794: \"$ac_try\"") >&5
3795   (eval $ac_try) 2>&5
3796   ac_status=$?
3797   echo "$as_me:3797: \$? = $ac_status" >&5
3798   (exit $ac_status); }; }; then
3799
3800         cf_cv_find_linkage_utf8=yes
3801         cf_cv_header_path_utf8=/usr/include
3802         cf_cv_library_path_utf8=/usr/lib
3803         cf_cv_library_file_utf8="-lutf8"
3804
3805 else
3806   echo "$as_me: failed program was:" >&5
3807 cat conftest.$ac_ext >&5
3808
3809         cf_cv_find_linkage_utf8=no
3810         LIBS="$cf_save_LIBS"
3811
3812     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
3813
3814 echo "${as_me-configure}:3814: testing find linkage for utf8 library ..." 1>&5
3815
3816 echo "${as_me-configure}:3816: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3817
3818     cf_save_CPPFLAGS="$CPPFLAGS"
3819     cf_test_CPPFLAGS="$CPPFLAGS"
3820
3821 cf_search=
3822
3823 # collect the current set of include-directories from compiler flags
3824 cf_header_path_list=""
3825 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3826         for cf_header_path in $CPPFLAGS $CFLAGS
3827         do
3828                 case $cf_header_path in #(vi
3829                 -I*)
3830                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3831
3832 test "$cf_header_path" != "NONE" && \
3833 test -d "$cf_header_path" && \
3834  {
3835         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3836         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3837         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
3838         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
3839         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
3840         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
3841 }
3842
3843                         cf_header_path_list="$cf_header_path_list $cf_search"
3844                         ;;
3845                 esac
3846         done
3847 fi
3848
3849 # add the variations for the package we are looking for
3850
3851 cf_search=
3852
3853 test "/usr" != "$prefix" && \
3854 test -d "/usr" && \
3855 (test $prefix = NONE || test "/usr" != "$prefix") && {
3856         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
3857         test -d /usr/include &&          cf_search="$cf_search /usr/include"
3858         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
3859         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
3860         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
3861         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
3862 }
3863
3864 test "$prefix" != "NONE" && \
3865 test -d "$prefix" && \
3866  {
3867         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3868         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3869         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
3870         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
3871         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
3872         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
3873 }
3874
3875 test "/usr/local" != "$prefix" && \
3876 test -d "/usr/local" && \
3877 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
3878         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
3879         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
3880         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
3881         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
3882         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
3883         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
3884 }
3885
3886 test "/opt" != "$prefix" && \
3887 test -d "/opt" && \
3888 (test $prefix = NONE || test "/opt" != "$prefix") && {
3889         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
3890         test -d /opt/include &&          cf_search="$cf_search /opt/include"
3891         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
3892         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
3893         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
3894         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
3895 }
3896
3897 test "$HOME" != "$prefix" && \
3898 test -d "$HOME" && \
3899 (test $prefix = NONE || test "$HOME" != "$prefix") && {
3900         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
3901         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
3902         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
3903         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
3904         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
3905         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
3906 }
3907
3908 test "$includedir" != NONE && \
3909 test "$includedir" != "/usr/include" && \
3910 test -d "$includedir" && {
3911         test -d $includedir &&    cf_search="$cf_search $includedir"
3912         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
3913 }
3914
3915 test "$oldincludedir" != NONE && \
3916 test "$oldincludedir" != "/usr/include" && \
3917 test -d "$oldincludedir" && {
3918         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3919         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
3920 }
3921
3922 cf_search="$cf_search $cf_header_path_list"
3923
3924     for cf_cv_header_path_utf8 in $cf_search
3925     do
3926       if test -d $cf_cv_header_path_utf8 ; then
3927         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
3928
3929 echo "${as_me-configure}:3929: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
3930
3931         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
3932         cat >conftest.$ac_ext <<_ACEOF
3933 #line 3933 "configure"
3934 #include "confdefs.h"
3935
3936 #include <libutf8.h>
3937 int
3938 main ()
3939 {
3940 putwc(0,0);
3941   ;
3942   return 0;
3943 }
3944 _ACEOF
3945 rm -f conftest.$ac_objext
3946 if { (eval echo "$as_me:3946: \"$ac_compile\"") >&5
3947   (eval $ac_compile) 2>&5
3948   ac_status=$?
3949   echo "$as_me:3949: \$? = $ac_status" >&5
3950   (exit $ac_status); } &&
3951          { ac_try='test -s conftest.$ac_objext'
3952   { (eval echo "$as_me:3952: \"$ac_try\"") >&5
3953   (eval $ac_try) 2>&5
3954   ac_status=$?
3955   echo "$as_me:3955: \$? = $ac_status" >&5
3956   (exit $ac_status); }; }; then
3957
3958             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
3959
3960 echo "${as_me-configure}:3960: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
3961
3962             cf_cv_find_linkage_utf8=maybe
3963             cf_test_CPPFLAGS="$CPPFLAGS"
3964             break
3965 else
3966   echo "$as_me: failed program was:" >&5
3967 cat conftest.$ac_ext >&5
3968
3969             CPPFLAGS="$cf_save_CPPFLAGS"
3970
3971 fi
3972 rm -f conftest.$ac_objext conftest.$ac_ext
3973       fi
3974     done
3975
3976     if test "$cf_cv_find_linkage_utf8" = maybe ; then
3977
3978 echo "${as_me-configure}:3978: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
3979
3980       cf_save_LIBS="$LIBS"
3981       cf_save_LDFLAGS="$LDFLAGS"
3982
3983       if test "$cf_cv_find_linkage_utf8" != yes ; then
3984
3985 cf_search=
3986 cf_library_path_list=""
3987 if test -n "${LDFLAGS}${LIBS}" ; then
3988         for cf_library_path in $LDFLAGS $LIBS
3989         do
3990                 case $cf_library_path in #(vi
3991                 -L*)
3992                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
3993
3994 test "$cf_library_path" != "NONE" && \
3995 test -d "$cf_library_path" && \
3996  {
3997         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
3998         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
3999         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
4000         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
4001         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
4002         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
4003 }
4004
4005                         cf_library_path_list="$cf_library_path_list $cf_search"
4006                         ;;
4007                 esac
4008         done
4009 fi
4010
4011 cf_search=
4012
4013 test "/usr" != "$prefix" && \
4014 test -d "/usr" && \
4015 (test $prefix = NONE || test "/usr" != "$prefix") && {
4016         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
4017         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
4018         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
4019         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
4020         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
4021         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
4022 }
4023
4024 test "$prefix" != "NONE" && \
4025 test -d "$prefix" && \
4026  {
4027         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
4028         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4029         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
4030         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
4031         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
4032         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
4033 }
4034
4035 test "/usr/local" != "$prefix" && \
4036 test -d "/usr/local" && \
4037 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4038         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
4039         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
4040         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
4041         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
4042         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
4043         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
4044 }
4045
4046 test "/opt" != "$prefix" && \
4047 test -d "/opt" && \
4048 (test $prefix = NONE || test "/opt" != "$prefix") && {
4049         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
4050         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
4051         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
4052         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
4053         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
4054         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
4055 }
4056
4057 test "$HOME" != "$prefix" && \
4058 test -d "$HOME" && \
4059 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4060         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
4061         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
4062         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
4063         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
4064         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
4065         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
4066 }
4067
4068 cf_search="$cf_library_path_list $cf_search"
4069
4070         for cf_cv_library_path_utf8 in $cf_search
4071         do
4072           if test -d $cf_cv_library_path_utf8 ; then
4073             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
4074
4075 echo "${as_me-configure}:4075: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
4076
4077             CPPFLAGS="$cf_test_CPPFLAGS"
4078             LIBS="-lutf8  $cf_save_LIBS"
4079             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
4080             cat >conftest.$ac_ext <<_ACEOF
4081 #line 4081 "configure"
4082 #include "confdefs.h"
4083
4084 #include <libutf8.h>
4085 int
4086 main ()
4087 {
4088 putwc(0,0);
4089   ;
4090   return 0;
4091 }
4092 _ACEOF
4093 rm -f conftest.$ac_objext conftest$ac_exeext
4094 if { (eval echo "$as_me:4094: \"$ac_link\"") >&5
4095   (eval $ac_link) 2>&5
4096   ac_status=$?
4097   echo "$as_me:4097: \$? = $ac_status" >&5
4098   (exit $ac_status); } &&
4099          { ac_try='test -s conftest$ac_exeext'
4100   { (eval echo "$as_me:4100: \"$ac_try\"") >&5
4101   (eval $ac_try) 2>&5
4102   ac_status=$?
4103   echo "$as_me:4103: \$? = $ac_status" >&5
4104   (exit $ac_status); }; }; then
4105
4106                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4107
4108 echo "${as_me-configure}:4108: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4109
4110                 cf_cv_find_linkage_utf8=yes
4111                 cf_cv_library_file_utf8="-lutf8"
4112                 break
4113 else
4114   echo "$as_me: failed program was:" >&5
4115 cat conftest.$ac_ext >&5
4116
4117                 CPPFLAGS="$cf_save_CPPFLAGS"
4118                 LIBS="$cf_save_LIBS"
4119                 LDFLAGS="$cf_save_LDFLAGS"
4120
4121 fi
4122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4123           fi
4124         done
4125         CPPFLAGS="$cf_save_CPPFLAGS"
4126         LDFLAGS="$cf_save_LDFLAGS"
4127       fi
4128
4129     else
4130       cf_cv_find_linkage_utf8=no
4131     fi
4132
4133 fi
4134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4135
4136 fi
4137 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4138
4139 LIBS="$cf_save_LIBS"
4140
4141 if test "$cf_cv_find_linkage_utf8" = yes ; then
4142 cf_cv_utf8_lib=add-on
4143 else
4144 cf_cv_utf8_lib=no
4145 fi
4146
4147 fi
4148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4149 fi
4150 echo "$as_me:4150: result: $cf_cv_utf8_lib" >&5
4151 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4152
4153 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4154 # ncurses/ncursesw:
4155 if test "$cf_cv_utf8_lib" = "add-on" ; then
4156         cat >>confdefs.h <<\EOF
4157 #define HAVE_LIBUTF8_H 1
4158 EOF
4159
4160 if test -n "$cf_cv_header_path_utf8" ; then
4161   for cf_add_incdir in $cf_cv_header_path_utf8
4162   do
4163         while test $cf_add_incdir != /usr/include
4164         do
4165           if test -d $cf_add_incdir
4166           then
4167                 cf_have_incdir=no
4168                 if test -n "$CFLAGS$CPPFLAGS" ; then
4169                   # a loop is needed to ensure we can add subdirs of existing dirs
4170                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4171                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4172                           cf_have_incdir=yes; break
4173                         fi
4174                   done
4175                 fi
4176
4177                 if test "$cf_have_incdir" = no ; then
4178                   if test "$cf_add_incdir" = /usr/local/include ; then
4179                         if test "$GCC" = yes
4180                         then
4181                           cf_save_CPPFLAGS=$CPPFLAGS
4182                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4183                           cat >conftest.$ac_ext <<_ACEOF
4184 #line 4184 "configure"
4185 #include "confdefs.h"
4186 #include <stdio.h>
4187 int
4188 main ()
4189 {
4190 printf("Hello")
4191   ;
4192   return 0;
4193 }
4194 _ACEOF
4195 rm -f conftest.$ac_objext
4196 if { (eval echo "$as_me:4196: \"$ac_compile\"") >&5
4197   (eval $ac_compile) 2>&5
4198   ac_status=$?
4199   echo "$as_me:4199: \$? = $ac_status" >&5
4200   (exit $ac_status); } &&
4201          { ac_try='test -s conftest.$ac_objext'
4202   { (eval echo "$as_me:4202: \"$ac_try\"") >&5
4203   (eval $ac_try) 2>&5
4204   ac_status=$?
4205   echo "$as_me:4205: \$? = $ac_status" >&5
4206   (exit $ac_status); }; }; then
4207   :
4208 else
4209   echo "$as_me: failed program was:" >&5
4210 cat conftest.$ac_ext >&5
4211 cf_have_incdir=yes
4212 fi
4213 rm -f conftest.$ac_objext conftest.$ac_ext
4214                           CPPFLAGS=$cf_save_CPPFLAGS
4215                         fi
4216                   fi
4217                 fi
4218
4219                 if test "$cf_have_incdir" = no ; then
4220                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4221
4222 echo "${as_me-configure}:4222: testing adding $cf_add_incdir to include-path ..." 1>&5
4223
4224                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4225
4226                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4227                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4228                   cf_add_incdir="$cf_top_incdir"
4229                 else
4230                   break
4231                 fi
4232           fi
4233         done
4234   done
4235 fi
4236
4237 if test -n "$cf_cv_library_path_utf8" ; then
4238   for cf_add_libdir in $cf_cv_library_path_utf8
4239   do
4240     if test $cf_add_libdir = /usr/lib ; then
4241       :
4242     elif test -d $cf_add_libdir
4243     then
4244       cf_have_libdir=no
4245       if test -n "$LDFLAGS$LIBS" ; then
4246         # a loop is needed to ensure we can add subdirs of existing dirs
4247         for cf_test_libdir in $LDFLAGS $LIBS ; do
4248           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4249             cf_have_libdir=yes; break
4250           fi
4251         done
4252       fi
4253       if test "$cf_have_libdir" = no ; then
4254         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4255
4256 echo "${as_me-configure}:4256: testing adding $cf_add_libdir to library-path ..." 1>&5
4257
4258         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4259       fi
4260     fi
4261   done
4262 fi
4263
4264         LIBS="$cf_cv_library_file_utf8 $LIBS"
4265 fi
4266
4267 cf_ncuconfig_root=ncursesw
4268
4269 echo "Looking for ${cf_ncuconfig_root}-config"
4270 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4271 do
4272   # Extract the first word of "$ac_prog", so it can be a program name with args.
4273 set dummy $ac_prog; ac_word=$2
4274 echo "$as_me:4274: checking for $ac_word" >&5
4275 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4276 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
4277   echo $ECHO_N "(cached) $ECHO_C" >&6
4278 else
4279   case $NCURSES_CONFIG in
4280   [\\/]* | ?:[\\/]*)
4281   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
4282   ;;
4283   *)
4284   ac_save_IFS=$IFS; IFS=$ac_path_separator
4285 ac_dummy="$PATH"
4286 for ac_dir in $ac_dummy; do
4287   IFS=$ac_save_IFS
4288   test -z "$ac_dir" && ac_dir=.
4289   if $as_executable_p "$ac_dir/$ac_word"; then
4290    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
4291    echo "$as_me:4291: found $ac_dir/$ac_word" >&5
4292    break
4293 fi
4294 done
4295
4296   ;;
4297 esac
4298 fi
4299 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
4300
4301 if test -n "$NCURSES_CONFIG"; then
4302   echo "$as_me:4302: result: $NCURSES_CONFIG" >&5
4303 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4304 else
4305   echo "$as_me:4305: result: no" >&5
4306 echo "${ECHO_T}no" >&6
4307 fi
4308
4309   test -n "$NCURSES_CONFIG" && break
4310 done
4311 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
4312
4313 if test "$NCURSES_CONFIG" != none ; then
4314
4315 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4316 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
4317
4318 # even with config script, some packages use no-override for curses.h
4319
4320 echo "$as_me:4320: checking if we have identified curses headers" >&5
4321 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4322 if test "${cf_cv_ncurses_header+set}" = set; then
4323   echo $ECHO_N "(cached) $ECHO_C" >&6
4324 else
4325
4326 cf_cv_ncurses_header=none
4327 for cf_header in  \
4328     ncursesw/curses.h \
4329         ncursesw/ncurses.h \
4330         curses.h \
4331         ncurses.h
4332 do
4333 cat >conftest.$ac_ext <<_ACEOF
4334 #line 4334 "configure"
4335 #include "confdefs.h"
4336 #include <${cf_header}>
4337 int
4338 main ()
4339 {
4340 initscr(); tgoto("?", 0,0)
4341   ;
4342   return 0;
4343 }
4344 _ACEOF
4345 rm -f conftest.$ac_objext
4346 if { (eval echo "$as_me:4346: \"$ac_compile\"") >&5
4347   (eval $ac_compile) 2>&5
4348   ac_status=$?
4349   echo "$as_me:4349: \$? = $ac_status" >&5
4350   (exit $ac_status); } &&
4351          { ac_try='test -s conftest.$ac_objext'
4352   { (eval echo "$as_me:4352: \"$ac_try\"") >&5
4353   (eval $ac_try) 2>&5
4354   ac_status=$?
4355   echo "$as_me:4355: \$? = $ac_status" >&5
4356   (exit $ac_status); }; }; then
4357   cf_cv_ncurses_header=$cf_header; break
4358 else
4359   echo "$as_me: failed program was:" >&5
4360 cat conftest.$ac_ext >&5
4361 fi
4362 rm -f conftest.$ac_objext conftest.$ac_ext
4363 done
4364
4365 fi
4366 echo "$as_me:4366: result: $cf_cv_ncurses_header" >&5
4367 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4368
4369 if test "$cf_cv_ncurses_header" = none ; then
4370         { { echo "$as_me:4370: error: No curses header-files found" >&5
4371 echo "$as_me: error: No curses header-files found" >&2;}
4372    { (exit 1); exit 1; }; }
4373 fi
4374
4375 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4376
4377 for ac_header in $cf_cv_ncurses_header
4378 do
4379 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4380 echo "$as_me:4380: checking for $ac_header" >&5
4381 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4382 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4383   echo $ECHO_N "(cached) $ECHO_C" >&6
4384 else
4385   cat >conftest.$ac_ext <<_ACEOF
4386 #line 4386 "configure"
4387 #include "confdefs.h"
4388 #include <$ac_header>
4389 _ACEOF
4390 if { (eval echo "$as_me:4390: \"$ac_cpp conftest.$ac_ext\"") >&5
4391   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4392   ac_status=$?
4393   egrep -v '^ *\+' conftest.er1 >conftest.err
4394   rm -f conftest.er1
4395   cat conftest.err >&5
4396   echo "$as_me:4396: \$? = $ac_status" >&5
4397   (exit $ac_status); } >/dev/null; then
4398   if test -s conftest.err; then
4399     ac_cpp_err=$ac_c_preproc_warn_flag
4400   else
4401     ac_cpp_err=
4402   fi
4403 else
4404   ac_cpp_err=yes
4405 fi
4406 if test -z "$ac_cpp_err"; then
4407   eval "$as_ac_Header=yes"
4408 else
4409   echo "$as_me: failed program was:" >&5
4410   cat conftest.$ac_ext >&5
4411   eval "$as_ac_Header=no"
4412 fi
4413 rm -f conftest.err conftest.$ac_ext
4414 fi
4415 echo "$as_me:4415: result: `eval echo '${'$as_ac_Header'}'`" >&5
4416 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4417 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4418   cat >>confdefs.h <<EOF
4419 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4420 EOF
4421
4422 fi
4423 done
4424
4425 cat >>confdefs.h <<\EOF
4426 #define NCURSES 1
4427 EOF
4428
4429 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4430
4431 cat >>confdefs.h <<EOF
4432 #define $cf_nculib_ROOT 1
4433 EOF
4434
4435 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4436
4437 else
4438
4439 cf_ncuhdr_root=ncursesw
4440
4441 test -n "$cf_cv_curses_dir" && \
4442 test "$cf_cv_curses_dir" != "no" && { \
4443
4444 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4445   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
4446   do
4447         while test $cf_add_incdir != /usr/include
4448         do
4449           if test -d $cf_add_incdir
4450           then
4451                 cf_have_incdir=no
4452                 if test -n "$CFLAGS$CPPFLAGS" ; then
4453                   # a loop is needed to ensure we can add subdirs of existing dirs
4454                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4455                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4456                           cf_have_incdir=yes; break
4457                         fi
4458                   done
4459                 fi
4460
4461                 if test "$cf_have_incdir" = no ; then
4462                   if test "$cf_add_incdir" = /usr/local/include ; then
4463                         if test "$GCC" = yes
4464                         then
4465                           cf_save_CPPFLAGS=$CPPFLAGS
4466                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4467                           cat >conftest.$ac_ext <<_ACEOF
4468 #line 4468 "configure"
4469 #include "confdefs.h"
4470 #include <stdio.h>
4471 int
4472 main ()
4473 {
4474 printf("Hello")
4475   ;
4476   return 0;
4477 }
4478 _ACEOF
4479 rm -f conftest.$ac_objext
4480 if { (eval echo "$as_me:4480: \"$ac_compile\"") >&5
4481   (eval $ac_compile) 2>&5
4482   ac_status=$?
4483   echo "$as_me:4483: \$? = $ac_status" >&5
4484   (exit $ac_status); } &&
4485          { ac_try='test -s conftest.$ac_objext'
4486   { (eval echo "$as_me:4486: \"$ac_try\"") >&5
4487   (eval $ac_try) 2>&5
4488   ac_status=$?
4489   echo "$as_me:4489: \$? = $ac_status" >&5
4490   (exit $ac_status); }; }; then
4491   :
4492 else
4493   echo "$as_me: failed program was:" >&5
4494 cat conftest.$ac_ext >&5
4495 cf_have_incdir=yes
4496 fi
4497 rm -f conftest.$ac_objext conftest.$ac_ext
4498                           CPPFLAGS=$cf_save_CPPFLAGS
4499                         fi
4500                   fi
4501                 fi
4502
4503                 if test "$cf_have_incdir" = no ; then
4504                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4505
4506 echo "${as_me-configure}:4506: testing adding $cf_add_incdir to include-path ..." 1>&5
4507
4508                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4509
4510                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4511                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4512                   cf_add_incdir="$cf_top_incdir"
4513                 else
4514                   break
4515                 fi
4516           fi
4517         done
4518   done
4519 fi
4520
4521 }
4522
4523 echo "$as_me:4523: checking for $cf_ncuhdr_root header in include-path" >&5
4524 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4525 if test "${cf_cv_ncurses_h+set}" = set; then
4526   echo $ECHO_N "(cached) $ECHO_C" >&6
4527 else
4528
4529         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4530         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4531         for cf_header in $cf_header_list
4532         do
4533
4534         cat >conftest.$ac_ext <<_ACEOF
4535 #line 4535 "configure"
4536 #include "confdefs.h"
4537
4538 #define _XOPEN_SOURCE_EXTENDED
4539 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4540 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4541
4542 #include <$cf_header>
4543 int
4544 main ()
4545 {
4546
4547 #ifdef NCURSES_VERSION
4548
4549 #ifndef WACS_BSSB
4550         make an error
4551 #endif
4552
4553 printf("%s\n", NCURSES_VERSION);
4554 #else
4555 #ifdef __NCURSES_H
4556 printf("old\n");
4557 #else
4558         make an error
4559 #endif
4560 #endif
4561
4562   ;
4563   return 0;
4564 }
4565 _ACEOF
4566 rm -f conftest.$ac_objext
4567 if { (eval echo "$as_me:4567: \"$ac_compile\"") >&5
4568   (eval $ac_compile) 2>&5
4569   ac_status=$?
4570   echo "$as_me:4570: \$? = $ac_status" >&5
4571   (exit $ac_status); } &&
4572          { ac_try='test -s conftest.$ac_objext'
4573   { (eval echo "$as_me:4573: \"$ac_try\"") >&5
4574   (eval $ac_try) 2>&5
4575   ac_status=$?
4576   echo "$as_me:4576: \$? = $ac_status" >&5
4577   (exit $ac_status); }; }; then
4578   cf_cv_ncurses_h=$cf_header
4579
4580 else
4581   echo "$as_me: failed program was:" >&5
4582 cat conftest.$ac_ext >&5
4583 cf_cv_ncurses_h=no
4584 fi
4585 rm -f conftest.$ac_objext conftest.$ac_ext
4586
4587                 test "$cf_cv_ncurses_h" != no && break
4588         done
4589
4590 fi
4591 echo "$as_me:4591: result: $cf_cv_ncurses_h" >&5
4592 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4593
4594 if test "$cf_cv_ncurses_h" != no ; then
4595         cf_cv_ncurses_header=$cf_cv_ncurses_h
4596 else
4597
4598 echo "$as_me:4598: checking for $cf_ncuhdr_root include-path" >&5
4599 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4600 if test "${cf_cv_ncurses_h2+set}" = set; then
4601   echo $ECHO_N "(cached) $ECHO_C" >&6
4602 else
4603
4604         test -n "$verbose" && echo
4605
4606 cf_search=
4607
4608 # collect the current set of include-directories from compiler flags
4609 cf_header_path_list=""
4610 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4611         for cf_header_path in $CPPFLAGS $CFLAGS
4612         do
4613                 case $cf_header_path in #(vi
4614                 -I*)
4615                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4616
4617 test "$cf_header_path" != "NONE" && \
4618 test -d "$cf_header_path" && \
4619  {
4620         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4621         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4622         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4623         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4624         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4625         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"
4626 }
4627
4628                         cf_header_path_list="$cf_header_path_list $cf_search"
4629                         ;;
4630                 esac
4631         done
4632 fi
4633
4634 # add the variations for the package we are looking for
4635
4636 cf_search=
4637
4638 test "/usr" != "$prefix" && \
4639 test -d "/usr" && \
4640 (test $prefix = NONE || test "/usr" != "$prefix") && {
4641         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4642         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4643         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
4644         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
4645         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
4646         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4647 }
4648
4649 test "$prefix" != "NONE" && \
4650 test -d "$prefix" && \
4651  {
4652         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4653         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4654         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4655         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4656         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4657         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4658 }
4659
4660 test "/usr/local" != "$prefix" && \
4661 test -d "/usr/local" && \
4662 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
4663         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4664         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4665         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
4666         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
4667         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
4668         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4669 }
4670
4671 test "/opt" != "$prefix" && \
4672 test -d "/opt" && \
4673 (test $prefix = NONE || test "/opt" != "$prefix") && {
4674         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4675         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4676         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
4677         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
4678         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
4679         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4680 }
4681
4682 test "$HOME" != "$prefix" && \
4683 test -d "$HOME" && \
4684 (test $prefix = NONE || test "$HOME" != "$prefix") && {
4685         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4686         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4687         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
4688         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
4689         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
4690         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4691 }
4692
4693 test "$includedir" != NONE && \
4694 test "$includedir" != "/usr/include" && \
4695 test -d "$includedir" && {
4696         test -d $includedir &&    cf_search="$cf_search $includedir"
4697         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4698 }
4699
4700 test "$oldincludedir" != NONE && \
4701 test "$oldincludedir" != "/usr/include" && \
4702 test -d "$oldincludedir" && {
4703         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4704         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4705 }
4706
4707 cf_search="$cf_search $cf_header_path_list"
4708
4709         test -n "$verbose" && echo search path $cf_search
4710         cf_save2_CPPFLAGS="$CPPFLAGS"
4711         for cf_incdir in $cf_search
4712         do
4713
4714 if test -n "$cf_incdir" ; then
4715   for cf_add_incdir in $cf_incdir
4716   do
4717         while test $cf_add_incdir != /usr/include
4718         do
4719           if test -d $cf_add_incdir
4720           then
4721                 cf_have_incdir=no
4722                 if test -n "$CFLAGS$CPPFLAGS" ; then
4723                   # a loop is needed to ensure we can add subdirs of existing dirs
4724                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4725                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4726                           cf_have_incdir=yes; break
4727                         fi
4728                   done
4729                 fi
4730
4731                 if test "$cf_have_incdir" = no ; then
4732                   if test "$cf_add_incdir" = /usr/local/include ; then
4733                         if test "$GCC" = yes
4734                         then
4735                           cf_save_CPPFLAGS=$CPPFLAGS
4736                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4737                           cat >conftest.$ac_ext <<_ACEOF
4738 #line 4738 "configure"
4739 #include "confdefs.h"
4740 #include <stdio.h>
4741 int
4742 main ()
4743 {
4744 printf("Hello")
4745   ;
4746   return 0;
4747 }
4748 _ACEOF
4749 rm -f conftest.$ac_objext
4750 if { (eval echo "$as_me:4750: \"$ac_compile\"") >&5
4751   (eval $ac_compile) 2>&5
4752   ac_status=$?
4753   echo "$as_me:4753: \$? = $ac_status" >&5
4754   (exit $ac_status); } &&
4755          { ac_try='test -s conftest.$ac_objext'
4756   { (eval echo "$as_me:4756: \"$ac_try\"") >&5
4757   (eval $ac_try) 2>&5
4758   ac_status=$?
4759   echo "$as_me:4759: \$? = $ac_status" >&5
4760   (exit $ac_status); }; }; then
4761   :
4762 else
4763   echo "$as_me: failed program was:" >&5
4764 cat conftest.$ac_ext >&5
4765 cf_have_incdir=yes
4766 fi
4767 rm -f conftest.$ac_objext conftest.$ac_ext
4768                           CPPFLAGS=$cf_save_CPPFLAGS
4769                         fi
4770                   fi
4771                 fi
4772
4773                 if test "$cf_have_incdir" = no ; then
4774                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4775
4776 echo "${as_me-configure}:4776: testing adding $cf_add_incdir to include-path ..." 1>&5
4777
4778                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4779
4780                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4781                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4782                   cf_add_incdir="$cf_top_incdir"
4783                 else
4784                   break
4785                 fi
4786           fi
4787         done
4788   done
4789 fi
4790
4791                 for cf_header in \
4792                         ncurses.h \
4793                         curses.h
4794                 do
4795
4796         cat >conftest.$ac_ext <<_ACEOF
4797 #line 4797 "configure"
4798 #include "confdefs.h"
4799
4800 #include <$cf_header>
4801 int
4802 main ()
4803 {
4804
4805 #ifdef NCURSES_VERSION
4806
4807 printf("%s\n", NCURSES_VERSION);
4808 #else
4809 #ifdef __NCURSES_H
4810 printf("old\n");
4811 #else
4812         make an error
4813 #endif
4814 #endif
4815
4816   ;
4817   return 0;
4818 }
4819 _ACEOF
4820 rm -f conftest.$ac_objext
4821 if { (eval echo "$as_me:4821: \"$ac_compile\"") >&5
4822   (eval $ac_compile) 2>&5
4823   ac_status=$?
4824   echo "$as_me:4824: \$? = $ac_status" >&5
4825   (exit $ac_status); } &&
4826          { ac_try='test -s conftest.$ac_objext'
4827   { (eval echo "$as_me:4827: \"$ac_try\"") >&5
4828   (eval $ac_try) 2>&5
4829   ac_status=$?
4830   echo "$as_me:4830: \$? = $ac_status" >&5
4831   (exit $ac_status); }; }; then
4832   cf_cv_ncurses_h2=$cf_header
4833
4834 else
4835   echo "$as_me: failed program was:" >&5
4836 cat conftest.$ac_ext >&5
4837 cf_cv_ncurses_h2=no
4838 fi
4839 rm -f conftest.$ac_objext conftest.$ac_ext
4840
4841                         if test "$cf_cv_ncurses_h2" != no ; then
4842                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4843                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4844                                 break
4845                         fi
4846                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4847                 done
4848                 CPPFLAGS="$cf_save2_CPPFLAGS"
4849                 test "$cf_cv_ncurses_h2" != no && break
4850         done
4851         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4851: error: not found" >&5
4852 echo "$as_me: error: not found" >&2;}
4853    { (exit 1); exit 1; }; }
4854
4855 fi
4856 echo "$as_me:4856: result: $cf_cv_ncurses_h2" >&5
4857 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4858
4859         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4860         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4861         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4862                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4863         fi
4864
4865 if test -n "$cf_1st_incdir" ; then
4866   for cf_add_incdir in $cf_1st_incdir
4867   do
4868         while test $cf_add_incdir != /usr/include
4869         do
4870           if test -d $cf_add_incdir
4871           then
4872                 cf_have_incdir=no
4873                 if test -n "$CFLAGS$CPPFLAGS" ; then
4874                   # a loop is needed to ensure we can add subdirs of existing dirs
4875                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4876                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4877                           cf_have_incdir=yes; break
4878                         fi
4879                   done
4880                 fi
4881
4882                 if test "$cf_have_incdir" = no ; then
4883                   if test "$cf_add_incdir" = /usr/local/include ; then
4884                         if test "$GCC" = yes
4885                         then
4886                           cf_save_CPPFLAGS=$CPPFLAGS
4887                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4888                           cat >conftest.$ac_ext <<_ACEOF
4889 #line 4889 "configure"
4890 #include "confdefs.h"
4891 #include <stdio.h>
4892 int
4893 main ()
4894 {
4895 printf("Hello")
4896   ;
4897   return 0;
4898 }
4899 _ACEOF
4900 rm -f conftest.$ac_objext
4901 if { (eval echo "$as_me:4901: \"$ac_compile\"") >&5
4902   (eval $ac_compile) 2>&5
4903   ac_status=$?
4904   echo "$as_me:4904: \$? = $ac_status" >&5
4905   (exit $ac_status); } &&
4906          { ac_try='test -s conftest.$ac_objext'
4907   { (eval echo "$as_me:4907: \"$ac_try\"") >&5
4908   (eval $ac_try) 2>&5
4909   ac_status=$?
4910   echo "$as_me:4910: \$? = $ac_status" >&5
4911   (exit $ac_status); }; }; then
4912   :
4913 else
4914   echo "$as_me: failed program was:" >&5
4915 cat conftest.$ac_ext >&5
4916 cf_have_incdir=yes
4917 fi
4918 rm -f conftest.$ac_objext conftest.$ac_ext
4919                           CPPFLAGS=$cf_save_CPPFLAGS
4920                         fi
4921                   fi
4922                 fi
4923
4924                 if test "$cf_have_incdir" = no ; then
4925                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4926
4927 echo "${as_me-configure}:4927: testing adding $cf_add_incdir to include-path ..." 1>&5
4928
4929                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4930
4931                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4932                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4933                   cf_add_incdir="$cf_top_incdir"
4934                 else
4935                   break
4936                 fi
4937           fi
4938         done
4939   done
4940 fi
4941
4942 fi
4943
4944 # Set definitions to allow ifdef'ing for ncurses.h
4945
4946 case $cf_cv_ncurses_header in # (vi
4947 *ncurses.h)
4948         cat >>confdefs.h <<\EOF
4949 #define HAVE_NCURSES_H 1
4950 EOF
4951
4952         ;;
4953 esac
4954
4955 case $cf_cv_ncurses_header in # (vi
4956 ncurses/curses.h|ncurses/ncurses.h)
4957         cat >>confdefs.h <<\EOF
4958 #define HAVE_NCURSES_NCURSES_H 1
4959 EOF
4960
4961         ;;
4962 ncursesw/curses.h|ncursesw/ncurses.h)
4963         cat >>confdefs.h <<\EOF
4964 #define HAVE_NCURSESW_NCURSES_H 1
4965 EOF
4966
4967         ;;
4968 esac
4969
4970 echo "$as_me:4970: checking for terminfo header" >&5
4971 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4972 if test "${cf_cv_term_header+set}" = set; then
4973   echo $ECHO_N "(cached) $ECHO_C" >&6
4974 else
4975
4976 case ${cf_cv_ncurses_header} in #(vi
4977 */ncurses.h|*/ncursesw.h) #(vi
4978         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4979         ;;
4980 *)
4981         cf_term_header=term.h
4982         ;;
4983 esac
4984
4985 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4986 do
4987 cat >conftest.$ac_ext <<_ACEOF
4988 #line 4988 "configure"
4989 #include "confdefs.h"
4990 #include <stdio.h>
4991 #include <${cf_cv_ncurses_header-curses.h}>
4992 #include <$cf_test>
4993
4994 int
4995 main ()
4996 {
4997 int x = auto_left_margin
4998   ;
4999   return 0;
5000 }
5001 _ACEOF
5002 rm -f conftest.$ac_objext
5003 if { (eval echo "$as_me:5003: \"$ac_compile\"") >&5
5004   (eval $ac_compile) 2>&5
5005   ac_status=$?
5006   echo "$as_me:5006: \$? = $ac_status" >&5
5007   (exit $ac_status); } &&
5008          { ac_try='test -s conftest.$ac_objext'
5009   { (eval echo "$as_me:5009: \"$ac_try\"") >&5
5010   (eval $ac_try) 2>&5
5011   ac_status=$?
5012   echo "$as_me:5012: \$? = $ac_status" >&5
5013   (exit $ac_status); }; }; then
5014
5015         cf_cv_term_header="$cf_test"
5016 else
5017   echo "$as_me: failed program was:" >&5
5018 cat conftest.$ac_ext >&5
5019
5020         cf_cv_term_header=unknown
5021
5022 fi
5023 rm -f conftest.$ac_objext conftest.$ac_ext
5024         test "$cf_cv_term_header" != unknown && break
5025 done
5026
5027 fi
5028 echo "$as_me:5028: result: $cf_cv_term_header" >&5
5029 echo "${ECHO_T}$cf_cv_term_header" >&6
5030
5031 # Set definitions to allow ifdef'ing to accommodate subdirectories
5032
5033 case $cf_cv_term_header in # (vi
5034 *term.h)
5035         cat >>confdefs.h <<\EOF
5036 #define HAVE_TERM_H 1
5037 EOF
5038
5039         ;;
5040 esac
5041
5042 case $cf_cv_term_header in # (vi
5043 ncurses/term.h) #(vi
5044         cat >>confdefs.h <<\EOF
5045 #define HAVE_NCURSES_TERM_H 1
5046 EOF
5047
5048         ;;
5049 ncursesw/term.h)
5050         cat >>confdefs.h <<\EOF
5051 #define HAVE_NCURSESW_TERM_H 1
5052 EOF
5053
5054         ;;
5055 esac
5056
5057 # some applications need this, but should check for NCURSES_VERSION
5058 cat >>confdefs.h <<\EOF
5059 #define NCURSES 1
5060 EOF
5061
5062 echo "$as_me:5062: checking for ncurses version" >&5
5063 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5064 if test "${cf_cv_ncurses_version+set}" = set; then
5065   echo $ECHO_N "(cached) $ECHO_C" >&6
5066 else
5067
5068         cf_cv_ncurses_version=no
5069         cf_tempfile=out$$
5070         rm -f $cf_tempfile
5071         if test "$cross_compiling" = yes; then
5072
5073         # This will not work if the preprocessor splits the line after the
5074         # Autoconf token.  The 'unproto' program does that.
5075         cat > conftest.$ac_ext <<EOF
5076 #include <${cf_cv_ncurses_header-curses.h}>
5077 #undef Autoconf
5078 #ifdef NCURSES_VERSION
5079 Autoconf NCURSES_VERSION
5080 #else
5081 #ifdef __NCURSES_H
5082 Autoconf "old"
5083 #endif
5084 ;
5085 #endif
5086 EOF
5087         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5088         { (eval echo "$as_me:5088: \"$cf_try\"") >&5
5089   (eval $cf_try) 2>&5
5090   ac_status=$?
5091   echo "$as_me:5091: \$? = $ac_status" >&5
5092   (exit $ac_status); }
5093         if test -f conftest.out ; then
5094                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5095                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5096                 rm -f conftest.out
5097         fi
5098
5099 else
5100   cat >conftest.$ac_ext <<_ACEOF
5101 #line 5101 "configure"
5102 #include "confdefs.h"
5103
5104 #include <${cf_cv_ncurses_header-curses.h}>
5105 #include <stdio.h>
5106 int main()
5107 {
5108         FILE *fp = fopen("$cf_tempfile", "w");
5109 #ifdef NCURSES_VERSION
5110 # ifdef NCURSES_VERSION_PATCH
5111         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5112 # else
5113         fprintf(fp, "%s\n", NCURSES_VERSION);
5114 # endif
5115 #else
5116 # ifdef __NCURSES_H
5117         fprintf(fp, "old\n");
5118 # else
5119         make an error
5120 # endif
5121 #endif
5122         ${cf_cv_main_return-return}(0);
5123 }
5124 _ACEOF
5125 rm -f conftest$ac_exeext
5126 if { (eval echo "$as_me:5126: \"$ac_link\"") >&5
5127   (eval $ac_link) 2>&5
5128   ac_status=$?
5129   echo "$as_me:5129: \$? = $ac_status" >&5
5130   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5131   { (eval echo "$as_me:5131: \"$ac_try\"") >&5
5132   (eval $ac_try) 2>&5
5133   ac_status=$?
5134   echo "$as_me:5134: \$? = $ac_status" >&5
5135   (exit $ac_status); }; }; then
5136
5137         cf_cv_ncurses_version=`cat $cf_tempfile`
5138 else
5139   echo "$as_me: program exited with status $ac_status" >&5
5140 echo "$as_me: failed program was:" >&5
5141 cat conftest.$ac_ext >&5
5142 fi
5143 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5144 fi
5145         rm -f $cf_tempfile
5146
5147 fi
5148 echo "$as_me:5148: result: $cf_cv_ncurses_version" >&5
5149 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5150 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5151 #define NCURSES 1
5152 EOF
5153
5154 cf_nculib_root=ncursesw
5155         # This works, except for the special case where we find gpm, but
5156         # ncurses is in a nonstandard location via $LIBS, and we really want
5157         # to link gpm.
5158 cf_ncurses_LIBS=""
5159 cf_ncurses_SAVE="$LIBS"
5160 echo "$as_me:5160: checking for Gpm_Open in -lgpm" >&5
5161 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5162 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5163   echo $ECHO_N "(cached) $ECHO_C" >&6
5164 else
5165   ac_check_lib_save_LIBS=$LIBS
5166 LIBS="-lgpm  $LIBS"
5167 cat >conftest.$ac_ext <<_ACEOF
5168 #line 5168 "configure"
5169 #include "confdefs.h"
5170
5171 /* Override any gcc2 internal prototype to avoid an error.  */
5172 #ifdef __cplusplus
5173 extern "C"
5174 #endif
5175 /* We use char because int might match the return type of a gcc2
5176    builtin and then its argument prototype would still apply.  */
5177 char Gpm_Open ();
5178 int
5179 main ()
5180 {
5181 Gpm_Open ();
5182   ;
5183   return 0;
5184 }
5185 _ACEOF
5186 rm -f conftest.$ac_objext conftest$ac_exeext
5187 if { (eval echo "$as_me:5187: \"$ac_link\"") >&5
5188   (eval $ac_link) 2>&5
5189   ac_status=$?
5190   echo "$as_me:5190: \$? = $ac_status" >&5
5191   (exit $ac_status); } &&
5192          { ac_try='test -s conftest$ac_exeext'
5193   { (eval echo "$as_me:5193: \"$ac_try\"") >&5
5194   (eval $ac_try) 2>&5
5195   ac_status=$?
5196   echo "$as_me:5196: \$? = $ac_status" >&5
5197   (exit $ac_status); }; }; then
5198   ac_cv_lib_gpm_Gpm_Open=yes
5199 else
5200   echo "$as_me: failed program was:" >&5
5201 cat conftest.$ac_ext >&5
5202 ac_cv_lib_gpm_Gpm_Open=no
5203 fi
5204 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5205 LIBS=$ac_check_lib_save_LIBS
5206 fi
5207 echo "$as_me:5207: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5208 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5209 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5210   echo "$as_me:5210: checking for initscr in -lgpm" >&5
5211 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5212 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5213   echo $ECHO_N "(cached) $ECHO_C" >&6
5214 else
5215   ac_check_lib_save_LIBS=$LIBS
5216 LIBS="-lgpm  $LIBS"
5217 cat >conftest.$ac_ext <<_ACEOF
5218 #line 5218 "configure"
5219 #include "confdefs.h"
5220
5221 /* Override any gcc2 internal prototype to avoid an error.  */
5222 #ifdef __cplusplus
5223 extern "C"
5224 #endif
5225 /* We use char because int might match the return type of a gcc2
5226    builtin and then its argument prototype would still apply.  */
5227 char initscr ();
5228 int
5229 main ()
5230 {
5231 initscr ();
5232   ;
5233   return 0;
5234 }
5235 _ACEOF
5236 rm -f conftest.$ac_objext conftest$ac_exeext
5237 if { (eval echo "$as_me:5237: \"$ac_link\"") >&5
5238   (eval $ac_link) 2>&5
5239   ac_status=$?
5240   echo "$as_me:5240: \$? = $ac_status" >&5
5241   (exit $ac_status); } &&
5242          { ac_try='test -s conftest$ac_exeext'
5243   { (eval echo "$as_me:5243: \"$ac_try\"") >&5
5244   (eval $ac_try) 2>&5
5245   ac_status=$?
5246   echo "$as_me:5246: \$? = $ac_status" >&5
5247   (exit $ac_status); }; }; then
5248   ac_cv_lib_gpm_initscr=yes
5249 else
5250   echo "$as_me: failed program was:" >&5
5251 cat conftest.$ac_ext >&5
5252 ac_cv_lib_gpm_initscr=no
5253 fi
5254 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5255 LIBS=$ac_check_lib_save_LIBS
5256 fi
5257 echo "$as_me:5257: result: $ac_cv_lib_gpm_initscr" >&5
5258 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5259 if test $ac_cv_lib_gpm_initscr = yes; then
5260   LIBS="$cf_ncurses_SAVE"
5261 else
5262   cf_ncurses_LIBS="-lgpm"
5263 fi
5264
5265 fi
5266
5267 case $host_os in #(vi
5268 freebsd*)
5269         # This is only necessary if you are linking against an obsolete
5270         # version of ncurses (but it should do no harm, since it's static).
5271         if test "$cf_nculib_root" = ncurses ; then
5272                 echo "$as_me:5272: checking for tgoto in -lmytinfo" >&5
5273 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5274 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5275   echo $ECHO_N "(cached) $ECHO_C" >&6
5276 else
5277   ac_check_lib_save_LIBS=$LIBS
5278 LIBS="-lmytinfo  $LIBS"
5279 cat >conftest.$ac_ext <<_ACEOF
5280 #line 5280 "configure"
5281 #include "confdefs.h"
5282
5283 /* Override any gcc2 internal prototype to avoid an error.  */
5284 #ifdef __cplusplus
5285 extern "C"
5286 #endif
5287 /* We use char because int might match the return type of a gcc2
5288    builtin and then its argument prototype would still apply.  */
5289 char tgoto ();
5290 int
5291 main ()
5292 {
5293 tgoto ();
5294   ;
5295   return 0;
5296 }
5297 _ACEOF
5298 rm -f conftest.$ac_objext conftest$ac_exeext
5299 if { (eval echo "$as_me:5299: \"$ac_link\"") >&5
5300   (eval $ac_link) 2>&5
5301   ac_status=$?
5302   echo "$as_me:5302: \$? = $ac_status" >&5
5303   (exit $ac_status); } &&
5304          { ac_try='test -s conftest$ac_exeext'
5305   { (eval echo "$as_me:5305: \"$ac_try\"") >&5
5306   (eval $ac_try) 2>&5
5307   ac_status=$?
5308   echo "$as_me:5308: \$? = $ac_status" >&5
5309   (exit $ac_status); }; }; then
5310   ac_cv_lib_mytinfo_tgoto=yes
5311 else
5312   echo "$as_me: failed program was:" >&5
5313 cat conftest.$ac_ext >&5
5314 ac_cv_lib_mytinfo_tgoto=no
5315 fi
5316 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5317 LIBS=$ac_check_lib_save_LIBS
5318 fi
5319 echo "$as_me:5319: result: $ac_cv_lib_mytinfo_tgoto" >&5
5320 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5321 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5322   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5323 fi
5324
5325         fi
5326         ;;
5327 esac
5328
5329 LIBS="$cf_ncurses_LIBS $LIBS"
5330
5331 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5332 then
5333
5334 if test -n "$cf_cv_curses_dir/lib" ; then
5335   for cf_add_libdir in $cf_cv_curses_dir/lib
5336   do
5337     if test $cf_add_libdir = /usr/lib ; then
5338       :
5339     elif test -d $cf_add_libdir
5340     then
5341       cf_have_libdir=no
5342       if test -n "$LDFLAGS$LIBS" ; then
5343         # a loop is needed to ensure we can add subdirs of existing dirs
5344         for cf_test_libdir in $LDFLAGS $LIBS ; do
5345           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5346             cf_have_libdir=yes; break
5347           fi
5348         done
5349       fi
5350       if test "$cf_have_libdir" = no ; then
5351         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5352
5353 echo "${as_me-configure}:5353: testing adding $cf_add_libdir to library-path ..." 1>&5
5354
5355         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5356       fi
5357     fi
5358   done
5359 fi
5360
5361         LIBS="-l$cf_nculib_root $LIBS"
5362 else
5363
5364         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5365         cf_libdir=""
5366         echo "$as_me:5366: checking for initscr" >&5
5367 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5368 if test "${ac_cv_func_initscr+set}" = set; then
5369   echo $ECHO_N "(cached) $ECHO_C" >&6
5370 else
5371   cat >conftest.$ac_ext <<_ACEOF
5372 #line 5372 "configure"
5373 #include "confdefs.h"
5374 /* System header to define __stub macros and hopefully few prototypes,
5375     which can conflict with char initscr (); below.  */
5376 #include <assert.h>
5377 /* Override any gcc2 internal prototype to avoid an error.  */
5378 #ifdef __cplusplus
5379 extern "C"
5380 #endif
5381 /* We use char because int might match the return type of a gcc2
5382    builtin and then its argument prototype would still apply.  */
5383 char initscr ();
5384 char (*f) ();
5385
5386 int
5387 main ()
5388 {
5389 /* The GNU C library defines this for functions which it implements
5390     to always fail with ENOSYS.  Some functions are actually named
5391     something starting with __ and the normal name is an alias.  */
5392 #if defined (__stub_initscr) || defined (__stub___initscr)
5393 choke me
5394 #else
5395 f = initscr;
5396 #endif
5397
5398   ;
5399   return 0;
5400 }
5401 _ACEOF
5402 rm -f conftest.$ac_objext conftest$ac_exeext
5403 if { (eval echo "$as_me:5403: \"$ac_link\"") >&5
5404   (eval $ac_link) 2>&5
5405   ac_status=$?
5406   echo "$as_me:5406: \$? = $ac_status" >&5
5407   (exit $ac_status); } &&
5408          { ac_try='test -s conftest$ac_exeext'
5409   { (eval echo "$as_me:5409: \"$ac_try\"") >&5
5410   (eval $ac_try) 2>&5
5411   ac_status=$?
5412   echo "$as_me:5412: \$? = $ac_status" >&5
5413   (exit $ac_status); }; }; then
5414   ac_cv_func_initscr=yes
5415 else
5416   echo "$as_me: failed program was:" >&5
5417 cat conftest.$ac_ext >&5
5418 ac_cv_func_initscr=no
5419 fi
5420 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5421 fi
5422 echo "$as_me:5422: result: $ac_cv_func_initscr" >&5
5423 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5424 if test $ac_cv_func_initscr = yes; then
5425   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5426 else
5427
5428                 cf_save_LIBS="$LIBS"
5429                 echo "$as_me:5429: checking for initscr in -l$cf_nculib_root" >&5
5430 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5431                 LIBS="-l$cf_nculib_root $LIBS"
5432                 cat >conftest.$ac_ext <<_ACEOF
5433 #line 5433 "configure"
5434 #include "confdefs.h"
5435 #include <${cf_cv_ncurses_header-curses.h}>
5436 int
5437 main ()
5438 {
5439 initscr()
5440   ;
5441   return 0;
5442 }
5443 _ACEOF
5444 rm -f conftest.$ac_objext conftest$ac_exeext
5445 if { (eval echo "$as_me:5445: \"$ac_link\"") >&5
5446   (eval $ac_link) 2>&5
5447   ac_status=$?
5448   echo "$as_me:5448: \$? = $ac_status" >&5
5449   (exit $ac_status); } &&
5450          { ac_try='test -s conftest$ac_exeext'
5451   { (eval echo "$as_me:5451: \"$ac_try\"") >&5
5452   (eval $ac_try) 2>&5
5453   ac_status=$?
5454   echo "$as_me:5454: \$? = $ac_status" >&5
5455   (exit $ac_status); }; }; then
5456   echo "$as_me:5456: result: yes" >&5
5457 echo "${ECHO_T}yes" >&6
5458                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5459
5460 else
5461   echo "$as_me: failed program was:" >&5
5462 cat conftest.$ac_ext >&5
5463 echo "$as_me:5463: result: no" >&5
5464 echo "${ECHO_T}no" >&6
5465
5466 cf_search=
5467 cf_library_path_list=""
5468 if test -n "${LDFLAGS}${LIBS}" ; then
5469         for cf_library_path in $LDFLAGS $LIBS
5470         do
5471                 case $cf_library_path in #(vi
5472                 -L*)
5473                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5474
5475 test "$cf_library_path" != "NONE" && \
5476 test -d "$cf_library_path" && \
5477  {
5478         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5479         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5480         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5481         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5482         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5483         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"
5484 }
5485
5486                         cf_library_path_list="$cf_library_path_list $cf_search"
5487                         ;;
5488                 esac
5489         done
5490 fi
5491
5492 cf_search=
5493
5494 test "/usr" != "$prefix" && \
5495 test -d "/usr" && \
5496 (test $prefix = NONE || test "/usr" != "$prefix") && {
5497         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
5498         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
5499         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
5500         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
5501         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
5502         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
5503 }
5504
5505 test "$prefix" != "NONE" && \
5506 test -d "$prefix" && \
5507  {
5508         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5509         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5510         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5511         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5512         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5513         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5514 }
5515
5516 test "/usr/local" != "$prefix" && \
5517 test -d "/usr/local" && \
5518 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
5519         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
5520         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
5521         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
5522         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
5523         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
5524         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
5525 }
5526
5527 test "/opt" != "$prefix" && \
5528 test -d "/opt" && \
5529 (test $prefix = NONE || test "/opt" != "$prefix") && {
5530         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
5531         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
5532         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
5533         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
5534         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
5535         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
5536 }
5537
5538 test "$HOME" != "$prefix" && \
5539 test -d "$HOME" && \
5540 (test $prefix = NONE || test "$HOME" != "$prefix") && {
5541         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
5542         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
5543         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
5544         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
5545         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
5546         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
5547 }
5548
5549 cf_search="$cf_library_path_list $cf_search"
5550
5551                         for cf_libdir in $cf_search
5552                         do
5553                                 echo "$as_me:5553: checking for -l$cf_nculib_root in $cf_libdir" >&5
5554 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5555                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5556                                 cat >conftest.$ac_ext <<_ACEOF
5557 #line 5557 "configure"
5558 #include "confdefs.h"
5559 #include <${cf_cv_ncurses_header-curses.h}>
5560 int
5561 main ()
5562 {
5563 initscr()
5564   ;
5565   return 0;
5566 }
5567 _ACEOF
5568 rm -f conftest.$ac_objext conftest$ac_exeext
5569 if { (eval echo "$as_me:5569: \"$ac_link\"") >&5
5570   (eval $ac_link) 2>&5
5571   ac_status=$?
5572   echo "$as_me:5572: \$? = $ac_status" >&5
5573   (exit $ac_status); } &&
5574          { ac_try='test -s conftest$ac_exeext'
5575   { (eval echo "$as_me:5575: \"$ac_try\"") >&5
5576   (eval $ac_try) 2>&5
5577   ac_status=$?
5578   echo "$as_me:5578: \$? = $ac_status" >&5
5579   (exit $ac_status); }; }; then
5580   echo "$as_me:5580: result: yes" >&5
5581 echo "${ECHO_T}yes" >&6
5582                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5583                                          break
5584 else
5585   echo "$as_me: failed program was:" >&5
5586 cat conftest.$ac_ext >&5
5587 echo "$as_me:5587: result: no" >&5
5588 echo "${ECHO_T}no" >&6
5589                                          LIBS="$cf_save_LIBS"
5590 fi
5591 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5592                         done
5593
5594 fi
5595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5596
5597 fi
5598
5599 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5600
5601 if test $cf_found_library = no ; then
5602         { { echo "$as_me:5602: error: Cannot link $cf_nculib_root library" >&5
5603 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5604    { (exit 1); exit 1; }; }
5605 fi
5606
5607 fi
5608
5609 if test -n "$cf_ncurses_LIBS" ; then
5610         echo "$as_me:5610: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5611 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5612         cf_ncurses_SAVE="$LIBS"
5613         for p in $cf_ncurses_LIBS ; do
5614                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5615                 if test "$q" != "$LIBS" ; then
5616                         LIBS="$q"
5617                 fi
5618         done
5619         cat >conftest.$ac_ext <<_ACEOF
5620 #line 5620 "configure"
5621 #include "confdefs.h"
5622 #include <${cf_cv_ncurses_header-curses.h}>
5623 int
5624 main ()
5625 {
5626 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5627   ;
5628   return 0;
5629 }
5630 _ACEOF
5631 rm -f conftest.$ac_objext conftest$ac_exeext
5632 if { (eval echo "$as_me:5632: \"$ac_link\"") >&5
5633   (eval $ac_link) 2>&5
5634   ac_status=$?
5635   echo "$as_me:5635: \$? = $ac_status" >&5
5636   (exit $ac_status); } &&
5637          { ac_try='test -s conftest$ac_exeext'
5638   { (eval echo "$as_me:5638: \"$ac_try\"") >&5
5639   (eval $ac_try) 2>&5
5640   ac_status=$?
5641   echo "$as_me:5641: \$? = $ac_status" >&5
5642   (exit $ac_status); }; }; then
5643   echo "$as_me:5643: result: yes" >&5
5644 echo "${ECHO_T}yes" >&6
5645 else
5646   echo "$as_me: failed program was:" >&5
5647 cat conftest.$ac_ext >&5
5648 echo "$as_me:5648: result: no" >&5
5649 echo "${ECHO_T}no" >&6
5650                  LIBS="$cf_ncurses_SAVE"
5651 fi
5652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5653 fi
5654
5655 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5656
5657 cat >>confdefs.h <<EOF
5658 #define $cf_nculib_ROOT 1
5659 EOF
5660
5661 fi
5662
5663 else
5664
5665 cf_ncuconfig_root=ncurses
5666
5667 echo "Looking for ${cf_ncuconfig_root}-config"
5668 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5669 do
5670   # Extract the first word of "$ac_prog", so it can be a program name with args.
5671 set dummy $ac_prog; ac_word=$2
5672 echo "$as_me:5672: checking for $ac_word" >&5
5673 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5674 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
5675   echo $ECHO_N "(cached) $ECHO_C" >&6
5676 else
5677   case $NCURSES_CONFIG in
5678   [\\/]* | ?:[\\/]*)
5679   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
5680   ;;
5681   *)
5682   ac_save_IFS=$IFS; IFS=$ac_path_separator
5683 ac_dummy="$PATH"
5684 for ac_dir in $ac_dummy; do
5685   IFS=$ac_save_IFS
5686   test -z "$ac_dir" && ac_dir=.
5687   if $as_executable_p "$ac_dir/$ac_word"; then
5688    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
5689    echo "$as_me:5689: found $ac_dir/$ac_word" >&5
5690    break
5691 fi
5692 done
5693
5694   ;;
5695 esac
5696 fi
5697 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
5698
5699 if test -n "$NCURSES_CONFIG"; then
5700   echo "$as_me:5700: result: $NCURSES_CONFIG" >&5
5701 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5702 else
5703   echo "$as_me:5703: result: no" >&5
5704 echo "${ECHO_T}no" >&6
5705 fi
5706
5707   test -n "$NCURSES_CONFIG" && break
5708 done
5709 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
5710
5711 if test "$NCURSES_CONFIG" != none ; then
5712
5713 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5714 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5715
5716 # even with config script, some packages use no-override for curses.h
5717
5718 echo "$as_me:5718: checking if we have identified curses headers" >&5
5719 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5720 if test "${cf_cv_ncurses_header+set}" = set; then
5721   echo $ECHO_N "(cached) $ECHO_C" >&6
5722 else
5723
5724 cf_cv_ncurses_header=none
5725 for cf_header in  \
5726     ncurses/curses.h \
5727         ncurses/ncurses.h \
5728         curses.h \
5729         ncurses.h
5730 do
5731 cat >conftest.$ac_ext <<_ACEOF
5732 #line 5732 "configure"
5733 #include "confdefs.h"
5734 #include <${cf_header}>
5735 int
5736 main ()
5737 {
5738 initscr(); tgoto("?", 0,0)
5739   ;
5740   return 0;
5741 }
5742 _ACEOF
5743 rm -f conftest.$ac_objext
5744 if { (eval echo "$as_me:5744: \"$ac_compile\"") >&5
5745   (eval $ac_compile) 2>&5
5746   ac_status=$?
5747   echo "$as_me:5747: \$? = $ac_status" >&5
5748   (exit $ac_status); } &&
5749          { ac_try='test -s conftest.$ac_objext'
5750   { (eval echo "$as_me:5750: \"$ac_try\"") >&5
5751   (eval $ac_try) 2>&5
5752   ac_status=$?
5753   echo "$as_me:5753: \$? = $ac_status" >&5
5754   (exit $ac_status); }; }; then
5755   cf_cv_ncurses_header=$cf_header; break
5756 else
5757   echo "$as_me: failed program was:" >&5
5758 cat conftest.$ac_ext >&5
5759 fi
5760 rm -f conftest.$ac_objext conftest.$ac_ext
5761 done
5762
5763 fi
5764 echo "$as_me:5764: result: $cf_cv_ncurses_header" >&5
5765 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5766
5767 if test "$cf_cv_ncurses_header" = none ; then
5768         { { echo "$as_me:5768: error: No curses header-files found" >&5
5769 echo "$as_me: error: No curses header-files found" >&2;}
5770    { (exit 1); exit 1; }; }
5771 fi
5772
5773 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5774
5775 for ac_header in $cf_cv_ncurses_header
5776 do
5777 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5778 echo "$as_me:5778: checking for $ac_header" >&5
5779 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5780 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5781   echo $ECHO_N "(cached) $ECHO_C" >&6
5782 else
5783   cat >conftest.$ac_ext <<_ACEOF
5784 #line 5784 "configure"
5785 #include "confdefs.h"
5786 #include <$ac_header>
5787 _ACEOF
5788 if { (eval echo "$as_me:5788: \"$ac_cpp conftest.$ac_ext\"") >&5
5789   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5790   ac_status=$?
5791   egrep -v '^ *\+' conftest.er1 >conftest.err
5792   rm -f conftest.er1
5793   cat conftest.err >&5
5794   echo "$as_me:5794: \$? = $ac_status" >&5
5795   (exit $ac_status); } >/dev/null; then
5796   if test -s conftest.err; then
5797     ac_cpp_err=$ac_c_preproc_warn_flag
5798   else
5799     ac_cpp_err=
5800   fi
5801 else
5802   ac_cpp_err=yes
5803 fi
5804 if test -z "$ac_cpp_err"; then
5805   eval "$as_ac_Header=yes"
5806 else
5807   echo "$as_me: failed program was:" >&5
5808   cat conftest.$ac_ext >&5
5809   eval "$as_ac_Header=no"
5810 fi
5811 rm -f conftest.err conftest.$ac_ext
5812 fi
5813 echo "$as_me:5813: result: `eval echo '${'$as_ac_Header'}'`" >&5
5814 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5815 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5816   cat >>confdefs.h <<EOF
5817 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5818 EOF
5819
5820 fi
5821 done
5822
5823 cat >>confdefs.h <<\EOF
5824 #define NCURSES 1
5825 EOF
5826
5827 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5828
5829 cat >>confdefs.h <<EOF
5830 #define $cf_nculib_ROOT 1
5831 EOF
5832
5833 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5834
5835 else
5836
5837 cf_ncuhdr_root=ncurses
5838
5839 test -n "$cf_cv_curses_dir" && \
5840 test "$cf_cv_curses_dir" != "no" && { \
5841
5842 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5843   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
5844   do
5845         while test $cf_add_incdir != /usr/include
5846         do
5847           if test -d $cf_add_incdir
5848           then
5849                 cf_have_incdir=no
5850                 if test -n "$CFLAGS$CPPFLAGS" ; then
5851                   # a loop is needed to ensure we can add subdirs of existing dirs
5852                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5853                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5854                           cf_have_incdir=yes; break
5855                         fi
5856                   done
5857                 fi
5858
5859                 if test "$cf_have_incdir" = no ; then
5860                   if test "$cf_add_incdir" = /usr/local/include ; then
5861                         if test "$GCC" = yes
5862                         then
5863                           cf_save_CPPFLAGS=$CPPFLAGS
5864                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5865                           cat >conftest.$ac_ext <<_ACEOF
5866 #line 5866 "configure"
5867 #include "confdefs.h"
5868 #include <stdio.h>
5869 int
5870 main ()
5871 {
5872 printf("Hello")
5873   ;
5874   return 0;
5875 }
5876 _ACEOF
5877 rm -f conftest.$ac_objext
5878 if { (eval echo "$as_me:5878: \"$ac_compile\"") >&5
5879   (eval $ac_compile) 2>&5
5880   ac_status=$?
5881   echo "$as_me:5881: \$? = $ac_status" >&5
5882   (exit $ac_status); } &&
5883          { ac_try='test -s conftest.$ac_objext'
5884   { (eval echo "$as_me:5884: \"$ac_try\"") >&5
5885   (eval $ac_try) 2>&5
5886   ac_status=$?
5887   echo "$as_me:5887: \$? = $ac_status" >&5
5888   (exit $ac_status); }; }; then
5889   :
5890 else
5891   echo "$as_me: failed program was:" >&5
5892 cat conftest.$ac_ext >&5
5893 cf_have_incdir=yes
5894 fi
5895 rm -f conftest.$ac_objext conftest.$ac_ext
5896                           CPPFLAGS=$cf_save_CPPFLAGS
5897                         fi
5898                   fi
5899                 fi
5900
5901                 if test "$cf_have_incdir" = no ; then
5902                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5903
5904 echo "${as_me-configure}:5904: testing adding $cf_add_incdir to include-path ..." 1>&5
5905
5906                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5907
5908                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5909                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5910                   cf_add_incdir="$cf_top_incdir"
5911                 else
5912                   break
5913                 fi
5914           fi
5915         done
5916   done
5917 fi
5918
5919 }
5920
5921 echo "$as_me:5921: checking for $cf_ncuhdr_root header in include-path" >&5
5922 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5923 if test "${cf_cv_ncurses_h+set}" = set; then
5924   echo $ECHO_N "(cached) $ECHO_C" >&6
5925 else
5926
5927         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5928         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5929         for cf_header in $cf_header_list
5930         do
5931
5932         cat >conftest.$ac_ext <<_ACEOF
5933 #line 5933 "configure"
5934 #include "confdefs.h"
5935
5936 #include <$cf_header>
5937 int
5938 main ()
5939 {
5940
5941 #ifdef NCURSES_VERSION
5942
5943 printf("%s\n", NCURSES_VERSION);
5944 #else
5945 #ifdef __NCURSES_H
5946 printf("old\n");
5947 #else
5948         make an error
5949 #endif
5950 #endif
5951
5952   ;
5953   return 0;
5954 }
5955 _ACEOF
5956 rm -f conftest.$ac_objext
5957 if { (eval echo "$as_me:5957: \"$ac_compile\"") >&5
5958   (eval $ac_compile) 2>&5
5959   ac_status=$?
5960   echo "$as_me:5960: \$? = $ac_status" >&5
5961   (exit $ac_status); } &&
5962          { ac_try='test -s conftest.$ac_objext'
5963   { (eval echo "$as_me:5963: \"$ac_try\"") >&5
5964   (eval $ac_try) 2>&5
5965   ac_status=$?
5966   echo "$as_me:5966: \$? = $ac_status" >&5
5967   (exit $ac_status); }; }; then
5968   cf_cv_ncurses_h=$cf_header
5969
5970 else
5971   echo "$as_me: failed program was:" >&5
5972 cat conftest.$ac_ext >&5
5973 cf_cv_ncurses_h=no
5974 fi
5975 rm -f conftest.$ac_objext conftest.$ac_ext
5976
5977                 test "$cf_cv_ncurses_h" != no && break
5978         done
5979
5980 fi
5981 echo "$as_me:5981: result: $cf_cv_ncurses_h" >&5
5982 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5983
5984 if test "$cf_cv_ncurses_h" != no ; then
5985         cf_cv_ncurses_header=$cf_cv_ncurses_h
5986 else
5987
5988 echo "$as_me:5988: checking for $cf_ncuhdr_root include-path" >&5
5989 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5990 if test "${cf_cv_ncurses_h2+set}" = set; then
5991   echo $ECHO_N "(cached) $ECHO_C" >&6
5992 else
5993
5994         test -n "$verbose" && echo
5995
5996 cf_search=
5997
5998 # collect the current set of include-directories from compiler flags
5999 cf_header_path_list=""
6000 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6001         for cf_header_path in $CPPFLAGS $CFLAGS
6002         do
6003                 case $cf_header_path in #(vi
6004                 -I*)
6005                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6006
6007 test "$cf_header_path" != "NONE" && \
6008 test -d "$cf_header_path" && \
6009  {
6010         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6011         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6012         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6013         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6014         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6015         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"
6016 }
6017
6018                         cf_header_path_list="$cf_header_path_list $cf_search"
6019                         ;;
6020                 esac
6021         done
6022 fi
6023
6024 # add the variations for the package we are looking for
6025
6026 cf_search=
6027
6028 test "/usr" != "$prefix" && \
6029 test -d "/usr" && \
6030 (test $prefix = NONE || test "/usr" != "$prefix") && {
6031         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6032         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6033         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6034         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6035         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6036         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6037 }
6038
6039 test "$prefix" != "NONE" && \
6040 test -d "$prefix" && \
6041  {
6042         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6043         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6044         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6045         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6046         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6047         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6048 }
6049
6050 test "/usr/local" != "$prefix" && \
6051 test -d "/usr/local" && \
6052 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6053         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6054         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6055         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6056         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6057         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6058         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6059 }
6060
6061 test "/opt" != "$prefix" && \
6062 test -d "/opt" && \
6063 (test $prefix = NONE || test "/opt" != "$prefix") && {
6064         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6065         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6066         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6067         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6068         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6069         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6070 }
6071
6072 test "$HOME" != "$prefix" && \
6073 test -d "$HOME" && \
6074 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6075         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6076         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6077         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6078         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6079         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6080         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6081 }
6082
6083 test "$includedir" != NONE && \
6084 test "$includedir" != "/usr/include" && \
6085 test -d "$includedir" && {
6086         test -d $includedir &&    cf_search="$cf_search $includedir"
6087         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6088 }
6089
6090 test "$oldincludedir" != NONE && \
6091 test "$oldincludedir" != "/usr/include" && \
6092 test -d "$oldincludedir" && {
6093         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6094         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6095 }
6096
6097 cf_search="$cf_search $cf_header_path_list"
6098
6099         test -n "$verbose" && echo search path $cf_search
6100         cf_save2_CPPFLAGS="$CPPFLAGS"
6101         for cf_incdir in $cf_search
6102         do
6103
6104 if test -n "$cf_incdir" ; then
6105   for cf_add_incdir in $cf_incdir
6106   do
6107         while test $cf_add_incdir != /usr/include
6108         do
6109           if test -d $cf_add_incdir
6110           then
6111                 cf_have_incdir=no
6112                 if test -n "$CFLAGS$CPPFLAGS" ; then
6113                   # a loop is needed to ensure we can add subdirs of existing dirs
6114                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6115                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6116                           cf_have_incdir=yes; break
6117                         fi
6118                   done
6119                 fi
6120
6121                 if test "$cf_have_incdir" = no ; then
6122                   if test "$cf_add_incdir" = /usr/local/include ; then
6123                         if test "$GCC" = yes
6124                         then
6125                           cf_save_CPPFLAGS=$CPPFLAGS
6126                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6127                           cat >conftest.$ac_ext <<_ACEOF
6128 #line 6128 "configure"
6129 #include "confdefs.h"
6130 #include <stdio.h>
6131 int
6132 main ()
6133 {
6134 printf("Hello")
6135   ;
6136   return 0;
6137 }
6138 _ACEOF
6139 rm -f conftest.$ac_objext
6140 if { (eval echo "$as_me:6140: \"$ac_compile\"") >&5
6141   (eval $ac_compile) 2>&5
6142   ac_status=$?
6143   echo "$as_me:6143: \$? = $ac_status" >&5
6144   (exit $ac_status); } &&
6145          { ac_try='test -s conftest.$ac_objext'
6146   { (eval echo "$as_me:6146: \"$ac_try\"") >&5
6147   (eval $ac_try) 2>&5
6148   ac_status=$?
6149   echo "$as_me:6149: \$? = $ac_status" >&5
6150   (exit $ac_status); }; }; then
6151   :
6152 else
6153   echo "$as_me: failed program was:" >&5
6154 cat conftest.$ac_ext >&5
6155 cf_have_incdir=yes
6156 fi
6157 rm -f conftest.$ac_objext conftest.$ac_ext
6158                           CPPFLAGS=$cf_save_CPPFLAGS
6159                         fi
6160                   fi
6161                 fi
6162
6163                 if test "$cf_have_incdir" = no ; then
6164                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6165
6166 echo "${as_me-configure}:6166: testing adding $cf_add_incdir to include-path ..." 1>&5
6167
6168                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6169
6170                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6171                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6172                   cf_add_incdir="$cf_top_incdir"
6173                 else
6174                   break
6175                 fi
6176           fi
6177         done
6178   done
6179 fi
6180
6181                 for cf_header in \
6182                         ncurses.h \
6183                         curses.h
6184                 do
6185
6186         cat >conftest.$ac_ext <<_ACEOF
6187 #line 6187 "configure"
6188 #include "confdefs.h"
6189
6190 #include <$cf_header>
6191 int
6192 main ()
6193 {
6194
6195 #ifdef NCURSES_VERSION
6196
6197 printf("%s\n", NCURSES_VERSION);
6198 #else
6199 #ifdef __NCURSES_H
6200 printf("old\n");
6201 #else
6202         make an error
6203 #endif
6204 #endif
6205
6206   ;
6207   return 0;
6208 }
6209 _ACEOF
6210 rm -f conftest.$ac_objext
6211 if { (eval echo "$as_me:6211: \"$ac_compile\"") >&5
6212   (eval $ac_compile) 2>&5
6213   ac_status=$?
6214   echo "$as_me:6214: \$? = $ac_status" >&5
6215   (exit $ac_status); } &&
6216          { ac_try='test -s conftest.$ac_objext'
6217   { (eval echo "$as_me:6217: \"$ac_try\"") >&5
6218   (eval $ac_try) 2>&5
6219   ac_status=$?
6220   echo "$as_me:6220: \$? = $ac_status" >&5
6221   (exit $ac_status); }; }; then
6222   cf_cv_ncurses_h2=$cf_header
6223
6224 else
6225   echo "$as_me: failed program was:" >&5
6226 cat conftest.$ac_ext >&5
6227 cf_cv_ncurses_h2=no
6228 fi
6229 rm -f conftest.$ac_objext conftest.$ac_ext
6230
6231                         if test "$cf_cv_ncurses_h2" != no ; then
6232                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6233                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6234                                 break
6235                         fi
6236                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6237                 done
6238                 CPPFLAGS="$cf_save2_CPPFLAGS"
6239                 test "$cf_cv_ncurses_h2" != no && break
6240         done
6241         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6241: error: not found" >&5
6242 echo "$as_me: error: not found" >&2;}
6243    { (exit 1); exit 1; }; }
6244
6245 fi
6246 echo "$as_me:6246: result: $cf_cv_ncurses_h2" >&5
6247 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6248
6249         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6250         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6251         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6252                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6253         fi
6254
6255 if test -n "$cf_1st_incdir" ; then
6256   for cf_add_incdir in $cf_1st_incdir
6257   do
6258         while test $cf_add_incdir != /usr/include
6259         do
6260           if test -d $cf_add_incdir
6261           then
6262                 cf_have_incdir=no
6263                 if test -n "$CFLAGS$CPPFLAGS" ; then
6264                   # a loop is needed to ensure we can add subdirs of existing dirs
6265                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6266                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6267                           cf_have_incdir=yes; break
6268                         fi
6269                   done
6270                 fi
6271
6272                 if test "$cf_have_incdir" = no ; then
6273                   if test "$cf_add_incdir" = /usr/local/include ; then
6274                         if test "$GCC" = yes
6275                         then
6276                           cf_save_CPPFLAGS=$CPPFLAGS
6277                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6278                           cat >conftest.$ac_ext <<_ACEOF
6279 #line 6279 "configure"
6280 #include "confdefs.h"
6281 #include <stdio.h>
6282 int
6283 main ()
6284 {
6285 printf("Hello")
6286   ;
6287   return 0;
6288 }
6289 _ACEOF
6290 rm -f conftest.$ac_objext
6291 if { (eval echo "$as_me:6291: \"$ac_compile\"") >&5
6292   (eval $ac_compile) 2>&5
6293   ac_status=$?
6294   echo "$as_me:6294: \$? = $ac_status" >&5
6295   (exit $ac_status); } &&
6296          { ac_try='test -s conftest.$ac_objext'
6297   { (eval echo "$as_me:6297: \"$ac_try\"") >&5
6298   (eval $ac_try) 2>&5
6299   ac_status=$?
6300   echo "$as_me:6300: \$? = $ac_status" >&5
6301   (exit $ac_status); }; }; then
6302   :
6303 else
6304   echo "$as_me: failed program was:" >&5
6305 cat conftest.$ac_ext >&5
6306 cf_have_incdir=yes
6307 fi
6308 rm -f conftest.$ac_objext conftest.$ac_ext
6309                           CPPFLAGS=$cf_save_CPPFLAGS
6310                         fi
6311                   fi
6312                 fi
6313
6314                 if test "$cf_have_incdir" = no ; then
6315                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6316
6317 echo "${as_me-configure}:6317: testing adding $cf_add_incdir to include-path ..." 1>&5
6318
6319                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6320
6321                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6322                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6323                   cf_add_incdir="$cf_top_incdir"
6324                 else
6325                   break
6326                 fi
6327           fi
6328         done
6329   done
6330 fi
6331
6332 fi
6333
6334 # Set definitions to allow ifdef'ing for ncurses.h
6335
6336 case $cf_cv_ncurses_header in # (vi
6337 *ncurses.h)
6338         cat >>confdefs.h <<\EOF
6339 #define HAVE_NCURSES_H 1
6340 EOF
6341
6342         ;;
6343 esac
6344
6345 case $cf_cv_ncurses_header in # (vi
6346 ncurses/curses.h|ncurses/ncurses.h)
6347         cat >>confdefs.h <<\EOF
6348 #define HAVE_NCURSES_NCURSES_H 1
6349 EOF
6350
6351         ;;
6352 ncursesw/curses.h|ncursesw/ncurses.h)
6353         cat >>confdefs.h <<\EOF
6354 #define HAVE_NCURSESW_NCURSES_H 1
6355 EOF
6356
6357         ;;
6358 esac
6359
6360 echo "$as_me:6360: checking for terminfo header" >&5
6361 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6362 if test "${cf_cv_term_header+set}" = set; then
6363   echo $ECHO_N "(cached) $ECHO_C" >&6
6364 else
6365
6366 case ${cf_cv_ncurses_header} in #(vi
6367 */ncurses.h|*/ncursesw.h) #(vi
6368         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6369         ;;
6370 *)
6371         cf_term_header=term.h
6372         ;;
6373 esac
6374
6375 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6376 do
6377 cat >conftest.$ac_ext <<_ACEOF
6378 #line 6378 "configure"
6379 #include "confdefs.h"
6380 #include <stdio.h>
6381 #include <${cf_cv_ncurses_header-curses.h}>
6382 #include <$cf_test>
6383
6384 int
6385 main ()
6386 {
6387 int x = auto_left_margin
6388   ;
6389   return 0;
6390 }
6391 _ACEOF
6392 rm -f conftest.$ac_objext
6393 if { (eval echo "$as_me:6393: \"$ac_compile\"") >&5
6394   (eval $ac_compile) 2>&5
6395   ac_status=$?
6396   echo "$as_me:6396: \$? = $ac_status" >&5
6397   (exit $ac_status); } &&
6398          { ac_try='test -s conftest.$ac_objext'
6399   { (eval echo "$as_me:6399: \"$ac_try\"") >&5
6400   (eval $ac_try) 2>&5
6401   ac_status=$?
6402   echo "$as_me:6402: \$? = $ac_status" >&5
6403   (exit $ac_status); }; }; then
6404
6405         cf_cv_term_header="$cf_test"
6406 else
6407   echo "$as_me: failed program was:" >&5
6408 cat conftest.$ac_ext >&5
6409
6410         cf_cv_term_header=unknown
6411
6412 fi
6413 rm -f conftest.$ac_objext conftest.$ac_ext
6414         test "$cf_cv_term_header" != unknown && break
6415 done
6416
6417 fi
6418 echo "$as_me:6418: result: $cf_cv_term_header" >&5
6419 echo "${ECHO_T}$cf_cv_term_header" >&6
6420
6421 # Set definitions to allow ifdef'ing to accommodate subdirectories
6422
6423 case $cf_cv_term_header in # (vi
6424 *term.h)
6425         cat >>confdefs.h <<\EOF
6426 #define HAVE_TERM_H 1
6427 EOF
6428
6429         ;;
6430 esac
6431
6432 case $cf_cv_term_header in # (vi
6433 ncurses/term.h) #(vi
6434         cat >>confdefs.h <<\EOF
6435 #define HAVE_NCURSES_TERM_H 1
6436 EOF
6437
6438         ;;
6439 ncursesw/term.h)
6440         cat >>confdefs.h <<\EOF
6441 #define HAVE_NCURSESW_TERM_H 1
6442 EOF
6443
6444         ;;
6445 esac
6446
6447 # some applications need this, but should check for NCURSES_VERSION
6448 cat >>confdefs.h <<\EOF
6449 #define NCURSES 1
6450 EOF
6451
6452 echo "$as_me:6452: checking for ncurses version" >&5
6453 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6454 if test "${cf_cv_ncurses_version+set}" = set; then
6455   echo $ECHO_N "(cached) $ECHO_C" >&6
6456 else
6457
6458         cf_cv_ncurses_version=no
6459         cf_tempfile=out$$
6460         rm -f $cf_tempfile
6461         if test "$cross_compiling" = yes; then
6462
6463         # This will not work if the preprocessor splits the line after the
6464         # Autoconf token.  The 'unproto' program does that.
6465         cat > conftest.$ac_ext <<EOF
6466 #include <${cf_cv_ncurses_header-curses.h}>
6467 #undef Autoconf
6468 #ifdef NCURSES_VERSION
6469 Autoconf NCURSES_VERSION
6470 #else
6471 #ifdef __NCURSES_H
6472 Autoconf "old"
6473 #endif
6474 ;
6475 #endif
6476 EOF
6477         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6478         { (eval echo "$as_me:6478: \"$cf_try\"") >&5
6479   (eval $cf_try) 2>&5
6480   ac_status=$?
6481   echo "$as_me:6481: \$? = $ac_status" >&5
6482   (exit $ac_status); }
6483         if test -f conftest.out ; then
6484                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6485                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6486                 rm -f conftest.out
6487         fi
6488
6489 else
6490   cat >conftest.$ac_ext <<_ACEOF
6491 #line 6491 "configure"
6492 #include "confdefs.h"
6493
6494 #include <${cf_cv_ncurses_header-curses.h}>
6495 #include <stdio.h>
6496 int main()
6497 {
6498         FILE *fp = fopen("$cf_tempfile", "w");
6499 #ifdef NCURSES_VERSION
6500 # ifdef NCURSES_VERSION_PATCH
6501         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6502 # else
6503         fprintf(fp, "%s\n", NCURSES_VERSION);
6504 # endif
6505 #else
6506 # ifdef __NCURSES_H
6507         fprintf(fp, "old\n");
6508 # else
6509         make an error
6510 # endif
6511 #endif
6512         ${cf_cv_main_return-return}(0);
6513 }
6514 _ACEOF
6515 rm -f conftest$ac_exeext
6516 if { (eval echo "$as_me:6516: \"$ac_link\"") >&5
6517   (eval $ac_link) 2>&5
6518   ac_status=$?
6519   echo "$as_me:6519: \$? = $ac_status" >&5
6520   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6521   { (eval echo "$as_me:6521: \"$ac_try\"") >&5
6522   (eval $ac_try) 2>&5
6523   ac_status=$?
6524   echo "$as_me:6524: \$? = $ac_status" >&5
6525   (exit $ac_status); }; }; then
6526
6527         cf_cv_ncurses_version=`cat $cf_tempfile`
6528 else
6529   echo "$as_me: program exited with status $ac_status" >&5
6530 echo "$as_me: failed program was:" >&5
6531 cat conftest.$ac_ext >&5
6532 fi
6533 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6534 fi
6535         rm -f $cf_tempfile
6536
6537 fi
6538 echo "$as_me:6538: result: $cf_cv_ncurses_version" >&5
6539 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6540 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
6541 #define NCURSES 1
6542 EOF
6543
6544 cf_nculib_root=ncurses
6545         # This works, except for the special case where we find gpm, but
6546         # ncurses is in a nonstandard location via $LIBS, and we really want
6547         # to link gpm.
6548 cf_ncurses_LIBS=""
6549 cf_ncurses_SAVE="$LIBS"
6550 echo "$as_me:6550: checking for Gpm_Open in -lgpm" >&5
6551 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6552 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6553   echo $ECHO_N "(cached) $ECHO_C" >&6
6554 else
6555   ac_check_lib_save_LIBS=$LIBS
6556 LIBS="-lgpm  $LIBS"
6557 cat >conftest.$ac_ext <<_ACEOF
6558 #line 6558 "configure"
6559 #include "confdefs.h"
6560
6561 /* Override any gcc2 internal prototype to avoid an error.  */
6562 #ifdef __cplusplus
6563 extern "C"
6564 #endif
6565 /* We use char because int might match the return type of a gcc2
6566    builtin and then its argument prototype would still apply.  */
6567 char Gpm_Open ();
6568 int
6569 main ()
6570 {
6571 Gpm_Open ();
6572   ;
6573   return 0;
6574 }
6575 _ACEOF
6576 rm -f conftest.$ac_objext conftest$ac_exeext
6577 if { (eval echo "$as_me:6577: \"$ac_link\"") >&5
6578   (eval $ac_link) 2>&5
6579   ac_status=$?
6580   echo "$as_me:6580: \$? = $ac_status" >&5
6581   (exit $ac_status); } &&
6582          { ac_try='test -s conftest$ac_exeext'
6583   { (eval echo "$as_me:6583: \"$ac_try\"") >&5
6584   (eval $ac_try) 2>&5
6585   ac_status=$?
6586   echo "$as_me:6586: \$? = $ac_status" >&5
6587   (exit $ac_status); }; }; then
6588   ac_cv_lib_gpm_Gpm_Open=yes
6589 else
6590   echo "$as_me: failed program was:" >&5
6591 cat conftest.$ac_ext >&5
6592 ac_cv_lib_gpm_Gpm_Open=no
6593 fi
6594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6595 LIBS=$ac_check_lib_save_LIBS
6596 fi
6597 echo "$as_me:6597: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6598 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6599 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6600   echo "$as_me:6600: checking for initscr in -lgpm" >&5
6601 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6602 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6603   echo $ECHO_N "(cached) $ECHO_C" >&6
6604 else
6605   ac_check_lib_save_LIBS=$LIBS
6606 LIBS="-lgpm  $LIBS"
6607 cat >conftest.$ac_ext <<_ACEOF
6608 #line 6608 "configure"
6609 #include "confdefs.h"
6610
6611 /* Override any gcc2 internal prototype to avoid an error.  */
6612 #ifdef __cplusplus
6613 extern "C"
6614 #endif
6615 /* We use char because int might match the return type of a gcc2
6616    builtin and then its argument prototype would still apply.  */
6617 char initscr ();
6618 int
6619 main ()
6620 {
6621 initscr ();
6622   ;
6623   return 0;
6624 }
6625 _ACEOF
6626 rm -f conftest.$ac_objext conftest$ac_exeext
6627 if { (eval echo "$as_me:6627: \"$ac_link\"") >&5
6628   (eval $ac_link) 2>&5
6629   ac_status=$?
6630   echo "$as_me:6630: \$? = $ac_status" >&5
6631   (exit $ac_status); } &&
6632          { ac_try='test -s conftest$ac_exeext'
6633   { (eval echo "$as_me:6633: \"$ac_try\"") >&5
6634   (eval $ac_try) 2>&5
6635   ac_status=$?
6636   echo "$as_me:6636: \$? = $ac_status" >&5
6637   (exit $ac_status); }; }; then
6638   ac_cv_lib_gpm_initscr=yes
6639 else
6640   echo "$as_me: failed program was:" >&5
6641 cat conftest.$ac_ext >&5
6642 ac_cv_lib_gpm_initscr=no
6643 fi
6644 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6645 LIBS=$ac_check_lib_save_LIBS
6646 fi
6647 echo "$as_me:6647: result: $ac_cv_lib_gpm_initscr" >&5
6648 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6649 if test $ac_cv_lib_gpm_initscr = yes; then
6650   LIBS="$cf_ncurses_SAVE"
6651 else
6652   cf_ncurses_LIBS="-lgpm"
6653 fi
6654
6655 fi
6656
6657 case $host_os in #(vi
6658 freebsd*)
6659         # This is only necessary if you are linking against an obsolete
6660         # version of ncurses (but it should do no harm, since it's static).
6661         if test "$cf_nculib_root" = ncurses ; then
6662                 echo "$as_me:6662: checking for tgoto in -lmytinfo" >&5
6663 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6664 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6665   echo $ECHO_N "(cached) $ECHO_C" >&6
6666 else
6667   ac_check_lib_save_LIBS=$LIBS
6668 LIBS="-lmytinfo  $LIBS"
6669 cat >conftest.$ac_ext <<_ACEOF
6670 #line 6670 "configure"
6671 #include "confdefs.h"
6672
6673 /* Override any gcc2 internal prototype to avoid an error.  */
6674 #ifdef __cplusplus
6675 extern "C"
6676 #endif
6677 /* We use char because int might match the return type of a gcc2
6678    builtin and then its argument prototype would still apply.  */
6679 char tgoto ();
6680 int
6681 main ()
6682 {
6683 tgoto ();
6684   ;
6685   return 0;
6686 }
6687 _ACEOF
6688 rm -f conftest.$ac_objext conftest$ac_exeext
6689 if { (eval echo "$as_me:6689: \"$ac_link\"") >&5
6690   (eval $ac_link) 2>&5
6691   ac_status=$?
6692   echo "$as_me:6692: \$? = $ac_status" >&5
6693   (exit $ac_status); } &&
6694          { ac_try='test -s conftest$ac_exeext'
6695   { (eval echo "$as_me:6695: \"$ac_try\"") >&5
6696   (eval $ac_try) 2>&5
6697   ac_status=$?
6698   echo "$as_me:6698: \$? = $ac_status" >&5
6699   (exit $ac_status); }; }; then
6700   ac_cv_lib_mytinfo_tgoto=yes
6701 else
6702   echo "$as_me: failed program was:" >&5
6703 cat conftest.$ac_ext >&5
6704 ac_cv_lib_mytinfo_tgoto=no
6705 fi
6706 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6707 LIBS=$ac_check_lib_save_LIBS
6708 fi
6709 echo "$as_me:6709: result: $ac_cv_lib_mytinfo_tgoto" >&5
6710 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6711 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6712   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6713 fi
6714
6715         fi
6716         ;;
6717 esac
6718
6719 LIBS="$cf_ncurses_LIBS $LIBS"
6720
6721 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6722 then
6723
6724 if test -n "$cf_cv_curses_dir/lib" ; then
6725   for cf_add_libdir in $cf_cv_curses_dir/lib
6726   do
6727     if test $cf_add_libdir = /usr/lib ; then
6728       :
6729     elif test -d $cf_add_libdir
6730     then
6731       cf_have_libdir=no
6732       if test -n "$LDFLAGS$LIBS" ; then
6733         # a loop is needed to ensure we can add subdirs of existing dirs
6734         for cf_test_libdir in $LDFLAGS $LIBS ; do
6735           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6736             cf_have_libdir=yes; break
6737           fi
6738         done
6739       fi
6740       if test "$cf_have_libdir" = no ; then
6741         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6742
6743 echo "${as_me-configure}:6743: testing adding $cf_add_libdir to library-path ..." 1>&5
6744
6745         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6746       fi
6747     fi
6748   done
6749 fi
6750
6751         LIBS="-l$cf_nculib_root $LIBS"
6752 else
6753
6754         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6755         cf_libdir=""
6756         echo "$as_me:6756: checking for initscr" >&5
6757 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6758 if test "${ac_cv_func_initscr+set}" = set; then
6759   echo $ECHO_N "(cached) $ECHO_C" >&6
6760 else
6761   cat >conftest.$ac_ext <<_ACEOF
6762 #line 6762 "configure"
6763 #include "confdefs.h"
6764 /* System header to define __stub macros and hopefully few prototypes,
6765     which can conflict with char initscr (); below.  */
6766 #include <assert.h>
6767 /* Override any gcc2 internal prototype to avoid an error.  */
6768 #ifdef __cplusplus
6769 extern "C"
6770 #endif
6771 /* We use char because int might match the return type of a gcc2
6772    builtin and then its argument prototype would still apply.  */
6773 char initscr ();
6774 char (*f) ();
6775
6776 int
6777 main ()
6778 {
6779 /* The GNU C library defines this for functions which it implements
6780     to always fail with ENOSYS.  Some functions are actually named
6781     something starting with __ and the normal name is an alias.  */
6782 #if defined (__stub_initscr) || defined (__stub___initscr)
6783 choke me
6784 #else
6785 f = initscr;
6786 #endif
6787
6788   ;
6789   return 0;
6790 }
6791 _ACEOF
6792 rm -f conftest.$ac_objext conftest$ac_exeext
6793 if { (eval echo "$as_me:6793: \"$ac_link\"") >&5
6794   (eval $ac_link) 2>&5
6795   ac_status=$?
6796   echo "$as_me:6796: \$? = $ac_status" >&5
6797   (exit $ac_status); } &&
6798          { ac_try='test -s conftest$ac_exeext'
6799   { (eval echo "$as_me:6799: \"$ac_try\"") >&5
6800   (eval $ac_try) 2>&5
6801   ac_status=$?
6802   echo "$as_me:6802: \$? = $ac_status" >&5
6803   (exit $ac_status); }; }; then
6804   ac_cv_func_initscr=yes
6805 else
6806   echo "$as_me: failed program was:" >&5
6807 cat conftest.$ac_ext >&5
6808 ac_cv_func_initscr=no
6809 fi
6810 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6811 fi
6812 echo "$as_me:6812: result: $ac_cv_func_initscr" >&5
6813 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6814 if test $ac_cv_func_initscr = yes; then
6815   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6816 else
6817
6818                 cf_save_LIBS="$LIBS"
6819                 echo "$as_me:6819: checking for initscr in -l$cf_nculib_root" >&5
6820 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6821                 LIBS="-l$cf_nculib_root $LIBS"
6822                 cat >conftest.$ac_ext <<_ACEOF
6823 #line 6823 "configure"
6824 #include "confdefs.h"
6825 #include <${cf_cv_ncurses_header-curses.h}>
6826 int
6827 main ()
6828 {
6829 initscr()
6830   ;
6831   return 0;
6832 }
6833 _ACEOF
6834 rm -f conftest.$ac_objext conftest$ac_exeext
6835 if { (eval echo "$as_me:6835: \"$ac_link\"") >&5
6836   (eval $ac_link) 2>&5
6837   ac_status=$?
6838   echo "$as_me:6838: \$? = $ac_status" >&5
6839   (exit $ac_status); } &&
6840          { ac_try='test -s conftest$ac_exeext'
6841   { (eval echo "$as_me:6841: \"$ac_try\"") >&5
6842   (eval $ac_try) 2>&5
6843   ac_status=$?
6844   echo "$as_me:6844: \$? = $ac_status" >&5
6845   (exit $ac_status); }; }; then
6846   echo "$as_me:6846: result: yes" >&5
6847 echo "${ECHO_T}yes" >&6
6848                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6849
6850 else
6851   echo "$as_me: failed program was:" >&5
6852 cat conftest.$ac_ext >&5
6853 echo "$as_me:6853: result: no" >&5
6854 echo "${ECHO_T}no" >&6
6855
6856 cf_search=
6857 cf_library_path_list=""
6858 if test -n "${LDFLAGS}${LIBS}" ; then
6859         for cf_library_path in $LDFLAGS $LIBS
6860         do
6861                 case $cf_library_path in #(vi
6862                 -L*)
6863                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6864
6865 test "$cf_library_path" != "NONE" && \
6866 test -d "$cf_library_path" && \
6867  {
6868         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6869         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6870         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6871         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6872         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6873         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"
6874 }
6875
6876                         cf_library_path_list="$cf_library_path_list $cf_search"
6877                         ;;
6878                 esac
6879         done
6880 fi
6881
6882 cf_search=
6883
6884 test "/usr" != "$prefix" && \
6885 test -d "/usr" && \
6886 (test $prefix = NONE || test "/usr" != "$prefix") && {
6887         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6888         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6889         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6890         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6891         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6892         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6893 }
6894
6895 test "$prefix" != "NONE" && \
6896 test -d "$prefix" && \
6897  {
6898         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6899         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6900         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6901         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6902         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6903         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6904 }
6905
6906 test "/usr/local" != "$prefix" && \
6907 test -d "/usr/local" && \
6908 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6909         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6910         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6911         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6912         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6913         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6914         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6915 }
6916
6917 test "/opt" != "$prefix" && \
6918 test -d "/opt" && \
6919 (test $prefix = NONE || test "/opt" != "$prefix") && {
6920         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6921         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6922         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6923         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6924         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6925         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6926 }
6927
6928 test "$HOME" != "$prefix" && \
6929 test -d "$HOME" && \
6930 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6931         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6932         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6933         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6934         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6935         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6936         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6937 }
6938
6939 cf_search="$cf_library_path_list $cf_search"
6940
6941                         for cf_libdir in $cf_search
6942                         do
6943                                 echo "$as_me:6943: checking for -l$cf_nculib_root in $cf_libdir" >&5
6944 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6945                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6946                                 cat >conftest.$ac_ext <<_ACEOF
6947 #line 6947 "configure"
6948 #include "confdefs.h"
6949 #include <${cf_cv_ncurses_header-curses.h}>
6950 int
6951 main ()
6952 {
6953 initscr()
6954   ;
6955   return 0;
6956 }
6957 _ACEOF
6958 rm -f conftest.$ac_objext conftest$ac_exeext
6959 if { (eval echo "$as_me:6959: \"$ac_link\"") >&5
6960   (eval $ac_link) 2>&5
6961   ac_status=$?
6962   echo "$as_me:6962: \$? = $ac_status" >&5
6963   (exit $ac_status); } &&
6964          { ac_try='test -s conftest$ac_exeext'
6965   { (eval echo "$as_me:6965: \"$ac_try\"") >&5
6966   (eval $ac_try) 2>&5
6967   ac_status=$?
6968   echo "$as_me:6968: \$? = $ac_status" >&5
6969   (exit $ac_status); }; }; then
6970   echo "$as_me:6970: result: yes" >&5
6971 echo "${ECHO_T}yes" >&6
6972                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6973                                          break
6974 else
6975   echo "$as_me: failed program was:" >&5
6976 cat conftest.$ac_ext >&5
6977 echo "$as_me:6977: result: no" >&5
6978 echo "${ECHO_T}no" >&6
6979                                          LIBS="$cf_save_LIBS"
6980 fi
6981 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6982                         done
6983
6984 fi
6985 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6986
6987 fi
6988
6989 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6990
6991 if test $cf_found_library = no ; then
6992         { { echo "$as_me:6992: error: Cannot link $cf_nculib_root library" >&5
6993 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6994    { (exit 1); exit 1; }; }
6995 fi
6996
6997 fi
6998
6999 if test -n "$cf_ncurses_LIBS" ; then
7000         echo "$as_me:7000: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7001 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7002         cf_ncurses_SAVE="$LIBS"
7003         for p in $cf_ncurses_LIBS ; do
7004                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7005                 if test "$q" != "$LIBS" ; then
7006                         LIBS="$q"
7007                 fi
7008         done
7009         cat >conftest.$ac_ext <<_ACEOF
7010 #line 7010 "configure"
7011 #include "confdefs.h"
7012 #include <${cf_cv_ncurses_header-curses.h}>
7013 int
7014 main ()
7015 {
7016 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7017   ;
7018   return 0;
7019 }
7020 _ACEOF
7021 rm -f conftest.$ac_objext conftest$ac_exeext
7022 if { (eval echo "$as_me:7022: \"$ac_link\"") >&5
7023   (eval $ac_link) 2>&5
7024   ac_status=$?
7025   echo "$as_me:7025: \$? = $ac_status" >&5
7026   (exit $ac_status); } &&
7027          { ac_try='test -s conftest$ac_exeext'
7028   { (eval echo "$as_me:7028: \"$ac_try\"") >&5
7029   (eval $ac_try) 2>&5
7030   ac_status=$?
7031   echo "$as_me:7031: \$? = $ac_status" >&5
7032   (exit $ac_status); }; }; then
7033   echo "$as_me:7033: result: yes" >&5
7034 echo "${ECHO_T}yes" >&6
7035 else
7036   echo "$as_me: failed program was:" >&5
7037 cat conftest.$ac_ext >&5
7038 echo "$as_me:7038: result: no" >&5
7039 echo "${ECHO_T}no" >&6
7040                  LIBS="$cf_ncurses_SAVE"
7041 fi
7042 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7043 fi
7044
7045 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7046
7047 cat >>confdefs.h <<EOF
7048 #define $cf_nculib_ROOT 1
7049 EOF
7050
7051 fi
7052
7053 fi
7054
7055 if test "$NCURSES_CONFIG" != none ; then
7056
7057 cf_version=`$NCURSES_CONFIG --version`
7058
7059 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7060 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9]\+\.//' -e 's/\..*//'`
7061 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9]\+\.[0-9]\+\.//'`
7062
7063 # ABI version is not available from headers
7064 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7065
7066 else
7067
7068 for cf_name in MAJOR MINOR PATCH
7069 do
7070 cat >conftest.$ac_ext <<CF_EOF
7071 #include <${cf_cv_ncurses_header-curses.h}>
7072 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7073 CF_EOF
7074         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7075         { (eval echo "$as_me:7075: \"$cf_try\"") >&5
7076   (eval $cf_try) 2>&5
7077   ac_status=$?
7078   echo "$as_me:7078: \$? = $ac_status" >&5
7079   (exit $ac_status); }
7080         if test -f conftest.out ; then
7081                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ]\+//"`
7082                 eval NCURSES_$cf_name=$cf_result
7083                 cat conftest.$ac_ext
7084                 cat conftest.out
7085         fi
7086 done
7087
7088 cf_cv_abi_version=${NCURSES_MAJOR}
7089
7090 fi
7091
7092 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7093
7094 cf_cv_timestamp=`date`
7095
7096 echo "$as_me:7096: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7097 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7098
7099         case $cf_cv_system_name in #(vi
7100         OS/2*|os2*) #(vi
7101         LIB_PREFIX=''
7102         ;;
7103         *)      LIB_PREFIX='lib'
7104         ;;
7105         esac
7106 cf_prefix=$LIB_PREFIX
7107
7108 LIB_PREFIX=$cf_prefix
7109
7110 LIB_SUFFIX=
7111
7112 ###############################################################################
7113
7114 if test X"$CC_G_OPT" = X"" ; then
7115         CC_G_OPT='-g'
7116         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7117 fi
7118
7119 echo "$as_me:7119: checking for default loader flags" >&5
7120 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7121 case $DFT_LWR_MODEL in
7122 normal)  LD_MODEL=''   ;;
7123 debug)   LD_MODEL=$CC_G_OPT ;;
7124 profile) LD_MODEL='-pg';;
7125 shared)  LD_MODEL=''   ;;
7126 esac
7127 echo "$as_me:7127: result: $LD_MODEL" >&5
7128 echo "${ECHO_T}$LD_MODEL" >&6
7129
7130 LD_RPATH_OPT=
7131 echo "$as_me:7131: checking for an rpath option" >&5
7132 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7133 case $cf_cv_system_name in #(vi
7134 irix*) #(vi
7135         if test "$GCC" = yes; then
7136                 LD_RPATH_OPT="-Wl,-rpath,"
7137         else
7138                 LD_RPATH_OPT="-rpath "
7139         fi
7140         ;;
7141 linux*|gnu*|k*bsd*-gnu) #(vi
7142         LD_RPATH_OPT="-Wl,-rpath,"
7143         ;;
7144 openbsd[2-9].*) #(vi
7145         LD_RPATH_OPT="-Wl,-rpath,"
7146         ;;
7147 freebsd*) #(vi
7148         LD_RPATH_OPT="-rpath "
7149         ;;
7150 netbsd*) #(vi
7151         LD_RPATH_OPT="-Wl,-rpath,"
7152         ;;
7153 osf*|mls+*) #(vi
7154         LD_RPATH_OPT="-rpath "
7155         ;;
7156 solaris2*) #(vi
7157         LD_RPATH_OPT="-R"
7158         ;;
7159 *)
7160         ;;
7161 esac
7162 echo "$as_me:7162: result: $LD_RPATH_OPT" >&5
7163 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7164
7165 case "x$LD_RPATH_OPT" in #(vi
7166 x-R*)
7167         echo "$as_me:7167: checking if we need a space after rpath option" >&5
7168 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7169         cf_save_LIBS="$LIBS"
7170         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
7171         cat >conftest.$ac_ext <<_ACEOF
7172 #line 7172 "configure"
7173 #include "confdefs.h"
7174
7175 int
7176 main ()
7177 {
7178
7179   ;
7180   return 0;
7181 }
7182 _ACEOF
7183 rm -f conftest.$ac_objext conftest$ac_exeext
7184 if { (eval echo "$as_me:7184: \"$ac_link\"") >&5
7185   (eval $ac_link) 2>&5
7186   ac_status=$?
7187   echo "$as_me:7187: \$? = $ac_status" >&5
7188   (exit $ac_status); } &&
7189          { ac_try='test -s conftest$ac_exeext'
7190   { (eval echo "$as_me:7190: \"$ac_try\"") >&5
7191   (eval $ac_try) 2>&5
7192   ac_status=$?
7193   echo "$as_me:7193: \$? = $ac_status" >&5
7194   (exit $ac_status); }; }; then
7195   cf_rpath_space=no
7196 else
7197   echo "$as_me: failed program was:" >&5
7198 cat conftest.$ac_ext >&5
7199 cf_rpath_space=yes
7200 fi
7201 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7202         LIBS="$cf_save_LIBS"
7203         echo "$as_me:7203: result: $cf_rpath_space" >&5
7204 echo "${ECHO_T}$cf_rpath_space" >&6
7205         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7206         ;;
7207 esac
7208
7209         LOCAL_LDFLAGS=
7210         LOCAL_LDFLAGS2=
7211         LD_SHARED_OPTS=
7212         INSTALL_LIB="-m 644"
7213
7214         cf_cv_do_symlinks=no
7215         cf_ld_rpath_opt=
7216         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7217
7218         echo "$as_me:7218: checking if release/abi version should be used for shared libs" >&5
7219 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7220
7221 # Check whether --with-shlib-version or --without-shlib-version was given.
7222 if test "${with_shlib_version+set}" = set; then
7223   withval="$with_shlib_version"
7224   test -z "$withval" && withval=auto
7225         case $withval in #(vi
7226         yes) #(vi
7227                 cf_cv_shlib_version=auto
7228                 ;;
7229         rel|abi|auto|no) #(vi
7230                 cf_cv_shlib_version=$withval
7231                 ;;
7232         *)
7233                 { { echo "$as_me:7233: error: option value must be one of: rel, abi, auto or no" >&5
7234 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7235    { (exit 1); exit 1; }; }
7236                 ;;
7237         esac
7238
7239 else
7240   cf_cv_shlib_version=auto
7241 fi;
7242         echo "$as_me:7242: result: $cf_cv_shlib_version" >&5
7243 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7244
7245         cf_cv_rm_so_locs=no
7246
7247         # Some less-capable ports of gcc support only -fpic
7248         CC_SHARED_OPTS=
7249         if test "$GCC" = yes
7250         then
7251                 echo "$as_me:7251: checking which $CC option to use" >&5
7252 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7253                 cf_save_CFLAGS="$CFLAGS"
7254                 for CC_SHARED_OPTS in -fPIC -fpic ''
7255                 do
7256                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7257                         cat >conftest.$ac_ext <<_ACEOF
7258 #line 7258 "configure"
7259 #include "confdefs.h"
7260 #include <stdio.h>
7261 int
7262 main ()
7263 {
7264 int x = 1
7265   ;
7266   return 0;
7267 }
7268 _ACEOF
7269 rm -f conftest.$ac_objext
7270 if { (eval echo "$as_me:7270: \"$ac_compile\"") >&5
7271   (eval $ac_compile) 2>&5
7272   ac_status=$?
7273   echo "$as_me:7273: \$? = $ac_status" >&5
7274   (exit $ac_status); } &&
7275          { ac_try='test -s conftest.$ac_objext'
7276   { (eval echo "$as_me:7276: \"$ac_try\"") >&5
7277   (eval $ac_try) 2>&5
7278   ac_status=$?
7279   echo "$as_me:7279: \$? = $ac_status" >&5
7280   (exit $ac_status); }; }; then
7281   break
7282 else
7283   echo "$as_me: failed program was:" >&5
7284 cat conftest.$ac_ext >&5
7285 fi
7286 rm -f conftest.$ac_objext conftest.$ac_ext
7287                 done
7288                 echo "$as_me:7288: result: $CC_SHARED_OPTS" >&5
7289 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7290                 CFLAGS="$cf_save_CFLAGS"
7291         fi
7292
7293         cf_cv_shlib_version_infix=no
7294
7295         case $cf_cv_system_name in #(vi
7296         aix[56]*) #(vi
7297                 if test "$GCC" = yes; then
7298                         CC_SHARED_OPTS=
7299                         MK_SHARED_LIB='$(CC) -shared'
7300                 fi
7301                 ;;
7302         beos*) #(vi
7303                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7304                 ;;
7305         cygwin*) #(vi
7306                 CC_SHARED_OPTS=
7307                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7308                 cf_cv_shlib_version=cygdll
7309                 cf_cv_shlib_version_infix=cygdll
7310                 cat >mk_shared_lib.sh <<-CF_EOF
7311                 #!/bin/sh
7312                 SHARED_LIB=\$1
7313                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7314                 shift
7315                 cat <<-EOF
7316                 Linking shared library
7317                 ** SHARED_LIB \$SHARED_LIB
7318                 ** IMPORT_LIB \$IMPORT_LIB
7319 EOF
7320                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7321 CF_EOF
7322                 chmod +x mk_shared_lib.sh
7323                 ;;
7324         darwin*) #(vi
7325                 EXTRA_CFLAGS="-no-cpp-precomp"
7326                 CC_SHARED_OPTS="-dynamic"
7327                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7328                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7329                 cf_cv_shlib_version_infix=yes
7330                 echo "$as_me:7330: checking if ld -search_paths_first works" >&5
7331 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7332 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7333   echo $ECHO_N "(cached) $ECHO_C" >&6
7334 else
7335
7336                         cf_save_LDFLAGS=$LDFLAGS
7337                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7338                         cat >conftest.$ac_ext <<_ACEOF
7339 #line 7339 "configure"
7340 #include "confdefs.h"
7341
7342 int
7343 main ()
7344 {
7345 int i;
7346   ;
7347   return 0;
7348 }
7349 _ACEOF
7350 rm -f conftest.$ac_objext conftest$ac_exeext
7351 if { (eval echo "$as_me:7351: \"$ac_link\"") >&5
7352   (eval $ac_link) 2>&5
7353   ac_status=$?
7354   echo "$as_me:7354: \$? = $ac_status" >&5
7355   (exit $ac_status); } &&
7356          { ac_try='test -s conftest$ac_exeext'
7357   { (eval echo "$as_me:7357: \"$ac_try\"") >&5
7358   (eval $ac_try) 2>&5
7359   ac_status=$?
7360   echo "$as_me:7360: \$? = $ac_status" >&5
7361   (exit $ac_status); }; }; then
7362   cf_cv_ldflags_search_paths_first=yes
7363 else
7364   echo "$as_me: failed program was:" >&5
7365 cat conftest.$ac_ext >&5
7366 cf_cv_ldflags_search_paths_first=no
7367 fi
7368 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7369                                 LDFLAGS=$cf_save_LDFLAGS
7370 fi
7371 echo "$as_me:7371: result: $cf_cv_ldflags_search_paths_first" >&5
7372 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7373                 if test $cf_cv_ldflags_search_paths_first = yes; then
7374                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7375                 fi
7376                 ;;
7377         hpux*) #(vi
7378                 # (tested with gcc 2.7.2 -- I don't have c89)
7379                 if test "$GCC" = yes; then
7380                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7381                 else
7382                         CC_SHARED_OPTS='+Z'
7383                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7384                 fi
7385                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7386                 # HP-UX shared libraries must be executable, and should be
7387                 # readonly to exploit a quirk in the memory manager.
7388                 INSTALL_LIB="-m 555"
7389                 ;;
7390         irix*) #(vi
7391                 if test "$cf_cv_enable_rpath" = yes ; then
7392                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7393                 fi
7394                 # tested with IRIX 5.2 and 'cc'.
7395                 if test "$GCC" != yes; then
7396                         CC_SHARED_OPTS='-KPIC'
7397                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7398                 else
7399                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7400                 fi
7401                 cf_cv_rm_so_locs=yes
7402                 ;;
7403         linux*|gnu*|k*bsd*-gnu) #(vi
7404                 if test "$DFT_LWR_MODEL" = "shared" ; then
7405                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7406                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7407                 fi
7408                 if test "$cf_cv_enable_rpath" = yes ; then
7409                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7410                 fi
7411
7412         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7413         if test "$cf_cv_shlib_version" = rel; then
7414                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7415         else
7416                 cf_cv_shared_soname='`basename $@`'
7417         fi
7418
7419                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7420                 ;;
7421         openbsd[2-9].*) #(vi
7422                 if test "$DFT_LWR_MODEL" = "shared" ; then
7423                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7424                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7425                 fi
7426                 if test "$cf_cv_enable_rpath" = yes ; then
7427                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7428                 fi
7429                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7430
7431         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7432         if test "$cf_cv_shlib_version" = rel; then
7433                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7434         else
7435                 cf_cv_shared_soname='`basename $@`'
7436         fi
7437
7438                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7439                 ;;
7440         nto-qnx*|openbsd*|freebsd[12].*) #(vi
7441                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7442                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7443                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7444                 ;;
7445         freebsd*) #(vi
7446                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7447                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7448                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7449                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
7450                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7451                 fi
7452
7453         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7454         if test "$cf_cv_shlib_version" = rel; then
7455                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7456         else
7457                 cf_cv_shared_soname='`basename $@`'
7458         fi
7459
7460                 MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
7461                 ;;
7462         netbsd*) #(vi
7463                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7464                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7465                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7466                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7467                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7468                         if test "$cf_cv_shlib_version" = auto; then
7469                         if test -f /usr/libexec/ld.elf_so; then
7470                                 cf_cv_shlib_version=abi
7471                         else
7472                                 cf_cv_shlib_version=rel
7473                         fi
7474                         fi
7475
7476         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7477         if test "$cf_cv_shlib_version" = rel; then
7478                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7479         else
7480                 cf_cv_shared_soname='`basename $@`'
7481         fi
7482
7483                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7484                 else
7485                         MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
7486                 fi
7487                 ;;
7488         osf*|mls+*) #(vi
7489                 # tested with OSF/1 V3.2 and 'cc'
7490                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7491                 # link with shared libs).
7492                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7493                 case $host_os in #(vi
7494                 osf4*)
7495                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7496                         ;;
7497                 esac
7498                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7499                 if test "$DFT_LWR_MODEL" = "shared" ; then
7500                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7501                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7502                 fi
7503                 cf_cv_rm_so_locs=yes
7504                 ;;
7505         sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
7506                 # tested with osr5.0.5
7507                 if test "$GCC" != yes; then
7508                         CC_SHARED_OPTS='-belf -KPIC'
7509                 fi
7510                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7511                 if test "$cf_cv_enable_rpath" = yes ; then
7512                         # only way is to set LD_RUN_PATH but no switch for it
7513                         RUN_PATH=$libdir
7514                 fi
7515                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7516                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7517                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7518                 ;;
7519         sunos4*) #(vi
7520                 # tested with SunOS 4.1.1 and gcc 2.7.0
7521                 if test "$GCC" != yes; then
7522                         CC_SHARED_OPTS='-KPIC'
7523                 fi
7524                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7525                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7526                 ;;
7527         solaris2*) #(vi
7528                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7529                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7530                 if test "$DFT_LWR_MODEL" = "shared" ; then
7531                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7532                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7533                 fi
7534                 if test "$cf_cv_enable_rpath" = yes ; then
7535                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7536                 fi
7537
7538         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7539         if test "$cf_cv_shlib_version" = rel; then
7540                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7541         else
7542                 cf_cv_shared_soname='`basename $@`'
7543         fi
7544
7545                 if test "$GCC" != yes; then
7546                         cf_save_CFLAGS="$CFLAGS"
7547                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7548                         do
7549                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7550                                 cat >conftest.$ac_ext <<_ACEOF
7551 #line 7551 "configure"
7552 #include "confdefs.h"
7553 #include <stdio.h>
7554 int
7555 main ()
7556 {
7557 printf("Hello\n");
7558   ;
7559   return 0;
7560 }
7561 _ACEOF
7562 rm -f conftest.$ac_objext
7563 if { (eval echo "$as_me:7563: \"$ac_compile\"") >&5
7564   (eval $ac_compile) 2>&5
7565   ac_status=$?
7566   echo "$as_me:7566: \$? = $ac_status" >&5
7567   (exit $ac_status); } &&
7568          { ac_try='test -s conftest.$ac_objext'
7569   { (eval echo "$as_me:7569: \"$ac_try\"") >&5
7570   (eval $ac_try) 2>&5
7571   ac_status=$?
7572   echo "$as_me:7572: \$? = $ac_status" >&5
7573   (exit $ac_status); }; }; then
7574   break
7575 else
7576   echo "$as_me: failed program was:" >&5
7577 cat conftest.$ac_ext >&5
7578 fi
7579 rm -f conftest.$ac_objext conftest.$ac_ext
7580                         done
7581                         CFLAGS="$cf_save_CFLAGS"
7582                         CC_SHARED_OPTS=$cf_shared_opts
7583                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7584                 else
7585                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7586                 fi
7587                 ;;
7588         sysv5uw7*|unix_sv*) #(vi
7589                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7590                 if test "$GCC" != yes; then
7591                         CC_SHARED_OPTS='-KPIC'
7592                 fi
7593                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7594                 ;;
7595         *)
7596                 CC_SHARED_OPTS='unknown'
7597                 MK_SHARED_LIB='echo unknown'
7598                 ;;
7599         esac
7600
7601         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7602         case "$cf_cv_shlib_version" in #(vi
7603         rel|abi)
7604                 case "$MK_SHARED_LIB" in #(vi
7605                 *'-o $@') #(vi
7606                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7607                         ;;
7608                 *)
7609                         { echo "$as_me:7609: WARNING: ignored --with-shlib-version" >&5
7610 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7611                         ;;
7612                 esac
7613                 ;;
7614         esac
7615
7616         if test -n "$cf_ld_rpath_opt" ; then
7617                 MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
7618         fi
7619
7620 ###############################################################################
7621
7622         case $cf_cv_system_name in
7623         os2*)   PATH_SEPARATOR=';'  ;;
7624         *)      PATH_SEPARATOR=':'  ;;
7625         esac
7626
7627 ###   use option --enable-broken-linker to force on use of broken-linker support
7628 echo "$as_me:7628: checking if you want broken-linker support code" >&5
7629 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7630
7631 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7632 if test "${enable_broken_linker+set}" = set; then
7633   enableval="$enable_broken_linker"
7634   with_broken_linker=$enableval
7635 else
7636   with_broken_linker=${BROKEN_LINKER-no}
7637 fi;
7638 echo "$as_me:7638: result: $with_broken_linker" >&5
7639 echo "${ECHO_T}$with_broken_linker" >&6
7640
7641 BROKEN_LINKER=0
7642 if test "$with_broken_linker" = yes ; then
7643         cat >>confdefs.h <<\EOF
7644 #define BROKEN_LINKER 1
7645 EOF
7646
7647         BROKEN_LINKER=1
7648 elif test "$DFT_LWR_MODEL" = shared ; then
7649         case $cf_cv_system_name in #(vi
7650         cygwin*)
7651                 cat >>confdefs.h <<\EOF
7652 #define BROKEN_LINKER 1
7653 EOF
7654
7655                 BROKEN_LINKER=1
7656                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7657
7658 echo "${as_me-configure}:7658: testing cygwin linker is broken anyway ..." 1>&5
7659
7660                 ;;
7661         esac
7662 fi
7663
7664 # Check to define _XOPEN_SOURCE "automatically"
7665
7666 cf_XOPEN_SOURCE=500
7667 cf_POSIX_C_SOURCE=199506L
7668 cf_xopen_source=
7669
7670 case $host_os in #(vi
7671 aix[456]*) #(vi
7672         cf_xopen_source="-D_ALL_SOURCE"
7673         ;;
7674 darwin[0-8].*) #(vi
7675         cf_xopen_source="-D_APPLE_C_SOURCE"
7676         ;;
7677 darwin*) #(vi
7678         cf_xopen_source="-D_DARWIN_C_SOURCE"
7679         ;;
7680 freebsd*|dragonfly*) #(vi
7681         # 5.x headers associate
7682         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7683         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7684         cf_POSIX_C_SOURCE=200112L
7685         cf_XOPEN_SOURCE=600
7686         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7687         ;;
7688 hpux11*) #(vi
7689         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7690         ;;
7691 hpux*) #(vi
7692         cf_xopen_source="-D_HPUX_SOURCE"
7693         ;;
7694 irix[56].*) #(vi
7695         cf_xopen_source="-D_SGI_SOURCE"
7696         ;;
7697 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
7698
7699 echo "$as_me:7699: checking if we must define _GNU_SOURCE" >&5
7700 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7701 if test "${cf_cv_gnu_source+set}" = set; then
7702   echo $ECHO_N "(cached) $ECHO_C" >&6
7703 else
7704
7705 cat >conftest.$ac_ext <<_ACEOF
7706 #line 7706 "configure"
7707 #include "confdefs.h"
7708 #include <sys/types.h>
7709 int
7710 main ()
7711 {
7712
7713 #ifndef _XOPEN_SOURCE
7714 make an error
7715 #endif
7716   ;
7717   return 0;
7718 }
7719 _ACEOF
7720 rm -f conftest.$ac_objext
7721 if { (eval echo "$as_me:7721: \"$ac_compile\"") >&5
7722   (eval $ac_compile) 2>&5
7723   ac_status=$?
7724   echo "$as_me:7724: \$? = $ac_status" >&5
7725   (exit $ac_status); } &&
7726          { ac_try='test -s conftest.$ac_objext'
7727   { (eval echo "$as_me:7727: \"$ac_try\"") >&5
7728   (eval $ac_try) 2>&5
7729   ac_status=$?
7730   echo "$as_me:7730: \$? = $ac_status" >&5
7731   (exit $ac_status); }; }; then
7732   cf_cv_gnu_source=no
7733 else
7734   echo "$as_me: failed program was:" >&5
7735 cat conftest.$ac_ext >&5
7736 cf_save="$CPPFLAGS"
7737          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7738          cat >conftest.$ac_ext <<_ACEOF
7739 #line 7739 "configure"
7740 #include "confdefs.h"
7741 #include <sys/types.h>
7742 int
7743 main ()
7744 {
7745
7746 #ifdef _XOPEN_SOURCE
7747 make an error
7748 #endif
7749   ;
7750   return 0;
7751 }
7752 _ACEOF
7753 rm -f conftest.$ac_objext
7754 if { (eval echo "$as_me:7754: \"$ac_compile\"") >&5
7755   (eval $ac_compile) 2>&5
7756   ac_status=$?
7757   echo "$as_me:7757: \$? = $ac_status" >&5
7758   (exit $ac_status); } &&
7759          { ac_try='test -s conftest.$ac_objext'
7760   { (eval echo "$as_me:7760: \"$ac_try\"") >&5
7761   (eval $ac_try) 2>&5
7762   ac_status=$?
7763   echo "$as_me:7763: \$? = $ac_status" >&5
7764   (exit $ac_status); }; }; then
7765   cf_cv_gnu_source=no
7766 else
7767   echo "$as_me: failed program was:" >&5
7768 cat conftest.$ac_ext >&5
7769 cf_cv_gnu_source=yes
7770 fi
7771 rm -f conftest.$ac_objext conftest.$ac_ext
7772         CPPFLAGS="$cf_save"
7773
7774 fi
7775 rm -f conftest.$ac_objext conftest.$ac_ext
7776
7777 fi
7778 echo "$as_me:7778: result: $cf_cv_gnu_source" >&5
7779 echo "${ECHO_T}$cf_cv_gnu_source" >&6
7780 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7781
7782         ;;
7783 mirbsd*) #(vi
7784         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
7785         ;;
7786 netbsd*) #(vi
7787         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
7788         ;;
7789 openbsd*) #(vi
7790         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
7791         ;;
7792 osf[45]*) #(vi
7793         cf_xopen_source="-D_OSF_SOURCE"
7794         ;;
7795 nto-qnx*) #(vi
7796         cf_xopen_source="-D_QNX_SOURCE"
7797         ;;
7798 sco*) #(vi
7799         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
7800         ;;
7801 solaris2.1[0-9]) #(vi
7802         cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7803         ;;
7804 solaris2.[1-9]) #(vi
7805         cf_xopen_source="-D__EXTENSIONS__"
7806         ;;
7807 *)
7808         echo "$as_me:7808: checking if we should define _XOPEN_SOURCE" >&5
7809 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
7810 if test "${cf_cv_xopen_source+set}" = set; then
7811   echo $ECHO_N "(cached) $ECHO_C" >&6
7812 else
7813
7814         cat >conftest.$ac_ext <<_ACEOF
7815 #line 7815 "configure"
7816 #include "confdefs.h"
7817 #include <sys/types.h>
7818 int
7819 main ()
7820 {
7821
7822 #ifndef _XOPEN_SOURCE
7823 make an error
7824 #endif
7825   ;
7826   return 0;
7827 }
7828 _ACEOF
7829 rm -f conftest.$ac_objext
7830 if { (eval echo "$as_me:7830: \"$ac_compile\"") >&5
7831   (eval $ac_compile) 2>&5
7832   ac_status=$?
7833   echo "$as_me:7833: \$? = $ac_status" >&5
7834   (exit $ac_status); } &&
7835          { ac_try='test -s conftest.$ac_objext'
7836   { (eval echo "$as_me:7836: \"$ac_try\"") >&5
7837   (eval $ac_try) 2>&5
7838   ac_status=$?
7839   echo "$as_me:7839: \$? = $ac_status" >&5
7840   (exit $ac_status); }; }; then
7841   cf_cv_xopen_source=no
7842 else
7843   echo "$as_me: failed program was:" >&5
7844 cat conftest.$ac_ext >&5
7845 cf_save="$CPPFLAGS"
7846          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7847          cat >conftest.$ac_ext <<_ACEOF
7848 #line 7848 "configure"
7849 #include "confdefs.h"
7850 #include <sys/types.h>
7851 int
7852 main ()
7853 {
7854
7855 #ifdef _XOPEN_SOURCE
7856 make an error
7857 #endif
7858   ;
7859   return 0;
7860 }
7861 _ACEOF
7862 rm -f conftest.$ac_objext
7863 if { (eval echo "$as_me:7863: \"$ac_compile\"") >&5
7864   (eval $ac_compile) 2>&5
7865   ac_status=$?
7866   echo "$as_me:7866: \$? = $ac_status" >&5
7867   (exit $ac_status); } &&
7868          { ac_try='test -s conftest.$ac_objext'
7869   { (eval echo "$as_me:7869: \"$ac_try\"") >&5
7870   (eval $ac_try) 2>&5
7871   ac_status=$?
7872   echo "$as_me:7872: \$? = $ac_status" >&5
7873   (exit $ac_status); }; }; then
7874   cf_cv_xopen_source=no
7875 else
7876   echo "$as_me: failed program was:" >&5
7877 cat conftest.$ac_ext >&5
7878 cf_cv_xopen_source=$cf_XOPEN_SOURCE
7879 fi
7880 rm -f conftest.$ac_objext conftest.$ac_ext
7881         CPPFLAGS="$cf_save"
7882
7883 fi
7884 rm -f conftest.$ac_objext conftest.$ac_ext
7885
7886 fi
7887 echo "$as_me:7887: result: $cf_cv_xopen_source" >&5
7888 echo "${ECHO_T}$cf_cv_xopen_source" >&6
7889         if test "$cf_cv_xopen_source" != no ; then
7890
7891 CFLAGS=`echo "$CFLAGS" | \
7892         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
7893                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
7894
7895 CPPFLAGS=`echo "$CPPFLAGS" | \
7896         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
7897                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
7898
7899                 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
7900
7901 cf_fix_cppflags=no
7902 cf_new_cflags=
7903 cf_new_cppflags=
7904 cf_new_extra_cppflags=
7905
7906 for cf_add_cflags in $cf_temp_xopen_source
7907 do
7908 case $cf_fix_cppflags in
7909 no)
7910         case $cf_add_cflags in #(vi
7911         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
7912                 case $cf_add_cflags in
7913                 -D*)
7914                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7915
7916                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7917                                 && test -z "${cf_tst_cflags}" \
7918                                 && cf_fix_cppflags=yes
7919
7920                         if test $cf_fix_cppflags = yes ; then
7921                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7922                                 continue
7923                         elif test "${cf_tst_cflags}" = "\"'" ; then
7924                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7925                                 continue
7926                         fi
7927                         ;;
7928                 esac
7929                 case "$CPPFLAGS" in
7930                 *$cf_add_cflags) #(vi
7931                         ;;
7932                 *) #(vi
7933                         case $cf_add_cflags in #(vi
7934                         -D*)
7935                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7936
7937 CPPFLAGS=`echo "$CPPFLAGS" | \
7938         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7939                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7940
7941                                 ;;
7942                         esac
7943                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
7944                         ;;
7945                 esac
7946                 ;;
7947         *)
7948                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
7949                 ;;
7950         esac
7951         ;;
7952 yes)
7953         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7954
7955         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7956
7957         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7958                 && test -z "${cf_tst_cflags}" \
7959                 && cf_fix_cppflags=no
7960         ;;
7961 esac
7962 done
7963
7964 if test -n "$cf_new_cflags" ; then
7965
7966         CFLAGS="$CFLAGS $cf_new_cflags"
7967 fi
7968
7969 if test -n "$cf_new_cppflags" ; then
7970
7971         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
7972 fi
7973
7974 if test -n "$cf_new_extra_cppflags" ; then
7975
7976         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
7977 fi
7978
7979         fi
7980
7981 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
7982
7983 cf_save_CFLAGS="$CFLAGS"
7984 cf_save_CPPFLAGS="$CPPFLAGS"
7985
7986 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
7987         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7988                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7989
7990 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
7991         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7992                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7993
7994 echo "$as_me:7994: checking if we should define _POSIX_C_SOURCE" >&5
7995 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
7996 if test "${cf_cv_posix_c_source+set}" = set; then
7997   echo $ECHO_N "(cached) $ECHO_C" >&6
7998 else
7999
8000 echo "${as_me-configure}:8000: testing if the symbol is already defined go no further ..." 1>&5
8001
8002         cat >conftest.$ac_ext <<_ACEOF
8003 #line 8003 "configure"
8004 #include "confdefs.h"
8005 #include <sys/types.h>
8006 int
8007 main ()
8008 {
8009
8010 #ifndef _POSIX_C_SOURCE
8011 make an error
8012 #endif
8013   ;
8014   return 0;
8015 }
8016 _ACEOF
8017 rm -f conftest.$ac_objext
8018 if { (eval echo "$as_me:8018: \"$ac_compile\"") >&5
8019   (eval $ac_compile) 2>&5
8020   ac_status=$?
8021   echo "$as_me:8021: \$? = $ac_status" >&5
8022   (exit $ac_status); } &&
8023          { ac_try='test -s conftest.$ac_objext'
8024   { (eval echo "$as_me:8024: \"$ac_try\"") >&5
8025   (eval $ac_try) 2>&5
8026   ac_status=$?
8027   echo "$as_me:8027: \$? = $ac_status" >&5
8028   (exit $ac_status); }; }; then
8029   cf_cv_posix_c_source=no
8030 else
8031   echo "$as_me: failed program was:" >&5
8032 cat conftest.$ac_ext >&5
8033 cf_want_posix_source=no
8034          case .$cf_POSIX_C_SOURCE in #(vi
8035          .[12]??*) #(vi
8036                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8037                 ;;
8038          .2) #(vi
8039                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8040                 cf_want_posix_source=yes
8041                 ;;
8042          .*)
8043                 cf_want_posix_source=yes
8044                 ;;
8045          esac
8046          if test "$cf_want_posix_source" = yes ; then
8047                 cat >conftest.$ac_ext <<_ACEOF
8048 #line 8048 "configure"
8049 #include "confdefs.h"
8050 #include <sys/types.h>
8051 int
8052 main ()
8053 {
8054
8055 #ifdef _POSIX_SOURCE
8056 make an error
8057 #endif
8058   ;
8059   return 0;
8060 }
8061 _ACEOF
8062 rm -f conftest.$ac_objext
8063 if { (eval echo "$as_me:8063: \"$ac_compile\"") >&5
8064   (eval $ac_compile) 2>&5
8065   ac_status=$?
8066   echo "$as_me:8066: \$? = $ac_status" >&5
8067   (exit $ac_status); } &&
8068          { ac_try='test -s conftest.$ac_objext'
8069   { (eval echo "$as_me:8069: \"$ac_try\"") >&5
8070   (eval $ac_try) 2>&5
8071   ac_status=$?
8072   echo "$as_me:8072: \$? = $ac_status" >&5
8073   (exit $ac_status); }; }; then
8074   :
8075 else
8076   echo "$as_me: failed program was:" >&5
8077 cat conftest.$ac_ext >&5
8078 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8079 fi
8080 rm -f conftest.$ac_objext conftest.$ac_ext
8081          fi
8082
8083 echo "${as_me-configure}:8083: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8084
8085          CFLAGS="$cf_trim_CFLAGS"
8086          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8087
8088 echo "${as_me-configure}:8088: testing if the second compile does not leave our definition intact error ..." 1>&5
8089
8090          cat >conftest.$ac_ext <<_ACEOF
8091 #line 8091 "configure"
8092 #include "confdefs.h"
8093 #include <sys/types.h>
8094 int
8095 main ()
8096 {
8097
8098 #ifndef _POSIX_C_SOURCE
8099 make an error
8100 #endif
8101   ;
8102   return 0;
8103 }
8104 _ACEOF
8105 rm -f conftest.$ac_objext
8106 if { (eval echo "$as_me:8106: \"$ac_compile\"") >&5
8107   (eval $ac_compile) 2>&5
8108   ac_status=$?
8109   echo "$as_me:8109: \$? = $ac_status" >&5
8110   (exit $ac_status); } &&
8111          { ac_try='test -s conftest.$ac_objext'
8112   { (eval echo "$as_me:8112: \"$ac_try\"") >&5
8113   (eval $ac_try) 2>&5
8114   ac_status=$?
8115   echo "$as_me:8115: \$? = $ac_status" >&5
8116   (exit $ac_status); }; }; then
8117   :
8118 else
8119   echo "$as_me: failed program was:" >&5
8120 cat conftest.$ac_ext >&5
8121 cf_cv_posix_c_source=no
8122 fi
8123 rm -f conftest.$ac_objext conftest.$ac_ext
8124          CFLAGS="$cf_save_CFLAGS"
8125          CPPFLAGS="$cf_save_CPPFLAGS"
8126
8127 fi
8128 rm -f conftest.$ac_objext conftest.$ac_ext
8129
8130 fi
8131 echo "$as_me:8131: result: $cf_cv_posix_c_source" >&5
8132 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8133
8134 if test "$cf_cv_posix_c_source" != no ; then
8135         CFLAGS="$cf_trim_CFLAGS"
8136         CPPFLAGS="$cf_trim_CPPFLAGS"
8137
8138 cf_fix_cppflags=no
8139 cf_new_cflags=
8140 cf_new_cppflags=
8141 cf_new_extra_cppflags=
8142
8143 for cf_add_cflags in $cf_cv_posix_c_source
8144 do
8145 case $cf_fix_cppflags in
8146 no)
8147         case $cf_add_cflags in #(vi
8148         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8149                 case $cf_add_cflags in
8150                 -D*)
8151                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8152
8153                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8154                                 && test -z "${cf_tst_cflags}" \
8155                                 && cf_fix_cppflags=yes
8156
8157                         if test $cf_fix_cppflags = yes ; then
8158                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8159                                 continue
8160                         elif test "${cf_tst_cflags}" = "\"'" ; then
8161                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8162                                 continue
8163                         fi
8164                         ;;
8165                 esac
8166                 case "$CPPFLAGS" in
8167                 *$cf_add_cflags) #(vi
8168                         ;;
8169                 *) #(vi
8170                         case $cf_add_cflags in #(vi
8171                         -D*)
8172                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8173
8174 CPPFLAGS=`echo "$CPPFLAGS" | \
8175         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8176                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8177
8178                                 ;;
8179                         esac
8180                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8181                         ;;
8182                 esac
8183                 ;;
8184         *)
8185                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8186                 ;;
8187         esac
8188         ;;
8189 yes)
8190         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8191
8192         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8193
8194         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8195                 && test -z "${cf_tst_cflags}" \
8196                 && cf_fix_cppflags=no
8197         ;;
8198 esac
8199 done
8200
8201 if test -n "$cf_new_cflags" ; then
8202
8203         CFLAGS="$CFLAGS $cf_new_cflags"
8204 fi
8205
8206 if test -n "$cf_new_cppflags" ; then
8207
8208         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8209 fi
8210
8211 if test -n "$cf_new_extra_cppflags" ; then
8212
8213         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8214 fi
8215
8216 fi
8217
8218         ;;
8219 esac
8220
8221 if test -n "$cf_xopen_source" ; then
8222
8223 cf_fix_cppflags=no
8224 cf_new_cflags=
8225 cf_new_cppflags=
8226 cf_new_extra_cppflags=
8227
8228 for cf_add_cflags in $cf_xopen_source
8229 do
8230 case $cf_fix_cppflags in
8231 no)
8232         case $cf_add_cflags in #(vi
8233         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8234                 case $cf_add_cflags in
8235                 -D*)
8236                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8237
8238                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8239                                 && test -z "${cf_tst_cflags}" \
8240                                 && cf_fix_cppflags=yes
8241
8242                         if test $cf_fix_cppflags = yes ; then
8243                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8244                                 continue
8245                         elif test "${cf_tst_cflags}" = "\"'" ; then
8246                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8247                                 continue
8248                         fi
8249                         ;;
8250                 esac
8251                 case "$CPPFLAGS" in
8252                 *$cf_add_cflags) #(vi
8253                         ;;
8254                 *) #(vi
8255                         case $cf_add_cflags in #(vi
8256                         -D*)
8257                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8258
8259 CPPFLAGS=`echo "$CPPFLAGS" | \
8260         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8261                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8262
8263                                 ;;
8264                         esac
8265                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8266                         ;;
8267                 esac
8268                 ;;
8269         *)
8270                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8271                 ;;
8272         esac
8273         ;;
8274 yes)
8275         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8276
8277         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8278
8279         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8280                 && test -z "${cf_tst_cflags}" \
8281                 && cf_fix_cppflags=no
8282         ;;
8283 esac
8284 done
8285
8286 if test -n "$cf_new_cflags" ; then
8287
8288         CFLAGS="$CFLAGS $cf_new_cflags"
8289 fi
8290
8291 if test -n "$cf_new_cppflags" ; then
8292
8293         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8294 fi
8295
8296 if test -n "$cf_new_extra_cppflags" ; then
8297
8298         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8299 fi
8300
8301 fi
8302
8303 # Check whether --enable-largefile or --disable-largefile was given.
8304 if test "${enable_largefile+set}" = set; then
8305   enableval="$enable_largefile"
8306
8307 fi;
8308 if test "$enable_largefile" != no; then
8309
8310   echo "$as_me:8310: checking for special C compiler options needed for large files" >&5
8311 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
8312 if test "${ac_cv_sys_largefile_CC+set}" = set; then
8313   echo $ECHO_N "(cached) $ECHO_C" >&6
8314 else
8315   ac_cv_sys_largefile_CC=no
8316      if test "$GCC" != yes; then
8317        ac_save_CC=$CC
8318        while :; do
8319          # IRIX 6.2 and later do not support large files by default,
8320          # so use the C compiler's -n32 option if that helps.
8321          cat >conftest.$ac_ext <<_ACEOF
8322 #line 8322 "configure"
8323 #include "confdefs.h"
8324 #include <sys/types.h>
8325  /* Check that off_t can represent 2**63 - 1 correctly.
8326     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8327     since some C++ compilers masquerading as C compilers
8328     incorrectly reject 9223372036854775807.  */
8329 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8330   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8331                        && LARGE_OFF_T % 2147483647 == 1)
8332                       ? 1 : -1];
8333 int
8334 main ()
8335 {
8336
8337   ;
8338   return 0;
8339 }
8340 _ACEOF
8341          rm -f conftest.$ac_objext
8342 if { (eval echo "$as_me:8342: \"$ac_compile\"") >&5
8343   (eval $ac_compile) 2>&5
8344   ac_status=$?
8345   echo "$as_me:8345: \$? = $ac_status" >&5
8346   (exit $ac_status); } &&
8347          { ac_try='test -s conftest.$ac_objext'
8348   { (eval echo "$as_me:8348: \"$ac_try\"") >&5
8349   (eval $ac_try) 2>&5
8350   ac_status=$?
8351   echo "$as_me:8351: \$? = $ac_status" >&5
8352   (exit $ac_status); }; }; then
8353   break
8354 else
8355   echo "$as_me: failed program was:" >&5
8356 cat conftest.$ac_ext >&5
8357 fi
8358 rm -f conftest.$ac_objext
8359          CC="$CC -n32"
8360          rm -f conftest.$ac_objext
8361 if { (eval echo "$as_me:8361: \"$ac_compile\"") >&5
8362   (eval $ac_compile) 2>&5
8363   ac_status=$?
8364   echo "$as_me:8364: \$? = $ac_status" >&5
8365   (exit $ac_status); } &&
8366          { ac_try='test -s conftest.$ac_objext'
8367   { (eval echo "$as_me:8367: \"$ac_try\"") >&5
8368   (eval $ac_try) 2>&5
8369   ac_status=$?
8370   echo "$as_me:8370: \$? = $ac_status" >&5
8371   (exit $ac_status); }; }; then
8372   ac_cv_sys_largefile_CC=' -n32'; break
8373 else
8374   echo "$as_me: failed program was:" >&5
8375 cat conftest.$ac_ext >&5
8376 fi
8377 rm -f conftest.$ac_objext
8378          break
8379        done
8380        CC=$ac_save_CC
8381        rm -f conftest.$ac_ext
8382     fi
8383 fi
8384 echo "$as_me:8384: result: $ac_cv_sys_largefile_CC" >&5
8385 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
8386   if test "$ac_cv_sys_largefile_CC" != no; then
8387     CC=$CC$ac_cv_sys_largefile_CC
8388   fi
8389
8390   echo "$as_me:8390: checking for _FILE_OFFSET_BITS value needed for large files" >&5
8391 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
8392 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
8393   echo $ECHO_N "(cached) $ECHO_C" >&6
8394 else
8395   while :; do
8396   ac_cv_sys_file_offset_bits=no
8397   cat >conftest.$ac_ext <<_ACEOF
8398 #line 8398 "configure"
8399 #include "confdefs.h"
8400 #include <sys/types.h>
8401  /* Check that off_t can represent 2**63 - 1 correctly.
8402     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8403     since some C++ compilers masquerading as C compilers
8404     incorrectly reject 9223372036854775807.  */
8405 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8406   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8407                        && LARGE_OFF_T % 2147483647 == 1)
8408                       ? 1 : -1];
8409 int
8410 main ()
8411 {
8412
8413   ;
8414   return 0;
8415 }
8416 _ACEOF
8417 rm -f conftest.$ac_objext
8418 if { (eval echo "$as_me:8418: \"$ac_compile\"") >&5
8419   (eval $ac_compile) 2>&5
8420   ac_status=$?
8421   echo "$as_me:8421: \$? = $ac_status" >&5
8422   (exit $ac_status); } &&
8423          { ac_try='test -s conftest.$ac_objext'
8424   { (eval echo "$as_me:8424: \"$ac_try\"") >&5
8425   (eval $ac_try) 2>&5
8426   ac_status=$?
8427   echo "$as_me:8427: \$? = $ac_status" >&5
8428   (exit $ac_status); }; }; then
8429   break
8430 else
8431   echo "$as_me: failed program was:" >&5
8432 cat conftest.$ac_ext >&5
8433 fi
8434 rm -f conftest.$ac_objext conftest.$ac_ext
8435   cat >conftest.$ac_ext <<_ACEOF
8436 #line 8436 "configure"
8437 #include "confdefs.h"
8438 #define _FILE_OFFSET_BITS 64
8439 #include <sys/types.h>
8440  /* Check that off_t can represent 2**63 - 1 correctly.
8441     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8442     since some C++ compilers masquerading as C compilers
8443     incorrectly reject 9223372036854775807.  */
8444 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8445   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8446                        && LARGE_OFF_T % 2147483647 == 1)
8447                       ? 1 : -1];
8448 int
8449 main ()
8450 {
8451
8452   ;
8453   return 0;
8454 }
8455 _ACEOF
8456 rm -f conftest.$ac_objext
8457 if { (eval echo "$as_me:8457: \"$ac_compile\"") >&5
8458   (eval $ac_compile) 2>&5
8459   ac_status=$?
8460   echo "$as_me:8460: \$? = $ac_status" >&5
8461   (exit $ac_status); } &&
8462          { ac_try='test -s conftest.$ac_objext'
8463   { (eval echo "$as_me:8463: \"$ac_try\"") >&5
8464   (eval $ac_try) 2>&5
8465   ac_status=$?
8466   echo "$as_me:8466: \$? = $ac_status" >&5
8467   (exit $ac_status); }; }; then
8468   ac_cv_sys_file_offset_bits=64; break
8469 else
8470   echo "$as_me: failed program was:" >&5
8471 cat conftest.$ac_ext >&5
8472 fi
8473 rm -f conftest.$ac_objext conftest.$ac_ext
8474   break
8475 done
8476 fi
8477 echo "$as_me:8477: result: $ac_cv_sys_file_offset_bits" >&5
8478 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
8479 if test "$ac_cv_sys_file_offset_bits" != no; then
8480
8481 cat >>confdefs.h <<EOF
8482 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
8483 EOF
8484
8485 fi
8486 rm -f conftest*
8487   echo "$as_me:8487: checking for _LARGE_FILES value needed for large files" >&5
8488 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
8489 if test "${ac_cv_sys_large_files+set}" = set; then
8490   echo $ECHO_N "(cached) $ECHO_C" >&6
8491 else
8492   while :; do
8493   ac_cv_sys_large_files=no
8494   cat >conftest.$ac_ext <<_ACEOF
8495 #line 8495 "configure"
8496 #include "confdefs.h"
8497 #include <sys/types.h>
8498  /* Check that off_t can represent 2**63 - 1 correctly.
8499     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8500     since some C++ compilers masquerading as C compilers
8501     incorrectly reject 9223372036854775807.  */
8502 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8503   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8504                        && LARGE_OFF_T % 2147483647 == 1)
8505                       ? 1 : -1];
8506 int
8507 main ()
8508 {
8509
8510   ;
8511   return 0;
8512 }
8513 _ACEOF
8514 rm -f conftest.$ac_objext
8515 if { (eval echo "$as_me:8515: \"$ac_compile\"") >&5
8516   (eval $ac_compile) 2>&5
8517   ac_status=$?
8518   echo "$as_me:8518: \$? = $ac_status" >&5
8519   (exit $ac_status); } &&
8520          { ac_try='test -s conftest.$ac_objext'
8521   { (eval echo "$as_me:8521: \"$ac_try\"") >&5
8522   (eval $ac_try) 2>&5
8523   ac_status=$?
8524   echo "$as_me:8524: \$? = $ac_status" >&5
8525   (exit $ac_status); }; }; then
8526   break
8527 else
8528   echo "$as_me: failed program was:" >&5
8529 cat conftest.$ac_ext >&5
8530 fi
8531 rm -f conftest.$ac_objext conftest.$ac_ext
8532   cat >conftest.$ac_ext <<_ACEOF
8533 #line 8533 "configure"
8534 #include "confdefs.h"
8535 #define _LARGE_FILES 1
8536 #include <sys/types.h>
8537  /* Check that off_t can represent 2**63 - 1 correctly.
8538     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8539     since some C++ compilers masquerading as C compilers
8540     incorrectly reject 9223372036854775807.  */
8541 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8542   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8543                        && LARGE_OFF_T % 2147483647 == 1)
8544                       ? 1 : -1];
8545 int
8546 main ()
8547 {
8548
8549   ;
8550   return 0;
8551 }
8552 _ACEOF
8553 rm -f conftest.$ac_objext
8554 if { (eval echo "$as_me:8554: \"$ac_compile\"") >&5
8555   (eval $ac_compile) 2>&5
8556   ac_status=$?
8557   echo "$as_me:8557: \$? = $ac_status" >&5
8558   (exit $ac_status); } &&
8559          { ac_try='test -s conftest.$ac_objext'
8560   { (eval echo "$as_me:8560: \"$ac_try\"") >&5
8561   (eval $ac_try) 2>&5
8562   ac_status=$?
8563   echo "$as_me:8563: \$? = $ac_status" >&5
8564   (exit $ac_status); }; }; then
8565   ac_cv_sys_large_files=1; break
8566 else
8567   echo "$as_me: failed program was:" >&5
8568 cat conftest.$ac_ext >&5
8569 fi
8570 rm -f conftest.$ac_objext conftest.$ac_ext
8571   break
8572 done
8573 fi
8574 echo "$as_me:8574: result: $ac_cv_sys_large_files" >&5
8575 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
8576 if test "$ac_cv_sys_large_files" != no; then
8577
8578 cat >>confdefs.h <<EOF
8579 #define _LARGE_FILES $ac_cv_sys_large_files
8580 EOF
8581
8582 fi
8583 rm -f conftest*
8584 fi
8585
8586     if test "$enable_largefile" != no ; then
8587         echo "$as_me:8587: checking for _LARGEFILE_SOURCE value needed for large files" >&5
8588 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
8589 if test "${ac_cv_sys_largefile_source+set}" = set; then
8590   echo $ECHO_N "(cached) $ECHO_C" >&6
8591 else
8592   while :; do
8593   ac_cv_sys_largefile_source=no
8594   cat >conftest.$ac_ext <<_ACEOF
8595 #line 8595 "configure"
8596 #include "confdefs.h"
8597 #include <stdio.h>
8598 int
8599 main ()
8600 {
8601 return !fseeko;
8602   ;
8603   return 0;
8604 }
8605 _ACEOF
8606 rm -f conftest.$ac_objext
8607 if { (eval echo "$as_me:8607: \"$ac_compile\"") >&5
8608   (eval $ac_compile) 2>&5
8609   ac_status=$?
8610   echo "$as_me:8610: \$? = $ac_status" >&5
8611   (exit $ac_status); } &&
8612          { ac_try='test -s conftest.$ac_objext'
8613   { (eval echo "$as_me:8613: \"$ac_try\"") >&5
8614   (eval $ac_try) 2>&5
8615   ac_status=$?
8616   echo "$as_me:8616: \$? = $ac_status" >&5
8617   (exit $ac_status); }; }; then
8618   break
8619 else
8620   echo "$as_me: failed program was:" >&5
8621 cat conftest.$ac_ext >&5
8622 fi
8623 rm -f conftest.$ac_objext conftest.$ac_ext
8624   cat >conftest.$ac_ext <<_ACEOF
8625 #line 8625 "configure"
8626 #include "confdefs.h"
8627 #define _LARGEFILE_SOURCE 1
8628 #include <stdio.h>
8629 int
8630 main ()
8631 {
8632 return !fseeko;
8633   ;
8634   return 0;
8635 }
8636 _ACEOF
8637 rm -f conftest.$ac_objext
8638 if { (eval echo "$as_me:8638: \"$ac_compile\"") >&5
8639   (eval $ac_compile) 2>&5
8640   ac_status=$?
8641   echo "$as_me:8641: \$? = $ac_status" >&5
8642   (exit $ac_status); } &&
8643          { ac_try='test -s conftest.$ac_objext'
8644   { (eval echo "$as_me:8644: \"$ac_try\"") >&5
8645   (eval $ac_try) 2>&5
8646   ac_status=$?
8647   echo "$as_me:8647: \$? = $ac_status" >&5
8648   (exit $ac_status); }; }; then
8649   ac_cv_sys_largefile_source=1; break
8650 else
8651   echo "$as_me: failed program was:" >&5
8652 cat conftest.$ac_ext >&5
8653 fi
8654 rm -f conftest.$ac_objext conftest.$ac_ext
8655   break
8656 done
8657 fi
8658 echo "$as_me:8658: result: $ac_cv_sys_largefile_source" >&5
8659 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
8660 if test "$ac_cv_sys_largefile_source" != no; then
8661
8662 cat >>confdefs.h <<EOF
8663 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
8664 EOF
8665
8666 fi
8667 rm -f conftest*
8668
8669 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
8670 # in glibc 2.1.3, but that breaks too many other things.
8671 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
8672 echo "$as_me:8672: checking for fseeko" >&5
8673 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
8674 if test "${ac_cv_func_fseeko+set}" = set; then
8675   echo $ECHO_N "(cached) $ECHO_C" >&6
8676 else
8677   cat >conftest.$ac_ext <<_ACEOF
8678 #line 8678 "configure"
8679 #include "confdefs.h"
8680 #include <stdio.h>
8681 int
8682 main ()
8683 {
8684 return fseeko && fseeko (stdin, 0, 0);
8685   ;
8686   return 0;
8687 }
8688 _ACEOF
8689 rm -f conftest.$ac_objext conftest$ac_exeext
8690 if { (eval echo "$as_me:8690: \"$ac_link\"") >&5
8691   (eval $ac_link) 2>&5
8692   ac_status=$?
8693   echo "$as_me:8693: \$? = $ac_status" >&5
8694   (exit $ac_status); } &&
8695          { ac_try='test -s conftest$ac_exeext'
8696   { (eval echo "$as_me:8696: \"$ac_try\"") >&5
8697   (eval $ac_try) 2>&5
8698   ac_status=$?
8699   echo "$as_me:8699: \$? = $ac_status" >&5
8700   (exit $ac_status); }; }; then
8701   ac_cv_func_fseeko=yes
8702 else
8703   echo "$as_me: failed program was:" >&5
8704 cat conftest.$ac_ext >&5
8705 ac_cv_func_fseeko=no
8706 fi
8707 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8708 fi
8709 echo "$as_me:8709: result: $ac_cv_func_fseeko" >&5
8710 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
8711 if test $ac_cv_func_fseeko = yes; then
8712
8713 cat >>confdefs.h <<\EOF
8714 #define HAVE_FSEEKO 1
8715 EOF
8716
8717 fi
8718
8719         # Normally we would collect these definitions in the config.h,
8720         # but (like _XOPEN_SOURCE), some environments rely on having these
8721         # defined before any of the system headers are included.  Another
8722         # case comes up with C++, e.g., on AIX the compiler compiles the
8723         # header files by themselves before looking at the body files it is
8724         # told to compile.  For ncurses, those header files do not include
8725         # the config.h
8726         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
8727         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
8728         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
8729
8730         echo "$as_me:8730: checking whether to use struct dirent64" >&5
8731 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
8732 if test "${cf_cv_struct_dirent64+set}" = set; then
8733   echo $ECHO_N "(cached) $ECHO_C" >&6
8734 else
8735
8736                 cat >conftest.$ac_ext <<_ACEOF
8737 #line 8737 "configure"
8738 #include "confdefs.h"
8739
8740 #include <sys/types.h>
8741 #include <dirent.h>
8742
8743 int
8744 main ()
8745 {
8746
8747                 /* if transitional largefile support is setup, this is true */
8748                 extern struct dirent64 * readdir(DIR *);
8749                 struct dirent64 *x = readdir((DIR *)0);
8750                 struct dirent *y = readdir((DIR *)0);
8751                 int z = x - y;
8752
8753   ;
8754   return 0;
8755 }
8756 _ACEOF
8757 rm -f conftest.$ac_objext
8758 if { (eval echo "$as_me:8758: \"$ac_compile\"") >&5
8759   (eval $ac_compile) 2>&5
8760   ac_status=$?
8761   echo "$as_me:8761: \$? = $ac_status" >&5
8762   (exit $ac_status); } &&
8763          { ac_try='test -s conftest.$ac_objext'
8764   { (eval echo "$as_me:8764: \"$ac_try\"") >&5
8765   (eval $ac_try) 2>&5
8766   ac_status=$?
8767   echo "$as_me:8767: \$? = $ac_status" >&5
8768   (exit $ac_status); }; }; then
8769   cf_cv_struct_dirent64=yes
8770 else
8771   echo "$as_me: failed program was:" >&5
8772 cat conftest.$ac_ext >&5
8773 cf_cv_struct_dirent64=no
8774 fi
8775 rm -f conftest.$ac_objext conftest.$ac_ext
8776
8777 fi
8778 echo "$as_me:8778: result: $cf_cv_struct_dirent64" >&5
8779 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
8780         test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
8781 #define HAVE_STRUCT_DIRENT64 1
8782 EOF
8783
8784     fi
8785
8786 ### Enable compiling-in rcs id's
8787 echo "$as_me:8787: checking if RCS identifiers should be compiled-in" >&5
8788 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
8789
8790 # Check whether --with-rcs-ids or --without-rcs-ids was given.
8791 if test "${with_rcs_ids+set}" = set; then
8792   withval="$with_rcs_ids"
8793   with_rcs_ids=$withval
8794 else
8795   with_rcs_ids=no
8796 fi;
8797 echo "$as_me:8797: result: $with_rcs_ids" >&5
8798 echo "${ECHO_T}$with_rcs_ids" >&6
8799 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF
8800 #define USE_RCS_IDS 1
8801 EOF
8802
8803 ###############################################################################
8804
8805 ### Note that some functions (such as const) are normally disabled anyway.
8806 echo "$as_me:8806: checking if you want to build with function extensions" >&5
8807 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
8808
8809 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
8810 if test "${enable_ext_funcs+set}" = set; then
8811   enableval="$enable_ext_funcs"
8812   with_ext_funcs=$enableval
8813 else
8814   with_ext_funcs=yes
8815 fi;
8816 echo "$as_me:8816: result: $with_ext_funcs" >&5
8817 echo "${ECHO_T}$with_ext_funcs" >&6
8818 if test "$with_ext_funcs" = yes ; then
8819         NCURSES_EXT_FUNCS=1
8820         cat >>confdefs.h <<\EOF
8821 #define HAVE_USE_DEFAULT_COLORS 1
8822 EOF
8823
8824         cat >>confdefs.h <<\EOF
8825 #define NCURSES_EXT_FUNCS 1
8826 EOF
8827
8828 else
8829         NCURSES_EXT_FUNCS=0
8830 fi
8831
8832 ###   use option --enable-const to turn on use of const beyond that in XSI.
8833 echo "$as_me:8833: checking for extended use of const keyword" >&5
8834 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
8835
8836 # Check whether --enable-const or --disable-const was given.
8837 if test "${enable_const+set}" = set; then
8838   enableval="$enable_const"
8839   with_ext_const=$enableval
8840 else
8841   with_ext_const=no
8842 fi;
8843 echo "$as_me:8843: result: $with_ext_const" >&5
8844 echo "${ECHO_T}$with_ext_const" >&6
8845 NCURSES_CONST='/*nothing*/'
8846 if test "$with_ext_const" = yes ; then
8847         NCURSES_CONST=const
8848 fi
8849
8850 ###############################################################################
8851 # These options are relatively safe to experiment with.
8852
8853 echo "$as_me:8853: checking if you want all development code" >&5
8854 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
8855
8856 # Check whether --with-develop or --without-develop was given.
8857 if test "${with_develop+set}" = set; then
8858   withval="$with_develop"
8859   with_develop=$withval
8860 else
8861   with_develop=no
8862 fi;
8863 echo "$as_me:8863: result: $with_develop" >&5
8864 echo "${ECHO_T}$with_develop" >&6
8865
8866 ###############################################################################
8867 # These are just experimental, probably should not be in a package:
8868
8869 # This is still experimental (20080329), but should ultimately be moved to
8870 # the script-block --with-normal, etc.
8871
8872 echo "$as_me:8872: checking if you want to link with the pthread library" >&5
8873 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
8874
8875 # Check whether --with-pthread or --without-pthread was given.
8876 if test "${with_pthread+set}" = set; then
8877   withval="$with_pthread"
8878   with_pthread=$withval
8879 else
8880   with_pthread=no
8881 fi;
8882 echo "$as_me:8882: result: $with_pthread" >&5
8883 echo "${ECHO_T}$with_pthread" >&6
8884
8885 if test "$with_pthread" != no ; then
8886     echo "$as_me:8886: checking for pthread.h" >&5
8887 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
8888 if test "${ac_cv_header_pthread_h+set}" = set; then
8889   echo $ECHO_N "(cached) $ECHO_C" >&6
8890 else
8891   cat >conftest.$ac_ext <<_ACEOF
8892 #line 8892 "configure"
8893 #include "confdefs.h"
8894 #include <pthread.h>
8895 _ACEOF
8896 if { (eval echo "$as_me:8896: \"$ac_cpp conftest.$ac_ext\"") >&5
8897   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8898   ac_status=$?
8899   egrep -v '^ *\+' conftest.er1 >conftest.err
8900   rm -f conftest.er1
8901   cat conftest.err >&5
8902   echo "$as_me:8902: \$? = $ac_status" >&5
8903   (exit $ac_status); } >/dev/null; then
8904   if test -s conftest.err; then
8905     ac_cpp_err=$ac_c_preproc_warn_flag
8906   else
8907     ac_cpp_err=
8908   fi
8909 else
8910   ac_cpp_err=yes
8911 fi
8912 if test -z "$ac_cpp_err"; then
8913   ac_cv_header_pthread_h=yes
8914 else
8915   echo "$as_me: failed program was:" >&5
8916   cat conftest.$ac_ext >&5
8917   ac_cv_header_pthread_h=no
8918 fi
8919 rm -f conftest.err conftest.$ac_ext
8920 fi
8921 echo "$as_me:8921: result: $ac_cv_header_pthread_h" >&5
8922 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
8923 if test $ac_cv_header_pthread_h = yes; then
8924
8925         cat >>confdefs.h <<\EOF
8926 #define HAVE_PTHREADS_H 1
8927 EOF
8928
8929         echo "$as_me:8929: checking if we can link with the pthread library" >&5
8930 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6
8931         cf_save_LIBS="$LIBS"
8932         LIBS="-lpthread $LIBS"
8933         cat >conftest.$ac_ext <<_ACEOF
8934 #line 8934 "configure"
8935 #include "confdefs.h"
8936
8937 #include <pthread.h>
8938
8939 int
8940 main ()
8941 {
8942
8943         int rc = pthread_create(0,0,0,0);
8944
8945   ;
8946   return 0;
8947 }
8948 _ACEOF
8949 rm -f conftest.$ac_objext conftest$ac_exeext
8950 if { (eval echo "$as_me:8950: \"$ac_link\"") >&5
8951   (eval $ac_link) 2>&5
8952   ac_status=$?
8953   echo "$as_me:8953: \$? = $ac_status" >&5
8954   (exit $ac_status); } &&
8955          { ac_try='test -s conftest$ac_exeext'
8956   { (eval echo "$as_me:8956: \"$ac_try\"") >&5
8957   (eval $ac_try) 2>&5
8958   ac_status=$?
8959   echo "$as_me:8959: \$? = $ac_status" >&5
8960   (exit $ac_status); }; }; then
8961   with_pthread=yes
8962 else
8963   echo "$as_me: failed program was:" >&5
8964 cat conftest.$ac_ext >&5
8965 with_pthread=no
8966 fi
8967 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8968         LIBS="$cf_save_LIBS"
8969         echo "$as_me:8969: result: $with_pthread" >&5
8970 echo "${ECHO_T}$with_pthread" >&6
8971
8972         if test "$with_pthread" = yes ; then
8973             LIBS="-lpthread $LIBS"
8974             cat >>confdefs.h <<\EOF
8975 #define HAVE_LIBPTHREADS 1
8976 EOF
8977
8978         else
8979             { { echo "$as_me:8979: error: Cannot link with pthread library" >&5
8980 echo "$as_me: error: Cannot link with pthread library" >&2;}
8981    { (exit 1); exit 1; }; }
8982         fi
8983
8984 fi
8985
8986 fi
8987
8988 echo "$as_me:8988: checking if you want to use weak-symbols for pthreads" >&5
8989 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
8990
8991 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
8992 if test "${enable_weak_symbols+set}" = set; then
8993   enableval="$enable_weak_symbols"
8994   use_weak_symbols=$withval
8995 else
8996   use_weak_symbols=no
8997 fi;
8998 echo "$as_me:8998: result: $use_weak_symbols" >&5
8999 echo "${ECHO_T}$use_weak_symbols" >&6
9000 if test "$use_weak_symbols" = yes ; then
9001
9002 echo "$as_me:9002: checking if $CC supports weak symbols" >&5
9003 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
9004 if test "${cf_cv_weak_symbols+set}" = set; then
9005   echo $ECHO_N "(cached) $ECHO_C" >&6
9006 else
9007
9008 cat >conftest.$ac_ext <<_ACEOF
9009 #line 9009 "configure"
9010 #include "confdefs.h"
9011
9012 #include <stdio.h>
9013 int
9014 main ()
9015 {
9016
9017 #if defined(__GNUC__)
9018 #  if defined __USE_ISOC99
9019 #    define _cat_pragma(exp)    _Pragma(#exp)
9020 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9021 #  else
9022 #    define _weak_pragma(exp)
9023 #  endif
9024 #  define _declare(name)        __extension__ extern __typeof__(name) name
9025 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9026 #endif
9027
9028 weak_symbol(fopen);
9029
9030   ;
9031   return 0;
9032 }
9033 _ACEOF
9034 rm -f conftest.$ac_objext
9035 if { (eval echo "$as_me:9035: \"$ac_compile\"") >&5
9036   (eval $ac_compile) 2>&5
9037   ac_status=$?
9038   echo "$as_me:9038: \$? = $ac_status" >&5
9039   (exit $ac_status); } &&
9040          { ac_try='test -s conftest.$ac_objext'
9041   { (eval echo "$as_me:9041: \"$ac_try\"") >&5
9042   (eval $ac_try) 2>&5
9043   ac_status=$?
9044   echo "$as_me:9044: \$? = $ac_status" >&5
9045   (exit $ac_status); }; }; then
9046   cf_cv_weak_symbols=yes
9047 else
9048   echo "$as_me: failed program was:" >&5
9049 cat conftest.$ac_ext >&5
9050 cf_cv_weak_symbols=no
9051 fi
9052 rm -f conftest.$ac_objext conftest.$ac_ext
9053
9054 fi
9055 echo "$as_me:9055: result: $cf_cv_weak_symbols" >&5
9056 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9057
9058 else
9059     cf_cv_weak_symbols=no
9060 fi
9061
9062 if test $cf_cv_weak_symbols = yes ; then
9063     cat >>confdefs.h <<\EOF
9064 #define USE_WEAK_SYMBOLS 1
9065 EOF
9066
9067 fi
9068
9069 PTHREAD=
9070 if test "$with_pthread" = "yes" ; then
9071     cat >>confdefs.h <<\EOF
9072 #define USE_PTHREADS 1
9073 EOF
9074
9075     enable_reentrant=yes
9076     if test $cf_cv_weak_symbols = yes ; then
9077         PTHREAD=-lpthread
9078     fi
9079 fi
9080
9081 # Reentrant code has to be opaque; there's little advantage to making ncurses
9082 # opaque outside of that, so there is no --enable-opaque option.  We can use
9083 # this option without --with-pthreads, but this will be always set for
9084 # pthreads.
9085 echo "$as_me:9085: checking if you want experimental reentrant code" >&5
9086 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9087
9088 # Check whether --enable-reentrant or --disable-reentrant was given.
9089 if test "${enable_reentrant+set}" = set; then
9090   enableval="$enable_reentrant"
9091   with_reentrant=$enableval
9092 else
9093   with_reentrant=no
9094 fi;
9095 echo "$as_me:9095: result: $with_reentrant" >&5
9096 echo "${ECHO_T}$with_reentrant" >&6
9097 if test "$with_reentrant" = yes ; then
9098         cf_cv_enable_reentrant=1
9099         if test $cf_cv_weak_symbols = yes ; then
9100
9101 # remove pthread library from $LIBS
9102 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9103
9104         else
9105                 LIB_SUFFIX="t${LIB_SUFFIX}"
9106         fi
9107         cat >>confdefs.h <<\EOF
9108 #define USE_REENTRANT 1
9109 EOF
9110
9111 else
9112         cf_cv_enable_reentrant=0
9113 fi
9114
9115 ### Allow using a different wrap-prefix
9116 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9117         echo "$as_me:9117: checking for prefix used to wrap public variables" >&5
9118 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9119
9120 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9121 if test "${with_wrap_prefix+set}" = set; then
9122   withval="$with_wrap_prefix"
9123   NCURSES_WRAP_PREFIX=$withval
9124 else
9125   NCURSES_WRAP_PREFIX=_nc_
9126 fi;
9127         echo "$as_me:9127: result: $NCURSES_WRAP_PREFIX" >&5
9128 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9129 else
9130         NCURSES_WRAP_PREFIX=_nc_
9131 fi
9132
9133 cat >>confdefs.h <<EOF
9134 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9135 EOF
9136
9137 ###############################################################################
9138
9139 ###     use option --disable-echo to suppress full display compiling commands
9140 echo "$as_me:9140: checking if you want to display full commands during build" >&5
9141 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6
9142
9143 # Check whether --enable-echo or --disable-echo was given.
9144 if test "${enable_echo+set}" = set; then
9145   enableval="$enable_echo"
9146   with_echo=$enableval
9147 else
9148   with_echo=yes
9149 fi;
9150 if test "$with_echo" = yes; then
9151         ECHO_LINK=
9152 else
9153         ECHO_LINK='@ echo linking $@ ... ;'
9154 fi
9155 echo "$as_me:9155: result: $with_echo" >&5
9156 echo "${ECHO_T}$with_echo" >&6
9157
9158 ###     use option --enable-warnings to turn on all gcc warnings
9159 echo "$as_me:9159: checking if you want to see compiler warnings" >&5
9160 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
9161
9162 # Check whether --enable-warnings or --disable-warnings was given.
9163 if test "${enable_warnings+set}" = set; then
9164   enableval="$enable_warnings"
9165   with_warnings=$enableval
9166 fi;
9167 echo "$as_me:9167: result: $with_warnings" >&5
9168 echo "${ECHO_T}$with_warnings" >&6
9169
9170 if test "x$with_warnings" = "xyes"; then
9171         ADAFLAGS="$ADAFLAGS -gnatg"
9172
9173 INTEL_COMPILER=no
9174
9175 if test "$GCC" = yes ; then
9176         case $host_os in
9177         linux*|gnu*)
9178                 echo "$as_me:9178: checking if this is really Intel C compiler" >&5
9179 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
9180                 cf_save_CFLAGS="$CFLAGS"
9181                 CFLAGS="$CFLAGS -no-gcc"
9182                 cat >conftest.$ac_ext <<_ACEOF
9183 #line 9183 "configure"
9184 #include "confdefs.h"
9185
9186 int
9187 main ()
9188 {
9189
9190 #ifdef __INTEL_COMPILER
9191 #else
9192 make an error
9193 #endif
9194
9195   ;
9196   return 0;
9197 }
9198 _ACEOF
9199 rm -f conftest.$ac_objext
9200 if { (eval echo "$as_me:9200: \"$ac_compile\"") >&5
9201   (eval $ac_compile) 2>&5
9202   ac_status=$?
9203   echo "$as_me:9203: \$? = $ac_status" >&5
9204   (exit $ac_status); } &&
9205          { ac_try='test -s conftest.$ac_objext'
9206   { (eval echo "$as_me:9206: \"$ac_try\"") >&5
9207   (eval $ac_try) 2>&5
9208   ac_status=$?
9209   echo "$as_me:9209: \$? = $ac_status" >&5
9210   (exit $ac_status); }; }; then
9211   INTEL_COMPILER=yes
9212 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
9213
9214 else
9215   echo "$as_me: failed program was:" >&5
9216 cat conftest.$ac_ext >&5
9217 fi
9218 rm -f conftest.$ac_objext conftest.$ac_ext
9219                 CFLAGS="$cf_save_CFLAGS"
9220                 echo "$as_me:9220: result: $INTEL_COMPILER" >&5
9221 echo "${ECHO_T}$INTEL_COMPILER" >&6
9222                 ;;
9223         esac
9224 fi
9225
9226 cat > conftest.$ac_ext <<EOF
9227 #line 9227 "${as_me-configure}"
9228 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
9229 EOF
9230
9231 if test "$INTEL_COMPILER" = yes
9232 then
9233 # The "-wdXXX" options suppress warnings:
9234 # remark #1419: external declaration in primary source file
9235 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
9236 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
9237 # remark #193: zero used for undefined preprocessing identifier
9238 # remark #593: variable "curs_sb_left_arrow" was set but never used
9239 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
9240 # remark #869: parameter "tw" was never referenced
9241 # remark #981: operands are evaluated in unspecified order
9242 # warning #279: controlling expression is constant
9243
9244         { echo "$as_me:9244: checking for $CC warning options..." >&5
9245 echo "$as_me: checking for $CC warning options..." >&6;}
9246         cf_save_CFLAGS="$CFLAGS"
9247         EXTRA_CFLAGS="-Wall"
9248         for cf_opt in \
9249                 wd1419 \
9250                 wd1683 \
9251                 wd1684 \
9252                 wd193 \
9253                 wd593 \
9254                 wd279 \
9255                 wd810 \
9256                 wd869 \
9257                 wd981
9258         do
9259                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
9260                 if { (eval echo "$as_me:9260: \"$ac_compile\"") >&5
9261   (eval $ac_compile) 2>&5
9262   ac_status=$?
9263   echo "$as_me:9263: \$? = $ac_status" >&5
9264   (exit $ac_status); }; then
9265                         test -n "$verbose" && echo "$as_me:9265: result: ... -$cf_opt" >&5
9266 echo "${ECHO_T}... -$cf_opt" >&6
9267                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
9268                 fi
9269         done
9270         CFLAGS="$cf_save_CFLAGS"
9271
9272 elif test "$GCC" = yes
9273 then
9274         { echo "$as_me:9274: checking for $CC warning options..." >&5
9275 echo "$as_me: checking for $CC warning options..." >&6;}
9276         cf_save_CFLAGS="$CFLAGS"
9277         EXTRA_CFLAGS=
9278         cf_warn_CONST=""
9279         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
9280         for cf_opt in W Wall \
9281                 Wbad-function-cast \
9282                 Wcast-align \
9283                 Wcast-qual \
9284                 Winline \
9285                 Wmissing-declarations \
9286                 Wmissing-prototypes \
9287                 Wnested-externs \
9288                 Wpointer-arith \
9289                 Wshadow \
9290                 Wstrict-prototypes \
9291                 Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
9292         do
9293                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
9294                 if { (eval echo "$as_me:9294: \"$ac_compile\"") >&5
9295   (eval $ac_compile) 2>&5
9296   ac_status=$?
9297   echo "$as_me:9297: \$? = $ac_status" >&5
9298   (exit $ac_status); }; then
9299                         test -n "$verbose" && echo "$as_me:9299: result: ... -$cf_opt" >&5
9300 echo "${ECHO_T}... -$cf_opt" >&6
9301                         case $cf_opt in #(vi
9302                         Wcast-qual) #(vi
9303                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
9304                                 ;;
9305                         Winline) #(vi
9306                                 case $GCC_VERSION in
9307                                 [34].*)
9308                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
9309
9310 echo "${as_me-configure}:9310: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
9311
9312                                         continue;;
9313                                 esac
9314                                 ;;
9315                         esac
9316                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
9317                 fi
9318         done
9319         CFLAGS="$cf_save_CFLAGS"
9320 fi
9321 rm -f conftest*
9322
9323 fi
9324
9325 if test "$GCC" = yes
9326 then
9327 cat > conftest.i <<EOF
9328 #ifndef GCC_PRINTF
9329 #define GCC_PRINTF 0
9330 #endif
9331 #ifndef GCC_SCANF
9332 #define GCC_SCANF 0
9333 #endif
9334 #ifndef GCC_NORETURN
9335 #define GCC_NORETURN /* nothing */
9336 #endif
9337 #ifndef GCC_UNUSED
9338 #define GCC_UNUSED /* nothing */
9339 #endif
9340 EOF
9341 if test "$GCC" = yes
9342 then
9343         { echo "$as_me:9343: checking for $CC __attribute__ directives..." >&5
9344 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
9345 cat > conftest.$ac_ext <<EOF
9346 #line 9346 "${as_me-configure}"
9347 #include "confdefs.h"
9348 #include "conftest.h"
9349 #include "conftest.i"
9350 #if     GCC_PRINTF
9351 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
9352 #else
9353 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
9354 #endif
9355 #if     GCC_SCANF
9356 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
9357 #else
9358 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
9359 #endif
9360 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
9361 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
9362 extern void foo(void) GCC_NORETURN;
9363 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
9364 EOF
9365         cf_printf_attribute=no
9366         cf_scanf_attribute=no
9367         for cf_attribute in scanf printf unused noreturn
9368         do
9369
9370 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9371
9372                 cf_directive="__attribute__(($cf_attribute))"
9373                 echo "checking for $CC $cf_directive" 1>&5
9374
9375                 case $cf_attribute in #(vi
9376                 printf) #(vi
9377                         cf_printf_attribute=yes
9378                         cat >conftest.h <<EOF
9379 #define GCC_$cf_ATTRIBUTE 1
9380 EOF
9381                         ;;
9382                 scanf) #(vi
9383                         cf_scanf_attribute=yes
9384                         cat >conftest.h <<EOF
9385 #define GCC_$cf_ATTRIBUTE 1
9386 EOF
9387                         ;;
9388                 *) #(vi
9389                         cat >conftest.h <<EOF
9390 #define GCC_$cf_ATTRIBUTE $cf_directive
9391 EOF
9392                         ;;
9393                 esac
9394
9395                 if { (eval echo "$as_me:9395: \"$ac_compile\"") >&5
9396   (eval $ac_compile) 2>&5
9397   ac_status=$?
9398   echo "$as_me:9398: \$? = $ac_status" >&5
9399   (exit $ac_status); }; then
9400                         test -n "$verbose" && echo "$as_me:9400: result: ... $cf_attribute" >&5
9401 echo "${ECHO_T}... $cf_attribute" >&6
9402                         cat conftest.h >>confdefs.h
9403                         case $cf_attribute in #(vi
9404                         printf) #(vi
9405                                 if test "$cf_printf_attribute" = no ; then
9406                                         cat >>confdefs.h <<EOF
9407 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
9408 EOF
9409                                 else
9410                                         cat >>confdefs.h <<EOF
9411 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
9412 EOF
9413                                 fi
9414                                 ;;
9415                         scanf) #(vi
9416                                 if test "$cf_scanf_attribute" = no ; then
9417                                         cat >>confdefs.h <<EOF
9418 #define GCC_SCANFLIKE(fmt,var) /* nothing */
9419 EOF
9420                                 else
9421                                         cat >>confdefs.h <<EOF
9422 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
9423 EOF
9424                                 fi
9425                                 ;;
9426                         esac
9427                 fi
9428         done
9429 else
9430         fgrep define conftest.i >>confdefs.h
9431 fi
9432 rm -rf conftest*
9433 fi
9434
9435 ###     use option --enable-assertions to turn on generation of assertion code
9436 echo "$as_me:9436: checking if you want to enable runtime assertions" >&5
9437 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
9438
9439 # Check whether --enable-assertions or --disable-assertions was given.
9440 if test "${enable_assertions+set}" = set; then
9441   enableval="$enable_assertions"
9442   with_assertions=$enableval
9443 else
9444   with_assertions=no
9445 fi;
9446 echo "$as_me:9446: result: $with_assertions" >&5
9447 echo "${ECHO_T}$with_assertions" >&6
9448 if test -n "$GCC"
9449 then
9450         if test "$with_assertions" = no
9451         then
9452                 cat >>confdefs.h <<\EOF
9453 #define NDEBUG 1
9454 EOF
9455
9456                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
9457         else
9458                 ADAFLAGS="$ADAFLAGS -gnata"
9459         fi
9460 fi
9461
9462 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
9463 cat >>confdefs.h <<\EOF
9464 #define HAVE_NC_ALLOC_H 1
9465 EOF
9466
9467 ###     use option --enable-expanded to generate certain macros as functions
9468
9469 # Check whether --enable-expanded or --disable-expanded was given.
9470 if test "${enable_expanded+set}" = set; then
9471   enableval="$enable_expanded"
9472   test "$enableval" = yes && cat >>confdefs.h <<\EOF
9473 #define NCURSES_EXPANDED 1
9474 EOF
9475
9476 fi;
9477
9478 ###     use option --disable-macros to suppress macros in favor of functions
9479
9480 # Check whether --enable-macros or --disable-macros was given.
9481 if test "${enable_macros+set}" = set; then
9482   enableval="$enable_macros"
9483   test "$enableval" = no && cat >>confdefs.h <<\EOF
9484 #define NCURSES_NOMACROS 1
9485 EOF
9486
9487 fi;
9488
9489 # Normally we only add trace() to the debug-library.  Allow this to be
9490 # extended to all models of the ncurses library:
9491 cf_all_traces=no
9492 case "$CFLAGS $CPPFLAGS" in
9493 *-DTRACE*)
9494         cf_all_traces=yes
9495         ;;
9496 esac
9497
9498 echo "$as_me:9498: checking whether to add trace feature to all models" >&5
9499 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
9500
9501 # Check whether --with-trace or --without-trace was given.
9502 if test "${with_trace+set}" = set; then
9503   withval="$with_trace"
9504   cf_with_trace=$withval
9505 else
9506   cf_with_trace=$cf_all_traces
9507 fi;
9508 echo "$as_me:9508: result: $cf_with_trace" >&5
9509 echo "${ECHO_T}$cf_with_trace" >&6
9510
9511 if test "$cf_with_trace" = yes ; then
9512         ADA_TRACE=TRUE
9513
9514 cf_fix_cppflags=no
9515 cf_new_cflags=
9516 cf_new_cppflags=
9517 cf_new_extra_cppflags=
9518
9519 for cf_add_cflags in -DTRACE
9520 do
9521 case $cf_fix_cppflags in
9522 no)
9523         case $cf_add_cflags in #(vi
9524         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9525                 case $cf_add_cflags in
9526                 -D*)
9527                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9528
9529                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9530                                 && test -z "${cf_tst_cflags}" \
9531                                 && cf_fix_cppflags=yes
9532
9533                         if test $cf_fix_cppflags = yes ; then
9534                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9535                                 continue
9536                         elif test "${cf_tst_cflags}" = "\"'" ; then
9537                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9538                                 continue
9539                         fi
9540                         ;;
9541                 esac
9542                 case "$CPPFLAGS" in
9543                 *$cf_add_cflags) #(vi
9544                         ;;
9545                 *) #(vi
9546                         case $cf_add_cflags in #(vi
9547                         -D*)
9548                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9549
9550 CPPFLAGS=`echo "$CPPFLAGS" | \
9551         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9552                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9553
9554                                 ;;
9555                         esac
9556                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9557                         ;;
9558                 esac
9559                 ;;
9560         *)
9561                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9562                 ;;
9563         esac
9564         ;;
9565 yes)
9566         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9567
9568         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9569
9570         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9571                 && test -z "${cf_tst_cflags}" \
9572                 && cf_fix_cppflags=no
9573         ;;
9574 esac
9575 done
9576
9577 if test -n "$cf_new_cflags" ; then
9578
9579         CFLAGS="$CFLAGS $cf_new_cflags"
9580 fi
9581
9582 if test -n "$cf_new_cppflags" ; then
9583
9584         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9585 fi
9586
9587 if test -n "$cf_new_extra_cppflags" ; then
9588
9589         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9590 fi
9591
9592 else
9593         ADA_TRACE=FALSE
9594 fi
9595
9596 ###     Checks for libraries.
9597 case $cf_cv_system_name in #(vi
9598 *mingw32*) #(vi
9599         ;;
9600 *)
9601 echo "$as_me:9601: checking for gettimeofday" >&5
9602 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
9603 if test "${ac_cv_func_gettimeofday+set}" = set; then
9604   echo $ECHO_N "(cached) $ECHO_C" >&6
9605 else
9606   cat >conftest.$ac_ext <<_ACEOF
9607 #line 9607 "configure"
9608 #include "confdefs.h"
9609 /* System header to define __stub macros and hopefully few prototypes,
9610     which can conflict with char gettimeofday (); below.  */
9611 #include <assert.h>
9612 /* Override any gcc2 internal prototype to avoid an error.  */
9613 #ifdef __cplusplus
9614 extern "C"
9615 #endif
9616 /* We use char because int might match the return type of a gcc2
9617    builtin and then its argument prototype would still apply.  */
9618 char gettimeofday ();
9619 char (*f) ();
9620
9621 int
9622 main ()
9623 {
9624 /* The GNU C library defines this for functions which it implements
9625     to always fail with ENOSYS.  Some functions are actually named
9626     something starting with __ and the normal name is an alias.  */
9627 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
9628 choke me
9629 #else
9630 f = gettimeofday;
9631 #endif
9632
9633   ;
9634   return 0;
9635 }
9636 _ACEOF
9637 rm -f conftest.$ac_objext conftest$ac_exeext
9638 if { (eval echo "$as_me:9638: \"$ac_link\"") >&5
9639   (eval $ac_link) 2>&5
9640   ac_status=$?
9641   echo "$as_me:9641: \$? = $ac_status" >&5
9642   (exit $ac_status); } &&
9643          { ac_try='test -s conftest$ac_exeext'
9644   { (eval echo "$as_me:9644: \"$ac_try\"") >&5
9645   (eval $ac_try) 2>&5
9646   ac_status=$?
9647   echo "$as_me:9647: \$? = $ac_status" >&5
9648   (exit $ac_status); }; }; then
9649   ac_cv_func_gettimeofday=yes
9650 else
9651   echo "$as_me: failed program was:" >&5
9652 cat conftest.$ac_ext >&5
9653 ac_cv_func_gettimeofday=no
9654 fi
9655 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9656 fi
9657 echo "$as_me:9657: result: $ac_cv_func_gettimeofday" >&5
9658 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
9659 if test $ac_cv_func_gettimeofday = yes; then
9660   cat >>confdefs.h <<\EOF
9661 #define HAVE_GETTIMEOFDAY 1
9662 EOF
9663
9664 else
9665
9666 echo "$as_me:9666: checking for gettimeofday in -lbsd" >&5
9667 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
9668 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
9669   echo $ECHO_N "(cached) $ECHO_C" >&6
9670 else
9671   ac_check_lib_save_LIBS=$LIBS
9672 LIBS="-lbsd  $LIBS"
9673 cat >conftest.$ac_ext <<_ACEOF
9674 #line 9674 "configure"
9675 #include "confdefs.h"
9676
9677 /* Override any gcc2 internal prototype to avoid an error.  */
9678 #ifdef __cplusplus
9679 extern "C"
9680 #endif
9681 /* We use char because int might match the return type of a gcc2
9682    builtin and then its argument prototype would still apply.  */
9683 char gettimeofday ();
9684 int
9685 main ()
9686 {
9687 gettimeofday ();
9688   ;
9689   return 0;
9690 }
9691 _ACEOF
9692 rm -f conftest.$ac_objext conftest$ac_exeext
9693 if { (eval echo "$as_me:9693: \"$ac_link\"") >&5
9694   (eval $ac_link) 2>&5
9695   ac_status=$?
9696   echo "$as_me:9696: \$? = $ac_status" >&5
9697   (exit $ac_status); } &&
9698          { ac_try='test -s conftest$ac_exeext'
9699   { (eval echo "$as_me:9699: \"$ac_try\"") >&5
9700   (eval $ac_try) 2>&5
9701   ac_status=$?
9702   echo "$as_me:9702: \$? = $ac_status" >&5
9703   (exit $ac_status); }; }; then
9704   ac_cv_lib_bsd_gettimeofday=yes
9705 else
9706   echo "$as_me: failed program was:" >&5
9707 cat conftest.$ac_ext >&5
9708 ac_cv_lib_bsd_gettimeofday=no
9709 fi
9710 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9711 LIBS=$ac_check_lib_save_LIBS
9712 fi
9713 echo "$as_me:9713: result: $ac_cv_lib_bsd_gettimeofday" >&5
9714 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
9715 if test $ac_cv_lib_bsd_gettimeofday = yes; then
9716   cat >>confdefs.h <<\EOF
9717 #define HAVE_GETTIMEOFDAY 1
9718 EOF
9719
9720         LIBS="$LIBS -lbsd"
9721 fi
9722
9723 fi
9724         ;;
9725 esac
9726
9727 ###     Checks for header files.
9728 echo "$as_me:9728: checking for ANSI C header files" >&5
9729 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
9730 if test "${ac_cv_header_stdc+set}" = set; then
9731   echo $ECHO_N "(cached) $ECHO_C" >&6
9732 else
9733   cat >conftest.$ac_ext <<_ACEOF
9734 #line 9734 "configure"
9735 #include "confdefs.h"
9736 #include <stdlib.h>
9737 #include <stdarg.h>
9738 #include <string.h>
9739 #include <float.h>
9740
9741 _ACEOF
9742 if { (eval echo "$as_me:9742: \"$ac_cpp conftest.$ac_ext\"") >&5
9743   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9744   ac_status=$?
9745   egrep -v '^ *\+' conftest.er1 >conftest.err
9746   rm -f conftest.er1
9747   cat conftest.err >&5
9748   echo "$as_me:9748: \$? = $ac_status" >&5
9749   (exit $ac_status); } >/dev/null; then
9750   if test -s conftest.err; then
9751     ac_cpp_err=$ac_c_preproc_warn_flag
9752   else
9753     ac_cpp_err=
9754   fi
9755 else
9756   ac_cpp_err=yes
9757 fi
9758 if test -z "$ac_cpp_err"; then
9759   ac_cv_header_stdc=yes
9760 else
9761   echo "$as_me: failed program was:" >&5
9762   cat conftest.$ac_ext >&5
9763   ac_cv_header_stdc=no
9764 fi
9765 rm -f conftest.err conftest.$ac_ext
9766
9767 if test $ac_cv_header_stdc = yes; then
9768   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9769   cat >conftest.$ac_ext <<_ACEOF
9770 #line 9770 "configure"
9771 #include "confdefs.h"
9772 #include <string.h>
9773
9774 _ACEOF
9775 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9776   egrep "memchr" >/dev/null 2>&1; then
9777   :
9778 else
9779   ac_cv_header_stdc=no
9780 fi
9781 rm -f conftest*
9782
9783 fi
9784
9785 if test $ac_cv_header_stdc = yes; then
9786   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9787   cat >conftest.$ac_ext <<_ACEOF
9788 #line 9788 "configure"
9789 #include "confdefs.h"
9790 #include <stdlib.h>
9791
9792 _ACEOF
9793 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9794   egrep "free" >/dev/null 2>&1; then
9795   :
9796 else
9797   ac_cv_header_stdc=no
9798 fi
9799 rm -f conftest*
9800
9801 fi
9802
9803 if test $ac_cv_header_stdc = yes; then
9804   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9805   if test "$cross_compiling" = yes; then
9806   :
9807 else
9808   cat >conftest.$ac_ext <<_ACEOF
9809 #line 9809 "configure"
9810 #include "confdefs.h"
9811 #include <ctype.h>
9812 #if ((' ' & 0x0FF) == 0x020)
9813 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9814 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9815 #else
9816 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9817                      || ('j' <= (c) && (c) <= 'r') \
9818                      || ('s' <= (c) && (c) <= 'z'))
9819 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
9820 #endif
9821
9822 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9823 int
9824 main ()
9825 {
9826   int i;
9827   for (i = 0; i < 256; i++)
9828     if (XOR (islower (i), ISLOWER (i))
9829         || toupper (i) != TOUPPER (i))
9830       $ac_main_return(2);
9831   $ac_main_return (0);
9832 }
9833 _ACEOF
9834 rm -f conftest$ac_exeext
9835 if { (eval echo "$as_me:9835: \"$ac_link\"") >&5
9836   (eval $ac_link) 2>&5
9837   ac_status=$?
9838   echo "$as_me:9838: \$? = $ac_status" >&5
9839   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9840   { (eval echo "$as_me:9840: \"$ac_try\"") >&5
9841   (eval $ac_try) 2>&5
9842   ac_status=$?
9843   echo "$as_me:9843: \$? = $ac_status" >&5
9844   (exit $ac_status); }; }; then
9845   :
9846 else
9847   echo "$as_me: program exited with status $ac_status" >&5
9848 echo "$as_me: failed program was:" >&5
9849 cat conftest.$ac_ext >&5
9850 ac_cv_header_stdc=no
9851 fi
9852 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9853 fi
9854 fi
9855 fi
9856 echo "$as_me:9856: result: $ac_cv_header_stdc" >&5
9857 echo "${ECHO_T}$ac_cv_header_stdc" >&6
9858 if test $ac_cv_header_stdc = yes; then
9859
9860 cat >>confdefs.h <<\EOF
9861 #define STDC_HEADERS 1
9862 EOF
9863
9864 fi
9865
9866 ac_header_dirent=no
9867 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
9868   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
9869 echo "$as_me:9869: checking for $ac_hdr that defines DIR" >&5
9870 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
9871 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9872   echo $ECHO_N "(cached) $ECHO_C" >&6
9873 else
9874   cat >conftest.$ac_ext <<_ACEOF
9875 #line 9875 "configure"
9876 #include "confdefs.h"
9877 #include <sys/types.h>
9878 #include <$ac_hdr>
9879
9880 int
9881 main ()
9882 {
9883 if ((DIR *) 0)
9884 return 0;
9885   ;
9886   return 0;
9887 }
9888 _ACEOF
9889 rm -f conftest.$ac_objext
9890 if { (eval echo "$as_me:9890: \"$ac_compile\"") >&5
9891   (eval $ac_compile) 2>&5
9892   ac_status=$?
9893   echo "$as_me:9893: \$? = $ac_status" >&5
9894   (exit $ac_status); } &&
9895          { ac_try='test -s conftest.$ac_objext'
9896   { (eval echo "$as_me:9896: \"$ac_try\"") >&5
9897   (eval $ac_try) 2>&5
9898   ac_status=$?
9899   echo "$as_me:9899: \$? = $ac_status" >&5
9900   (exit $ac_status); }; }; then
9901   eval "$as_ac_Header=yes"
9902 else
9903   echo "$as_me: failed program was:" >&5
9904 cat conftest.$ac_ext >&5
9905 eval "$as_ac_Header=no"
9906 fi
9907 rm -f conftest.$ac_objext conftest.$ac_ext
9908 fi
9909 echo "$as_me:9909: result: `eval echo '${'$as_ac_Header'}'`" >&5
9910 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9911 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9912   cat >>confdefs.h <<EOF
9913 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
9914 EOF
9915
9916 ac_header_dirent=$ac_hdr; break
9917 fi
9918
9919 done
9920 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9921 if test $ac_header_dirent = dirent.h; then
9922   echo "$as_me:9922: checking for opendir in -ldir" >&5
9923 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
9924 if test "${ac_cv_lib_dir_opendir+set}" = set; then
9925   echo $ECHO_N "(cached) $ECHO_C" >&6
9926 else
9927   ac_check_lib_save_LIBS=$LIBS
9928 LIBS="-ldir  $LIBS"
9929 cat >conftest.$ac_ext <<_ACEOF
9930 #line 9930 "configure"
9931 #include "confdefs.h"
9932
9933 /* Override any gcc2 internal prototype to avoid an error.  */
9934 #ifdef __cplusplus
9935 extern "C"
9936 #endif
9937 /* We use char because int might match the return type of a gcc2
9938    builtin and then its argument prototype would still apply.  */
9939 char opendir ();
9940 int
9941 main ()
9942 {
9943 opendir ();
9944   ;
9945   return 0;
9946 }
9947 _ACEOF
9948 rm -f conftest.$ac_objext conftest$ac_exeext
9949 if { (eval echo "$as_me:9949: \"$ac_link\"") >&5
9950   (eval $ac_link) 2>&5
9951   ac_status=$?
9952   echo "$as_me:9952: \$? = $ac_status" >&5
9953   (exit $ac_status); } &&
9954          { ac_try='test -s conftest$ac_exeext'
9955   { (eval echo "$as_me:9955: \"$ac_try\"") >&5
9956   (eval $ac_try) 2>&5
9957   ac_status=$?
9958   echo "$as_me:9958: \$? = $ac_status" >&5
9959   (exit $ac_status); }; }; then
9960   ac_cv_lib_dir_opendir=yes
9961 else
9962   echo "$as_me: failed program was:" >&5
9963 cat conftest.$ac_ext >&5
9964 ac_cv_lib_dir_opendir=no
9965 fi
9966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9967 LIBS=$ac_check_lib_save_LIBS
9968 fi
9969 echo "$as_me:9969: result: $ac_cv_lib_dir_opendir" >&5
9970 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
9971 if test $ac_cv_lib_dir_opendir = yes; then
9972   LIBS="$LIBS -ldir"
9973 fi
9974
9975 else
9976   echo "$as_me:9976: checking for opendir in -lx" >&5
9977 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
9978 if test "${ac_cv_lib_x_opendir+set}" = set; then
9979   echo $ECHO_N "(cached) $ECHO_C" >&6
9980 else
9981   ac_check_lib_save_LIBS=$LIBS
9982 LIBS="-lx  $LIBS"
9983 cat >conftest.$ac_ext <<_ACEOF
9984 #line 9984 "configure"
9985 #include "confdefs.h"
9986
9987 /* Override any gcc2 internal prototype to avoid an error.  */
9988 #ifdef __cplusplus
9989 extern "C"
9990 #endif
9991 /* We use char because int might match the return type of a gcc2
9992    builtin and then its argument prototype would still apply.  */
9993 char opendir ();
9994 int
9995 main ()
9996 {
9997 opendir ();
9998   ;
9999   return 0;
10000 }
10001 _ACEOF
10002 rm -f conftest.$ac_objext conftest$ac_exeext
10003 if { (eval echo "$as_me:10003: \"$ac_link\"") >&5
10004   (eval $ac_link) 2>&5
10005   ac_status=$?
10006   echo "$as_me:10006: \$? = $ac_status" >&5
10007   (exit $ac_status); } &&
10008          { ac_try='test -s conftest$ac_exeext'
10009   { (eval echo "$as_me:10009: \"$ac_try\"") >&5
10010   (eval $ac_try) 2>&5
10011   ac_status=$?
10012   echo "$as_me:10012: \$? = $ac_status" >&5
10013   (exit $ac_status); }; }; then
10014   ac_cv_lib_x_opendir=yes
10015 else
10016   echo "$as_me: failed program was:" >&5
10017 cat conftest.$ac_ext >&5
10018 ac_cv_lib_x_opendir=no
10019 fi
10020 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10021 LIBS=$ac_check_lib_save_LIBS
10022 fi
10023 echo "$as_me:10023: result: $ac_cv_lib_x_opendir" >&5
10024 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10025 if test $ac_cv_lib_x_opendir = yes; then
10026   LIBS="$LIBS -lx"
10027 fi
10028
10029 fi
10030
10031 echo "$as_me:10031: checking whether time.h and sys/time.h may both be included" >&5
10032 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10033 if test "${ac_cv_header_time+set}" = set; then
10034   echo $ECHO_N "(cached) $ECHO_C" >&6
10035 else
10036   cat >conftest.$ac_ext <<_ACEOF
10037 #line 10037 "configure"
10038 #include "confdefs.h"
10039 #include <sys/types.h>
10040 #include <sys/time.h>
10041 #include <time.h>
10042
10043 int
10044 main ()
10045 {
10046 if ((struct tm *) 0)
10047 return 0;
10048   ;
10049   return 0;
10050 }
10051 _ACEOF
10052 rm -f conftest.$ac_objext
10053 if { (eval echo "$as_me:10053: \"$ac_compile\"") >&5
10054   (eval $ac_compile) 2>&5
10055   ac_status=$?
10056   echo "$as_me:10056: \$? = $ac_status" >&5
10057   (exit $ac_status); } &&
10058          { ac_try='test -s conftest.$ac_objext'
10059   { (eval echo "$as_me:10059: \"$ac_try\"") >&5
10060   (eval $ac_try) 2>&5
10061   ac_status=$?
10062   echo "$as_me:10062: \$? = $ac_status" >&5
10063   (exit $ac_status); }; }; then
10064   ac_cv_header_time=yes
10065 else
10066   echo "$as_me: failed program was:" >&5
10067 cat conftest.$ac_ext >&5
10068 ac_cv_header_time=no
10069 fi
10070 rm -f conftest.$ac_objext conftest.$ac_ext
10071 fi
10072 echo "$as_me:10072: result: $ac_cv_header_time" >&5
10073 echo "${ECHO_T}$ac_cv_header_time" >&6
10074 if test $ac_cv_header_time = yes; then
10075
10076 cat >>confdefs.h <<\EOF
10077 #define TIME_WITH_SYS_TIME 1
10078 EOF
10079
10080 fi
10081
10082 ###     checks for compiler characteristics
10083 ac_ext=c
10084 ac_cpp='$CPP $CPPFLAGS'
10085 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10086 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10087 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10088 ac_main_return=return
10089
10090 echo "$as_me:10090: checking for $CC option to accept ANSI C" >&5
10091 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
10092 if test "${ac_cv_prog_cc_stdc+set}" = set; then
10093   echo $ECHO_N "(cached) $ECHO_C" >&6
10094 else
10095   ac_cv_prog_cc_stdc=no
10096 ac_save_CC=$CC
10097 cat >conftest.$ac_ext <<_ACEOF
10098 #line 10098 "configure"
10099 #include "confdefs.h"
10100 #include <stdarg.h>
10101 #include <stdio.h>
10102 #include <sys/types.h>
10103 #include <sys/stat.h>
10104 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
10105 struct buf { int x; };
10106 FILE * (*rcsopen) (struct buf *, struct stat *, int);
10107 static char *e (p, i)
10108      char **p;
10109      int i;
10110 {
10111   return p[i];
10112 }
10113 static char *f (char * (*g) (char **, int), char **p, ...)
10114 {
10115   char *s;
10116   va_list v;
10117   va_start (v,p);
10118   s = g (p, va_arg (v,int));
10119   va_end (v);
10120   return s;
10121 }
10122 int test (int i, double x);
10123 struct s1 {int (*f) (int a);};
10124 struct s2 {int (*f) (double a);};
10125 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
10126 int argc;
10127 char **argv;
10128 int
10129 main ()
10130 {
10131 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
10132   ;
10133   return 0;
10134 }
10135 _ACEOF
10136 # Don't try gcc -ansi; that turns off useful extensions and
10137 # breaks some systems' header files.
10138 # AIX                   -qlanglvl=ansi
10139 # Ultrix and OSF/1      -std1
10140 # HP-UX 10.20 and later -Ae
10141 # HP-UX older versions  -Aa -D_HPUX_SOURCE
10142 # SVR4                  -Xc -D__EXTENSIONS__
10143 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
10144 do
10145   CC="$ac_save_CC $ac_arg"
10146   rm -f conftest.$ac_objext
10147 if { (eval echo "$as_me:10147: \"$ac_compile\"") >&5
10148   (eval $ac_compile) 2>&5
10149   ac_status=$?
10150   echo "$as_me:10150: \$? = $ac_status" >&5
10151   (exit $ac_status); } &&
10152          { ac_try='test -s conftest.$ac_objext'
10153   { (eval echo "$as_me:10153: \"$ac_try\"") >&5
10154   (eval $ac_try) 2>&5
10155   ac_status=$?
10156   echo "$as_me:10156: \$? = $ac_status" >&5
10157   (exit $ac_status); }; }; then
10158   ac_cv_prog_cc_stdc=$ac_arg
10159 break
10160 else
10161   echo "$as_me: failed program was:" >&5
10162 cat conftest.$ac_ext >&5
10163 fi
10164 rm -f conftest.$ac_objext
10165 done
10166 rm -f conftest.$ac_ext conftest.$ac_objext
10167 CC=$ac_save_CC
10168
10169 fi
10170
10171 case "x$ac_cv_prog_cc_stdc" in
10172   x|xno)
10173     echo "$as_me:10173: result: none needed" >&5
10174 echo "${ECHO_T}none needed" >&6 ;;
10175   *)
10176     echo "$as_me:10176: result: $ac_cv_prog_cc_stdc" >&5
10177 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
10178     CC="$CC $ac_cv_prog_cc_stdc" ;;
10179 esac
10180
10181 echo "$as_me:10181: checking for an ANSI C-conforming const" >&5
10182 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
10183 if test "${ac_cv_c_const+set}" = set; then
10184   echo $ECHO_N "(cached) $ECHO_C" >&6
10185 else
10186   cat >conftest.$ac_ext <<_ACEOF
10187 #line 10187 "configure"
10188 #include "confdefs.h"
10189
10190 int
10191 main ()
10192 {
10193 /* FIXME: Include the comments suggested by Paul. */
10194 #ifndef __cplusplus
10195   /* Ultrix mips cc rejects this.  */
10196   typedef int charset[2];
10197   const charset x;
10198   /* SunOS 4.1.1 cc rejects this.  */
10199   char const *const *ccp;
10200   char **p;
10201   /* NEC SVR4.0.2 mips cc rejects this.  */
10202   struct point {int x, y;};
10203   static struct point const zero = {0,0};
10204   /* AIX XL C 1.02.0.0 rejects this.
10205      It does not let you subtract one const X* pointer from another in
10206      an arm of an if-expression whose if-part is not a constant
10207      expression */
10208   const char *g = "string";
10209   ccp = &g + (g ? g-g : 0);
10210   /* HPUX 7.0 cc rejects these. */
10211   ++ccp;
10212   p = (char**) ccp;
10213   ccp = (char const *const *) p;
10214   { /* SCO 3.2v4 cc rejects this.  */
10215     char *t;
10216     char const *s = 0 ? (char *) 0 : (char const *) 0;
10217
10218     *t++ = 0;
10219   }
10220   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10221     int x[] = {25, 17};
10222     const int *foo = &x[0];
10223     ++foo;
10224   }
10225   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10226     typedef const int *iptr;
10227     iptr p = 0;
10228     ++p;
10229   }
10230   { /* AIX XL C 1.02.0.0 rejects this saying
10231        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10232     struct s { int j; const int *ap[3]; };
10233     struct s *b; b->j = 5;
10234   }
10235   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10236     const int foo = 10;
10237   }
10238 #endif
10239
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_c_const=yes
10257 else
10258   echo "$as_me: failed program was:" >&5
10259 cat conftest.$ac_ext >&5
10260 ac_cv_c_const=no
10261 fi
10262 rm -f conftest.$ac_objext conftest.$ac_ext
10263 fi
10264 echo "$as_me:10264: result: $ac_cv_c_const" >&5
10265 echo "${ECHO_T}$ac_cv_c_const" >&6
10266 if test $ac_cv_c_const = no; then
10267
10268 cat >>confdefs.h <<\EOF
10269 #define const
10270 EOF
10271
10272 fi
10273
10274 ###     Checks for external-data
10275
10276 echo "$as_me:10276: checking if data-only library module links" >&5
10277 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
10278 if test "${cf_cv_link_dataonly+set}" = set; then
10279   echo $ECHO_N "(cached) $ECHO_C" >&6
10280 else
10281
10282         rm -f conftest.a
10283         cat >conftest.$ac_ext <<EOF
10284 #line 10284 "configure"
10285 int     testdata[3] = { 123, 456, 789 };
10286 EOF
10287         if { (eval echo "$as_me:10287: \"$ac_compile\"") >&5
10288   (eval $ac_compile) 2>&5
10289   ac_status=$?
10290   echo "$as_me:10290: \$? = $ac_status" >&5
10291   (exit $ac_status); } ; then
10292                 mv conftest.o data.o && \
10293                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
10294         fi
10295         rm -f conftest.$ac_ext data.o
10296         cat >conftest.$ac_ext <<EOF
10297 #line 10297 "configure"
10298 int     testfunc()
10299 {
10300 #if defined(NeXT)
10301         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
10302 #else
10303         extern int testdata[3];
10304         return testdata[0] == 123
10305            &&  testdata[1] == 456
10306            &&  testdata[2] == 789;
10307 #endif
10308 }
10309 EOF
10310         if { (eval echo "$as_me:10310: \"$ac_compile\"") >&5
10311   (eval $ac_compile) 2>&5
10312   ac_status=$?
10313   echo "$as_me:10313: \$? = $ac_status" >&5
10314   (exit $ac_status); }; then
10315                 mv conftest.o func.o && \
10316                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
10317         fi
10318         rm -f conftest.$ac_ext func.o
10319         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
10320         cf_saveLIBS="$LIBS"
10321         LIBS="conftest.a $LIBS"
10322         if test "$cross_compiling" = yes; then
10323   cf_cv_link_dataonly=unknown
10324 else
10325   cat >conftest.$ac_ext <<_ACEOF
10326 #line 10326 "configure"
10327 #include "confdefs.h"
10328
10329         int main()
10330         {
10331                 extern int testfunc();
10332                 ${cf_cv_main_return:-return} (!testfunc());
10333         }
10334
10335 _ACEOF
10336 rm -f conftest$ac_exeext
10337 if { (eval echo "$as_me:10337: \"$ac_link\"") >&5
10338   (eval $ac_link) 2>&5
10339   ac_status=$?
10340   echo "$as_me:10340: \$? = $ac_status" >&5
10341   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10342   { (eval echo "$as_me:10342: \"$ac_try\"") >&5
10343   (eval $ac_try) 2>&5
10344   ac_status=$?
10345   echo "$as_me:10345: \$? = $ac_status" >&5
10346   (exit $ac_status); }; }; then
10347   cf_cv_link_dataonly=yes
10348 else
10349   echo "$as_me: program exited with status $ac_status" >&5
10350 echo "$as_me: failed program was:" >&5
10351 cat conftest.$ac_ext >&5
10352 cf_cv_link_dataonly=no
10353 fi
10354 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10355 fi
10356         LIBS="$cf_saveLIBS"
10357
10358 fi
10359
10360 echo "$as_me:10360: result: $cf_cv_link_dataonly" >&5
10361 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
10362
10363 if test "$cf_cv_link_dataonly" = no ; then
10364         cat >>confdefs.h <<\EOF
10365 #define BROKEN_LINKER 1
10366 EOF
10367
10368         BROKEN_LINKER=1
10369 fi
10370
10371 ###     Checks for library functions.
10372
10373 echo "$as_me:10373: checking for working mkstemp" >&5
10374 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
10375 if test "${cf_cv_func_mkstemp+set}" = set; then
10376   echo $ECHO_N "(cached) $ECHO_C" >&6
10377 else
10378
10379 rm -f conftest*
10380 if test "$cross_compiling" = yes; then
10381   echo "$as_me:10381: checking for mkstemp" >&5
10382 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
10383 if test "${ac_cv_func_mkstemp+set}" = set; then
10384   echo $ECHO_N "(cached) $ECHO_C" >&6
10385 else
10386   cat >conftest.$ac_ext <<_ACEOF
10387 #line 10387 "configure"
10388 #include "confdefs.h"
10389 /* System header to define __stub macros and hopefully few prototypes,
10390     which can conflict with char mkstemp (); below.  */
10391 #include <assert.h>
10392 /* Override any gcc2 internal prototype to avoid an error.  */
10393 #ifdef __cplusplus
10394 extern "C"
10395 #endif
10396 /* We use char because int might match the return type of a gcc2
10397    builtin and then its argument prototype would still apply.  */
10398 char mkstemp ();
10399 char (*f) ();
10400
10401 int
10402 main ()
10403 {
10404 /* The GNU C library defines this for functions which it implements
10405     to always fail with ENOSYS.  Some functions are actually named
10406     something starting with __ and the normal name is an alias.  */
10407 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
10408 choke me
10409 #else
10410 f = mkstemp;
10411 #endif
10412
10413   ;
10414   return 0;
10415 }
10416 _ACEOF
10417 rm -f conftest.$ac_objext conftest$ac_exeext
10418 if { (eval echo "$as_me:10418: \"$ac_link\"") >&5
10419   (eval $ac_link) 2>&5
10420   ac_status=$?
10421   echo "$as_me:10421: \$? = $ac_status" >&5
10422   (exit $ac_status); } &&
10423          { ac_try='test -s conftest$ac_exeext'
10424   { (eval echo "$as_me:10424: \"$ac_try\"") >&5
10425   (eval $ac_try) 2>&5
10426   ac_status=$?
10427   echo "$as_me:10427: \$? = $ac_status" >&5
10428   (exit $ac_status); }; }; then
10429   ac_cv_func_mkstemp=yes
10430 else
10431   echo "$as_me: failed program was:" >&5
10432 cat conftest.$ac_ext >&5
10433 ac_cv_func_mkstemp=no
10434 fi
10435 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10436 fi
10437 echo "$as_me:10437: result: $ac_cv_func_mkstemp" >&5
10438 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
10439
10440 else
10441   cat >conftest.$ac_ext <<_ACEOF
10442 #line 10442 "configure"
10443 #include "confdefs.h"
10444
10445 #include <sys/types.h>
10446 #include <stdlib.h>
10447 #include <stdio.h>
10448 #include <string.h>
10449 #include <sys/stat.h>
10450 int main()
10451 {
10452         char *tmpl = "conftestXXXXXX";
10453         char name[2][80];
10454         int n;
10455         int result = 0;
10456         int fd;
10457         struct stat sb;
10458
10459         umask(077);
10460         for (n = 0; n < 2; ++n) {
10461                 strcpy(name[n], tmpl);
10462                 if ((fd = mkstemp(name[n])) >= 0) {
10463                         if (!strcmp(name[n], tmpl)
10464                          || stat(name[n], &sb) != 0
10465                          || (sb.st_mode & S_IFMT) != S_IFREG
10466                          || (sb.st_mode & 077) != 0) {
10467                                 result = 1;
10468                         }
10469                         close(fd);
10470                 }
10471         }
10472         if (result == 0
10473          && !strcmp(name[0], name[1]))
10474                 result = 1;
10475         ${cf_cv_main_return:-return}(result);
10476 }
10477
10478 _ACEOF
10479 rm -f conftest$ac_exeext
10480 if { (eval echo "$as_me:10480: \"$ac_link\"") >&5
10481   (eval $ac_link) 2>&5
10482   ac_status=$?
10483   echo "$as_me:10483: \$? = $ac_status" >&5
10484   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10485   { (eval echo "$as_me:10485: \"$ac_try\"") >&5
10486   (eval $ac_try) 2>&5
10487   ac_status=$?
10488   echo "$as_me:10488: \$? = $ac_status" >&5
10489   (exit $ac_status); }; }; then
10490   cf_cv_func_mkstemp=yes
10491
10492 else
10493   echo "$as_me: program exited with status $ac_status" >&5
10494 echo "$as_me: failed program was:" >&5
10495 cat conftest.$ac_ext >&5
10496 cf_cv_func_mkstemp=no
10497
10498 fi
10499 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10500 fi
10501
10502 fi
10503 echo "$as_me:10503: result: $cf_cv_func_mkstemp" >&5
10504 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
10505 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
10506         cat >>confdefs.h <<\EOF
10507 #define HAVE_MKSTEMP 1
10508 EOF
10509
10510 fi
10511
10512 echo "$as_me:10512: checking return type of signal handlers" >&5
10513 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
10514 if test "${ac_cv_type_signal+set}" = set; then
10515   echo $ECHO_N "(cached) $ECHO_C" >&6
10516 else
10517   cat >conftest.$ac_ext <<_ACEOF
10518 #line 10518 "configure"
10519 #include "confdefs.h"
10520 #include <sys/types.h>
10521 #include <signal.h>
10522 #ifdef signal
10523 # undef signal
10524 #endif
10525 #ifdef __cplusplus
10526 extern "C" void (*signal (int, void (*)(int)))(int);
10527 #else
10528 void (*signal ()) ();
10529 #endif
10530
10531 int
10532 main ()
10533 {
10534 int i;
10535   ;
10536   return 0;
10537 }
10538 _ACEOF
10539 rm -f conftest.$ac_objext
10540 if { (eval echo "$as_me:10540: \"$ac_compile\"") >&5
10541   (eval $ac_compile) 2>&5
10542   ac_status=$?
10543   echo "$as_me:10543: \$? = $ac_status" >&5
10544   (exit $ac_status); } &&
10545          { ac_try='test -s conftest.$ac_objext'
10546   { (eval echo "$as_me:10546: \"$ac_try\"") >&5
10547   (eval $ac_try) 2>&5
10548   ac_status=$?
10549   echo "$as_me:10549: \$? = $ac_status" >&5
10550   (exit $ac_status); }; }; then
10551   ac_cv_type_signal=void
10552 else
10553   echo "$as_me: failed program was:" >&5
10554 cat conftest.$ac_ext >&5
10555 ac_cv_type_signal=int
10556 fi
10557 rm -f conftest.$ac_objext conftest.$ac_ext
10558 fi
10559 echo "$as_me:10559: result: $ac_cv_type_signal" >&5
10560 echo "${ECHO_T}$ac_cv_type_signal" >&6
10561
10562 cat >>confdefs.h <<EOF
10563 #define RETSIGTYPE $ac_cv_type_signal
10564 EOF
10565
10566 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
10567         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
10568         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
10569 fi
10570
10571 if test "$cf_with_ada" != "no" ; then
10572
10573 cf_ada_make=gnatmake
10574 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
10575 set dummy $cf_ada_make; ac_word=$2
10576 echo "$as_me:10576: checking for $ac_word" >&5
10577 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10578 if test "${ac_cv_prog_gnat_exists+set}" = set; then
10579   echo $ECHO_N "(cached) $ECHO_C" >&6
10580 else
10581   if test -n "$gnat_exists"; then
10582   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
10583 else
10584   ac_save_IFS=$IFS; IFS=$ac_path_separator
10585 ac_dummy="$PATH"
10586 for ac_dir in $ac_dummy; do
10587   IFS=$ac_save_IFS
10588   test -z "$ac_dir" && ac_dir=.
10589   $as_executable_p "$ac_dir/$ac_word" || continue
10590 ac_cv_prog_gnat_exists="yes"
10591 echo "$as_me:10591: found $ac_dir/$ac_word" >&5
10592 break
10593 done
10594
10595   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
10596 fi
10597 fi
10598 gnat_exists=$ac_cv_prog_gnat_exists
10599 if test -n "$gnat_exists"; then
10600   echo "$as_me:10600: result: $gnat_exists" >&5
10601 echo "${ECHO_T}$gnat_exists" >&6
10602 else
10603   echo "$as_me:10603: result: no" >&5
10604 echo "${ECHO_T}no" >&6
10605 fi
10606
10607 if test "$ac_cv_prog_gnat_exists" = no; then
10608    cf_ada_make=
10609 else
10610
10611 echo "$as_me:10611: checking for gnat version" >&5
10612 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
10613 cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\
10614   sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
10615 echo "$as_me:10615: result: $cf_gnat_version" >&5
10616 echo "${ECHO_T}$cf_gnat_version" >&6
10617
10618 case $cf_gnat_version in
10619   3.1[1-9]*|3.[2-9]*|[4-9].*)
10620     cf_cv_prog_gnat_correct=yes
10621     ;;
10622   *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding.
10623      cf_cv_prog_gnat_correct=no
10624      ;;
10625 esac
10626
10627 case $cf_gnat_version in
10628   3.[1-9]*|[4-9].*)
10629       cf_compile_generics=generics
10630       cf_generic_objects="\${GENOBJS}"
10631       ;;
10632   *)  cf_compile_generics=
10633       cf_generic_objects=
10634       ;;
10635 esac
10636
10637 case $cf_gnat_version in
10638   3.[0-9]*)
10639     USE_OLD_MAKERULES=""
10640     USE_GNAT_PROJECTS="#"
10641     ;;
10642   *)
10643     USE_OLD_MAKERULES="#"
10644     USE_GNAT_PROJECTS=""
10645     ;;
10646 esac
10647
10648    # Extract the first word of "m4", so it can be a program name with args.
10649 set dummy m4; ac_word=$2
10650 echo "$as_me:10650: checking for $ac_word" >&5
10651 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10652 if test "${ac_cv_prog_M4_exists+set}" = set; then
10653   echo $ECHO_N "(cached) $ECHO_C" >&6
10654 else
10655   if test -n "$M4_exists"; then
10656   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
10657 else
10658   ac_save_IFS=$IFS; IFS=$ac_path_separator
10659 ac_dummy="$PATH"
10660 for ac_dir in $ac_dummy; do
10661   IFS=$ac_save_IFS
10662   test -z "$ac_dir" && ac_dir=.
10663   $as_executable_p "$ac_dir/$ac_word" || continue
10664 ac_cv_prog_M4_exists="yes"
10665 echo "$as_me:10665: found $ac_dir/$ac_word" >&5
10666 break
10667 done
10668
10669   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
10670 fi
10671 fi
10672 M4_exists=$ac_cv_prog_M4_exists
10673 if test -n "$M4_exists"; then
10674   echo "$as_me:10674: result: $M4_exists" >&5
10675 echo "${ECHO_T}$M4_exists" >&6
10676 else
10677   echo "$as_me:10677: result: no" >&5
10678 echo "${ECHO_T}no" >&6
10679 fi
10680
10681    if test "$ac_cv_prog_M4_exists" = no; then
10682       cf_cv_prog_gnat_correct=no
10683       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
10684    fi
10685    if test "$cf_cv_prog_gnat_correct" = yes; then
10686       echo "$as_me:10686: checking if GNAT works" >&5
10687 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
10688
10689 rm -f conftest*
10690 cat >>conftest.ads <<CF_EOF
10691 procedure conftest;
10692 CF_EOF
10693 cat >>conftest.adb <<CF_EOF
10694 with Text_IO;
10695 with GNAT.OS_Lib;
10696 procedure conftest is
10697 begin
10698    Text_IO.Put ("Hello World");
10699    Text_IO.New_Line;
10700    GNAT.OS_Lib.OS_Exit (0);
10701 end conftest;
10702 CF_EOF
10703 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
10704    if ( ./conftest 1>&5 2>&1 ) ; then
10705       cf_cv_prog_gnat_correct=yes
10706    else
10707       cf_cv_prog_gnat_correct=no
10708    fi
10709 else
10710    cf_cv_prog_gnat_correct=no
10711 fi
10712 rm -f conftest*
10713
10714       echo "$as_me:10714: result: $cf_cv_prog_gnat_correct" >&5
10715 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
10716    fi
10717 fi
10718
10719         if test "$cf_cv_prog_gnat_correct" = yes; then
10720
10721         ADAFLAGS="$ADAFLAGS -O3 -gnatpn"
10722
10723 echo "$as_me:10723: checking if GNAT pragma Unreferenced works" >&5
10724 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
10725 if test "${cf_cv_pragma_unreferenced+set}" = set; then
10726   echo $ECHO_N "(cached) $ECHO_C" >&6
10727 else
10728
10729 rm -f conftest*
10730 cat >>conftest.ads <<CF_EOF
10731 procedure conftest;
10732 CF_EOF
10733 cat >>conftest.adb <<CF_EOF
10734 with Text_IO;
10735 with GNAT.OS_Lib;
10736 procedure conftest is
10737    test : Integer;
10738    pragma Unreferenced (test);
10739 begin
10740    test := 1;
10741    Text_IO.Put ("Hello World");
10742    Text_IO.New_Line;
10743    GNAT.OS_Lib.OS_Exit (0);
10744 end conftest;
10745 CF_EOF
10746 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
10747       cf_cv_pragma_unreferenced=yes
10748 else
10749    cf_cv_pragma_unreferenced=no
10750 fi
10751 rm -f conftest*
10752
10753 fi
10754 echo "$as_me:10754: result: $cf_cv_pragma_unreferenced" >&5
10755 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
10756
10757 # if the pragma is supported, use it (needed in the Trace code).
10758 if test $cf_cv_pragma_unreferenced = yes ; then
10759         PRAGMA_UNREF=TRUE
10760 else
10761         PRAGMA_UNREF=FALSE
10762 fi
10763
10764 echo "$as_me:10764: checking for ada-compiler" >&5
10765 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
10766
10767 # Check whether --with-ada-compiler or --without-ada-compiler was given.
10768 if test "${with_ada_compiler+set}" = set; then
10769   withval="$with_ada_compiler"
10770   cf_ada_compiler=$withval
10771 else
10772   cf_ada_compiler=gnatmake
10773 fi;
10774
10775 echo "$as_me:10775: result: $cf_ada_compiler" >&5
10776 echo "${ECHO_T}$cf_ada_compiler" >&6
10777
10778                 cf_ada_package=terminal_interface
10779
10780 echo "$as_me:10780: checking for ada-include" >&5
10781 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
10782
10783 # Check whether --with-ada-include or --without-ada-include was given.
10784 if test "${with_ada_include+set}" = set; then
10785   withval="$with_ada_include"
10786
10787 else
10788   withval="${ADA_INCLUDE-$prefix/share/ada/adainclude}"
10789 fi; if test -n "$prefix/share/ada/adainclude" ; then
10790
10791 if test "x$prefix" != xNONE; then
10792   cf_path_syntax="$prefix"
10793 else
10794   cf_path_syntax="$ac_default_prefix"
10795 fi
10796
10797 case ".$withval" in #(vi
10798 .\$\(*\)*|.\'*\'*) #(vi
10799   ;;
10800 ..|./*|.\\*) #(vi
10801   ;;
10802 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
10803   ;;
10804 .\${*prefix}*) #(vi
10805   eval withval="$withval"
10806   case ".$withval" in #(vi
10807   .NONE/*)
10808     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
10809     ;;
10810   esac
10811   ;; #(vi
10812 .no|.NONE/*)
10813   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
10814   ;;
10815 *)
10816   { { echo "$as_me:10816: error: expected a pathname, not \"$withval\"" >&5
10817 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
10818    { (exit 1); exit 1; }; }
10819   ;;
10820 esac
10821
10822 fi
10823 ADA_INCLUDE="$withval"
10824
10825 echo "$as_me:10825: result: $ADA_INCLUDE" >&5
10826 echo "${ECHO_T}$ADA_INCLUDE" >&6
10827
10828 echo "$as_me:10828: checking for ada-objects" >&5
10829 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
10830
10831 # Check whether --with-ada-objects or --without-ada-objects was given.
10832 if test "${with_ada_objects+set}" = set; then
10833   withval="$with_ada_objects"
10834
10835 else
10836   withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}"
10837 fi; if test -n "$prefix/lib/ada/adalib" ; then
10838
10839 if test "x$prefix" != xNONE; then
10840   cf_path_syntax="$prefix"
10841 else
10842   cf_path_syntax="$ac_default_prefix"
10843 fi
10844
10845 case ".$withval" in #(vi
10846 .\$\(*\)*|.\'*\'*) #(vi
10847   ;;
10848 ..|./*|.\\*) #(vi
10849   ;;
10850 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
10851   ;;
10852 .\${*prefix}*) #(vi
10853   eval withval="$withval"
10854   case ".$withval" in #(vi
10855   .NONE/*)
10856     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
10857     ;;
10858   esac
10859   ;; #(vi
10860 .no|.NONE/*)
10861   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
10862   ;;
10863 *)
10864   { { echo "$as_me:10864: error: expected a pathname, not \"$withval\"" >&5
10865 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
10866    { (exit 1); exit 1; }; }
10867   ;;
10868 esac
10869
10870 fi
10871 ADA_OBJECTS="$withval"
10872
10873 echo "$as_me:10873: result: $ADA_OBJECTS" >&5
10874 echo "${ECHO_T}$ADA_OBJECTS" >&6
10875
10876 echo "$as_me:10876: checking if an Ada95 shared-library should be built" >&5
10877 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
10878
10879 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
10880 if test "${with_ada_sharedlib+set}" = set; then
10881   withval="$with_ada_sharedlib"
10882   with_ada_sharedlib=$withval
10883 else
10884   with_ada_sharedlib=no
10885 fi;
10886 echo "$as_me:10886: result: $with_ada_sharedlib" >&5
10887 echo "${ECHO_T}$with_ada_sharedlib" >&6
10888
10889 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
10890 MAKE_ADA_SHAREDLIB="#"
10891
10892 if test "x$with_ada_sharedlib" != xno
10893 then
10894         MAKE_ADA_SHAREDLIB=
10895         if test "x$with_ada_sharedlib" != xyes
10896         then
10897                 ADA_SHAREDLIB="$with_ada_sharedlib"
10898         fi
10899 fi
10900
10901         fi
10902 fi
10903
10904 ################################################################################
10905
10906 # not needed
10907 TINFO_ARGS2=
10908
10909 ### Construct the list of include-directories to be generated
10910
10911 CPPFLAGS="$CPPFLAGS -I. -I../include"
10912 if test "$srcdir" != "."; then
10913         CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
10914 fi
10915 if test "$GCC" != yes; then
10916         CPPFLAGS="$CPPFLAGS -I\${includedir}"
10917 elif test "$includedir" != "/usr/include"; then
10918         if test "$includedir" = '${prefix}/include' ; then
10919                 if test $prefix != /usr ; then
10920                         CPPFLAGS="$CPPFLAGS -I\${includedir}"
10921                 fi
10922         else
10923                 CPPFLAGS="$CPPFLAGS -I\${includedir}"
10924         fi
10925 fi
10926
10927 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
10928 if test "$srcdir" != "."; then
10929         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
10930 fi
10931 if test "$GCC" != yes; then
10932         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
10933 elif test "$includedir" != "/usr/include"; then
10934         if test "$includedir" = '${prefix}/include' ; then
10935                 if test $prefix != /usr ; then
10936                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
10937                 fi
10938         else
10939                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
10940         fi
10941 fi
10942
10943 ### Build up pieces for makefile rules
10944 echo "$as_me:10944: checking default library suffix" >&5
10945 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
10946
10947         case $DFT_LWR_MODEL in
10948         libtool) DFT_ARG_SUFFIX=''   ;;
10949         normal)  DFT_ARG_SUFFIX=''   ;;
10950         debug)   DFT_ARG_SUFFIX='_g' ;;
10951         profile) DFT_ARG_SUFFIX='_p' ;;
10952         shared)  DFT_ARG_SUFFIX=''   ;;
10953         esac
10954         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
10955 echo "$as_me:10955: result: $DFT_ARG_SUFFIX" >&5
10956 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
10957
10958 echo "$as_me:10958: checking default library-dependency suffix" >&5
10959 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
10960
10961         case $DFT_LWR_MODEL in #(vi
10962         libtool) #(vi
10963                 DFT_LIB_SUFFIX='.la'
10964                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10965                 ;;
10966         normal) #(vi
10967                 DFT_LIB_SUFFIX='.a'
10968                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10969                 ;;
10970         debug) #(vi
10971                 DFT_LIB_SUFFIX='_g.a'
10972                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10973                 ;;
10974         profile) #(vi
10975                 DFT_LIB_SUFFIX='_p.a'
10976                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10977                 ;;
10978         shared) #(vi
10979                 case $cf_cv_system_name in
10980                 aix[56]*) #(vi
10981                         DFT_LIB_SUFFIX='.a'
10982                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10983                         ;;
10984                 cygwin*) #(vi
10985                         DFT_LIB_SUFFIX='.dll'
10986                         DFT_DEP_SUFFIX='.dll.a'
10987                         ;;
10988                 darwin*) #(vi
10989                         DFT_LIB_SUFFIX='.dylib'
10990                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10991                         ;;
10992                 hpux*) #(vi
10993                         case $target in
10994                         ia64*) #(vi
10995                                 DFT_LIB_SUFFIX='.so'
10996                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10997                                 ;;
10998                         *) #(vi
10999                                 DFT_LIB_SUFFIX='.sl'
11000                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11001                                 ;;
11002                         esac
11003                         ;;
11004                 *)      DFT_LIB_SUFFIX='.so'
11005                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
11006                         ;;
11007                 esac
11008         esac
11009         test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
11010         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
11011 echo "$as_me:11011: result: $DFT_DEP_SUFFIX" >&5
11012 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
11013
11014 echo "$as_me:11014: checking default object directory" >&5
11015 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
11016
11017         case $DFT_LWR_MODEL in
11018         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
11019         normal)  DFT_OBJ_SUBDIR='objects' ;;
11020         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
11021         profile) DFT_OBJ_SUBDIR='obj_p' ;;
11022         shared)
11023                 case $cf_cv_system_name in #(vi
11024                 cygwin) #(vi
11025                         DFT_OBJ_SUBDIR='objects' ;;
11026                 *)
11027                         DFT_OBJ_SUBDIR='obj_s' ;;
11028                 esac
11029         esac
11030 echo "$as_me:11030: result: $DFT_OBJ_SUBDIR" >&5
11031 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
11032
11033 ### Set up low-level terminfo dependencies for makefiles.
11034
11035 if test "$DFT_LWR_MODEL" = shared ; then
11036         case $cf_cv_system_name in #(vi
11037         cygwin*)
11038                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
11039                 ;;
11040         esac
11041 fi
11042
11043 ### Construct the list of subdirectories for which we'll customize makefiles
11044 ### with the appropriate compile-rules.
11045
11046 SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
11047
11048 cat >>confdefs.h <<EOF
11049 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
11050 EOF
11051
11052 ### Now that we're done running tests, add the compiler-warnings, if any
11053
11054 cf_fix_cppflags=no
11055 cf_new_cflags=
11056 cf_new_cppflags=
11057 cf_new_extra_cppflags=
11058
11059 for cf_add_cflags in $EXTRA_CFLAGS
11060 do
11061 case $cf_fix_cppflags in
11062 no)
11063         case $cf_add_cflags in #(vi
11064         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11065                 case $cf_add_cflags in
11066                 -D*)
11067                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11068
11069                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11070                                 && test -z "${cf_tst_cflags}" \
11071                                 && cf_fix_cppflags=yes
11072
11073                         if test $cf_fix_cppflags = yes ; then
11074                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11075                                 continue
11076                         elif test "${cf_tst_cflags}" = "\"'" ; then
11077                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11078                                 continue
11079                         fi
11080                         ;;
11081                 esac
11082                 case "$CPPFLAGS" in
11083                 *$cf_add_cflags) #(vi
11084                         ;;
11085                 *) #(vi
11086                         case $cf_add_cflags in #(vi
11087                         -D*)
11088                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11089
11090 CPPFLAGS=`echo "$CPPFLAGS" | \
11091         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11092                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11093
11094                                 ;;
11095                         esac
11096                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11097                         ;;
11098                 esac
11099                 ;;
11100         *)
11101                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11102                 ;;
11103         esac
11104         ;;
11105 yes)
11106         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11107
11108         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11109
11110         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11111                 && test -z "${cf_tst_cflags}" \
11112                 && cf_fix_cppflags=no
11113         ;;
11114 esac
11115 done
11116
11117 if test -n "$cf_new_cflags" ; then
11118
11119         CFLAGS="$CFLAGS $cf_new_cflags"
11120 fi
11121
11122 if test -n "$cf_new_cppflags" ; then
11123
11124         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11125 fi
11126
11127 if test -n "$cf_new_extra_cppflags" ; then
11128
11129         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11130 fi
11131
11132 ################################################################################
11133
11134 if test x"$enable_pc_files" = xyes ; then \
11135 SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
11136 MAKE_PC_FILES=
11137 else
11138 MAKE_PC_FILES="#"
11139 fi
11140
11141 ################################################################################
11142
11143 TEST_ARG2=
11144
11145 TEST_LIBS2=
11146
11147 NCURSES_SHLIB2="sh -c"
11148
11149 ADA_SUBDIRS="include gen src samples"
11150 for cf_dir in $ADA_SUBDIRS
11151 do
11152         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
11153 done
11154
11155 NCURSES_TREE="#"
11156
11157 EXTERNAL_TREE=
11158
11159 ac_config_files="$ac_config_files $SUB_MAKEFILES Makefile"
11160 ac_config_commands="$ac_config_commands default"
11161 cat >confcache <<\_ACEOF
11162 # This file is a shell script that caches the results of configure
11163 # tests run on this system so they can be shared between configure
11164 # scripts and configure runs, see configure's option --config-cache.
11165 # It is not useful on other systems.  If it contains results you don't
11166 # want to keep, you may remove or edit it.
11167 #
11168 # config.status only pays attention to the cache file if you give it
11169 # the --recheck option to rerun configure.
11170 #
11171 # `ac_cv_env_foo' variables (set or unset) will be overriden when
11172 # loading this file, other *unset* `ac_cv_foo' will be assigned the
11173 # following values.
11174
11175 _ACEOF
11176
11177 # The following way of writing the cache mishandles newlines in values,
11178 # but we know of no workaround that is simple, portable, and efficient.
11179 # So, don't put newlines in cache variables' values.
11180 # Ultrix sh set writes to stderr and can't be redirected directly,
11181 # and sets the high bit in the cache file unless we assign to the vars.
11182 {
11183   (set) 2>&1 |
11184     case `(ac_space=' '; set | grep ac_space) 2>&1` in
11185     *ac_space=\ *)
11186       # `set' does not quote correctly, so add quotes (double-quote
11187       # substitution turns \\\\ into \\, and sed turns \\ into \).
11188       sed -n \
11189         "s/'/'\\\\''/g;
11190           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
11191       ;;
11192     *)
11193       # `set' quotes correctly as required by POSIX, so do not add quotes.
11194       sed -n \
11195         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
11196       ;;
11197     esac;
11198 } |
11199   sed '
11200      t clear
11201      : clear
11202      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
11203      t end
11204      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
11205      : end' >>confcache
11206 if cmp -s $cache_file confcache; then :; else
11207   if test -w $cache_file; then
11208     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
11209     cat confcache >$cache_file
11210   else
11211     echo "not updating unwritable cache $cache_file"
11212   fi
11213 fi
11214 rm -f confcache
11215
11216 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11217 # Let make expand exec_prefix.
11218 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11219
11220 # VPATH may cause trouble with some makes, so we remove $(srcdir),
11221 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
11222 # trailing colons and then remove the whole line if VPATH becomes empty
11223 # (actually we leave an empty line to preserve line numbers).
11224 if test "x$srcdir" = x.; then
11225   ac_vpsub='/^[         ]*VPATH[        ]*=/{
11226 s/:*\$(srcdir):*/:/;
11227 s/:*\${srcdir}:*/:/;
11228 s/:*@srcdir@:*/:/;
11229 s/^\([^=]*=[    ]*\):*/\1/;
11230 s/:*$//;
11231 s/^[^=]*=[      ]*$//;
11232 }'
11233 fi
11234
11235 DEFS=-DHAVE_CONFIG_H
11236
11237 : ${CONFIG_STATUS=./config.status}
11238 ac_clean_files_save=$ac_clean_files
11239 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
11240 { echo "$as_me:11240: creating $CONFIG_STATUS" >&5
11241 echo "$as_me: creating $CONFIG_STATUS" >&6;}
11242 cat >$CONFIG_STATUS <<_ACEOF
11243 #! $SHELL
11244 # Generated automatically by configure.
11245 # Run this file to recreate the current configuration.
11246 # Compiler output produced by configure, useful for debugging
11247 # configure, is in config.log if it exists.
11248
11249 debug=false
11250 SHELL=\${CONFIG_SHELL-$SHELL}
11251 ac_cs_invocation="\$0 \$@"
11252
11253 _ACEOF
11254
11255 cat >>$CONFIG_STATUS <<\_ACEOF
11256 # Be Bourne compatible
11257 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
11258   emulate sh
11259   NULLCMD=:
11260 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
11261   set -o posix
11262 fi
11263
11264 # Name of the executable.
11265 as_me=`echo "$0" |sed 's,.*[\\/],,'`
11266
11267 if expr a : '\(a\)' >/dev/null 2>&1; then
11268   as_expr=expr
11269 else
11270   as_expr=false
11271 fi
11272
11273 rm -f conf$$ conf$$.exe conf$$.file
11274 echo >conf$$.file
11275 if ln -s conf$$.file conf$$ 2>/dev/null; then
11276   # We could just check for DJGPP; but this test a) works b) is more generic
11277   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
11278   if test -f conf$$.exe; then
11279     # Don't use ln at all; we don't have any links
11280     as_ln_s='cp -p'
11281   else
11282     as_ln_s='ln -s'
11283   fi
11284 elif ln conf$$.file conf$$ 2>/dev/null; then
11285   as_ln_s=ln
11286 else
11287   as_ln_s='cp -p'
11288 fi
11289 rm -f conf$$ conf$$.exe conf$$.file
11290
11291 as_executable_p="test -f"
11292
11293 # Support unset when possible.
11294 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
11295   as_unset=unset
11296 else
11297   as_unset=false
11298 fi
11299
11300 # NLS nuisances.
11301 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
11302 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
11303 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
11304 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
11305 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
11306 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
11307 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
11308 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
11309
11310 # IFS
11311 # We need space, tab and new line, in precisely that order.
11312 as_nl='
11313 '
11314 IFS="   $as_nl"
11315
11316 # CDPATH.
11317 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
11318
11319 exec 6>&1
11320
11321 _ACEOF
11322
11323 # Files that config.status was made for.
11324 if test -n "$ac_config_files"; then
11325   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
11326 fi
11327
11328 if test -n "$ac_config_headers"; then
11329   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
11330 fi
11331
11332 if test -n "$ac_config_links"; then
11333   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
11334 fi
11335
11336 if test -n "$ac_config_commands"; then
11337   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
11338 fi
11339
11340 cat >>$CONFIG_STATUS <<\EOF
11341
11342 ac_cs_usage="\
11343 \`$as_me' instantiates files from templates according to the
11344 current configuration.
11345
11346 Usage: $0 [OPTIONS] [FILE]...
11347
11348   -h, --help       print this help, then exit
11349   -V, --version    print version number, then exit
11350   -d, --debug      don't remove temporary files
11351       --recheck    update $as_me by reconfiguring in the same conditions
11352   --file=FILE[:TEMPLATE]
11353                    instantiate the configuration file FILE
11354   --header=FILE[:TEMPLATE]
11355                    instantiate the configuration header FILE
11356
11357 Configuration files:
11358 $config_files
11359
11360 Configuration headers:
11361 $config_headers
11362
11363 Configuration commands:
11364 $config_commands
11365
11366 Report bugs to <bug-autoconf@gnu.org>."
11367 EOF
11368
11369 cat >>$CONFIG_STATUS <<EOF
11370 ac_cs_version="\\
11371 config.status
11372 configured by $0, generated by GNU Autoconf 2.52.20100530,
11373   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
11374
11375 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
11376 Free Software Foundation, Inc.
11377 This config.status script is free software; the Free Software Foundation
11378 gives unlimited permission to copy, distribute and modify it."
11379 srcdir=$srcdir
11380 INSTALL="$INSTALL"
11381 EOF
11382
11383 cat >>$CONFIG_STATUS <<\EOF
11384 # If no file are specified by the user, then we need to provide default
11385 # value.  By we need to know if files were specified by the user.
11386 ac_need_defaults=:
11387 while test $# != 0
11388 do
11389   case $1 in
11390   --*=*)
11391     ac_option=`expr "x$1" : 'x\([^=]*\)='`
11392     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
11393     shift
11394     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
11395     shift
11396     ;;
11397   -*);;
11398   *) # This is not an option, so the user has probably given explicit
11399      # arguments.
11400      ac_need_defaults=false;;
11401   esac
11402
11403   case $1 in
11404   # Handling of the options.
11405 EOF
11406 cat >>$CONFIG_STATUS <<EOF
11407   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11408     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
11409     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
11410 EOF
11411 cat >>$CONFIG_STATUS <<\EOF
11412   --version | --vers* | -V )
11413     echo "$ac_cs_version"; exit 0 ;;
11414   --he | --h)
11415     # Conflict between --help and --header
11416     { { echo "$as_me:11416: error: ambiguous option: $1
11417 Try \`$0 --help' for more information." >&5
11418 echo "$as_me: error: ambiguous option: $1
11419 Try \`$0 --help' for more information." >&2;}
11420    { (exit 1); exit 1; }; };;
11421   --help | --hel | -h )
11422     echo "$ac_cs_usage"; exit 0 ;;
11423   --debug | --d* | -d )
11424     debug=: ;;
11425   --file | --fil | --fi | --f )
11426     shift
11427     CONFIG_FILES="$CONFIG_FILES $1"
11428     ac_need_defaults=false;;
11429   --header | --heade | --head | --hea )
11430     shift
11431     CONFIG_HEADERS="$CONFIG_HEADERS $1"
11432     ac_need_defaults=false;;
11433
11434   # This is an error.
11435   -*) { { echo "$as_me:11435: error: unrecognized option: $1
11436 Try \`$0 --help' for more information." >&5
11437 echo "$as_me: error: unrecognized option: $1
11438 Try \`$0 --help' for more information." >&2;}
11439    { (exit 1); exit 1; }; } ;;
11440
11441   *) ac_config_targets="$ac_config_targets $1" ;;
11442
11443   esac
11444   shift
11445 done
11446
11447 exec 5>>config.log
11448 cat >&5 << _ACEOF
11449
11450 ## ----------------------- ##
11451 ## Running config.status.  ##
11452 ## ----------------------- ##
11453
11454 This file was extended by $as_me 2.52.20100530, executed with
11455   CONFIG_FILES    = $CONFIG_FILES
11456   CONFIG_HEADERS  = $CONFIG_HEADERS
11457   CONFIG_LINKS    = $CONFIG_LINKS
11458   CONFIG_COMMANDS = $CONFIG_COMMANDS
11459   > $ac_cs_invocation
11460 on `(hostname || uname -n) 2>/dev/null | sed 1q`
11461
11462 _ACEOF
11463 EOF
11464
11465 cat >>$CONFIG_STATUS <<EOF
11466 #
11467 # INIT-COMMANDS section.
11468 #
11469
11470 ### Special initialization commands, used to pass information from the
11471 ### configuration-run into config.status
11472
11473 AWK="$AWK"
11474 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
11475 DFT_LWR_MODEL="$DFT_LWR_MODEL"
11476 ECHO_LINK="$ECHO_LINK"
11477 LIB_NAME="$LIB_NAME"
11478 LIB_SUFFIX="$LIB_SUFFIX"
11479 LN_S="$LN_S"
11480 NCURSES_MAJOR="$NCURSES_MAJOR"
11481 NCURSES_MINOR="$NCURSES_MINOR"
11482 NCURSES_PATCH="$NCURSES_PATCH"
11483 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
11484 cf_cv_abi_version="$cf_cv_abi_version"
11485 cf_cv_rel_version="$cf_cv_rel_version"
11486 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
11487 cf_cv_shared_soname='$cf_cv_shared_soname'
11488 cf_cv_shlib_version="$cf_cv_shlib_version"
11489 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
11490 cf_cv_system_name="$cf_cv_system_name"
11491 host="$host"
11492 target="$target"
11493
11494 EOF
11495
11496 cat >>$CONFIG_STATUS <<\EOF
11497 for ac_config_target in $ac_config_targets
11498 do
11499   case "$ac_config_target" in
11500   # Handling of arguments.
11501   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
11502   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
11503   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
11504   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
11505   *) { { echo "$as_me:11505: error: invalid argument: $ac_config_target" >&5
11506 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
11507    { (exit 1); exit 1; }; };;
11508   esac
11509 done
11510
11511 # If the user did not use the arguments to specify the items to instantiate,
11512 # then the envvar interface is used.  Set only those that are not.
11513 # We use the long form for the default assignment because of an extremely
11514 # bizarre bug on SunOS 4.1.3.
11515 if $ac_need_defaults; then
11516   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
11517   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
11518   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
11519 fi
11520
11521 # Create a temporary directory, and hook for its removal unless debugging.
11522 $debug ||
11523 {
11524   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
11525   trap '{ (exit 1); exit 1; }' 1 2 13 15
11526 }
11527
11528 # Create a (secure) tmp directory for tmp files.
11529 : ${TMPDIR=/tmp}
11530 {
11531   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
11532   test -n "$tmp" && test -d "$tmp"
11533 }  ||
11534 {
11535   tmp=$TMPDIR/cs$$-$RANDOM
11536   (umask 077 && mkdir $tmp)
11537 } ||
11538 {
11539    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
11540    { (exit 1); exit 1; }
11541 }
11542
11543 EOF
11544
11545 cat >>$CONFIG_STATUS <<EOF
11546
11547 #
11548 # CONFIG_FILES section.
11549 #
11550
11551 # No need to generate the scripts if there are no CONFIG_FILES.
11552 # This happens for instance when ./config.status config.h
11553 if test -n "\$CONFIG_FILES"; then
11554   # Protect against being on the right side of a sed subst in config.status.
11555   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
11556    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
11557 s,@SHELL@,$SHELL,;t t
11558 s,@exec_prefix@,$exec_prefix,;t t
11559 s,@prefix@,$prefix,;t t
11560 s,@program_transform_name@,$program_transform_name,;t t
11561 s,@bindir@,$bindir,;t t
11562 s,@sbindir@,$sbindir,;t t
11563 s,@libexecdir@,$libexecdir,;t t
11564 s,@datadir@,$datadir,;t t
11565 s,@sysconfdir@,$sysconfdir,;t t
11566 s,@sharedstatedir@,$sharedstatedir,;t t
11567 s,@localstatedir@,$localstatedir,;t t
11568 s,@libdir@,$libdir,;t t
11569 s,@includedir@,$includedir,;t t
11570 s,@oldincludedir@,$oldincludedir,;t t
11571 s,@infodir@,$infodir,;t t
11572 s,@mandir@,$mandir,;t t
11573 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
11574 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
11575 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
11576 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
11577 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
11578 s,@build_alias@,$build_alias,;t t
11579 s,@host_alias@,$host_alias,;t t
11580 s,@target_alias@,$target_alias,;t t
11581 s,@ECHO_C@,$ECHO_C,;t t
11582 s,@ECHO_N@,$ECHO_N,;t t
11583 s,@ECHO_T@,$ECHO_T,;t t
11584 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
11585 s,@DEFS@,$DEFS,;t t
11586 s,@LIBS@,$LIBS,;t t
11587 s,@top_builddir@,$top_builddir,;t t
11588 s,@build@,$build,;t t
11589 s,@build_cpu@,$build_cpu,;t t
11590 s,@build_vendor@,$build_vendor,;t t
11591 s,@build_os@,$build_os,;t t
11592 s,@host@,$host,;t t
11593 s,@host_cpu@,$host_cpu,;t t
11594 s,@host_vendor@,$host_vendor,;t t
11595 s,@host_os@,$host_os,;t t
11596 s,@target@,$target,;t t
11597 s,@target_cpu@,$target_cpu,;t t
11598 s,@target_vendor@,$target_vendor,;t t
11599 s,@target_os@,$target_os,;t t
11600 s,@CC@,$CC,;t t
11601 s,@CFLAGS@,$CFLAGS,;t t
11602 s,@LDFLAGS@,$LDFLAGS,;t t
11603 s,@CPPFLAGS@,$CPPFLAGS,;t t
11604 s,@ac_ct_CC@,$ac_ct_CC,;t t
11605 s,@EXEEXT@,$EXEEXT,;t t
11606 s,@OBJEXT@,$OBJEXT,;t t
11607 s,@CPP@,$CPP,;t t
11608 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
11609 s,@PROG_EXT@,$PROG_EXT,;t t
11610 s,@AWK@,$AWK,;t t
11611 s,@EGREP@,$EGREP,;t t
11612 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
11613 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
11614 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
11615 s,@LN_S@,$LN_S,;t t
11616 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
11617 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
11618 s,@SET_MAKE@,$SET_MAKE,;t t
11619 s,@CTAGS@,$CTAGS,;t t
11620 s,@ETAGS@,$ETAGS,;t t
11621 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
11622 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
11623 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
11624 s,@RANLIB@,$RANLIB,;t t
11625 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
11626 s,@LD@,$LD,;t t
11627 s,@ac_ct_LD@,$ac_ct_LD,;t t
11628 s,@AR@,$AR,;t t
11629 s,@ac_ct_AR@,$ac_ct_AR,;t t
11630 s,@ARFLAGS@,$ARFLAGS,;t t
11631 s,@DESTDIR@,$DESTDIR,;t t
11632 s,@BUILD_CC@,$BUILD_CC,;t t
11633 s,@BUILD_CPP@,$BUILD_CPP,;t t
11634 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
11635 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
11636 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
11637 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
11638 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
11639 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
11640 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
11641 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
11642 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
11643 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
11644 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
11645 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
11646 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
11647 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
11648 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
11649 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
11650 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
11651 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
11652 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
11653 s,@CC_G_OPT@,$CC_G_OPT,;t t
11654 s,@LD_MODEL@,$LD_MODEL,;t t
11655 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
11656 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
11657 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
11658 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
11659 s,@LINK_PROGS@,$LINK_PROGS,;t t
11660 s,@LINK_TESTS@,$LINK_TESTS,;t t
11661 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
11662 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
11663 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
11664 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
11665 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
11666 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
11667 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
11668 s,@PTHREAD@,$PTHREAD,;t t
11669 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
11670 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
11671 s,@ECHO_LINK@,$ECHO_LINK,;t t
11672 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
11673 s,@ADA_TRACE@,$ADA_TRACE,;t t
11674 s,@gnat_exists@,$gnat_exists,;t t
11675 s,@cf_compile_generics@,$cf_compile_generics,;t t
11676 s,@cf_generic_objects@,$cf_generic_objects,;t t
11677 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
11678 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
11679 s,@M4_exists@,$M4_exists,;t t
11680 s,@cf_ada_make@,$cf_ada_make,;t t
11681 s,@ADAFLAGS@,$ADAFLAGS,;t t
11682 s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
11683 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
11684 s,@cf_ada_package@,$cf_ada_package,;t t
11685 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
11686 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
11687 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
11688 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
11689 s,@TINFO_ARGS2@,$TINFO_ARGS2,;t t
11690 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
11691 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
11692 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
11693 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
11694 s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
11695 s,@cross_compiling@,$cross_compiling,;t t
11696 s,@TEST_ARG2@,$TEST_ARG2,;t t
11697 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
11698 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
11699 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
11700 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
11701 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
11702 CEOF
11703
11704 EOF
11705
11706   cat >>$CONFIG_STATUS <<\EOF
11707   # Split the substitutions into bite-sized pieces for seds with
11708   # small command number limits, like on Digital OSF/1 and HP-UX.
11709   ac_max_sed_lines=48
11710   ac_sed_frag=1 # Number of current file.
11711   ac_beg=1 # First line for current file.
11712   ac_end=$ac_max_sed_lines # Line after last line for current file.
11713   ac_more_lines=:
11714   ac_sed_cmds=
11715   while $ac_more_lines; do
11716     if test $ac_beg -gt 1; then
11717       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
11718     else
11719       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
11720     fi
11721     if test ! -s $tmp/subs.frag; then
11722       ac_more_lines=false
11723     else
11724       # The purpose of the label and of the branching condition is to
11725       # speed up the sed processing (if there are no `@' at all, there
11726       # is no need to browse any of the substitutions).
11727       # These are the two extra sed commands mentioned above.
11728       (echo ':t
11729   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
11730       if test -z "$ac_sed_cmds"; then
11731         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
11732       else
11733         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
11734       fi
11735       ac_sed_frag=`expr $ac_sed_frag + 1`
11736       ac_beg=$ac_end
11737       ac_end=`expr $ac_end + $ac_max_sed_lines`
11738     fi
11739   done
11740   if test -z "$ac_sed_cmds"; then
11741     ac_sed_cmds=cat
11742   fi
11743 fi # test -n "$CONFIG_FILES"
11744
11745 EOF
11746 cat >>$CONFIG_STATUS <<\EOF
11747 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
11748   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11749   case $ac_file in
11750   - | *:- | *:-:* ) # input from stdin
11751         cat >$tmp/stdin
11752         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
11753         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
11754   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
11755         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
11756   * )   ac_file_in=$ac_file.in ;;
11757   esac
11758
11759   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
11760   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
11761          X"$ac_file" : 'X\(//\)[^/]' \| \
11762          X"$ac_file" : 'X\(//\)$' \| \
11763          X"$ac_file" : 'X\(/\)' \| \
11764          .     : '\(.\)' 2>/dev/null ||
11765 echo X"$ac_file" |
11766     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
11767           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
11768           /^X\(\/\/\)$/{ s//\1/; q; }
11769           /^X\(\/\).*/{ s//\1/; q; }
11770           s/.*/./; q'`
11771   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11772     { case "$ac_dir" in
11773   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
11774   *)                      as_incr_dir=.;;
11775 esac
11776 as_dummy="$ac_dir"
11777 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
11778   case $as_mkdir_dir in
11779     # Skip DOS drivespec
11780     ?:) as_incr_dir=$as_mkdir_dir ;;
11781     *)
11782       as_incr_dir=$as_incr_dir/$as_mkdir_dir
11783       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
11784     ;;
11785   esac
11786 done; }
11787
11788     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
11789     # A "../" for each directory in $ac_dir_suffix.
11790     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
11791   else
11792     ac_dir_suffix= ac_dots=
11793   fi
11794
11795   case $srcdir in
11796   .)  ac_srcdir=.
11797       if test -z "$ac_dots"; then
11798          ac_top_srcdir=.
11799       else
11800          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
11801       fi ;;
11802   [\\/]* | ?:[\\/]* )
11803       ac_srcdir=$srcdir$ac_dir_suffix;
11804       ac_top_srcdir=$srcdir ;;
11805   *) # Relative path.
11806     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
11807     ac_top_srcdir=$ac_dots$srcdir ;;
11808   esac
11809
11810   case $INSTALL in
11811   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
11812   *) ac_INSTALL=$ac_dots$INSTALL ;;
11813   esac
11814
11815   if test x"$ac_file" != x-; then
11816     { echo "$as_me:11816: creating $ac_file" >&5
11817 echo "$as_me: creating $ac_file" >&6;}
11818     rm -f "$ac_file"
11819   fi
11820   # Let's still pretend it is `configure' which instantiates (i.e., don't
11821   # use $as_me), people would be surprised to read:
11822   #    /* config.h.  Generated automatically by config.status.  */
11823   configure_input="Generated automatically from `echo $ac_file_in |
11824                                                  sed 's,.*/,,'` by configure."
11825
11826   # First look for the input files in the build tree, otherwise in the
11827   # src tree.
11828   ac_file_inputs=`IFS=:
11829     for f in $ac_file_in; do
11830       case $f in
11831       -) echo $tmp/stdin ;;
11832       [\\/$]*)
11833          # Absolute (can't be DOS-style, as IFS=:)
11834          test -f "$f" || { { echo "$as_me:11834: error: cannot find input file: $f" >&5
11835 echo "$as_me: error: cannot find input file: $f" >&2;}
11836    { (exit 1); exit 1; }; }
11837          echo $f;;
11838       *) # Relative
11839          if test -f "$f"; then
11840            # Build tree
11841            echo $f
11842          elif test -f "$srcdir/$f"; then
11843            # Source tree
11844            echo $srcdir/$f
11845          else
11846            # /dev/null tree
11847            { { echo "$as_me:11847: error: cannot find input file: $f" >&5
11848 echo "$as_me: error: cannot find input file: $f" >&2;}
11849    { (exit 1); exit 1; }; }
11850          fi;;
11851       esac
11852     done` || { (exit 1); exit 1; }
11853 EOF
11854 cat >>$CONFIG_STATUS <<EOF
11855   sed "$ac_vpsub
11856 $extrasub
11857 EOF
11858 cat >>$CONFIG_STATUS <<\EOF
11859 :t
11860 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
11861 s,@configure_input@,$configure_input,;t t
11862 s,@srcdir@,$ac_srcdir,;t t
11863 s,@top_srcdir@,$ac_top_srcdir,;t t
11864 s,@INSTALL@,$ac_INSTALL,;t t
11865 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
11866   rm -f $tmp/stdin
11867   if test x"$ac_file" != x-; then
11868     mv $tmp/out $ac_file
11869   else
11870     cat $tmp/out
11871     rm -f $tmp/out
11872   fi
11873
11874 done
11875 EOF
11876 cat >>$CONFIG_STATUS <<\EOF
11877
11878 #
11879 # CONFIG_HEADER section.
11880 #
11881
11882 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
11883 # NAME is the cpp macro being defined and VALUE is the value it is being given.
11884 #
11885 # ac_d sets the value in "#define NAME VALUE" lines.
11886 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
11887 ac_dB='[        ].*$,\1#\2'
11888 ac_dC=' '
11889 ac_dD=',;t'
11890 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
11891 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11892 ac_iB='\([      ]\),\1#\2define\3'
11893 ac_iC=' '
11894 ac_iD='\4,;t'
11895 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
11896 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11897 ac_uB='$,\1#\2define\3'
11898 ac_uC=' '
11899 ac_uD=',;t'
11900
11901 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
11902   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11903   case $ac_file in
11904   - | *:- | *:-:* ) # input from stdin
11905         cat >$tmp/stdin
11906         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
11907         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
11908   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
11909         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
11910   * )   ac_file_in=$ac_file.in ;;
11911   esac
11912
11913   test x"$ac_file" != x- && { echo "$as_me:11913: creating $ac_file" >&5
11914 echo "$as_me: creating $ac_file" >&6;}
11915
11916   # First look for the input files in the build tree, otherwise in the
11917   # src tree.
11918   ac_file_inputs=`IFS=:
11919     for f in $ac_file_in; do
11920       case $f in
11921       -) echo $tmp/stdin ;;
11922       [\\/$]*)
11923          # Absolute (can't be DOS-style, as IFS=:)
11924          test -f "$f" || { { echo "$as_me:11924: error: cannot find input file: $f" >&5
11925 echo "$as_me: error: cannot find input file: $f" >&2;}
11926    { (exit 1); exit 1; }; }
11927          echo $f;;
11928       *) # Relative
11929          if test -f "$f"; then
11930            # Build tree
11931            echo $f
11932          elif test -f "$srcdir/$f"; then
11933            # Source tree
11934            echo $srcdir/$f
11935          else
11936            # /dev/null tree
11937            { { echo "$as_me:11937: error: cannot find input file: $f" >&5
11938 echo "$as_me: error: cannot find input file: $f" >&2;}
11939    { (exit 1); exit 1; }; }
11940          fi;;
11941       esac
11942     done` || { (exit 1); exit 1; }
11943   # Remove the trailing spaces.
11944   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
11945
11946 EOF
11947
11948 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
11949 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
11950 # be either 'cat' or 'sort'.
11951 cat confdefs.h | uniq >conftest.vals
11952
11953 # Break up conftest.vals because some shells have a limit on
11954 # the size of here documents, and old seds have small limits too.
11955
11956 rm -f conftest.tail
11957 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
11958 while grep . conftest.vals >/dev/null
11959 do
11960   # Write chunks of a limited-size here document to conftest.frag.
11961   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
11962   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
11963   echo 'CEOF' >> $CONFIG_STATUS
11964   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
11965   rm -f conftest.vals
11966   mv conftest.tail conftest.vals
11967 done
11968 rm -f conftest.vals
11969
11970 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
11971 # marker @DEFS@.
11972 echo '  cat >> conftest.edit <<CEOF
11973 /@DEFS@/r conftest.frag
11974 /@DEFS@/d
11975 CEOF
11976 sed -f conftest.edit $tmp/in > $tmp/out
11977 rm -f $tmp/in
11978 mv $tmp/out $tmp/in
11979 rm -f conftest.edit conftest.frag
11980 ' >> $CONFIG_STATUS
11981
11982 cat >>$CONFIG_STATUS <<\EOF
11983   # Let's still pretend it is `configure' which instantiates (i.e., don't
11984   # use $as_me), people would be surprised to read:
11985   #    /* config.h.  Generated automatically by config.status.  */
11986   if test x"$ac_file" = x-; then
11987     echo "/* Generated automatically by configure.  */" >$tmp/config.h
11988   else
11989     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
11990   fi
11991   cat $tmp/in >>$tmp/config.h
11992   rm -f $tmp/in
11993   if test x"$ac_file" != x-; then
11994     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
11995       { echo "$as_me:11995: $ac_file is unchanged" >&5
11996 echo "$as_me: $ac_file is unchanged" >&6;}
11997     else
11998       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
11999          X"$ac_file" : 'X\(//\)[^/]' \| \
12000          X"$ac_file" : 'X\(//\)$' \| \
12001          X"$ac_file" : 'X\(/\)' \| \
12002          .     : '\(.\)' 2>/dev/null ||
12003 echo X"$ac_file" |
12004     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12005           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12006           /^X\(\/\/\)$/{ s//\1/; q; }
12007           /^X\(\/\).*/{ s//\1/; q; }
12008           s/.*/./; q'`
12009       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12010         { case "$ac_dir" in
12011   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
12012   *)                      as_incr_dir=.;;
12013 esac
12014 as_dummy="$ac_dir"
12015 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
12016   case $as_mkdir_dir in
12017     # Skip DOS drivespec
12018     ?:) as_incr_dir=$as_mkdir_dir ;;
12019     *)
12020       as_incr_dir=$as_incr_dir/$as_mkdir_dir
12021       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12022     ;;
12023   esac
12024 done; }
12025
12026       fi
12027       rm -f $ac_file
12028       mv $tmp/config.h $ac_file
12029     fi
12030   else
12031     cat $tmp/config.h
12032     rm -f $tmp/config.h
12033   fi
12034 done
12035 EOF
12036 cat >>$CONFIG_STATUS <<\EOF
12037 #
12038 # CONFIG_COMMANDS section.
12039 #
12040 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
12041   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
12042   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
12043
12044   case $ac_dest in
12045     default )
12046 if test -z "$USE_OLD_MAKERULES" ; then
12047         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
12048 fi
12049  ;;
12050   esac
12051 done
12052 EOF
12053
12054 cat >>$CONFIG_STATUS <<\EOF
12055
12056 { (exit 0); exit 0; }
12057 EOF
12058 chmod +x $CONFIG_STATUS
12059 ac_clean_files=$ac_clean_files_save
12060
12061 # configure is writing to config.log, and then calls config.status.
12062 # config.status does its own redirection, appending to config.log.
12063 # Unfortunately, on DOS this fails, as config.log is still kept open
12064 # by configure, so config.status won't be able to write to it; its
12065 # output is simply discarded.  So we exec the FD to /dev/null,
12066 # effectively closing config.log, so it can be properly (re)opened and
12067 # appended to by config.status.  When coming back to configure, we
12068 # need to make the FD available again.
12069 if test "$no_create" != yes; then
12070   ac_cs_success=:
12071   exec 5>/dev/null
12072   $SHELL $CONFIG_STATUS || ac_cs_success=false
12073   exec 5>>config.log
12074   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
12075   # would make configure fail if this is the last instruction.
12076   $ac_cs_success || { (exit 1); exit 1; }
12077 fi
12078 ${MAKE-make} preinstall