]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 5.7 - patch 20100703
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.16 .
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 for long file names" >&5
2624 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2625 if test "${ac_cv_sys_long_file_names+set}" = set; then
2626   echo $ECHO_N "(cached) $ECHO_C" >&6
2627 else
2628   ac_cv_sys_long_file_names=yes
2629 # Test for long file names in all the places we know might matter:
2630 #      .                the current directory, where building will happen
2631 #      $prefix/lib      where we will be installing things
2632 #      $exec_prefix/lib likewise
2633 # eval it to expand exec_prefix.
2634 #      $TMPDIR          if set, where it might want to write temporary files
2635 # if $TMPDIR is not set:
2636 #      /tmp             where it might want to write temporary files
2637 #      /var/tmp         likewise
2638 #      /usr/tmp         likewise
2639 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2640   ac_tmpdirs=$TMPDIR
2641 else
2642   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2643 fi
2644 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2645   test -d $ac_dir || continue
2646   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2647   ac_xdir=$ac_dir/cf$$
2648   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2649   ac_tf1=$ac_xdir/conftest9012345
2650   ac_tf2=$ac_xdir/conftest9012346
2651   (echo 1 >$ac_tf1) 2>/dev/null
2652   (echo 2 >$ac_tf2) 2>/dev/null
2653   ac_val=`cat $ac_tf1 2>/dev/null`
2654   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2655     ac_cv_sys_long_file_names=no
2656     rm -rf $ac_xdir 2>/dev/null
2657     break
2658   fi
2659   rm -rf $ac_xdir 2>/dev/null
2660 done
2661 fi
2662 echo "$as_me:2662: result: $ac_cv_sys_long_file_names" >&5
2663 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2664 if test $ac_cv_sys_long_file_names = yes; then
2665
2666 cat >>confdefs.h <<\EOF
2667 #define HAVE_LONG_FILE_NAMES 1
2668 EOF
2669
2670 fi
2671
2672 # if we find pkg-config, check if we should install the ".pc" files.
2673
2674 echo "$as_me:2674: checking if you want to use pkg-config" >&5
2675 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2676
2677 # Check whether --with-pkg-config or --without-pkg-config was given.
2678 if test "${with_pkg_config+set}" = set; then
2679   withval="$with_pkg_config"
2680   cf_pkg_config=$withval
2681 else
2682   cf_pkg_config=yes
2683 fi;
2684 echo "$as_me:2684: result: $cf_pkg_config" >&5
2685 echo "${ECHO_T}$cf_pkg_config" >&6
2686
2687 case $cf_pkg_config in #(vi
2688 no) #(vi
2689         PKG_CONFIG=none
2690         ;;
2691 yes) #(vi
2692         # Extract the first word of "pkg-config", so it can be a program name with args.
2693 set dummy pkg-config; ac_word=$2
2694 echo "$as_me:2694: checking for $ac_word" >&5
2695 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2696 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2697   echo $ECHO_N "(cached) $ECHO_C" >&6
2698 else
2699   case $PKG_CONFIG in
2700   [\\/]* | ?:[\\/]*)
2701   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2702   ;;
2703   *)
2704   ac_save_IFS=$IFS; IFS=$ac_path_separator
2705 ac_dummy="$PATH"
2706 for ac_dir in $ac_dummy; do
2707   IFS=$ac_save_IFS
2708   test -z "$ac_dir" && ac_dir=.
2709   if $as_executable_p "$ac_dir/$ac_word"; then
2710    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2711    echo "$as_me:2711: found $ac_dir/$ac_word" >&5
2712    break
2713 fi
2714 done
2715
2716   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
2717   ;;
2718 esac
2719 fi
2720 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2721
2722 if test -n "$PKG_CONFIG"; then
2723   echo "$as_me:2723: result: $PKG_CONFIG" >&5
2724 echo "${ECHO_T}$PKG_CONFIG" >&6
2725 else
2726   echo "$as_me:2726: result: no" >&5
2727 echo "${ECHO_T}no" >&6
2728 fi
2729
2730         ;;
2731 *)
2732         PKG_CONFIG=$withval
2733         ;;
2734 esac
2735
2736 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2737 if test "$PKG_CONFIG" != none ; then
2738
2739 if test "x$prefix" != xNONE; then
2740   cf_path_syntax="$prefix"
2741 else
2742   cf_path_syntax="$ac_default_prefix"
2743 fi
2744
2745 case ".$PKG_CONFIG" in #(vi
2746 .\$\(*\)*|.\'*\'*) #(vi
2747   ;;
2748 ..|./*|.\\*) #(vi
2749   ;;
2750 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2751   ;;
2752 .\${*prefix}*) #(vi
2753   eval PKG_CONFIG="$PKG_CONFIG"
2754   case ".$PKG_CONFIG" in #(vi
2755   .NONE/*)
2756     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2757     ;;
2758   esac
2759   ;; #(vi
2760 .no|.NONE/*)
2761   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2762   ;;
2763 *)
2764   { { echo "$as_me:2764: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2765 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2766    { (exit 1); exit 1; }; }
2767   ;;
2768 esac
2769
2770 fi
2771
2772 if test "$PKG_CONFIG" != no ; then
2773         echo "$as_me:2773: checking if we should install .pc files for $PKG_CONFIG" >&5
2774 echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6
2775
2776         # Leave this as something that can be overridden in the environment.
2777         if test -z "$PKG_CONFIG_LIBDIR" ; then
2778                 PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
2779         fi
2780         PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
2781         if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
2782
2783 # Check whether --enable-pc-files or --disable-pc-files was given.
2784 if test "${enable_pc_files+set}" = set; then
2785   enableval="$enable_pc_files"
2786   enable_pc_files=$enableval
2787 else
2788   enable_pc_files=no
2789 fi;
2790                 echo "$as_me:2790: result: $enable_pc_files" >&5
2791 echo "${ECHO_T}$enable_pc_files" >&6
2792         else
2793                 echo "$as_me:2793: result: no" >&5
2794 echo "${ECHO_T}no" >&6
2795                 { echo "$as_me:2795: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5
2796 echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;}
2797                 enable_pc_files=no
2798         fi
2799 fi
2800
2801 echo "$as_me:2801: checking if we should assume mixed-case filenames" >&5
2802 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2803
2804 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2805 if test "${enable_mixed_case+set}" = set; then
2806   enableval="$enable_mixed_case"
2807   enable_mixedcase=$enableval
2808 else
2809   enable_mixedcase=auto
2810 fi;
2811 echo "$as_me:2811: result: $enable_mixedcase" >&5
2812 echo "${ECHO_T}$enable_mixedcase" >&6
2813 if test "$enable_mixedcase" = "auto" ; then
2814
2815 echo "$as_me:2815: checking if filesystem supports mixed-case filenames" >&5
2816 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2817 if test "${cf_cv_mixedcase+set}" = set; then
2818   echo $ECHO_N "(cached) $ECHO_C" >&6
2819 else
2820
2821 if test "$cross_compiling" = yes ; then
2822         case $target_alias in #(vi
2823         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2824                 cf_cv_mixedcase=no
2825                 ;;
2826         *)
2827                 cf_cv_mixedcase=yes
2828                 ;;
2829         esac
2830 else
2831         rm -f conftest CONFTEST
2832         echo test >conftest
2833         if test -f CONFTEST ; then
2834                 cf_cv_mixedcase=no
2835         else
2836                 cf_cv_mixedcase=yes
2837         fi
2838         rm -f conftest CONFTEST
2839 fi
2840
2841 fi
2842 echo "$as_me:2842: result: $cf_cv_mixedcase" >&5
2843 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2844 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2845 #define MIXEDCASE_FILENAMES 1
2846 EOF
2847
2848 else
2849     cf_cv_mixedcase=$enable_mixedcase
2850     if test "$enable_mixedcase" = "yes" ; then
2851         cat >>confdefs.h <<\EOF
2852 #define MIXEDCASE_FILENAMES 1
2853 EOF
2854
2855     fi
2856 fi
2857
2858 # do this after mixed-case option (tags/TAGS is not as important as tic).
2859 echo "$as_me:2859: checking whether ${MAKE-make} sets \${MAKE}" >&5
2860 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2861 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2862 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2863   echo $ECHO_N "(cached) $ECHO_C" >&6
2864 else
2865   cat >conftest.make <<\EOF
2866 all:
2867         @echo 'ac_maketemp="${MAKE}"'
2868 EOF
2869 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2870 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2871 if test -n "$ac_maketemp"; then
2872   eval ac_cv_prog_make_${ac_make}_set=yes
2873 else
2874   eval ac_cv_prog_make_${ac_make}_set=no
2875 fi
2876 rm -f conftest.make
2877 fi
2878 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2879   echo "$as_me:2879: result: yes" >&5
2880 echo "${ECHO_T}yes" >&6
2881   SET_MAKE=
2882 else
2883   echo "$as_me:2883: result: no" >&5
2884 echo "${ECHO_T}no" >&6
2885   SET_MAKE="MAKE=${MAKE-make}"
2886 fi
2887
2888 for ac_prog in exctags ctags
2889 do
2890   # Extract the first word of "$ac_prog", so it can be a program name with args.
2891 set dummy $ac_prog; ac_word=$2
2892 echo "$as_me:2892: checking for $ac_word" >&5
2893 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2894 if test "${ac_cv_prog_CTAGS+set}" = set; then
2895   echo $ECHO_N "(cached) $ECHO_C" >&6
2896 else
2897   if test -n "$CTAGS"; then
2898   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2899 else
2900   ac_save_IFS=$IFS; IFS=$ac_path_separator
2901 ac_dummy="$PATH"
2902 for ac_dir in $ac_dummy; do
2903   IFS=$ac_save_IFS
2904   test -z "$ac_dir" && ac_dir=.
2905   $as_executable_p "$ac_dir/$ac_word" || continue
2906 ac_cv_prog_CTAGS="$ac_prog"
2907 echo "$as_me:2907: found $ac_dir/$ac_word" >&5
2908 break
2909 done
2910
2911 fi
2912 fi
2913 CTAGS=$ac_cv_prog_CTAGS
2914 if test -n "$CTAGS"; then
2915   echo "$as_me:2915: result: $CTAGS" >&5
2916 echo "${ECHO_T}$CTAGS" >&6
2917 else
2918   echo "$as_me:2918: result: no" >&5
2919 echo "${ECHO_T}no" >&6
2920 fi
2921
2922   test -n "$CTAGS" && break
2923 done
2924
2925 for ac_prog in exetags etags
2926 do
2927   # Extract the first word of "$ac_prog", so it can be a program name with args.
2928 set dummy $ac_prog; ac_word=$2
2929 echo "$as_me:2929: checking for $ac_word" >&5
2930 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2931 if test "${ac_cv_prog_ETAGS+set}" = set; then
2932   echo $ECHO_N "(cached) $ECHO_C" >&6
2933 else
2934   if test -n "$ETAGS"; then
2935   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2936 else
2937   ac_save_IFS=$IFS; IFS=$ac_path_separator
2938 ac_dummy="$PATH"
2939 for ac_dir in $ac_dummy; do
2940   IFS=$ac_save_IFS
2941   test -z "$ac_dir" && ac_dir=.
2942   $as_executable_p "$ac_dir/$ac_word" || continue
2943 ac_cv_prog_ETAGS="$ac_prog"
2944 echo "$as_me:2944: found $ac_dir/$ac_word" >&5
2945 break
2946 done
2947
2948 fi
2949 fi
2950 ETAGS=$ac_cv_prog_ETAGS
2951 if test -n "$ETAGS"; then
2952   echo "$as_me:2952: result: $ETAGS" >&5
2953 echo "${ECHO_T}$ETAGS" >&6
2954 else
2955   echo "$as_me:2955: result: no" >&5
2956 echo "${ECHO_T}no" >&6
2957 fi
2958
2959   test -n "$ETAGS" && break
2960 done
2961
2962 # Extract the first word of "${CTAGS-ctags}", so it can be a program name with args.
2963 set dummy ${CTAGS-ctags}; ac_word=$2
2964 echo "$as_me:2964: checking for $ac_word" >&5
2965 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2966 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2967   echo $ECHO_N "(cached) $ECHO_C" >&6
2968 else
2969   if test -n "$MAKE_LOWER_TAGS"; then
2970   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2971 else
2972   ac_save_IFS=$IFS; IFS=$ac_path_separator
2973 ac_dummy="$PATH"
2974 for ac_dir in $ac_dummy; do
2975   IFS=$ac_save_IFS
2976   test -z "$ac_dir" && ac_dir=.
2977   $as_executable_p "$ac_dir/$ac_word" || continue
2978 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2979 echo "$as_me:2979: found $ac_dir/$ac_word" >&5
2980 break
2981 done
2982
2983   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2984 fi
2985 fi
2986 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2987 if test -n "$MAKE_LOWER_TAGS"; then
2988   echo "$as_me:2988: result: $MAKE_LOWER_TAGS" >&5
2989 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2990 else
2991   echo "$as_me:2991: result: no" >&5
2992 echo "${ECHO_T}no" >&6
2993 fi
2994
2995 if test "$cf_cv_mixedcase" = yes ; then
2996         # Extract the first word of "${ETAGS-etags}", so it can be a program name with args.
2997 set dummy ${ETAGS-etags}; ac_word=$2
2998 echo "$as_me:2998: checking for $ac_word" >&5
2999 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3000 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3001   echo $ECHO_N "(cached) $ECHO_C" >&6
3002 else
3003   if test -n "$MAKE_UPPER_TAGS"; then
3004   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3005 else
3006   ac_save_IFS=$IFS; IFS=$ac_path_separator
3007 ac_dummy="$PATH"
3008 for ac_dir in $ac_dummy; do
3009   IFS=$ac_save_IFS
3010   test -z "$ac_dir" && ac_dir=.
3011   $as_executable_p "$ac_dir/$ac_word" || continue
3012 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3013 echo "$as_me:3013: found $ac_dir/$ac_word" >&5
3014 break
3015 done
3016
3017   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3018 fi
3019 fi
3020 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3021 if test -n "$MAKE_UPPER_TAGS"; then
3022   echo "$as_me:3022: result: $MAKE_UPPER_TAGS" >&5
3023 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3024 else
3025   echo "$as_me:3025: result: no" >&5
3026 echo "${ECHO_T}no" >&6
3027 fi
3028
3029 else
3030         MAKE_UPPER_TAGS=no
3031 fi
3032
3033 if test "$MAKE_UPPER_TAGS" = yes ; then
3034         MAKE_UPPER_TAGS=
3035 else
3036         MAKE_UPPER_TAGS="#"
3037 fi
3038
3039 if test "$MAKE_LOWER_TAGS" = yes ; then
3040         MAKE_LOWER_TAGS=
3041 else
3042         MAKE_LOWER_TAGS="#"
3043 fi
3044
3045 echo "$as_me:3045: checking for makeflags variable" >&5
3046 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3047 if test "${cf_cv_makeflags+set}" = set; then
3048   echo $ECHO_N "(cached) $ECHO_C" >&6
3049 else
3050
3051         cf_cv_makeflags=''
3052         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3053         do
3054                 cat >cf_makeflags.tmp <<CF_EOF
3055 SHELL = /bin/sh
3056 all :
3057         @ echo '.$cf_option'
3058 CF_EOF
3059                 cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[        ]*$,,'`
3060                 case "$cf_result" in
3061                 .*k)
3062                         cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3063                         case "$cf_result" in
3064                         .*CC=*) cf_cv_makeflags=
3065                                 ;;
3066                         *)      cf_cv_makeflags=$cf_option
3067                                 ;;
3068                         esac
3069                         break
3070                         ;;
3071                 .-)     ;;
3072                 *)      echo "given option \"$cf_option\", no match \"$cf_result\""
3073                         ;;
3074                 esac
3075         done
3076         rm -f cf_makeflags.tmp
3077
3078 fi
3079 echo "$as_me:3079: result: $cf_cv_makeflags" >&5
3080 echo "${ECHO_T}$cf_cv_makeflags" >&6
3081
3082 if test -n "$ac_tool_prefix"; then
3083   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3084 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3085 echo "$as_me:3085: checking for $ac_word" >&5
3086 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3087 if test "${ac_cv_prog_RANLIB+set}" = set; then
3088   echo $ECHO_N "(cached) $ECHO_C" >&6
3089 else
3090   if test -n "$RANLIB"; then
3091   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3092 else
3093   ac_save_IFS=$IFS; IFS=$ac_path_separator
3094 ac_dummy="$PATH"
3095 for ac_dir in $ac_dummy; do
3096   IFS=$ac_save_IFS
3097   test -z "$ac_dir" && ac_dir=.
3098   $as_executable_p "$ac_dir/$ac_word" || continue
3099 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3100 echo "$as_me:3100: found $ac_dir/$ac_word" >&5
3101 break
3102 done
3103
3104 fi
3105 fi
3106 RANLIB=$ac_cv_prog_RANLIB
3107 if test -n "$RANLIB"; then
3108   echo "$as_me:3108: result: $RANLIB" >&5
3109 echo "${ECHO_T}$RANLIB" >&6
3110 else
3111   echo "$as_me:3111: result: no" >&5
3112 echo "${ECHO_T}no" >&6
3113 fi
3114
3115 fi
3116 if test -z "$ac_cv_prog_RANLIB"; then
3117   ac_ct_RANLIB=$RANLIB
3118   # Extract the first word of "ranlib", so it can be a program name with args.
3119 set dummy ranlib; ac_word=$2
3120 echo "$as_me:3120: checking for $ac_word" >&5
3121 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3122 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3123   echo $ECHO_N "(cached) $ECHO_C" >&6
3124 else
3125   if test -n "$ac_ct_RANLIB"; then
3126   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3127 else
3128   ac_save_IFS=$IFS; IFS=$ac_path_separator
3129 ac_dummy="$PATH"
3130 for ac_dir in $ac_dummy; do
3131   IFS=$ac_save_IFS
3132   test -z "$ac_dir" && ac_dir=.
3133   $as_executable_p "$ac_dir/$ac_word" || continue
3134 ac_cv_prog_ac_ct_RANLIB="ranlib"
3135 echo "$as_me:3135: found $ac_dir/$ac_word" >&5
3136 break
3137 done
3138
3139   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3140 fi
3141 fi
3142 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3143 if test -n "$ac_ct_RANLIB"; then
3144   echo "$as_me:3144: result: $ac_ct_RANLIB" >&5
3145 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3146 else
3147   echo "$as_me:3147: result: no" >&5
3148 echo "${ECHO_T}no" >&6
3149 fi
3150
3151   RANLIB=$ac_ct_RANLIB
3152 else
3153   RANLIB="$ac_cv_prog_RANLIB"
3154 fi
3155
3156 if test -n "$ac_tool_prefix"; then
3157   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3158 set dummy ${ac_tool_prefix}ld; ac_word=$2
3159 echo "$as_me:3159: checking for $ac_word" >&5
3160 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3161 if test "${ac_cv_prog_LD+set}" = set; then
3162   echo $ECHO_N "(cached) $ECHO_C" >&6
3163 else
3164   if test -n "$LD"; then
3165   ac_cv_prog_LD="$LD" # Let the user override the test.
3166 else
3167   ac_save_IFS=$IFS; IFS=$ac_path_separator
3168 ac_dummy="$PATH"
3169 for ac_dir in $ac_dummy; do
3170   IFS=$ac_save_IFS
3171   test -z "$ac_dir" && ac_dir=.
3172   $as_executable_p "$ac_dir/$ac_word" || continue
3173 ac_cv_prog_LD="${ac_tool_prefix}ld"
3174 echo "$as_me:3174: found $ac_dir/$ac_word" >&5
3175 break
3176 done
3177
3178 fi
3179 fi
3180 LD=$ac_cv_prog_LD
3181 if test -n "$LD"; then
3182   echo "$as_me:3182: result: $LD" >&5
3183 echo "${ECHO_T}$LD" >&6
3184 else
3185   echo "$as_me:3185: result: no" >&5
3186 echo "${ECHO_T}no" >&6
3187 fi
3188
3189 fi
3190 if test -z "$ac_cv_prog_LD"; then
3191   ac_ct_LD=$LD
3192   # Extract the first word of "ld", so it can be a program name with args.
3193 set dummy ld; ac_word=$2
3194 echo "$as_me:3194: checking for $ac_word" >&5
3195 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3196 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3197   echo $ECHO_N "(cached) $ECHO_C" >&6
3198 else
3199   if test -n "$ac_ct_LD"; then
3200   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3201 else
3202   ac_save_IFS=$IFS; IFS=$ac_path_separator
3203 ac_dummy="$PATH"
3204 for ac_dir in $ac_dummy; do
3205   IFS=$ac_save_IFS
3206   test -z "$ac_dir" && ac_dir=.
3207   $as_executable_p "$ac_dir/$ac_word" || continue
3208 ac_cv_prog_ac_ct_LD="ld"
3209 echo "$as_me:3209: found $ac_dir/$ac_word" >&5
3210 break
3211 done
3212
3213   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3214 fi
3215 fi
3216 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3217 if test -n "$ac_ct_LD"; then
3218   echo "$as_me:3218: result: $ac_ct_LD" >&5
3219 echo "${ECHO_T}$ac_ct_LD" >&6
3220 else
3221   echo "$as_me:3221: result: no" >&5
3222 echo "${ECHO_T}no" >&6
3223 fi
3224
3225   LD=$ac_ct_LD
3226 else
3227   LD="$ac_cv_prog_LD"
3228 fi
3229
3230 if test -n "$ac_tool_prefix"; then
3231   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3232 set dummy ${ac_tool_prefix}ar; ac_word=$2
3233 echo "$as_me:3233: checking for $ac_word" >&5
3234 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3235 if test "${ac_cv_prog_AR+set}" = set; then
3236   echo $ECHO_N "(cached) $ECHO_C" >&6
3237 else
3238   if test -n "$AR"; then
3239   ac_cv_prog_AR="$AR" # Let the user override the test.
3240 else
3241   ac_save_IFS=$IFS; IFS=$ac_path_separator
3242 ac_dummy="$PATH"
3243 for ac_dir in $ac_dummy; do
3244   IFS=$ac_save_IFS
3245   test -z "$ac_dir" && ac_dir=.
3246   $as_executable_p "$ac_dir/$ac_word" || continue
3247 ac_cv_prog_AR="${ac_tool_prefix}ar"
3248 echo "$as_me:3248: found $ac_dir/$ac_word" >&5
3249 break
3250 done
3251
3252 fi
3253 fi
3254 AR=$ac_cv_prog_AR
3255 if test -n "$AR"; then
3256   echo "$as_me:3256: result: $AR" >&5
3257 echo "${ECHO_T}$AR" >&6
3258 else
3259   echo "$as_me:3259: result: no" >&5
3260 echo "${ECHO_T}no" >&6
3261 fi
3262
3263 fi
3264 if test -z "$ac_cv_prog_AR"; then
3265   ac_ct_AR=$AR
3266   # Extract the first word of "ar", so it can be a program name with args.
3267 set dummy ar; ac_word=$2
3268 echo "$as_me:3268: checking for $ac_word" >&5
3269 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3270 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3271   echo $ECHO_N "(cached) $ECHO_C" >&6
3272 else
3273   if test -n "$ac_ct_AR"; then
3274   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3275 else
3276   ac_save_IFS=$IFS; IFS=$ac_path_separator
3277 ac_dummy="$PATH"
3278 for ac_dir in $ac_dummy; do
3279   IFS=$ac_save_IFS
3280   test -z "$ac_dir" && ac_dir=.
3281   $as_executable_p "$ac_dir/$ac_word" || continue
3282 ac_cv_prog_ac_ct_AR="ar"
3283 echo "$as_me:3283: found $ac_dir/$ac_word" >&5
3284 break
3285 done
3286
3287   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3288 fi
3289 fi
3290 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3291 if test -n "$ac_ct_AR"; then
3292   echo "$as_me:3292: result: $ac_ct_AR" >&5
3293 echo "${ECHO_T}$ac_ct_AR" >&6
3294 else
3295   echo "$as_me:3295: result: no" >&5
3296 echo "${ECHO_T}no" >&6
3297 fi
3298
3299   AR=$ac_ct_AR
3300 else
3301   AR="$ac_cv_prog_AR"
3302 fi
3303
3304 if test -n "$ac_tool_prefix"; then
3305   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3306 set dummy ${ac_tool_prefix}ar; ac_word=$2
3307 echo "$as_me:3307: checking for $ac_word" >&5
3308 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3309 if test "${ac_cv_prog_AR+set}" = set; then
3310   echo $ECHO_N "(cached) $ECHO_C" >&6
3311 else
3312   if test -n "$AR"; then
3313   ac_cv_prog_AR="$AR" # Let the user override the test.
3314 else
3315   ac_save_IFS=$IFS; IFS=$ac_path_separator
3316 ac_dummy="$PATH"
3317 for ac_dir in $ac_dummy; do
3318   IFS=$ac_save_IFS
3319   test -z "$ac_dir" && ac_dir=.
3320   $as_executable_p "$ac_dir/$ac_word" || continue
3321 ac_cv_prog_AR="${ac_tool_prefix}ar"
3322 echo "$as_me:3322: found $ac_dir/$ac_word" >&5
3323 break
3324 done
3325
3326 fi
3327 fi
3328 AR=$ac_cv_prog_AR
3329 if test -n "$AR"; then
3330   echo "$as_me:3330: result: $AR" >&5
3331 echo "${ECHO_T}$AR" >&6
3332 else
3333   echo "$as_me:3333: result: no" >&5
3334 echo "${ECHO_T}no" >&6
3335 fi
3336
3337 fi
3338 if test -z "$ac_cv_prog_AR"; then
3339   ac_ct_AR=$AR
3340   # Extract the first word of "ar", so it can be a program name with args.
3341 set dummy ar; ac_word=$2
3342 echo "$as_me:3342: checking for $ac_word" >&5
3343 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3344 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3345   echo $ECHO_N "(cached) $ECHO_C" >&6
3346 else
3347   if test -n "$ac_ct_AR"; then
3348   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3349 else
3350   ac_save_IFS=$IFS; IFS=$ac_path_separator
3351 ac_dummy="$PATH"
3352 for ac_dir in $ac_dummy; do
3353   IFS=$ac_save_IFS
3354   test -z "$ac_dir" && ac_dir=.
3355   $as_executable_p "$ac_dir/$ac_word" || continue
3356 ac_cv_prog_ac_ct_AR="ar"
3357 echo "$as_me:3357: found $ac_dir/$ac_word" >&5
3358 break
3359 done
3360
3361   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3362 fi
3363 fi
3364 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3365 if test -n "$ac_ct_AR"; then
3366   echo "$as_me:3366: result: $ac_ct_AR" >&5
3367 echo "${ECHO_T}$ac_ct_AR" >&6
3368 else
3369   echo "$as_me:3369: result: no" >&5
3370 echo "${ECHO_T}no" >&6
3371 fi
3372
3373   AR=$ac_ct_AR
3374 else
3375   AR="$ac_cv_prog_AR"
3376 fi
3377
3378 echo "$as_me:3378: checking for options to update archives" >&5
3379 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3380 if test "${cf_cv_ar_flags+set}" = set; then
3381   echo $ECHO_N "(cached) $ECHO_C" >&6
3382 else
3383
3384         cf_cv_ar_flags=unknown
3385         for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
3386         do
3387
3388                 # check if $ARFLAGS already contains this choice
3389                 if test "x$ARFLAGS" != "x" ; then
3390                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3391                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3392                                 cf_cv_ar_flags=
3393                                 break
3394                         fi
3395                 fi
3396
3397                 rm -f conftest.$ac_cv_objext
3398                 rm -f conftest.a
3399
3400                 cat >conftest.$ac_ext <<EOF
3401 #line 3401 "configure"
3402 int     testdata[3] = { 123, 456, 789 };
3403 EOF
3404                 if { (eval echo "$as_me:3404: \"$ac_compile\"") >&5
3405   (eval $ac_compile) 2>&5
3406   ac_status=$?
3407   echo "$as_me:3407: \$? = $ac_status" >&5
3408   (exit $ac_status); } ; then
3409                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3410                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3411                         if test -f conftest.a ; then
3412                                 cf_cv_ar_flags=$cf_ar_flags
3413                                 break
3414                         fi
3415                 else
3416                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3417
3418 echo "${as_me-configure}:3418: testing cannot compile test-program ..." 1>&5
3419
3420                         break
3421                 fi
3422         done
3423         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3424
3425 fi
3426 echo "$as_me:3426: result: $cf_cv_ar_flags" >&5
3427 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3428
3429 if test -n "$ARFLAGS" ; then
3430         if test -n "$cf_cv_ar_flags" ; then
3431                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3432         fi
3433 else
3434         ARFLAGS=$cf_cv_ar_flags
3435 fi
3436
3437 echo "$as_me:3437: checking if you have specified an install-prefix" >&5
3438 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3439
3440 # Check whether --with-install-prefix or --without-install-prefix was given.
3441 if test "${with_install_prefix+set}" = set; then
3442   withval="$with_install_prefix"
3443   case "$withval" in #(vi
3444         yes|no) #(vi
3445                 ;;
3446         *)      DESTDIR="$withval"
3447                 ;;
3448         esac
3449 fi;
3450 echo "$as_me:3450: result: $DESTDIR" >&5
3451 echo "${ECHO_T}$DESTDIR" >&6
3452
3453 ###############################################################################
3454
3455 # If we're cross-compiling, allow the user to override the tools and their
3456 # options.  The configure script is oriented toward identifying the host
3457 # compiler, etc., but we need a build compiler to generate parts of the source.
3458
3459 if test "$cross_compiling" = yes ; then
3460
3461         # defaults that we might want to override
3462         : ${BUILD_CFLAGS:=''}
3463         : ${BUILD_CPPFLAGS:=''}
3464         : ${BUILD_LDFLAGS:=''}
3465         : ${BUILD_LIBS:=''}
3466         : ${BUILD_EXEEXT:='$x'}
3467         : ${BUILD_OBJEXT:='o'}
3468
3469 # Check whether --with-build-cc or --without-build-cc was given.
3470 if test "${with_build_cc+set}" = set; then
3471   withval="$with_build_cc"
3472   BUILD_CC="$withval"
3473 else
3474   for ac_prog in gcc cc cl
3475 do
3476   # Extract the first word of "$ac_prog", so it can be a program name with args.
3477 set dummy $ac_prog; ac_word=$2
3478 echo "$as_me:3478: checking for $ac_word" >&5
3479 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3480 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3481   echo $ECHO_N "(cached) $ECHO_C" >&6
3482 else
3483   if test -n "$BUILD_CC"; then
3484   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3485 else
3486   ac_save_IFS=$IFS; IFS=$ac_path_separator
3487 ac_dummy="$PATH"
3488 for ac_dir in $ac_dummy; do
3489   IFS=$ac_save_IFS
3490   test -z "$ac_dir" && ac_dir=.
3491   $as_executable_p "$ac_dir/$ac_word" || continue
3492 ac_cv_prog_BUILD_CC="$ac_prog"
3493 echo "$as_me:3493: found $ac_dir/$ac_word" >&5
3494 break
3495 done
3496
3497 fi
3498 fi
3499 BUILD_CC=$ac_cv_prog_BUILD_CC
3500 if test -n "$BUILD_CC"; then
3501   echo "$as_me:3501: result: $BUILD_CC" >&5
3502 echo "${ECHO_T}$BUILD_CC" >&6
3503 else
3504   echo "$as_me:3504: result: no" >&5
3505 echo "${ECHO_T}no" >&6
3506 fi
3507
3508   test -n "$BUILD_CC" && break
3509 done
3510
3511 fi;
3512         echo "$as_me:3512: checking for native build C compiler" >&5
3513 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3514         echo "$as_me:3514: result: $BUILD_CC" >&5
3515 echo "${ECHO_T}$BUILD_CC" >&6
3516
3517         echo "$as_me:3517: checking for native build C preprocessor" >&5
3518 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3519
3520 # Check whether --with-build-cpp or --without-build-cpp was given.
3521 if test "${with_build_cpp+set}" = set; then
3522   withval="$with_build_cpp"
3523   BUILD_CPP="$withval"
3524 else
3525   BUILD_CPP='${BUILD_CC} -E'
3526 fi;
3527         echo "$as_me:3527: result: $BUILD_CPP" >&5
3528 echo "${ECHO_T}$BUILD_CPP" >&6
3529
3530         echo "$as_me:3530: checking for native build C flags" >&5
3531 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3532
3533 # Check whether --with-build-cflags or --without-build-cflags was given.
3534 if test "${with_build_cflags+set}" = set; then
3535   withval="$with_build_cflags"
3536   BUILD_CFLAGS="$withval"
3537 fi;
3538         echo "$as_me:3538: result: $BUILD_CFLAGS" >&5
3539 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3540
3541         echo "$as_me:3541: checking for native build C preprocessor-flags" >&5
3542 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3543
3544 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3545 if test "${with_build_cppflags+set}" = set; then
3546   withval="$with_build_cppflags"
3547   BUILD_CPPFLAGS="$withval"
3548 fi;
3549         echo "$as_me:3549: result: $BUILD_CPPFLAGS" >&5
3550 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3551
3552         echo "$as_me:3552: checking for native build linker-flags" >&5
3553 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3554
3555 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3556 if test "${with_build_ldflags+set}" = set; then
3557   withval="$with_build_ldflags"
3558   BUILD_LDFLAGS="$withval"
3559 fi;
3560         echo "$as_me:3560: result: $BUILD_LDFLAGS" >&5
3561 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3562
3563         echo "$as_me:3563: checking for native build linker-libraries" >&5
3564 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3565
3566 # Check whether --with-build-libs or --without-build-libs was given.
3567 if test "${with_build_libs+set}" = set; then
3568   withval="$with_build_libs"
3569   BUILD_LIBS="$withval"
3570 fi;
3571         echo "$as_me:3571: result: $BUILD_LIBS" >&5
3572 echo "${ECHO_T}$BUILD_LIBS" >&6
3573
3574         # this assumes we're on Unix.
3575         BUILD_EXEEXT=
3576         BUILD_OBJEXT=o
3577
3578         : ${BUILD_CC:='${CC}'}
3579
3580         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3581                 { { echo "$as_me:3581: error: Cross-build requires two compilers.
3582 Use --with-build-cc to specify the native compiler." >&5
3583 echo "$as_me: error: Cross-build requires two compilers.
3584 Use --with-build-cc to specify the native compiler." >&2;}
3585    { (exit 1); exit 1; }; }
3586         fi
3587
3588 else
3589         : ${BUILD_CC:='${CC}'}
3590         : ${BUILD_CPP:='${CPP}'}
3591         : ${BUILD_CFLAGS:='${CFLAGS}'}
3592         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3593         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3594         : ${BUILD_LIBS:='${LIBS}'}
3595         : ${BUILD_EXEEXT:='$x'}
3596         : ${BUILD_OBJEXT:='o'}
3597 fi
3598
3599 ###############################################################################
3600
3601 ### Options to allow the user to specify the set of libraries which are used.
3602 ### Use "--without-normal --with-shared" to allow the default model to be
3603 ### shared, for example.
3604 cf_list_models=""
3605 echo "$as_me:3605: checking for specified models" >&5
3606 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3607 test -z "$cf_list_models" && cf_list_models=normal
3608 echo "$as_me:3608: result: $cf_list_models" >&5
3609 echo "${ECHO_T}$cf_list_models" >&6
3610
3611 ### Use the first model as the default, and save its suffix for use in building
3612 ### up test-applications.
3613 echo "$as_me:3613: checking for default model" >&5
3614 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3615 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3616 echo "$as_me:3616: result: $DFT_LWR_MODEL" >&5
3617 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3618
3619 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3620
3621 # Check whether --with-curses-dir or --without-curses-dir was given.
3622 if test "${with_curses_dir+set}" = set; then
3623   withval="$with_curses_dir"
3624
3625 if test "x$prefix" != xNONE; then
3626   cf_path_syntax="$prefix"
3627 else
3628   cf_path_syntax="$ac_default_prefix"
3629 fi
3630
3631 case ".$withval" in #(vi
3632 .\$\(*\)*|.\'*\'*) #(vi
3633   ;;
3634 ..|./*|.\\*) #(vi
3635   ;;
3636 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
3637   ;;
3638 .\${*prefix}*) #(vi
3639   eval withval="$withval"
3640   case ".$withval" in #(vi
3641   .NONE/*)
3642     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3643     ;;
3644   esac
3645   ;; #(vi
3646 .no|.NONE/*)
3647   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3648   ;;
3649 *)
3650   { { echo "$as_me:3650: error: expected a pathname, not \"$withval\"" >&5
3651 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3652    { (exit 1); exit 1; }; }
3653   ;;
3654 esac
3655
3656          cf_cv_curses_dir=$withval
3657 else
3658   cf_cv_curses_dir=no
3659 fi;
3660
3661 echo "$as_me:3661: checking if you want wide-character code" >&5
3662 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
3663
3664 # Check whether --enable-widec or --disable-widec was given.
3665 if test "${enable_widec+set}" = set; then
3666   enableval="$enable_widec"
3667   with_widec=$enableval
3668 else
3669   with_widec=no
3670 fi;
3671 echo "$as_me:3671: result: $with_widec" >&5
3672 echo "${ECHO_T}$with_widec" >&6
3673 if test "$with_widec" = yes ; then
3674
3675 echo "$as_me:3675: checking for multibyte character support" >&5
3676 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
3677 if test "${cf_cv_utf8_lib+set}" = set; then
3678   echo $ECHO_N "(cached) $ECHO_C" >&6
3679 else
3680
3681         cf_save_LIBS="$LIBS"
3682         cat >conftest.$ac_ext <<_ACEOF
3683 #line 3683 "configure"
3684 #include "confdefs.h"
3685
3686 #include <stdlib.h>
3687 int
3688 main ()
3689 {
3690 putwc(0,0);
3691   ;
3692   return 0;
3693 }
3694 _ACEOF
3695 rm -f conftest.$ac_objext conftest$ac_exeext
3696 if { (eval echo "$as_me:3696: \"$ac_link\"") >&5
3697   (eval $ac_link) 2>&5
3698   ac_status=$?
3699   echo "$as_me:3699: \$? = $ac_status" >&5
3700   (exit $ac_status); } &&
3701          { ac_try='test -s conftest$ac_exeext'
3702   { (eval echo "$as_me:3702: \"$ac_try\"") >&5
3703   (eval $ac_try) 2>&5
3704   ac_status=$?
3705   echo "$as_me:3705: \$? = $ac_status" >&5
3706   (exit $ac_status); }; }; then
3707   cf_cv_utf8_lib=yes
3708 else
3709   echo "$as_me: failed program was:" >&5
3710 cat conftest.$ac_ext >&5
3711
3712 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
3713 # will be set on completion of the AC_TRY_LINK below.
3714 cf_cv_header_path_utf8=
3715 cf_cv_library_path_utf8=
3716
3717 echo "${as_me-configure}:3717: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
3718
3719 cf_save_LIBS="$LIBS"
3720
3721 cat >conftest.$ac_ext <<_ACEOF
3722 #line 3722 "configure"
3723 #include "confdefs.h"
3724
3725 #include <libutf8.h>
3726 int
3727 main ()
3728 {
3729 putwc(0,0);
3730   ;
3731   return 0;
3732 }
3733 _ACEOF
3734 rm -f conftest.$ac_objext conftest$ac_exeext
3735 if { (eval echo "$as_me:3735: \"$ac_link\"") >&5
3736   (eval $ac_link) 2>&5
3737   ac_status=$?
3738   echo "$as_me:3738: \$? = $ac_status" >&5
3739   (exit $ac_status); } &&
3740          { ac_try='test -s conftest$ac_exeext'
3741   { (eval echo "$as_me:3741: \"$ac_try\"") >&5
3742   (eval $ac_try) 2>&5
3743   ac_status=$?
3744   echo "$as_me:3744: \$? = $ac_status" >&5
3745   (exit $ac_status); }; }; then
3746
3747         cf_cv_find_linkage_utf8=yes
3748         cf_cv_header_path_utf8=/usr/include
3749         cf_cv_library_path_utf8=/usr/lib
3750
3751 else
3752   echo "$as_me: failed program was:" >&5
3753 cat conftest.$ac_ext >&5
3754
3755 LIBS="-lutf8  $cf_save_LIBS"
3756
3757 cat >conftest.$ac_ext <<_ACEOF
3758 #line 3758 "configure"
3759 #include "confdefs.h"
3760
3761 #include <libutf8.h>
3762 int
3763 main ()
3764 {
3765 putwc(0,0);
3766   ;
3767   return 0;
3768 }
3769 _ACEOF
3770 rm -f conftest.$ac_objext conftest$ac_exeext
3771 if { (eval echo "$as_me:3771: \"$ac_link\"") >&5
3772   (eval $ac_link) 2>&5
3773   ac_status=$?
3774   echo "$as_me:3774: \$? = $ac_status" >&5
3775   (exit $ac_status); } &&
3776          { ac_try='test -s conftest$ac_exeext'
3777   { (eval echo "$as_me:3777: \"$ac_try\"") >&5
3778   (eval $ac_try) 2>&5
3779   ac_status=$?
3780   echo "$as_me:3780: \$? = $ac_status" >&5
3781   (exit $ac_status); }; }; then
3782
3783         cf_cv_find_linkage_utf8=yes
3784         cf_cv_header_path_utf8=/usr/include
3785         cf_cv_library_path_utf8=/usr/lib
3786         cf_cv_library_file_utf8="-lutf8"
3787
3788 else
3789   echo "$as_me: failed program was:" >&5
3790 cat conftest.$ac_ext >&5
3791
3792         cf_cv_find_linkage_utf8=no
3793         LIBS="$cf_save_LIBS"
3794
3795     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
3796
3797 echo "${as_me-configure}:3797: testing find linkage for utf8 library ..." 1>&5
3798
3799 echo "${as_me-configure}:3799: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
3800
3801     cf_save_CPPFLAGS="$CPPFLAGS"
3802     cf_test_CPPFLAGS="$CPPFLAGS"
3803
3804 cf_search=
3805
3806 # collect the current set of include-directories from compiler flags
3807 cf_header_path_list=""
3808 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3809         for cf_header_path in $CPPFLAGS $CFLAGS
3810         do
3811                 case $cf_header_path in #(vi
3812                 -I*)
3813                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3814
3815 test "$cf_header_path" != "NONE" && \
3816 test -d "$cf_header_path" && \
3817  {
3818         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3819         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3820         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
3821         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
3822         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
3823         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
3824 }
3825
3826                         cf_header_path_list="$cf_header_path_list $cf_search"
3827                         ;;
3828                 esac
3829         done
3830 fi
3831
3832 # add the variations for the package we are looking for
3833
3834 cf_search=
3835
3836 test "/usr" != "$prefix" && \
3837 test -d "/usr" && \
3838 (test $prefix = NONE || test -d $prefix) && {
3839         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
3840         test -d /usr/include &&          cf_search="$cf_search /usr/include"
3841         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
3842         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
3843         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
3844         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
3845 }
3846
3847 test "$prefix" != "NONE" && \
3848 test -d "$prefix" && \
3849  {
3850         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3851         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3852         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
3853         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
3854         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
3855         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
3856 }
3857
3858 test "/usr/local" != "$prefix" && \
3859 test -d "/usr/local" && \
3860 (test $prefix = NONE || test -d $prefix) && {
3861         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
3862         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
3863         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
3864         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
3865         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
3866         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
3867 }
3868
3869 test "/opt" != "$prefix" && \
3870 test -d "/opt" && \
3871 (test $prefix = NONE || test -d $prefix) && {
3872         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
3873         test -d /opt/include &&          cf_search="$cf_search /opt/include"
3874         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
3875         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
3876         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
3877         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
3878 }
3879
3880 test "$HOME" != "$prefix" && \
3881 test -d "$HOME" && \
3882 (test $prefix = NONE || test -d $prefix) && {
3883         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
3884         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
3885         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
3886         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
3887         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
3888         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
3889 }
3890
3891 test "$includedir" != NONE && \
3892 test "$includedir" != "/usr/include" && \
3893 test -d "$includedir" && {
3894         test -d $includedir &&    cf_search="$cf_search $includedir"
3895         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
3896 }
3897
3898 test "$oldincludedir" != NONE && \
3899 test "$oldincludedir" != "/usr/include" && \
3900 test -d "$oldincludedir" && {
3901         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3902         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
3903 }
3904
3905 cf_search="$cf_search $cf_header_path_list"
3906
3907     for cf_cv_header_path_utf8 in $cf_search
3908     do
3909       if test -d $cf_cv_header_path_utf8 ; then
3910         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
3911
3912 echo "${as_me-configure}:3912: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
3913
3914         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
3915         cat >conftest.$ac_ext <<_ACEOF
3916 #line 3916 "configure"
3917 #include "confdefs.h"
3918
3919 #include <libutf8.h>
3920 int
3921 main ()
3922 {
3923 putwc(0,0);
3924   ;
3925   return 0;
3926 }
3927 _ACEOF
3928 rm -f conftest.$ac_objext
3929 if { (eval echo "$as_me:3929: \"$ac_compile\"") >&5
3930   (eval $ac_compile) 2>&5
3931   ac_status=$?
3932   echo "$as_me:3932: \$? = $ac_status" >&5
3933   (exit $ac_status); } &&
3934          { ac_try='test -s conftest.$ac_objext'
3935   { (eval echo "$as_me:3935: \"$ac_try\"") >&5
3936   (eval $ac_try) 2>&5
3937   ac_status=$?
3938   echo "$as_me:3938: \$? = $ac_status" >&5
3939   (exit $ac_status); }; }; then
3940
3941             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
3942
3943 echo "${as_me-configure}:3943: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
3944
3945             cf_cv_find_linkage_utf8=maybe
3946             cf_test_CPPFLAGS="$CPPFLAGS"
3947             break
3948 else
3949   echo "$as_me: failed program was:" >&5
3950 cat conftest.$ac_ext >&5
3951
3952             CPPFLAGS="$cf_save_CPPFLAGS"
3953
3954 fi
3955 rm -f conftest.$ac_objext conftest.$ac_ext
3956       fi
3957     done
3958
3959     if test "$cf_cv_find_linkage_utf8" = maybe ; then
3960
3961 echo "${as_me-configure}:3961: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
3962
3963       cf_save_LIBS="$LIBS"
3964       cf_save_LDFLAGS="$LDFLAGS"
3965
3966       if test "$cf_cv_find_linkage_utf8" != yes ; then
3967
3968 cf_search=
3969 cf_library_path_list=""
3970 if test -n "${LDFLAGS}${LIBS}" ; then
3971         for cf_library_path in $LDFLAGS $LIBS
3972         do
3973                 case $cf_library_path in #(vi
3974                 -L*)
3975                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
3976
3977 test "$cf_library_path" != "NONE" && \
3978 test -d "$cf_library_path" && \
3979  {
3980         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
3981         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
3982         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
3983         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
3984         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
3985         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
3986 }
3987
3988                         cf_library_path_list="$cf_library_path_list $cf_search"
3989                         ;;
3990                 esac
3991         done
3992 fi
3993
3994 cf_search=
3995
3996 test "/usr" != "$prefix" && \
3997 test -d "/usr" && \
3998 (test $prefix = NONE || test -d $prefix) && {
3999         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
4000         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
4001         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
4002         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
4003         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
4004         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
4005 }
4006
4007 test "$prefix" != "NONE" && \
4008 test -d "$prefix" && \
4009  {
4010         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
4011         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4012         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
4013         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
4014         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
4015         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
4016 }
4017
4018 test "/usr/local" != "$prefix" && \
4019 test -d "/usr/local" && \
4020 (test $prefix = NONE || test -d $prefix) && {
4021         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
4022         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
4023         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
4024         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
4025         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
4026         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
4027 }
4028
4029 test "/opt" != "$prefix" && \
4030 test -d "/opt" && \
4031 (test $prefix = NONE || test -d $prefix) && {
4032         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
4033         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
4034         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
4035         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
4036         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
4037         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
4038 }
4039
4040 test "$HOME" != "$prefix" && \
4041 test -d "$HOME" && \
4042 (test $prefix = NONE || test -d $prefix) && {
4043         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
4044         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
4045         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
4046         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
4047         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
4048         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
4049 }
4050
4051 cf_search="$cf_library_path_list $cf_search"
4052
4053         for cf_cv_library_path_utf8 in $cf_search
4054         do
4055           if test -d $cf_cv_library_path_utf8 ; then
4056             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
4057
4058 echo "${as_me-configure}:4058: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
4059
4060             CPPFLAGS="$cf_test_CPPFLAGS"
4061             LIBS="-lutf8  $cf_save_LIBS"
4062             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
4063             cat >conftest.$ac_ext <<_ACEOF
4064 #line 4064 "configure"
4065 #include "confdefs.h"
4066
4067 #include <libutf8.h>
4068 int
4069 main ()
4070 {
4071 putwc(0,0);
4072   ;
4073   return 0;
4074 }
4075 _ACEOF
4076 rm -f conftest.$ac_objext conftest$ac_exeext
4077 if { (eval echo "$as_me:4077: \"$ac_link\"") >&5
4078   (eval $ac_link) 2>&5
4079   ac_status=$?
4080   echo "$as_me:4080: \$? = $ac_status" >&5
4081   (exit $ac_status); } &&
4082          { ac_try='test -s conftest$ac_exeext'
4083   { (eval echo "$as_me:4083: \"$ac_try\"") >&5
4084   (eval $ac_try) 2>&5
4085   ac_status=$?
4086   echo "$as_me:4086: \$? = $ac_status" >&5
4087   (exit $ac_status); }; }; then
4088
4089                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
4090
4091 echo "${as_me-configure}:4091: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
4092
4093                 cf_cv_find_linkage_utf8=yes
4094                 cf_cv_library_file_utf8="-lutf8"
4095                 break
4096 else
4097   echo "$as_me: failed program was:" >&5
4098 cat conftest.$ac_ext >&5
4099
4100                 CPPFLAGS="$cf_save_CPPFLAGS"
4101                 LIBS="$cf_save_LIBS"
4102                 LDFLAGS="$cf_save_LDFLAGS"
4103
4104 fi
4105 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4106           fi
4107         done
4108         CPPFLAGS="$cf_save_CPPFLAGS"
4109         LDFLAGS="$cf_save_LDFLAGS"
4110       fi
4111
4112     else
4113       cf_cv_find_linkage_utf8=no
4114     fi
4115
4116 fi
4117 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4118
4119 fi
4120 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4121
4122 LIBS="$cf_save_LIBS"
4123
4124 if test "$cf_cv_find_linkage_utf8" = yes ; then
4125 cf_cv_utf8_lib=add-on
4126 else
4127 cf_cv_utf8_lib=no
4128 fi
4129
4130 fi
4131 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4132 fi
4133 echo "$as_me:4133: result: $cf_cv_utf8_lib" >&5
4134 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
4135
4136 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4137 # ncurses/ncursesw:
4138 if test "$cf_cv_utf8_lib" = "add-on" ; then
4139         cat >>confdefs.h <<\EOF
4140 #define HAVE_LIBUTF8_H 1
4141 EOF
4142
4143 if test -n "$cf_cv_header_path_utf8" ; then
4144   for cf_add_incdir in $cf_cv_header_path_utf8
4145   do
4146         while test $cf_add_incdir != /usr/include
4147         do
4148           if test -d $cf_add_incdir
4149           then
4150                 cf_have_incdir=no
4151                 if test -n "$CFLAGS$CPPFLAGS" ; then
4152                   # a loop is needed to ensure we can add subdirs of existing dirs
4153                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4154                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4155                           cf_have_incdir=yes; break
4156                         fi
4157                   done
4158                 fi
4159
4160                 if test "$cf_have_incdir" = no ; then
4161                   if test "$cf_add_incdir" = /usr/local/include ; then
4162                         if test "$GCC" = yes
4163                         then
4164                           cf_save_CPPFLAGS=$CPPFLAGS
4165                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4166                           cat >conftest.$ac_ext <<_ACEOF
4167 #line 4167 "configure"
4168 #include "confdefs.h"
4169 #include <stdio.h>
4170 int
4171 main ()
4172 {
4173 printf("Hello")
4174   ;
4175   return 0;
4176 }
4177 _ACEOF
4178 rm -f conftest.$ac_objext
4179 if { (eval echo "$as_me:4179: \"$ac_compile\"") >&5
4180   (eval $ac_compile) 2>&5
4181   ac_status=$?
4182   echo "$as_me:4182: \$? = $ac_status" >&5
4183   (exit $ac_status); } &&
4184          { ac_try='test -s conftest.$ac_objext'
4185   { (eval echo "$as_me:4185: \"$ac_try\"") >&5
4186   (eval $ac_try) 2>&5
4187   ac_status=$?
4188   echo "$as_me:4188: \$? = $ac_status" >&5
4189   (exit $ac_status); }; }; then
4190   :
4191 else
4192   echo "$as_me: failed program was:" >&5
4193 cat conftest.$ac_ext >&5
4194 cf_have_incdir=yes
4195 fi
4196 rm -f conftest.$ac_objext conftest.$ac_ext
4197                           CPPFLAGS=$cf_save_CPPFLAGS
4198                         fi
4199                   fi
4200                 fi
4201
4202                 if test "$cf_have_incdir" = no ; then
4203                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4204
4205 echo "${as_me-configure}:4205: testing adding $cf_add_incdir to include-path ..." 1>&5
4206
4207                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4208
4209                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4210                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4211                   cf_add_incdir="$cf_top_incdir"
4212                 else
4213                   break
4214                 fi
4215           fi
4216         done
4217   done
4218 fi
4219
4220 if test -n "$cf_cv_library_path_utf8" ; then
4221   for cf_add_libdir in $cf_cv_library_path_utf8
4222   do
4223     if test $cf_add_libdir = /usr/lib ; then
4224       :
4225     elif test -d $cf_add_libdir
4226     then
4227       cf_have_libdir=no
4228       if test -n "$LDFLAGS$LIBS" ; then
4229         # a loop is needed to ensure we can add subdirs of existing dirs
4230         for cf_test_libdir in $LDFLAGS $LIBS ; do
4231           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4232             cf_have_libdir=yes; break
4233           fi
4234         done
4235       fi
4236       if test "$cf_have_libdir" = no ; then
4237         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4238
4239 echo "${as_me-configure}:4239: testing adding $cf_add_libdir to library-path ..." 1>&5
4240
4241         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4242       fi
4243     fi
4244   done
4245 fi
4246
4247         LIBS="$cf_cv_library_file_utf8 $LIBS"
4248 fi
4249
4250 cf_ncuconfig_root=ncursesw
4251
4252 echo "Looking for ${cf_ncuconfig_root}-config"
4253 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4254 do
4255   # Extract the first word of "$ac_prog", so it can be a program name with args.
4256 set dummy $ac_prog; ac_word=$2
4257 echo "$as_me:4257: checking for $ac_word" >&5
4258 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4259 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
4260   echo $ECHO_N "(cached) $ECHO_C" >&6
4261 else
4262   case $NCURSES_CONFIG in
4263   [\\/]* | ?:[\\/]*)
4264   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
4265   ;;
4266   *)
4267   ac_save_IFS=$IFS; IFS=$ac_path_separator
4268 ac_dummy="$PATH"
4269 for ac_dir in $ac_dummy; do
4270   IFS=$ac_save_IFS
4271   test -z "$ac_dir" && ac_dir=.
4272   if $as_executable_p "$ac_dir/$ac_word"; then
4273    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
4274    echo "$as_me:4274: found $ac_dir/$ac_word" >&5
4275    break
4276 fi
4277 done
4278
4279   ;;
4280 esac
4281 fi
4282 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
4283
4284 if test -n "$NCURSES_CONFIG"; then
4285   echo "$as_me:4285: result: $NCURSES_CONFIG" >&5
4286 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4287 else
4288   echo "$as_me:4288: result: no" >&5
4289 echo "${ECHO_T}no" >&6
4290 fi
4291
4292   test -n "$NCURSES_CONFIG" && break
4293 done
4294 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
4295
4296 if test "$NCURSES_CONFIG" != none ; then
4297
4298 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4299 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
4300
4301 # even with config script, some packages use no-override for curses.h
4302
4303 echo "$as_me:4303: checking if we have identified curses headers" >&5
4304 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4305 if test "${cf_cv_ncurses_header+set}" = set; then
4306   echo $ECHO_N "(cached) $ECHO_C" >&6
4307 else
4308
4309 cf_cv_ncurses_header=none
4310 for cf_header in  \
4311     ncursesw/curses.h \
4312         ncursesw/ncurses.h \
4313         curses.h \
4314         ncurses.h
4315 do
4316 cat >conftest.$ac_ext <<_ACEOF
4317 #line 4317 "configure"
4318 #include "confdefs.h"
4319 #include <${cf_header}>
4320 int
4321 main ()
4322 {
4323 initscr(); tgoto("?", 0,0)
4324   ;
4325   return 0;
4326 }
4327 _ACEOF
4328 rm -f conftest.$ac_objext
4329 if { (eval echo "$as_me:4329: \"$ac_compile\"") >&5
4330   (eval $ac_compile) 2>&5
4331   ac_status=$?
4332   echo "$as_me:4332: \$? = $ac_status" >&5
4333   (exit $ac_status); } &&
4334          { ac_try='test -s conftest.$ac_objext'
4335   { (eval echo "$as_me:4335: \"$ac_try\"") >&5
4336   (eval $ac_try) 2>&5
4337   ac_status=$?
4338   echo "$as_me:4338: \$? = $ac_status" >&5
4339   (exit $ac_status); }; }; then
4340   cf_cv_ncurses_header=$cf_header; break
4341 else
4342   echo "$as_me: failed program was:" >&5
4343 cat conftest.$ac_ext >&5
4344 fi
4345 rm -f conftest.$ac_objext conftest.$ac_ext
4346 done
4347
4348 fi
4349 echo "$as_me:4349: result: $cf_cv_ncurses_header" >&5
4350 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4351
4352 if test "$cf_cv_ncurses_header" = none ; then
4353         { { echo "$as_me:4353: error: No curses header-files found" >&5
4354 echo "$as_me: error: No curses header-files found" >&2;}
4355    { (exit 1); exit 1; }; }
4356 fi
4357
4358 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4359
4360 for ac_header in $cf_cv_ncurses_header
4361 do
4362 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4363 echo "$as_me:4363: checking for $ac_header" >&5
4364 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4365 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4366   echo $ECHO_N "(cached) $ECHO_C" >&6
4367 else
4368   cat >conftest.$ac_ext <<_ACEOF
4369 #line 4369 "configure"
4370 #include "confdefs.h"
4371 #include <$ac_header>
4372 _ACEOF
4373 if { (eval echo "$as_me:4373: \"$ac_cpp conftest.$ac_ext\"") >&5
4374   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4375   ac_status=$?
4376   egrep -v '^ *\+' conftest.er1 >conftest.err
4377   rm -f conftest.er1
4378   cat conftest.err >&5
4379   echo "$as_me:4379: \$? = $ac_status" >&5
4380   (exit $ac_status); } >/dev/null; then
4381   if test -s conftest.err; then
4382     ac_cpp_err=$ac_c_preproc_warn_flag
4383   else
4384     ac_cpp_err=
4385   fi
4386 else
4387   ac_cpp_err=yes
4388 fi
4389 if test -z "$ac_cpp_err"; then
4390   eval "$as_ac_Header=yes"
4391 else
4392   echo "$as_me: failed program was:" >&5
4393   cat conftest.$ac_ext >&5
4394   eval "$as_ac_Header=no"
4395 fi
4396 rm -f conftest.err conftest.$ac_ext
4397 fi
4398 echo "$as_me:4398: result: `eval echo '${'$as_ac_Header'}'`" >&5
4399 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4400 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4401   cat >>confdefs.h <<EOF
4402 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4403 EOF
4404
4405 fi
4406 done
4407
4408 cat >>confdefs.h <<\EOF
4409 #define NCURSES 1
4410 EOF
4411
4412 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4413
4414 cat >>confdefs.h <<EOF
4415 #define $cf_nculib_ROOT 1
4416 EOF
4417
4418 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4419
4420 else
4421
4422 cf_ncuhdr_root=ncursesw
4423
4424 test -n "$cf_cv_curses_dir" && \
4425 test "$cf_cv_curses_dir" != "no" && { \
4426
4427 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4428   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
4429   do
4430         while test $cf_add_incdir != /usr/include
4431         do
4432           if test -d $cf_add_incdir
4433           then
4434                 cf_have_incdir=no
4435                 if test -n "$CFLAGS$CPPFLAGS" ; then
4436                   # a loop is needed to ensure we can add subdirs of existing dirs
4437                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4438                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4439                           cf_have_incdir=yes; break
4440                         fi
4441                   done
4442                 fi
4443
4444                 if test "$cf_have_incdir" = no ; then
4445                   if test "$cf_add_incdir" = /usr/local/include ; then
4446                         if test "$GCC" = yes
4447                         then
4448                           cf_save_CPPFLAGS=$CPPFLAGS
4449                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4450                           cat >conftest.$ac_ext <<_ACEOF
4451 #line 4451 "configure"
4452 #include "confdefs.h"
4453 #include <stdio.h>
4454 int
4455 main ()
4456 {
4457 printf("Hello")
4458   ;
4459   return 0;
4460 }
4461 _ACEOF
4462 rm -f conftest.$ac_objext
4463 if { (eval echo "$as_me:4463: \"$ac_compile\"") >&5
4464   (eval $ac_compile) 2>&5
4465   ac_status=$?
4466   echo "$as_me:4466: \$? = $ac_status" >&5
4467   (exit $ac_status); } &&
4468          { ac_try='test -s conftest.$ac_objext'
4469   { (eval echo "$as_me:4469: \"$ac_try\"") >&5
4470   (eval $ac_try) 2>&5
4471   ac_status=$?
4472   echo "$as_me:4472: \$? = $ac_status" >&5
4473   (exit $ac_status); }; }; then
4474   :
4475 else
4476   echo "$as_me: failed program was:" >&5
4477 cat conftest.$ac_ext >&5
4478 cf_have_incdir=yes
4479 fi
4480 rm -f conftest.$ac_objext conftest.$ac_ext
4481                           CPPFLAGS=$cf_save_CPPFLAGS
4482                         fi
4483                   fi
4484                 fi
4485
4486                 if test "$cf_have_incdir" = no ; then
4487                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4488
4489 echo "${as_me-configure}:4489: testing adding $cf_add_incdir to include-path ..." 1>&5
4490
4491                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4492
4493                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4494                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4495                   cf_add_incdir="$cf_top_incdir"
4496                 else
4497                   break
4498                 fi
4499           fi
4500         done
4501   done
4502 fi
4503
4504 }
4505
4506 echo "$as_me:4506: checking for $cf_ncuhdr_root header in include-path" >&5
4507 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4508 if test "${cf_cv_ncurses_h+set}" = set; then
4509   echo $ECHO_N "(cached) $ECHO_C" >&6
4510 else
4511
4512         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4513         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4514         for cf_header in $cf_header_list
4515         do
4516
4517         cat >conftest.$ac_ext <<_ACEOF
4518 #line 4518 "configure"
4519 #include "confdefs.h"
4520
4521 #define _XOPEN_SOURCE_EXTENDED
4522 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
4523 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
4524
4525 #include <$cf_header>
4526 int
4527 main ()
4528 {
4529
4530 #ifdef NCURSES_VERSION
4531
4532 #ifndef WACS_BSSB
4533         make an error
4534 #endif
4535
4536 printf("%s\n", NCURSES_VERSION);
4537 #else
4538 #ifdef __NCURSES_H
4539 printf("old\n");
4540 #else
4541         make an error
4542 #endif
4543 #endif
4544
4545   ;
4546   return 0;
4547 }
4548 _ACEOF
4549 rm -f conftest.$ac_objext
4550 if { (eval echo "$as_me:4550: \"$ac_compile\"") >&5
4551   (eval $ac_compile) 2>&5
4552   ac_status=$?
4553   echo "$as_me:4553: \$? = $ac_status" >&5
4554   (exit $ac_status); } &&
4555          { ac_try='test -s conftest.$ac_objext'
4556   { (eval echo "$as_me:4556: \"$ac_try\"") >&5
4557   (eval $ac_try) 2>&5
4558   ac_status=$?
4559   echo "$as_me:4559: \$? = $ac_status" >&5
4560   (exit $ac_status); }; }; then
4561   cf_cv_ncurses_h=$cf_header
4562
4563 else
4564   echo "$as_me: failed program was:" >&5
4565 cat conftest.$ac_ext >&5
4566 cf_cv_ncurses_h=no
4567 fi
4568 rm -f conftest.$ac_objext conftest.$ac_ext
4569
4570                 test "$cf_cv_ncurses_h" != no && break
4571         done
4572
4573 fi
4574 echo "$as_me:4574: result: $cf_cv_ncurses_h" >&5
4575 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4576
4577 if test "$cf_cv_ncurses_h" != no ; then
4578         cf_cv_ncurses_header=$cf_cv_ncurses_h
4579 else
4580
4581 echo "$as_me:4581: checking for $cf_ncuhdr_root include-path" >&5
4582 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4583 if test "${cf_cv_ncurses_h2+set}" = set; then
4584   echo $ECHO_N "(cached) $ECHO_C" >&6
4585 else
4586
4587         test -n "$verbose" && echo
4588
4589 cf_search=
4590
4591 # collect the current set of include-directories from compiler flags
4592 cf_header_path_list=""
4593 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4594         for cf_header_path in $CPPFLAGS $CFLAGS
4595         do
4596                 case $cf_header_path in #(vi
4597                 -I*)
4598                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4599
4600 test "$cf_header_path" != "NONE" && \
4601 test -d "$cf_header_path" && \
4602  {
4603         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4604         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4605         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4606         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4607         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4608         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"
4609 }
4610
4611                         cf_header_path_list="$cf_header_path_list $cf_search"
4612                         ;;
4613                 esac
4614         done
4615 fi
4616
4617 # add the variations for the package we are looking for
4618
4619 cf_search=
4620
4621 test "/usr" != "$prefix" && \
4622 test -d "/usr" && \
4623 (test $prefix = NONE || test -d $prefix) && {
4624         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4625         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4626         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
4627         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
4628         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
4629         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4630 }
4631
4632 test "$prefix" != "NONE" && \
4633 test -d "$prefix" && \
4634  {
4635         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4636         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4637         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4638         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4639         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4640         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4641 }
4642
4643 test "/usr/local" != "$prefix" && \
4644 test -d "/usr/local" && \
4645 (test $prefix = NONE || test -d $prefix) && {
4646         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4647         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4648         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
4649         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
4650         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
4651         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4652 }
4653
4654 test "/opt" != "$prefix" && \
4655 test -d "/opt" && \
4656 (test $prefix = NONE || test -d $prefix) && {
4657         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4658         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4659         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
4660         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
4661         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
4662         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4663 }
4664
4665 test "$HOME" != "$prefix" && \
4666 test -d "$HOME" && \
4667 (test $prefix = NONE || test -d $prefix) && {
4668         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4669         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4670         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
4671         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
4672         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
4673         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4674 }
4675
4676 test "$includedir" != NONE && \
4677 test "$includedir" != "/usr/include" && \
4678 test -d "$includedir" && {
4679         test -d $includedir &&    cf_search="$cf_search $includedir"
4680         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4681 }
4682
4683 test "$oldincludedir" != NONE && \
4684 test "$oldincludedir" != "/usr/include" && \
4685 test -d "$oldincludedir" && {
4686         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4687         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4688 }
4689
4690 cf_search="$cf_search $cf_header_path_list"
4691
4692         test -n "$verbose" && echo search path $cf_search
4693         cf_save2_CPPFLAGS="$CPPFLAGS"
4694         for cf_incdir in $cf_search
4695         do
4696
4697 if test -n "$cf_incdir" ; then
4698   for cf_add_incdir in $cf_incdir
4699   do
4700         while test $cf_add_incdir != /usr/include
4701         do
4702           if test -d $cf_add_incdir
4703           then
4704                 cf_have_incdir=no
4705                 if test -n "$CFLAGS$CPPFLAGS" ; then
4706                   # a loop is needed to ensure we can add subdirs of existing dirs
4707                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4708                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4709                           cf_have_incdir=yes; break
4710                         fi
4711                   done
4712                 fi
4713
4714                 if test "$cf_have_incdir" = no ; then
4715                   if test "$cf_add_incdir" = /usr/local/include ; then
4716                         if test "$GCC" = yes
4717                         then
4718                           cf_save_CPPFLAGS=$CPPFLAGS
4719                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4720                           cat >conftest.$ac_ext <<_ACEOF
4721 #line 4721 "configure"
4722 #include "confdefs.h"
4723 #include <stdio.h>
4724 int
4725 main ()
4726 {
4727 printf("Hello")
4728   ;
4729   return 0;
4730 }
4731 _ACEOF
4732 rm -f conftest.$ac_objext
4733 if { (eval echo "$as_me:4733: \"$ac_compile\"") >&5
4734   (eval $ac_compile) 2>&5
4735   ac_status=$?
4736   echo "$as_me:4736: \$? = $ac_status" >&5
4737   (exit $ac_status); } &&
4738          { ac_try='test -s conftest.$ac_objext'
4739   { (eval echo "$as_me:4739: \"$ac_try\"") >&5
4740   (eval $ac_try) 2>&5
4741   ac_status=$?
4742   echo "$as_me:4742: \$? = $ac_status" >&5
4743   (exit $ac_status); }; }; then
4744   :
4745 else
4746   echo "$as_me: failed program was:" >&5
4747 cat conftest.$ac_ext >&5
4748 cf_have_incdir=yes
4749 fi
4750 rm -f conftest.$ac_objext conftest.$ac_ext
4751                           CPPFLAGS=$cf_save_CPPFLAGS
4752                         fi
4753                   fi
4754                 fi
4755
4756                 if test "$cf_have_incdir" = no ; then
4757                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4758
4759 echo "${as_me-configure}:4759: testing adding $cf_add_incdir to include-path ..." 1>&5
4760
4761                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4762
4763                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4764                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4765                   cf_add_incdir="$cf_top_incdir"
4766                 else
4767                   break
4768                 fi
4769           fi
4770         done
4771   done
4772 fi
4773
4774                 for cf_header in \
4775                         ncurses.h \
4776                         curses.h
4777                 do
4778
4779         cat >conftest.$ac_ext <<_ACEOF
4780 #line 4780 "configure"
4781 #include "confdefs.h"
4782
4783 #include <$cf_header>
4784 int
4785 main ()
4786 {
4787
4788 #ifdef NCURSES_VERSION
4789
4790 printf("%s\n", NCURSES_VERSION);
4791 #else
4792 #ifdef __NCURSES_H
4793 printf("old\n");
4794 #else
4795         make an error
4796 #endif
4797 #endif
4798
4799   ;
4800   return 0;
4801 }
4802 _ACEOF
4803 rm -f conftest.$ac_objext
4804 if { (eval echo "$as_me:4804: \"$ac_compile\"") >&5
4805   (eval $ac_compile) 2>&5
4806   ac_status=$?
4807   echo "$as_me:4807: \$? = $ac_status" >&5
4808   (exit $ac_status); } &&
4809          { ac_try='test -s conftest.$ac_objext'
4810   { (eval echo "$as_me:4810: \"$ac_try\"") >&5
4811   (eval $ac_try) 2>&5
4812   ac_status=$?
4813   echo "$as_me:4813: \$? = $ac_status" >&5
4814   (exit $ac_status); }; }; then
4815   cf_cv_ncurses_h2=$cf_header
4816
4817 else
4818   echo "$as_me: failed program was:" >&5
4819 cat conftest.$ac_ext >&5
4820 cf_cv_ncurses_h2=no
4821 fi
4822 rm -f conftest.$ac_objext conftest.$ac_ext
4823
4824                         if test "$cf_cv_ncurses_h2" != no ; then
4825                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4826                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4827                                 break
4828                         fi
4829                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4830                 done
4831                 CPPFLAGS="$cf_save2_CPPFLAGS"
4832                 test "$cf_cv_ncurses_h2" != no && break
4833         done
4834         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4834: error: not found" >&5
4835 echo "$as_me: error: not found" >&2;}
4836    { (exit 1); exit 1; }; }
4837
4838 fi
4839 echo "$as_me:4839: result: $cf_cv_ncurses_h2" >&5
4840 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4841
4842         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4843         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4844         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4845                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4846         fi
4847
4848 if test -n "$cf_1st_incdir" ; then
4849   for cf_add_incdir in $cf_1st_incdir
4850   do
4851         while test $cf_add_incdir != /usr/include
4852         do
4853           if test -d $cf_add_incdir
4854           then
4855                 cf_have_incdir=no
4856                 if test -n "$CFLAGS$CPPFLAGS" ; then
4857                   # a loop is needed to ensure we can add subdirs of existing dirs
4858                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4859                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4860                           cf_have_incdir=yes; break
4861                         fi
4862                   done
4863                 fi
4864
4865                 if test "$cf_have_incdir" = no ; then
4866                   if test "$cf_add_incdir" = /usr/local/include ; then
4867                         if test "$GCC" = yes
4868                         then
4869                           cf_save_CPPFLAGS=$CPPFLAGS
4870                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4871                           cat >conftest.$ac_ext <<_ACEOF
4872 #line 4872 "configure"
4873 #include "confdefs.h"
4874 #include <stdio.h>
4875 int
4876 main ()
4877 {
4878 printf("Hello")
4879   ;
4880   return 0;
4881 }
4882 _ACEOF
4883 rm -f conftest.$ac_objext
4884 if { (eval echo "$as_me:4884: \"$ac_compile\"") >&5
4885   (eval $ac_compile) 2>&5
4886   ac_status=$?
4887   echo "$as_me:4887: \$? = $ac_status" >&5
4888   (exit $ac_status); } &&
4889          { ac_try='test -s conftest.$ac_objext'
4890   { (eval echo "$as_me:4890: \"$ac_try\"") >&5
4891   (eval $ac_try) 2>&5
4892   ac_status=$?
4893   echo "$as_me:4893: \$? = $ac_status" >&5
4894   (exit $ac_status); }; }; then
4895   :
4896 else
4897   echo "$as_me: failed program was:" >&5
4898 cat conftest.$ac_ext >&5
4899 cf_have_incdir=yes
4900 fi
4901 rm -f conftest.$ac_objext conftest.$ac_ext
4902                           CPPFLAGS=$cf_save_CPPFLAGS
4903                         fi
4904                   fi
4905                 fi
4906
4907                 if test "$cf_have_incdir" = no ; then
4908                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4909
4910 echo "${as_me-configure}:4910: testing adding $cf_add_incdir to include-path ..." 1>&5
4911
4912                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4913
4914                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4915                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4916                   cf_add_incdir="$cf_top_incdir"
4917                 else
4918                   break
4919                 fi
4920           fi
4921         done
4922   done
4923 fi
4924
4925 fi
4926
4927 # Set definitions to allow ifdef'ing for ncurses.h
4928
4929 case $cf_cv_ncurses_header in # (vi
4930 *ncurses.h)
4931         cat >>confdefs.h <<\EOF
4932 #define HAVE_NCURSES_H 1
4933 EOF
4934
4935         ;;
4936 esac
4937
4938 case $cf_cv_ncurses_header in # (vi
4939 ncurses/curses.h|ncurses/ncurses.h)
4940         cat >>confdefs.h <<\EOF
4941 #define HAVE_NCURSES_NCURSES_H 1
4942 EOF
4943
4944         ;;
4945 ncursesw/curses.h|ncursesw/ncurses.h)
4946         cat >>confdefs.h <<\EOF
4947 #define HAVE_NCURSESW_NCURSES_H 1
4948 EOF
4949
4950         ;;
4951 esac
4952
4953 echo "$as_me:4953: checking for terminfo header" >&5
4954 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4955 if test "${cf_cv_term_header+set}" = set; then
4956   echo $ECHO_N "(cached) $ECHO_C" >&6
4957 else
4958
4959 case ${cf_cv_ncurses_header} in #(vi
4960 */ncurses.h|*/ncursesw.h) #(vi
4961         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4962         ;;
4963 *)
4964         cf_term_header=term.h
4965         ;;
4966 esac
4967
4968 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4969 do
4970 cat >conftest.$ac_ext <<_ACEOF
4971 #line 4971 "configure"
4972 #include "confdefs.h"
4973 #include <stdio.h>
4974 #include <${cf_cv_ncurses_header-curses.h}>
4975 #include <$cf_test>
4976
4977 int
4978 main ()
4979 {
4980 int x = auto_left_margin
4981   ;
4982   return 0;
4983 }
4984 _ACEOF
4985 rm -f conftest.$ac_objext
4986 if { (eval echo "$as_me:4986: \"$ac_compile\"") >&5
4987   (eval $ac_compile) 2>&5
4988   ac_status=$?
4989   echo "$as_me:4989: \$? = $ac_status" >&5
4990   (exit $ac_status); } &&
4991          { ac_try='test -s conftest.$ac_objext'
4992   { (eval echo "$as_me:4992: \"$ac_try\"") >&5
4993   (eval $ac_try) 2>&5
4994   ac_status=$?
4995   echo "$as_me:4995: \$? = $ac_status" >&5
4996   (exit $ac_status); }; }; then
4997
4998         cf_cv_term_header="$cf_test"
4999 else
5000   echo "$as_me: failed program was:" >&5
5001 cat conftest.$ac_ext >&5
5002
5003         cf_cv_term_header=unknown
5004
5005 fi
5006 rm -f conftest.$ac_objext conftest.$ac_ext
5007         test "$cf_cv_term_header" != unknown && break
5008 done
5009
5010 fi
5011 echo "$as_me:5011: result: $cf_cv_term_header" >&5
5012 echo "${ECHO_T}$cf_cv_term_header" >&6
5013
5014 # Set definitions to allow ifdef'ing to accommodate subdirectories
5015
5016 case $cf_cv_term_header in # (vi
5017 *term.h)
5018         cat >>confdefs.h <<\EOF
5019 #define HAVE_TERM_H 1
5020 EOF
5021
5022         ;;
5023 esac
5024
5025 case $cf_cv_term_header in # (vi
5026 ncurses/term.h) #(vi
5027         cat >>confdefs.h <<\EOF
5028 #define HAVE_NCURSES_TERM_H 1
5029 EOF
5030
5031         ;;
5032 ncursesw/term.h)
5033         cat >>confdefs.h <<\EOF
5034 #define HAVE_NCURSESW_TERM_H 1
5035 EOF
5036
5037         ;;
5038 esac
5039
5040 # some applications need this, but should check for NCURSES_VERSION
5041 cat >>confdefs.h <<\EOF
5042 #define NCURSES 1
5043 EOF
5044
5045 echo "$as_me:5045: checking for ncurses version" >&5
5046 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5047 if test "${cf_cv_ncurses_version+set}" = set; then
5048   echo $ECHO_N "(cached) $ECHO_C" >&6
5049 else
5050
5051         cf_cv_ncurses_version=no
5052         cf_tempfile=out$$
5053         rm -f $cf_tempfile
5054         if test "$cross_compiling" = yes; then
5055
5056         # This will not work if the preprocessor splits the line after the
5057         # Autoconf token.  The 'unproto' program does that.
5058         cat > conftest.$ac_ext <<EOF
5059 #include <${cf_cv_ncurses_header-curses.h}>
5060 #undef Autoconf
5061 #ifdef NCURSES_VERSION
5062 Autoconf NCURSES_VERSION
5063 #else
5064 #ifdef __NCURSES_H
5065 Autoconf "old"
5066 #endif
5067 ;
5068 #endif
5069 EOF
5070         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5071         { (eval echo "$as_me:5071: \"$cf_try\"") >&5
5072   (eval $cf_try) 2>&5
5073   ac_status=$?
5074   echo "$as_me:5074: \$? = $ac_status" >&5
5075   (exit $ac_status); }
5076         if test -f conftest.out ; then
5077                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5078                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5079                 rm -f conftest.out
5080         fi
5081
5082 else
5083   cat >conftest.$ac_ext <<_ACEOF
5084 #line 5084 "configure"
5085 #include "confdefs.h"
5086
5087 #include <${cf_cv_ncurses_header-curses.h}>
5088 #include <stdio.h>
5089 int main()
5090 {
5091         FILE *fp = fopen("$cf_tempfile", "w");
5092 #ifdef NCURSES_VERSION
5093 # ifdef NCURSES_VERSION_PATCH
5094         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5095 # else
5096         fprintf(fp, "%s\n", NCURSES_VERSION);
5097 # endif
5098 #else
5099 # ifdef __NCURSES_H
5100         fprintf(fp, "old\n");
5101 # else
5102         make an error
5103 # endif
5104 #endif
5105         ${cf_cv_main_return-return}(0);
5106 }
5107 _ACEOF
5108 rm -f conftest$ac_exeext
5109 if { (eval echo "$as_me:5109: \"$ac_link\"") >&5
5110   (eval $ac_link) 2>&5
5111   ac_status=$?
5112   echo "$as_me:5112: \$? = $ac_status" >&5
5113   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5114   { (eval echo "$as_me:5114: \"$ac_try\"") >&5
5115   (eval $ac_try) 2>&5
5116   ac_status=$?
5117   echo "$as_me:5117: \$? = $ac_status" >&5
5118   (exit $ac_status); }; }; then
5119
5120         cf_cv_ncurses_version=`cat $cf_tempfile`
5121 else
5122   echo "$as_me: program exited with status $ac_status" >&5
5123 echo "$as_me: failed program was:" >&5
5124 cat conftest.$ac_ext >&5
5125 fi
5126 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5127 fi
5128         rm -f $cf_tempfile
5129
5130 fi
5131 echo "$as_me:5131: result: $cf_cv_ncurses_version" >&5
5132 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5133 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5134 #define NCURSES 1
5135 EOF
5136
5137 cf_nculib_root=ncursesw
5138         # This works, except for the special case where we find gpm, but
5139         # ncurses is in a nonstandard location via $LIBS, and we really want
5140         # to link gpm.
5141 cf_ncurses_LIBS=""
5142 cf_ncurses_SAVE="$LIBS"
5143 echo "$as_me:5143: checking for Gpm_Open in -lgpm" >&5
5144 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5145 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5146   echo $ECHO_N "(cached) $ECHO_C" >&6
5147 else
5148   ac_check_lib_save_LIBS=$LIBS
5149 LIBS="-lgpm  $LIBS"
5150 cat >conftest.$ac_ext <<_ACEOF
5151 #line 5151 "configure"
5152 #include "confdefs.h"
5153
5154 /* Override any gcc2 internal prototype to avoid an error.  */
5155 #ifdef __cplusplus
5156 extern "C"
5157 #endif
5158 /* We use char because int might match the return type of a gcc2
5159    builtin and then its argument prototype would still apply.  */
5160 char Gpm_Open ();
5161 int
5162 main ()
5163 {
5164 Gpm_Open ();
5165   ;
5166   return 0;
5167 }
5168 _ACEOF
5169 rm -f conftest.$ac_objext conftest$ac_exeext
5170 if { (eval echo "$as_me:5170: \"$ac_link\"") >&5
5171   (eval $ac_link) 2>&5
5172   ac_status=$?
5173   echo "$as_me:5173: \$? = $ac_status" >&5
5174   (exit $ac_status); } &&
5175          { ac_try='test -s conftest$ac_exeext'
5176   { (eval echo "$as_me:5176: \"$ac_try\"") >&5
5177   (eval $ac_try) 2>&5
5178   ac_status=$?
5179   echo "$as_me:5179: \$? = $ac_status" >&5
5180   (exit $ac_status); }; }; then
5181   ac_cv_lib_gpm_Gpm_Open=yes
5182 else
5183   echo "$as_me: failed program was:" >&5
5184 cat conftest.$ac_ext >&5
5185 ac_cv_lib_gpm_Gpm_Open=no
5186 fi
5187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5188 LIBS=$ac_check_lib_save_LIBS
5189 fi
5190 echo "$as_me:5190: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5191 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5192 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5193   echo "$as_me:5193: checking for initscr in -lgpm" >&5
5194 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5195 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5196   echo $ECHO_N "(cached) $ECHO_C" >&6
5197 else
5198   ac_check_lib_save_LIBS=$LIBS
5199 LIBS="-lgpm  $LIBS"
5200 cat >conftest.$ac_ext <<_ACEOF
5201 #line 5201 "configure"
5202 #include "confdefs.h"
5203
5204 /* Override any gcc2 internal prototype to avoid an error.  */
5205 #ifdef __cplusplus
5206 extern "C"
5207 #endif
5208 /* We use char because int might match the return type of a gcc2
5209    builtin and then its argument prototype would still apply.  */
5210 char initscr ();
5211 int
5212 main ()
5213 {
5214 initscr ();
5215   ;
5216   return 0;
5217 }
5218 _ACEOF
5219 rm -f conftest.$ac_objext conftest$ac_exeext
5220 if { (eval echo "$as_me:5220: \"$ac_link\"") >&5
5221   (eval $ac_link) 2>&5
5222   ac_status=$?
5223   echo "$as_me:5223: \$? = $ac_status" >&5
5224   (exit $ac_status); } &&
5225          { ac_try='test -s conftest$ac_exeext'
5226   { (eval echo "$as_me:5226: \"$ac_try\"") >&5
5227   (eval $ac_try) 2>&5
5228   ac_status=$?
5229   echo "$as_me:5229: \$? = $ac_status" >&5
5230   (exit $ac_status); }; }; then
5231   ac_cv_lib_gpm_initscr=yes
5232 else
5233   echo "$as_me: failed program was:" >&5
5234 cat conftest.$ac_ext >&5
5235 ac_cv_lib_gpm_initscr=no
5236 fi
5237 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5238 LIBS=$ac_check_lib_save_LIBS
5239 fi
5240 echo "$as_me:5240: result: $ac_cv_lib_gpm_initscr" >&5
5241 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5242 if test $ac_cv_lib_gpm_initscr = yes; then
5243   LIBS="$cf_ncurses_SAVE"
5244 else
5245   cf_ncurses_LIBS="-lgpm"
5246 fi
5247
5248 fi
5249
5250 case $host_os in #(vi
5251 freebsd*)
5252         # This is only necessary if you are linking against an obsolete
5253         # version of ncurses (but it should do no harm, since it's static).
5254         if test "$cf_nculib_root" = ncurses ; then
5255                 echo "$as_me:5255: checking for tgoto in -lmytinfo" >&5
5256 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5257 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5258   echo $ECHO_N "(cached) $ECHO_C" >&6
5259 else
5260   ac_check_lib_save_LIBS=$LIBS
5261 LIBS="-lmytinfo  $LIBS"
5262 cat >conftest.$ac_ext <<_ACEOF
5263 #line 5263 "configure"
5264 #include "confdefs.h"
5265
5266 /* Override any gcc2 internal prototype to avoid an error.  */
5267 #ifdef __cplusplus
5268 extern "C"
5269 #endif
5270 /* We use char because int might match the return type of a gcc2
5271    builtin and then its argument prototype would still apply.  */
5272 char tgoto ();
5273 int
5274 main ()
5275 {
5276 tgoto ();
5277   ;
5278   return 0;
5279 }
5280 _ACEOF
5281 rm -f conftest.$ac_objext conftest$ac_exeext
5282 if { (eval echo "$as_me:5282: \"$ac_link\"") >&5
5283   (eval $ac_link) 2>&5
5284   ac_status=$?
5285   echo "$as_me:5285: \$? = $ac_status" >&5
5286   (exit $ac_status); } &&
5287          { ac_try='test -s conftest$ac_exeext'
5288   { (eval echo "$as_me:5288: \"$ac_try\"") >&5
5289   (eval $ac_try) 2>&5
5290   ac_status=$?
5291   echo "$as_me:5291: \$? = $ac_status" >&5
5292   (exit $ac_status); }; }; then
5293   ac_cv_lib_mytinfo_tgoto=yes
5294 else
5295   echo "$as_me: failed program was:" >&5
5296 cat conftest.$ac_ext >&5
5297 ac_cv_lib_mytinfo_tgoto=no
5298 fi
5299 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5300 LIBS=$ac_check_lib_save_LIBS
5301 fi
5302 echo "$as_me:5302: result: $ac_cv_lib_mytinfo_tgoto" >&5
5303 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5304 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5305   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5306 fi
5307
5308         fi
5309         ;;
5310 esac
5311
5312 LIBS="$cf_ncurses_LIBS $LIBS"
5313
5314 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5315 then
5316
5317 if test -n "$cf_cv_curses_dir/lib" ; then
5318   for cf_add_libdir in $cf_cv_curses_dir/lib
5319   do
5320     if test $cf_add_libdir = /usr/lib ; then
5321       :
5322     elif test -d $cf_add_libdir
5323     then
5324       cf_have_libdir=no
5325       if test -n "$LDFLAGS$LIBS" ; then
5326         # a loop is needed to ensure we can add subdirs of existing dirs
5327         for cf_test_libdir in $LDFLAGS $LIBS ; do
5328           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5329             cf_have_libdir=yes; break
5330           fi
5331         done
5332       fi
5333       if test "$cf_have_libdir" = no ; then
5334         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5335
5336 echo "${as_me-configure}:5336: testing adding $cf_add_libdir to library-path ..." 1>&5
5337
5338         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5339       fi
5340     fi
5341   done
5342 fi
5343
5344         LIBS="-l$cf_nculib_root $LIBS"
5345 else
5346
5347         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5348         cf_libdir=""
5349         echo "$as_me:5349: checking for initscr" >&5
5350 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5351 if test "${ac_cv_func_initscr+set}" = set; then
5352   echo $ECHO_N "(cached) $ECHO_C" >&6
5353 else
5354   cat >conftest.$ac_ext <<_ACEOF
5355 #line 5355 "configure"
5356 #include "confdefs.h"
5357 /* System header to define __stub macros and hopefully few prototypes,
5358     which can conflict with char initscr (); below.  */
5359 #include <assert.h>
5360 /* Override any gcc2 internal prototype to avoid an error.  */
5361 #ifdef __cplusplus
5362 extern "C"
5363 #endif
5364 /* We use char because int might match the return type of a gcc2
5365    builtin and then its argument prototype would still apply.  */
5366 char initscr ();
5367 char (*f) ();
5368
5369 int
5370 main ()
5371 {
5372 /* The GNU C library defines this for functions which it implements
5373     to always fail with ENOSYS.  Some functions are actually named
5374     something starting with __ and the normal name is an alias.  */
5375 #if defined (__stub_initscr) || defined (__stub___initscr)
5376 choke me
5377 #else
5378 f = initscr;
5379 #endif
5380
5381   ;
5382   return 0;
5383 }
5384 _ACEOF
5385 rm -f conftest.$ac_objext conftest$ac_exeext
5386 if { (eval echo "$as_me:5386: \"$ac_link\"") >&5
5387   (eval $ac_link) 2>&5
5388   ac_status=$?
5389   echo "$as_me:5389: \$? = $ac_status" >&5
5390   (exit $ac_status); } &&
5391          { ac_try='test -s conftest$ac_exeext'
5392   { (eval echo "$as_me:5392: \"$ac_try\"") >&5
5393   (eval $ac_try) 2>&5
5394   ac_status=$?
5395   echo "$as_me:5395: \$? = $ac_status" >&5
5396   (exit $ac_status); }; }; then
5397   ac_cv_func_initscr=yes
5398 else
5399   echo "$as_me: failed program was:" >&5
5400 cat conftest.$ac_ext >&5
5401 ac_cv_func_initscr=no
5402 fi
5403 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5404 fi
5405 echo "$as_me:5405: result: $ac_cv_func_initscr" >&5
5406 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5407 if test $ac_cv_func_initscr = yes; then
5408   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5409 else
5410
5411                 cf_save_LIBS="$LIBS"
5412                 echo "$as_me:5412: checking for initscr in -l$cf_nculib_root" >&5
5413 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5414                 LIBS="-l$cf_nculib_root $LIBS"
5415                 cat >conftest.$ac_ext <<_ACEOF
5416 #line 5416 "configure"
5417 #include "confdefs.h"
5418 #include <${cf_cv_ncurses_header-curses.h}>
5419 int
5420 main ()
5421 {
5422 initscr()
5423   ;
5424   return 0;
5425 }
5426 _ACEOF
5427 rm -f conftest.$ac_objext conftest$ac_exeext
5428 if { (eval echo "$as_me:5428: \"$ac_link\"") >&5
5429   (eval $ac_link) 2>&5
5430   ac_status=$?
5431   echo "$as_me:5431: \$? = $ac_status" >&5
5432   (exit $ac_status); } &&
5433          { ac_try='test -s conftest$ac_exeext'
5434   { (eval echo "$as_me:5434: \"$ac_try\"") >&5
5435   (eval $ac_try) 2>&5
5436   ac_status=$?
5437   echo "$as_me:5437: \$? = $ac_status" >&5
5438   (exit $ac_status); }; }; then
5439   echo "$as_me:5439: result: yes" >&5
5440 echo "${ECHO_T}yes" >&6
5441                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5442
5443 else
5444   echo "$as_me: failed program was:" >&5
5445 cat conftest.$ac_ext >&5
5446 echo "$as_me:5446: result: no" >&5
5447 echo "${ECHO_T}no" >&6
5448
5449 cf_search=
5450 cf_library_path_list=""
5451 if test -n "${LDFLAGS}${LIBS}" ; then
5452         for cf_library_path in $LDFLAGS $LIBS
5453         do
5454                 case $cf_library_path in #(vi
5455                 -L*)
5456                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5457
5458 test "$cf_library_path" != "NONE" && \
5459 test -d "$cf_library_path" && \
5460  {
5461         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5462         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5463         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5464         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5465         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5466         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"
5467 }
5468
5469                         cf_library_path_list="$cf_library_path_list $cf_search"
5470                         ;;
5471                 esac
5472         done
5473 fi
5474
5475 cf_search=
5476
5477 test "/usr" != "$prefix" && \
5478 test -d "/usr" && \
5479 (test $prefix = NONE || test -d $prefix) && {
5480         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
5481         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
5482         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
5483         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
5484         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
5485         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
5486 }
5487
5488 test "$prefix" != "NONE" && \
5489 test -d "$prefix" && \
5490  {
5491         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5492         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5493         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5494         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5495         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5496         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5497 }
5498
5499 test "/usr/local" != "$prefix" && \
5500 test -d "/usr/local" && \
5501 (test $prefix = NONE || test -d $prefix) && {
5502         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
5503         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
5504         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
5505         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
5506         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
5507         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
5508 }
5509
5510 test "/opt" != "$prefix" && \
5511 test -d "/opt" && \
5512 (test $prefix = NONE || test -d $prefix) && {
5513         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
5514         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
5515         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
5516         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
5517         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
5518         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
5519 }
5520
5521 test "$HOME" != "$prefix" && \
5522 test -d "$HOME" && \
5523 (test $prefix = NONE || test -d $prefix) && {
5524         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
5525         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
5526         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
5527         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
5528         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
5529         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
5530 }
5531
5532 cf_search="$cf_library_path_list $cf_search"
5533
5534                         for cf_libdir in $cf_search
5535                         do
5536                                 echo "$as_me:5536: checking for -l$cf_nculib_root in $cf_libdir" >&5
5537 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5538                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5539                                 cat >conftest.$ac_ext <<_ACEOF
5540 #line 5540 "configure"
5541 #include "confdefs.h"
5542 #include <${cf_cv_ncurses_header-curses.h}>
5543 int
5544 main ()
5545 {
5546 initscr()
5547   ;
5548   return 0;
5549 }
5550 _ACEOF
5551 rm -f conftest.$ac_objext conftest$ac_exeext
5552 if { (eval echo "$as_me:5552: \"$ac_link\"") >&5
5553   (eval $ac_link) 2>&5
5554   ac_status=$?
5555   echo "$as_me:5555: \$? = $ac_status" >&5
5556   (exit $ac_status); } &&
5557          { ac_try='test -s conftest$ac_exeext'
5558   { (eval echo "$as_me:5558: \"$ac_try\"") >&5
5559   (eval $ac_try) 2>&5
5560   ac_status=$?
5561   echo "$as_me:5561: \$? = $ac_status" >&5
5562   (exit $ac_status); }; }; then
5563   echo "$as_me:5563: result: yes" >&5
5564 echo "${ECHO_T}yes" >&6
5565                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5566                                          break
5567 else
5568   echo "$as_me: failed program was:" >&5
5569 cat conftest.$ac_ext >&5
5570 echo "$as_me:5570: result: no" >&5
5571 echo "${ECHO_T}no" >&6
5572                                          LIBS="$cf_save_LIBS"
5573 fi
5574 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5575                         done
5576
5577 fi
5578 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5579
5580 fi
5581
5582 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5583
5584 if test $cf_found_library = no ; then
5585         { { echo "$as_me:5585: error: Cannot link $cf_nculib_root library" >&5
5586 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5587    { (exit 1); exit 1; }; }
5588 fi
5589
5590 fi
5591
5592 if test -n "$cf_ncurses_LIBS" ; then
5593         echo "$as_me:5593: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5594 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5595         cf_ncurses_SAVE="$LIBS"
5596         for p in $cf_ncurses_LIBS ; do
5597                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5598                 if test "$q" != "$LIBS" ; then
5599                         LIBS="$q"
5600                 fi
5601         done
5602         cat >conftest.$ac_ext <<_ACEOF
5603 #line 5603 "configure"
5604 #include "confdefs.h"
5605 #include <${cf_cv_ncurses_header-curses.h}>
5606 int
5607 main ()
5608 {
5609 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5610   ;
5611   return 0;
5612 }
5613 _ACEOF
5614 rm -f conftest.$ac_objext conftest$ac_exeext
5615 if { (eval echo "$as_me:5615: \"$ac_link\"") >&5
5616   (eval $ac_link) 2>&5
5617   ac_status=$?
5618   echo "$as_me:5618: \$? = $ac_status" >&5
5619   (exit $ac_status); } &&
5620          { ac_try='test -s conftest$ac_exeext'
5621   { (eval echo "$as_me:5621: \"$ac_try\"") >&5
5622   (eval $ac_try) 2>&5
5623   ac_status=$?
5624   echo "$as_me:5624: \$? = $ac_status" >&5
5625   (exit $ac_status); }; }; then
5626   echo "$as_me:5626: result: yes" >&5
5627 echo "${ECHO_T}yes" >&6
5628 else
5629   echo "$as_me: failed program was:" >&5
5630 cat conftest.$ac_ext >&5
5631 echo "$as_me:5631: result: no" >&5
5632 echo "${ECHO_T}no" >&6
5633                  LIBS="$cf_ncurses_SAVE"
5634 fi
5635 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5636 fi
5637
5638 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5639
5640 cat >>confdefs.h <<EOF
5641 #define $cf_nculib_ROOT 1
5642 EOF
5643
5644 fi
5645
5646 else
5647
5648 cf_ncuconfig_root=ncurses
5649
5650 echo "Looking for ${cf_ncuconfig_root}-config"
5651 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5652 do
5653   # Extract the first word of "$ac_prog", so it can be a program name with args.
5654 set dummy $ac_prog; ac_word=$2
5655 echo "$as_me:5655: checking for $ac_word" >&5
5656 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5657 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
5658   echo $ECHO_N "(cached) $ECHO_C" >&6
5659 else
5660   case $NCURSES_CONFIG in
5661   [\\/]* | ?:[\\/]*)
5662   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
5663   ;;
5664   *)
5665   ac_save_IFS=$IFS; IFS=$ac_path_separator
5666 ac_dummy="$PATH"
5667 for ac_dir in $ac_dummy; do
5668   IFS=$ac_save_IFS
5669   test -z "$ac_dir" && ac_dir=.
5670   if $as_executable_p "$ac_dir/$ac_word"; then
5671    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
5672    echo "$as_me:5672: found $ac_dir/$ac_word" >&5
5673    break
5674 fi
5675 done
5676
5677   ;;
5678 esac
5679 fi
5680 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
5681
5682 if test -n "$NCURSES_CONFIG"; then
5683   echo "$as_me:5683: result: $NCURSES_CONFIG" >&5
5684 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5685 else
5686   echo "$as_me:5686: result: no" >&5
5687 echo "${ECHO_T}no" >&6
5688 fi
5689
5690   test -n "$NCURSES_CONFIG" && break
5691 done
5692 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
5693
5694 if test "$NCURSES_CONFIG" != none ; then
5695
5696 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5697 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5698
5699 # even with config script, some packages use no-override for curses.h
5700
5701 echo "$as_me:5701: checking if we have identified curses headers" >&5
5702 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5703 if test "${cf_cv_ncurses_header+set}" = set; then
5704   echo $ECHO_N "(cached) $ECHO_C" >&6
5705 else
5706
5707 cf_cv_ncurses_header=none
5708 for cf_header in  \
5709     ncurses/curses.h \
5710         ncurses/ncurses.h \
5711         curses.h \
5712         ncurses.h
5713 do
5714 cat >conftest.$ac_ext <<_ACEOF
5715 #line 5715 "configure"
5716 #include "confdefs.h"
5717 #include <${cf_header}>
5718 int
5719 main ()
5720 {
5721 initscr(); tgoto("?", 0,0)
5722   ;
5723   return 0;
5724 }
5725 _ACEOF
5726 rm -f conftest.$ac_objext
5727 if { (eval echo "$as_me:5727: \"$ac_compile\"") >&5
5728   (eval $ac_compile) 2>&5
5729   ac_status=$?
5730   echo "$as_me:5730: \$? = $ac_status" >&5
5731   (exit $ac_status); } &&
5732          { ac_try='test -s conftest.$ac_objext'
5733   { (eval echo "$as_me:5733: \"$ac_try\"") >&5
5734   (eval $ac_try) 2>&5
5735   ac_status=$?
5736   echo "$as_me:5736: \$? = $ac_status" >&5
5737   (exit $ac_status); }; }; then
5738   cf_cv_ncurses_header=$cf_header; break
5739 else
5740   echo "$as_me: failed program was:" >&5
5741 cat conftest.$ac_ext >&5
5742 fi
5743 rm -f conftest.$ac_objext conftest.$ac_ext
5744 done
5745
5746 fi
5747 echo "$as_me:5747: result: $cf_cv_ncurses_header" >&5
5748 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5749
5750 if test "$cf_cv_ncurses_header" = none ; then
5751         { { echo "$as_me:5751: error: No curses header-files found" >&5
5752 echo "$as_me: error: No curses header-files found" >&2;}
5753    { (exit 1); exit 1; }; }
5754 fi
5755
5756 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5757
5758 for ac_header in $cf_cv_ncurses_header
5759 do
5760 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5761 echo "$as_me:5761: checking for $ac_header" >&5
5762 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5763 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5764   echo $ECHO_N "(cached) $ECHO_C" >&6
5765 else
5766   cat >conftest.$ac_ext <<_ACEOF
5767 #line 5767 "configure"
5768 #include "confdefs.h"
5769 #include <$ac_header>
5770 _ACEOF
5771 if { (eval echo "$as_me:5771: \"$ac_cpp conftest.$ac_ext\"") >&5
5772   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5773   ac_status=$?
5774   egrep -v '^ *\+' conftest.er1 >conftest.err
5775   rm -f conftest.er1
5776   cat conftest.err >&5
5777   echo "$as_me:5777: \$? = $ac_status" >&5
5778   (exit $ac_status); } >/dev/null; then
5779   if test -s conftest.err; then
5780     ac_cpp_err=$ac_c_preproc_warn_flag
5781   else
5782     ac_cpp_err=
5783   fi
5784 else
5785   ac_cpp_err=yes
5786 fi
5787 if test -z "$ac_cpp_err"; then
5788   eval "$as_ac_Header=yes"
5789 else
5790   echo "$as_me: failed program was:" >&5
5791   cat conftest.$ac_ext >&5
5792   eval "$as_ac_Header=no"
5793 fi
5794 rm -f conftest.err conftest.$ac_ext
5795 fi
5796 echo "$as_me:5796: result: `eval echo '${'$as_ac_Header'}'`" >&5
5797 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5798 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5799   cat >>confdefs.h <<EOF
5800 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5801 EOF
5802
5803 fi
5804 done
5805
5806 cat >>confdefs.h <<\EOF
5807 #define NCURSES 1
5808 EOF
5809
5810 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5811
5812 cat >>confdefs.h <<EOF
5813 #define $cf_nculib_ROOT 1
5814 EOF
5815
5816 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5817
5818 else
5819
5820 cf_ncuhdr_root=ncurses
5821
5822 test -n "$cf_cv_curses_dir" && \
5823 test "$cf_cv_curses_dir" != "no" && { \
5824
5825 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5826   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
5827   do
5828         while test $cf_add_incdir != /usr/include
5829         do
5830           if test -d $cf_add_incdir
5831           then
5832                 cf_have_incdir=no
5833                 if test -n "$CFLAGS$CPPFLAGS" ; then
5834                   # a loop is needed to ensure we can add subdirs of existing dirs
5835                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5836                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5837                           cf_have_incdir=yes; break
5838                         fi
5839                   done
5840                 fi
5841
5842                 if test "$cf_have_incdir" = no ; then
5843                   if test "$cf_add_incdir" = /usr/local/include ; then
5844                         if test "$GCC" = yes
5845                         then
5846                           cf_save_CPPFLAGS=$CPPFLAGS
5847                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5848                           cat >conftest.$ac_ext <<_ACEOF
5849 #line 5849 "configure"
5850 #include "confdefs.h"
5851 #include <stdio.h>
5852 int
5853 main ()
5854 {
5855 printf("Hello")
5856   ;
5857   return 0;
5858 }
5859 _ACEOF
5860 rm -f conftest.$ac_objext
5861 if { (eval echo "$as_me:5861: \"$ac_compile\"") >&5
5862   (eval $ac_compile) 2>&5
5863   ac_status=$?
5864   echo "$as_me:5864: \$? = $ac_status" >&5
5865   (exit $ac_status); } &&
5866          { ac_try='test -s conftest.$ac_objext'
5867   { (eval echo "$as_me:5867: \"$ac_try\"") >&5
5868   (eval $ac_try) 2>&5
5869   ac_status=$?
5870   echo "$as_me:5870: \$? = $ac_status" >&5
5871   (exit $ac_status); }; }; then
5872   :
5873 else
5874   echo "$as_me: failed program was:" >&5
5875 cat conftest.$ac_ext >&5
5876 cf_have_incdir=yes
5877 fi
5878 rm -f conftest.$ac_objext conftest.$ac_ext
5879                           CPPFLAGS=$cf_save_CPPFLAGS
5880                         fi
5881                   fi
5882                 fi
5883
5884                 if test "$cf_have_incdir" = no ; then
5885                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5886
5887 echo "${as_me-configure}:5887: testing adding $cf_add_incdir to include-path ..." 1>&5
5888
5889                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5890
5891                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5892                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5893                   cf_add_incdir="$cf_top_incdir"
5894                 else
5895                   break
5896                 fi
5897           fi
5898         done
5899   done
5900 fi
5901
5902 }
5903
5904 echo "$as_me:5904: checking for $cf_ncuhdr_root header in include-path" >&5
5905 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5906 if test "${cf_cv_ncurses_h+set}" = set; then
5907   echo $ECHO_N "(cached) $ECHO_C" >&6
5908 else
5909
5910         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5911         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5912         for cf_header in $cf_header_list
5913         do
5914
5915         cat >conftest.$ac_ext <<_ACEOF
5916 #line 5916 "configure"
5917 #include "confdefs.h"
5918
5919 #include <$cf_header>
5920 int
5921 main ()
5922 {
5923
5924 #ifdef NCURSES_VERSION
5925
5926 printf("%s\n", NCURSES_VERSION);
5927 #else
5928 #ifdef __NCURSES_H
5929 printf("old\n");
5930 #else
5931         make an error
5932 #endif
5933 #endif
5934
5935   ;
5936   return 0;
5937 }
5938 _ACEOF
5939 rm -f conftest.$ac_objext
5940 if { (eval echo "$as_me:5940: \"$ac_compile\"") >&5
5941   (eval $ac_compile) 2>&5
5942   ac_status=$?
5943   echo "$as_me:5943: \$? = $ac_status" >&5
5944   (exit $ac_status); } &&
5945          { ac_try='test -s conftest.$ac_objext'
5946   { (eval echo "$as_me:5946: \"$ac_try\"") >&5
5947   (eval $ac_try) 2>&5
5948   ac_status=$?
5949   echo "$as_me:5949: \$? = $ac_status" >&5
5950   (exit $ac_status); }; }; then
5951   cf_cv_ncurses_h=$cf_header
5952
5953 else
5954   echo "$as_me: failed program was:" >&5
5955 cat conftest.$ac_ext >&5
5956 cf_cv_ncurses_h=no
5957 fi
5958 rm -f conftest.$ac_objext conftest.$ac_ext
5959
5960                 test "$cf_cv_ncurses_h" != no && break
5961         done
5962
5963 fi
5964 echo "$as_me:5964: result: $cf_cv_ncurses_h" >&5
5965 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5966
5967 if test "$cf_cv_ncurses_h" != no ; then
5968         cf_cv_ncurses_header=$cf_cv_ncurses_h
5969 else
5970
5971 echo "$as_me:5971: checking for $cf_ncuhdr_root include-path" >&5
5972 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5973 if test "${cf_cv_ncurses_h2+set}" = set; then
5974   echo $ECHO_N "(cached) $ECHO_C" >&6
5975 else
5976
5977         test -n "$verbose" && echo
5978
5979 cf_search=
5980
5981 # collect the current set of include-directories from compiler flags
5982 cf_header_path_list=""
5983 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5984         for cf_header_path in $CPPFLAGS $CFLAGS
5985         do
5986                 case $cf_header_path in #(vi
5987                 -I*)
5988                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5989
5990 test "$cf_header_path" != "NONE" && \
5991 test -d "$cf_header_path" && \
5992  {
5993         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5994         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5995         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5996         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5997         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5998         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"
5999 }
6000
6001                         cf_header_path_list="$cf_header_path_list $cf_search"
6002                         ;;
6003                 esac
6004         done
6005 fi
6006
6007 # add the variations for the package we are looking for
6008
6009 cf_search=
6010
6011 test "/usr" != "$prefix" && \
6012 test -d "/usr" && \
6013 (test $prefix = NONE || test -d $prefix) && {
6014         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6015         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6016         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6017         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6018         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6019         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6020 }
6021
6022 test "$prefix" != "NONE" && \
6023 test -d "$prefix" && \
6024  {
6025         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6026         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6027         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6028         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6029         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6030         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6031 }
6032
6033 test "/usr/local" != "$prefix" && \
6034 test -d "/usr/local" && \
6035 (test $prefix = NONE || test -d $prefix) && {
6036         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6037         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6038         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6039         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6040         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6041         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6042 }
6043
6044 test "/opt" != "$prefix" && \
6045 test -d "/opt" && \
6046 (test $prefix = NONE || test -d $prefix) && {
6047         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6048         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6049         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6050         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6051         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6052         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6053 }
6054
6055 test "$HOME" != "$prefix" && \
6056 test -d "$HOME" && \
6057 (test $prefix = NONE || test -d $prefix) && {
6058         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6059         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6060         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6061         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6062         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6063         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6064 }
6065
6066 test "$includedir" != NONE && \
6067 test "$includedir" != "/usr/include" && \
6068 test -d "$includedir" && {
6069         test -d $includedir &&    cf_search="$cf_search $includedir"
6070         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6071 }
6072
6073 test "$oldincludedir" != NONE && \
6074 test "$oldincludedir" != "/usr/include" && \
6075 test -d "$oldincludedir" && {
6076         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6077         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6078 }
6079
6080 cf_search="$cf_search $cf_header_path_list"
6081
6082         test -n "$verbose" && echo search path $cf_search
6083         cf_save2_CPPFLAGS="$CPPFLAGS"
6084         for cf_incdir in $cf_search
6085         do
6086
6087 if test -n "$cf_incdir" ; then
6088   for cf_add_incdir in $cf_incdir
6089   do
6090         while test $cf_add_incdir != /usr/include
6091         do
6092           if test -d $cf_add_incdir
6093           then
6094                 cf_have_incdir=no
6095                 if test -n "$CFLAGS$CPPFLAGS" ; then
6096                   # a loop is needed to ensure we can add subdirs of existing dirs
6097                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6098                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6099                           cf_have_incdir=yes; break
6100                         fi
6101                   done
6102                 fi
6103
6104                 if test "$cf_have_incdir" = no ; then
6105                   if test "$cf_add_incdir" = /usr/local/include ; then
6106                         if test "$GCC" = yes
6107                         then
6108                           cf_save_CPPFLAGS=$CPPFLAGS
6109                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6110                           cat >conftest.$ac_ext <<_ACEOF
6111 #line 6111 "configure"
6112 #include "confdefs.h"
6113 #include <stdio.h>
6114 int
6115 main ()
6116 {
6117 printf("Hello")
6118   ;
6119   return 0;
6120 }
6121 _ACEOF
6122 rm -f conftest.$ac_objext
6123 if { (eval echo "$as_me:6123: \"$ac_compile\"") >&5
6124   (eval $ac_compile) 2>&5
6125   ac_status=$?
6126   echo "$as_me:6126: \$? = $ac_status" >&5
6127   (exit $ac_status); } &&
6128          { ac_try='test -s conftest.$ac_objext'
6129   { (eval echo "$as_me:6129: \"$ac_try\"") >&5
6130   (eval $ac_try) 2>&5
6131   ac_status=$?
6132   echo "$as_me:6132: \$? = $ac_status" >&5
6133   (exit $ac_status); }; }; then
6134   :
6135 else
6136   echo "$as_me: failed program was:" >&5
6137 cat conftest.$ac_ext >&5
6138 cf_have_incdir=yes
6139 fi
6140 rm -f conftest.$ac_objext conftest.$ac_ext
6141                           CPPFLAGS=$cf_save_CPPFLAGS
6142                         fi
6143                   fi
6144                 fi
6145
6146                 if test "$cf_have_incdir" = no ; then
6147                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6148
6149 echo "${as_me-configure}:6149: testing adding $cf_add_incdir to include-path ..." 1>&5
6150
6151                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6152
6153                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6154                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6155                   cf_add_incdir="$cf_top_incdir"
6156                 else
6157                   break
6158                 fi
6159           fi
6160         done
6161   done
6162 fi
6163
6164                 for cf_header in \
6165                         ncurses.h \
6166                         curses.h
6167                 do
6168
6169         cat >conftest.$ac_ext <<_ACEOF
6170 #line 6170 "configure"
6171 #include "confdefs.h"
6172
6173 #include <$cf_header>
6174 int
6175 main ()
6176 {
6177
6178 #ifdef NCURSES_VERSION
6179
6180 printf("%s\n", NCURSES_VERSION);
6181 #else
6182 #ifdef __NCURSES_H
6183 printf("old\n");
6184 #else
6185         make an error
6186 #endif
6187 #endif
6188
6189   ;
6190   return 0;
6191 }
6192 _ACEOF
6193 rm -f conftest.$ac_objext
6194 if { (eval echo "$as_me:6194: \"$ac_compile\"") >&5
6195   (eval $ac_compile) 2>&5
6196   ac_status=$?
6197   echo "$as_me:6197: \$? = $ac_status" >&5
6198   (exit $ac_status); } &&
6199          { ac_try='test -s conftest.$ac_objext'
6200   { (eval echo "$as_me:6200: \"$ac_try\"") >&5
6201   (eval $ac_try) 2>&5
6202   ac_status=$?
6203   echo "$as_me:6203: \$? = $ac_status" >&5
6204   (exit $ac_status); }; }; then
6205   cf_cv_ncurses_h2=$cf_header
6206
6207 else
6208   echo "$as_me: failed program was:" >&5
6209 cat conftest.$ac_ext >&5
6210 cf_cv_ncurses_h2=no
6211 fi
6212 rm -f conftest.$ac_objext conftest.$ac_ext
6213
6214                         if test "$cf_cv_ncurses_h2" != no ; then
6215                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6216                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6217                                 break
6218                         fi
6219                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6220                 done
6221                 CPPFLAGS="$cf_save2_CPPFLAGS"
6222                 test "$cf_cv_ncurses_h2" != no && break
6223         done
6224         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6224: error: not found" >&5
6225 echo "$as_me: error: not found" >&2;}
6226    { (exit 1); exit 1; }; }
6227
6228 fi
6229 echo "$as_me:6229: result: $cf_cv_ncurses_h2" >&5
6230 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6231
6232         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6233         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6234         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6235                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6236         fi
6237
6238 if test -n "$cf_1st_incdir" ; then
6239   for cf_add_incdir in $cf_1st_incdir
6240   do
6241         while test $cf_add_incdir != /usr/include
6242         do
6243           if test -d $cf_add_incdir
6244           then
6245                 cf_have_incdir=no
6246                 if test -n "$CFLAGS$CPPFLAGS" ; then
6247                   # a loop is needed to ensure we can add subdirs of existing dirs
6248                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6249                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6250                           cf_have_incdir=yes; break
6251                         fi
6252                   done
6253                 fi
6254
6255                 if test "$cf_have_incdir" = no ; then
6256                   if test "$cf_add_incdir" = /usr/local/include ; then
6257                         if test "$GCC" = yes
6258                         then
6259                           cf_save_CPPFLAGS=$CPPFLAGS
6260                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6261                           cat >conftest.$ac_ext <<_ACEOF
6262 #line 6262 "configure"
6263 #include "confdefs.h"
6264 #include <stdio.h>
6265 int
6266 main ()
6267 {
6268 printf("Hello")
6269   ;
6270   return 0;
6271 }
6272 _ACEOF
6273 rm -f conftest.$ac_objext
6274 if { (eval echo "$as_me:6274: \"$ac_compile\"") >&5
6275   (eval $ac_compile) 2>&5
6276   ac_status=$?
6277   echo "$as_me:6277: \$? = $ac_status" >&5
6278   (exit $ac_status); } &&
6279          { ac_try='test -s conftest.$ac_objext'
6280   { (eval echo "$as_me:6280: \"$ac_try\"") >&5
6281   (eval $ac_try) 2>&5
6282   ac_status=$?
6283   echo "$as_me:6283: \$? = $ac_status" >&5
6284   (exit $ac_status); }; }; then
6285   :
6286 else
6287   echo "$as_me: failed program was:" >&5
6288 cat conftest.$ac_ext >&5
6289 cf_have_incdir=yes
6290 fi
6291 rm -f conftest.$ac_objext conftest.$ac_ext
6292                           CPPFLAGS=$cf_save_CPPFLAGS
6293                         fi
6294                   fi
6295                 fi
6296
6297                 if test "$cf_have_incdir" = no ; then
6298                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6299
6300 echo "${as_me-configure}:6300: testing adding $cf_add_incdir to include-path ..." 1>&5
6301
6302                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6303
6304                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6305                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6306                   cf_add_incdir="$cf_top_incdir"
6307                 else
6308                   break
6309                 fi
6310           fi
6311         done
6312   done
6313 fi
6314
6315 fi
6316
6317 # Set definitions to allow ifdef'ing for ncurses.h
6318
6319 case $cf_cv_ncurses_header in # (vi
6320 *ncurses.h)
6321         cat >>confdefs.h <<\EOF
6322 #define HAVE_NCURSES_H 1
6323 EOF
6324
6325         ;;
6326 esac
6327
6328 case $cf_cv_ncurses_header in # (vi
6329 ncurses/curses.h|ncurses/ncurses.h)
6330         cat >>confdefs.h <<\EOF
6331 #define HAVE_NCURSES_NCURSES_H 1
6332 EOF
6333
6334         ;;
6335 ncursesw/curses.h|ncursesw/ncurses.h)
6336         cat >>confdefs.h <<\EOF
6337 #define HAVE_NCURSESW_NCURSES_H 1
6338 EOF
6339
6340         ;;
6341 esac
6342
6343 echo "$as_me:6343: checking for terminfo header" >&5
6344 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6345 if test "${cf_cv_term_header+set}" = set; then
6346   echo $ECHO_N "(cached) $ECHO_C" >&6
6347 else
6348
6349 case ${cf_cv_ncurses_header} in #(vi
6350 */ncurses.h|*/ncursesw.h) #(vi
6351         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6352         ;;
6353 *)
6354         cf_term_header=term.h
6355         ;;
6356 esac
6357
6358 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6359 do
6360 cat >conftest.$ac_ext <<_ACEOF
6361 #line 6361 "configure"
6362 #include "confdefs.h"
6363 #include <stdio.h>
6364 #include <${cf_cv_ncurses_header-curses.h}>
6365 #include <$cf_test>
6366
6367 int
6368 main ()
6369 {
6370 int x = auto_left_margin
6371   ;
6372   return 0;
6373 }
6374 _ACEOF
6375 rm -f conftest.$ac_objext
6376 if { (eval echo "$as_me:6376: \"$ac_compile\"") >&5
6377   (eval $ac_compile) 2>&5
6378   ac_status=$?
6379   echo "$as_me:6379: \$? = $ac_status" >&5
6380   (exit $ac_status); } &&
6381          { ac_try='test -s conftest.$ac_objext'
6382   { (eval echo "$as_me:6382: \"$ac_try\"") >&5
6383   (eval $ac_try) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit $ac_status); }; }; then
6387
6388         cf_cv_term_header="$cf_test"
6389 else
6390   echo "$as_me: failed program was:" >&5
6391 cat conftest.$ac_ext >&5
6392
6393         cf_cv_term_header=unknown
6394
6395 fi
6396 rm -f conftest.$ac_objext conftest.$ac_ext
6397         test "$cf_cv_term_header" != unknown && break
6398 done
6399
6400 fi
6401 echo "$as_me:6401: result: $cf_cv_term_header" >&5
6402 echo "${ECHO_T}$cf_cv_term_header" >&6
6403
6404 # Set definitions to allow ifdef'ing to accommodate subdirectories
6405
6406 case $cf_cv_term_header in # (vi
6407 *term.h)
6408         cat >>confdefs.h <<\EOF
6409 #define HAVE_TERM_H 1
6410 EOF
6411
6412         ;;
6413 esac
6414
6415 case $cf_cv_term_header in # (vi
6416 ncurses/term.h) #(vi
6417         cat >>confdefs.h <<\EOF
6418 #define HAVE_NCURSES_TERM_H 1
6419 EOF
6420
6421         ;;
6422 ncursesw/term.h)
6423         cat >>confdefs.h <<\EOF
6424 #define HAVE_NCURSESW_TERM_H 1
6425 EOF
6426
6427         ;;
6428 esac
6429
6430 # some applications need this, but should check for NCURSES_VERSION
6431 cat >>confdefs.h <<\EOF
6432 #define NCURSES 1
6433 EOF
6434
6435 echo "$as_me:6435: checking for ncurses version" >&5
6436 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6437 if test "${cf_cv_ncurses_version+set}" = set; then
6438   echo $ECHO_N "(cached) $ECHO_C" >&6
6439 else
6440
6441         cf_cv_ncurses_version=no
6442         cf_tempfile=out$$
6443         rm -f $cf_tempfile
6444         if test "$cross_compiling" = yes; then
6445
6446         # This will not work if the preprocessor splits the line after the
6447         # Autoconf token.  The 'unproto' program does that.
6448         cat > conftest.$ac_ext <<EOF
6449 #include <${cf_cv_ncurses_header-curses.h}>
6450 #undef Autoconf
6451 #ifdef NCURSES_VERSION
6452 Autoconf NCURSES_VERSION
6453 #else
6454 #ifdef __NCURSES_H
6455 Autoconf "old"
6456 #endif
6457 ;
6458 #endif
6459 EOF
6460         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6461         { (eval echo "$as_me:6461: \"$cf_try\"") >&5
6462   (eval $cf_try) 2>&5
6463   ac_status=$?
6464   echo "$as_me:6464: \$? = $ac_status" >&5
6465   (exit $ac_status); }
6466         if test -f conftest.out ; then
6467                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6468                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6469                 rm -f conftest.out
6470         fi
6471
6472 else
6473   cat >conftest.$ac_ext <<_ACEOF
6474 #line 6474 "configure"
6475 #include "confdefs.h"
6476
6477 #include <${cf_cv_ncurses_header-curses.h}>
6478 #include <stdio.h>
6479 int main()
6480 {
6481         FILE *fp = fopen("$cf_tempfile", "w");
6482 #ifdef NCURSES_VERSION
6483 # ifdef NCURSES_VERSION_PATCH
6484         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6485 # else
6486         fprintf(fp, "%s\n", NCURSES_VERSION);
6487 # endif
6488 #else
6489 # ifdef __NCURSES_H
6490         fprintf(fp, "old\n");
6491 # else
6492         make an error
6493 # endif
6494 #endif
6495         ${cf_cv_main_return-return}(0);
6496 }
6497 _ACEOF
6498 rm -f conftest$ac_exeext
6499 if { (eval echo "$as_me:6499: \"$ac_link\"") >&5
6500   (eval $ac_link) 2>&5
6501   ac_status=$?
6502   echo "$as_me:6502: \$? = $ac_status" >&5
6503   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6504   { (eval echo "$as_me:6504: \"$ac_try\"") >&5
6505   (eval $ac_try) 2>&5
6506   ac_status=$?
6507   echo "$as_me:6507: \$? = $ac_status" >&5
6508   (exit $ac_status); }; }; then
6509
6510         cf_cv_ncurses_version=`cat $cf_tempfile`
6511 else
6512   echo "$as_me: program exited with status $ac_status" >&5
6513 echo "$as_me: failed program was:" >&5
6514 cat conftest.$ac_ext >&5
6515 fi
6516 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6517 fi
6518         rm -f $cf_tempfile
6519
6520 fi
6521 echo "$as_me:6521: result: $cf_cv_ncurses_version" >&5
6522 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6523 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
6524 #define NCURSES 1
6525 EOF
6526
6527 cf_nculib_root=ncurses
6528         # This works, except for the special case where we find gpm, but
6529         # ncurses is in a nonstandard location via $LIBS, and we really want
6530         # to link gpm.
6531 cf_ncurses_LIBS=""
6532 cf_ncurses_SAVE="$LIBS"
6533 echo "$as_me:6533: checking for Gpm_Open in -lgpm" >&5
6534 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6535 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6536   echo $ECHO_N "(cached) $ECHO_C" >&6
6537 else
6538   ac_check_lib_save_LIBS=$LIBS
6539 LIBS="-lgpm  $LIBS"
6540 cat >conftest.$ac_ext <<_ACEOF
6541 #line 6541 "configure"
6542 #include "confdefs.h"
6543
6544 /* Override any gcc2 internal prototype to avoid an error.  */
6545 #ifdef __cplusplus
6546 extern "C"
6547 #endif
6548 /* We use char because int might match the return type of a gcc2
6549    builtin and then its argument prototype would still apply.  */
6550 char Gpm_Open ();
6551 int
6552 main ()
6553 {
6554 Gpm_Open ();
6555   ;
6556   return 0;
6557 }
6558 _ACEOF
6559 rm -f conftest.$ac_objext conftest$ac_exeext
6560 if { (eval echo "$as_me:6560: \"$ac_link\"") >&5
6561   (eval $ac_link) 2>&5
6562   ac_status=$?
6563   echo "$as_me:6563: \$? = $ac_status" >&5
6564   (exit $ac_status); } &&
6565          { ac_try='test -s conftest$ac_exeext'
6566   { (eval echo "$as_me:6566: \"$ac_try\"") >&5
6567   (eval $ac_try) 2>&5
6568   ac_status=$?
6569   echo "$as_me:6569: \$? = $ac_status" >&5
6570   (exit $ac_status); }; }; then
6571   ac_cv_lib_gpm_Gpm_Open=yes
6572 else
6573   echo "$as_me: failed program was:" >&5
6574 cat conftest.$ac_ext >&5
6575 ac_cv_lib_gpm_Gpm_Open=no
6576 fi
6577 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6578 LIBS=$ac_check_lib_save_LIBS
6579 fi
6580 echo "$as_me:6580: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6581 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6582 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6583   echo "$as_me:6583: checking for initscr in -lgpm" >&5
6584 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6585 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6586   echo $ECHO_N "(cached) $ECHO_C" >&6
6587 else
6588   ac_check_lib_save_LIBS=$LIBS
6589 LIBS="-lgpm  $LIBS"
6590 cat >conftest.$ac_ext <<_ACEOF
6591 #line 6591 "configure"
6592 #include "confdefs.h"
6593
6594 /* Override any gcc2 internal prototype to avoid an error.  */
6595 #ifdef __cplusplus
6596 extern "C"
6597 #endif
6598 /* We use char because int might match the return type of a gcc2
6599    builtin and then its argument prototype would still apply.  */
6600 char initscr ();
6601 int
6602 main ()
6603 {
6604 initscr ();
6605   ;
6606   return 0;
6607 }
6608 _ACEOF
6609 rm -f conftest.$ac_objext conftest$ac_exeext
6610 if { (eval echo "$as_me:6610: \"$ac_link\"") >&5
6611   (eval $ac_link) 2>&5
6612   ac_status=$?
6613   echo "$as_me:6613: \$? = $ac_status" >&5
6614   (exit $ac_status); } &&
6615          { ac_try='test -s conftest$ac_exeext'
6616   { (eval echo "$as_me:6616: \"$ac_try\"") >&5
6617   (eval $ac_try) 2>&5
6618   ac_status=$?
6619   echo "$as_me:6619: \$? = $ac_status" >&5
6620   (exit $ac_status); }; }; then
6621   ac_cv_lib_gpm_initscr=yes
6622 else
6623   echo "$as_me: failed program was:" >&5
6624 cat conftest.$ac_ext >&5
6625 ac_cv_lib_gpm_initscr=no
6626 fi
6627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6628 LIBS=$ac_check_lib_save_LIBS
6629 fi
6630 echo "$as_me:6630: result: $ac_cv_lib_gpm_initscr" >&5
6631 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6632 if test $ac_cv_lib_gpm_initscr = yes; then
6633   LIBS="$cf_ncurses_SAVE"
6634 else
6635   cf_ncurses_LIBS="-lgpm"
6636 fi
6637
6638 fi
6639
6640 case $host_os in #(vi
6641 freebsd*)
6642         # This is only necessary if you are linking against an obsolete
6643         # version of ncurses (but it should do no harm, since it's static).
6644         if test "$cf_nculib_root" = ncurses ; then
6645                 echo "$as_me:6645: checking for tgoto in -lmytinfo" >&5
6646 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6647 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6648   echo $ECHO_N "(cached) $ECHO_C" >&6
6649 else
6650   ac_check_lib_save_LIBS=$LIBS
6651 LIBS="-lmytinfo  $LIBS"
6652 cat >conftest.$ac_ext <<_ACEOF
6653 #line 6653 "configure"
6654 #include "confdefs.h"
6655
6656 /* Override any gcc2 internal prototype to avoid an error.  */
6657 #ifdef __cplusplus
6658 extern "C"
6659 #endif
6660 /* We use char because int might match the return type of a gcc2
6661    builtin and then its argument prototype would still apply.  */
6662 char tgoto ();
6663 int
6664 main ()
6665 {
6666 tgoto ();
6667   ;
6668   return 0;
6669 }
6670 _ACEOF
6671 rm -f conftest.$ac_objext conftest$ac_exeext
6672 if { (eval echo "$as_me:6672: \"$ac_link\"") >&5
6673   (eval $ac_link) 2>&5
6674   ac_status=$?
6675   echo "$as_me:6675: \$? = $ac_status" >&5
6676   (exit $ac_status); } &&
6677          { ac_try='test -s conftest$ac_exeext'
6678   { (eval echo "$as_me:6678: \"$ac_try\"") >&5
6679   (eval $ac_try) 2>&5
6680   ac_status=$?
6681   echo "$as_me:6681: \$? = $ac_status" >&5
6682   (exit $ac_status); }; }; then
6683   ac_cv_lib_mytinfo_tgoto=yes
6684 else
6685   echo "$as_me: failed program was:" >&5
6686 cat conftest.$ac_ext >&5
6687 ac_cv_lib_mytinfo_tgoto=no
6688 fi
6689 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6690 LIBS=$ac_check_lib_save_LIBS
6691 fi
6692 echo "$as_me:6692: result: $ac_cv_lib_mytinfo_tgoto" >&5
6693 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6694 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6695   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6696 fi
6697
6698         fi
6699         ;;
6700 esac
6701
6702 LIBS="$cf_ncurses_LIBS $LIBS"
6703
6704 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6705 then
6706
6707 if test -n "$cf_cv_curses_dir/lib" ; then
6708   for cf_add_libdir in $cf_cv_curses_dir/lib
6709   do
6710     if test $cf_add_libdir = /usr/lib ; then
6711       :
6712     elif test -d $cf_add_libdir
6713     then
6714       cf_have_libdir=no
6715       if test -n "$LDFLAGS$LIBS" ; then
6716         # a loop is needed to ensure we can add subdirs of existing dirs
6717         for cf_test_libdir in $LDFLAGS $LIBS ; do
6718           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6719             cf_have_libdir=yes; break
6720           fi
6721         done
6722       fi
6723       if test "$cf_have_libdir" = no ; then
6724         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6725
6726 echo "${as_me-configure}:6726: testing adding $cf_add_libdir to library-path ..." 1>&5
6727
6728         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6729       fi
6730     fi
6731   done
6732 fi
6733
6734         LIBS="-l$cf_nculib_root $LIBS"
6735 else
6736
6737         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6738         cf_libdir=""
6739         echo "$as_me:6739: checking for initscr" >&5
6740 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6741 if test "${ac_cv_func_initscr+set}" = set; then
6742   echo $ECHO_N "(cached) $ECHO_C" >&6
6743 else
6744   cat >conftest.$ac_ext <<_ACEOF
6745 #line 6745 "configure"
6746 #include "confdefs.h"
6747 /* System header to define __stub macros and hopefully few prototypes,
6748     which can conflict with char initscr (); below.  */
6749 #include <assert.h>
6750 /* Override any gcc2 internal prototype to avoid an error.  */
6751 #ifdef __cplusplus
6752 extern "C"
6753 #endif
6754 /* We use char because int might match the return type of a gcc2
6755    builtin and then its argument prototype would still apply.  */
6756 char initscr ();
6757 char (*f) ();
6758
6759 int
6760 main ()
6761 {
6762 /* The GNU C library defines this for functions which it implements
6763     to always fail with ENOSYS.  Some functions are actually named
6764     something starting with __ and the normal name is an alias.  */
6765 #if defined (__stub_initscr) || defined (__stub___initscr)
6766 choke me
6767 #else
6768 f = initscr;
6769 #endif
6770
6771   ;
6772   return 0;
6773 }
6774 _ACEOF
6775 rm -f conftest.$ac_objext conftest$ac_exeext
6776 if { (eval echo "$as_me:6776: \"$ac_link\"") >&5
6777   (eval $ac_link) 2>&5
6778   ac_status=$?
6779   echo "$as_me:6779: \$? = $ac_status" >&5
6780   (exit $ac_status); } &&
6781          { ac_try='test -s conftest$ac_exeext'
6782   { (eval echo "$as_me:6782: \"$ac_try\"") >&5
6783   (eval $ac_try) 2>&5
6784   ac_status=$?
6785   echo "$as_me:6785: \$? = $ac_status" >&5
6786   (exit $ac_status); }; }; then
6787   ac_cv_func_initscr=yes
6788 else
6789   echo "$as_me: failed program was:" >&5
6790 cat conftest.$ac_ext >&5
6791 ac_cv_func_initscr=no
6792 fi
6793 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6794 fi
6795 echo "$as_me:6795: result: $ac_cv_func_initscr" >&5
6796 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6797 if test $ac_cv_func_initscr = yes; then
6798   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6799 else
6800
6801                 cf_save_LIBS="$LIBS"
6802                 echo "$as_me:6802: checking for initscr in -l$cf_nculib_root" >&5
6803 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6804                 LIBS="-l$cf_nculib_root $LIBS"
6805                 cat >conftest.$ac_ext <<_ACEOF
6806 #line 6806 "configure"
6807 #include "confdefs.h"
6808 #include <${cf_cv_ncurses_header-curses.h}>
6809 int
6810 main ()
6811 {
6812 initscr()
6813   ;
6814   return 0;
6815 }
6816 _ACEOF
6817 rm -f conftest.$ac_objext conftest$ac_exeext
6818 if { (eval echo "$as_me:6818: \"$ac_link\"") >&5
6819   (eval $ac_link) 2>&5
6820   ac_status=$?
6821   echo "$as_me:6821: \$? = $ac_status" >&5
6822   (exit $ac_status); } &&
6823          { ac_try='test -s conftest$ac_exeext'
6824   { (eval echo "$as_me:6824: \"$ac_try\"") >&5
6825   (eval $ac_try) 2>&5
6826   ac_status=$?
6827   echo "$as_me:6827: \$? = $ac_status" >&5
6828   (exit $ac_status); }; }; then
6829   echo "$as_me:6829: result: yes" >&5
6830 echo "${ECHO_T}yes" >&6
6831                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6832
6833 else
6834   echo "$as_me: failed program was:" >&5
6835 cat conftest.$ac_ext >&5
6836 echo "$as_me:6836: result: no" >&5
6837 echo "${ECHO_T}no" >&6
6838
6839 cf_search=
6840 cf_library_path_list=""
6841 if test -n "${LDFLAGS}${LIBS}" ; then
6842         for cf_library_path in $LDFLAGS $LIBS
6843         do
6844                 case $cf_library_path in #(vi
6845                 -L*)
6846                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6847
6848 test "$cf_library_path" != "NONE" && \
6849 test -d "$cf_library_path" && \
6850  {
6851         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6852         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6853         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6854         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6855         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6856         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"
6857 }
6858
6859                         cf_library_path_list="$cf_library_path_list $cf_search"
6860                         ;;
6861                 esac
6862         done
6863 fi
6864
6865 cf_search=
6866
6867 test "/usr" != "$prefix" && \
6868 test -d "/usr" && \
6869 (test $prefix = NONE || test -d $prefix) && {
6870         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6871         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6872         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6873         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6874         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6875         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6876 }
6877
6878 test "$prefix" != "NONE" && \
6879 test -d "$prefix" && \
6880  {
6881         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6882         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6883         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6884         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6885         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6886         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6887 }
6888
6889 test "/usr/local" != "$prefix" && \
6890 test -d "/usr/local" && \
6891 (test $prefix = NONE || test -d $prefix) && {
6892         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6893         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6894         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6895         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6896         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6897         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6898 }
6899
6900 test "/opt" != "$prefix" && \
6901 test -d "/opt" && \
6902 (test $prefix = NONE || test -d $prefix) && {
6903         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6904         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6905         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6906         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6907         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6908         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6909 }
6910
6911 test "$HOME" != "$prefix" && \
6912 test -d "$HOME" && \
6913 (test $prefix = NONE || test -d $prefix) && {
6914         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6915         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6916         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6917         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6918         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6919         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6920 }
6921
6922 cf_search="$cf_library_path_list $cf_search"
6923
6924                         for cf_libdir in $cf_search
6925                         do
6926                                 echo "$as_me:6926: checking for -l$cf_nculib_root in $cf_libdir" >&5
6927 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6928                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6929                                 cat >conftest.$ac_ext <<_ACEOF
6930 #line 6930 "configure"
6931 #include "confdefs.h"
6932 #include <${cf_cv_ncurses_header-curses.h}>
6933 int
6934 main ()
6935 {
6936 initscr()
6937   ;
6938   return 0;
6939 }
6940 _ACEOF
6941 rm -f conftest.$ac_objext conftest$ac_exeext
6942 if { (eval echo "$as_me:6942: \"$ac_link\"") >&5
6943   (eval $ac_link) 2>&5
6944   ac_status=$?
6945   echo "$as_me:6945: \$? = $ac_status" >&5
6946   (exit $ac_status); } &&
6947          { ac_try='test -s conftest$ac_exeext'
6948   { (eval echo "$as_me:6948: \"$ac_try\"") >&5
6949   (eval $ac_try) 2>&5
6950   ac_status=$?
6951   echo "$as_me:6951: \$? = $ac_status" >&5
6952   (exit $ac_status); }; }; then
6953   echo "$as_me:6953: result: yes" >&5
6954 echo "${ECHO_T}yes" >&6
6955                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6956                                          break
6957 else
6958   echo "$as_me: failed program was:" >&5
6959 cat conftest.$ac_ext >&5
6960 echo "$as_me:6960: result: no" >&5
6961 echo "${ECHO_T}no" >&6
6962                                          LIBS="$cf_save_LIBS"
6963 fi
6964 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6965                         done
6966
6967 fi
6968 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6969
6970 fi
6971
6972 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6973
6974 if test $cf_found_library = no ; then
6975         { { echo "$as_me:6975: error: Cannot link $cf_nculib_root library" >&5
6976 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6977    { (exit 1); exit 1; }; }
6978 fi
6979
6980 fi
6981
6982 if test -n "$cf_ncurses_LIBS" ; then
6983         echo "$as_me:6983: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6984 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6985         cf_ncurses_SAVE="$LIBS"
6986         for p in $cf_ncurses_LIBS ; do
6987                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6988                 if test "$q" != "$LIBS" ; then
6989                         LIBS="$q"
6990                 fi
6991         done
6992         cat >conftest.$ac_ext <<_ACEOF
6993 #line 6993 "configure"
6994 #include "confdefs.h"
6995 #include <${cf_cv_ncurses_header-curses.h}>
6996 int
6997 main ()
6998 {
6999 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7000   ;
7001   return 0;
7002 }
7003 _ACEOF
7004 rm -f conftest.$ac_objext conftest$ac_exeext
7005 if { (eval echo "$as_me:7005: \"$ac_link\"") >&5
7006   (eval $ac_link) 2>&5
7007   ac_status=$?
7008   echo "$as_me:7008: \$? = $ac_status" >&5
7009   (exit $ac_status); } &&
7010          { ac_try='test -s conftest$ac_exeext'
7011   { (eval echo "$as_me:7011: \"$ac_try\"") >&5
7012   (eval $ac_try) 2>&5
7013   ac_status=$?
7014   echo "$as_me:7014: \$? = $ac_status" >&5
7015   (exit $ac_status); }; }; then
7016   echo "$as_me:7016: result: yes" >&5
7017 echo "${ECHO_T}yes" >&6
7018 else
7019   echo "$as_me: failed program was:" >&5
7020 cat conftest.$ac_ext >&5
7021 echo "$as_me:7021: result: no" >&5
7022 echo "${ECHO_T}no" >&6
7023                  LIBS="$cf_ncurses_SAVE"
7024 fi
7025 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7026 fi
7027
7028 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7029
7030 cat >>confdefs.h <<EOF
7031 #define $cf_nculib_ROOT 1
7032 EOF
7033
7034 fi
7035
7036 fi
7037
7038 if test "$NCURSES_CONFIG" != none ; then
7039
7040 cf_version=`$NCURSES_CONFIG --version`
7041
7042 NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
7043 NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9]\+\.//' -e 's/\..*//'`
7044 NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9]\+\.[0-9]\+\.//'`
7045
7046 # ABI version is not available from headers
7047 cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
7048
7049 else
7050
7051 for cf_name in MAJOR MINOR PATCH
7052 do
7053 cat >conftest.$ac_ext <<CF_EOF
7054 #include <${cf_cv_ncurses_header-curses.h}>
7055 AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
7056 CF_EOF
7057         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
7058         { (eval echo "$as_me:7058: \"$cf_try\"") >&5
7059   (eval $cf_try) 2>&5
7060   ac_status=$?
7061   echo "$as_me:7061: \$? = $ac_status" >&5
7062   (exit $ac_status); }
7063         if test -f conftest.out ; then
7064                 cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ]\+//"`
7065                 eval NCURSES_$cf_name=$cf_result
7066                 cat conftest.$ac_ext
7067                 cat conftest.out
7068         fi
7069 done
7070
7071 cf_cv_abi_version=${NCURSES_MAJOR}
7072
7073 fi
7074
7075 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
7076
7077 cf_cv_timestamp=`date`
7078
7079 echo "$as_me:7079: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
7080 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
7081
7082         case $cf_cv_system_name in #(vi
7083         OS/2*|os2*) #(vi
7084         LIB_PREFIX=''
7085         ;;
7086         *)      LIB_PREFIX='lib'
7087         ;;
7088         esac
7089 cf_prefix=$LIB_PREFIX
7090
7091 LIB_PREFIX=$cf_prefix
7092
7093 LIB_SUFFIX=
7094
7095 ###############################################################################
7096
7097 if test X"$CC_G_OPT" = X"" ; then
7098         CC_G_OPT='-g'
7099         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
7100 fi
7101
7102 echo "$as_me:7102: checking for default loader flags" >&5
7103 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
7104 case $DFT_LWR_MODEL in
7105 normal)  LD_MODEL=''   ;;
7106 debug)   LD_MODEL=$CC_G_OPT ;;
7107 profile) LD_MODEL='-pg';;
7108 shared)  LD_MODEL=''   ;;
7109 esac
7110 echo "$as_me:7110: result: $LD_MODEL" >&5
7111 echo "${ECHO_T}$LD_MODEL" >&6
7112
7113 LD_RPATH_OPT=
7114 echo "$as_me:7114: checking for an rpath option" >&5
7115 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
7116 case $cf_cv_system_name in #(vi
7117 irix*) #(vi
7118         if test "$GCC" = yes; then
7119                 LD_RPATH_OPT="-Wl,-rpath,"
7120         else
7121                 LD_RPATH_OPT="-rpath "
7122         fi
7123         ;;
7124 linux*|gnu*|k*bsd*-gnu) #(vi
7125         LD_RPATH_OPT="-Wl,-rpath,"
7126         ;;
7127 openbsd[2-9].*) #(vi
7128         LD_RPATH_OPT="-Wl,-rpath,"
7129         ;;
7130 freebsd*) #(vi
7131         LD_RPATH_OPT="-rpath "
7132         ;;
7133 netbsd*) #(vi
7134         LD_RPATH_OPT="-Wl,-rpath,"
7135         ;;
7136 osf*|mls+*) #(vi
7137         LD_RPATH_OPT="-rpath "
7138         ;;
7139 solaris2*) #(vi
7140         LD_RPATH_OPT="-R"
7141         ;;
7142 *)
7143         ;;
7144 esac
7145 echo "$as_me:7145: result: $LD_RPATH_OPT" >&5
7146 echo "${ECHO_T}$LD_RPATH_OPT" >&6
7147
7148 case "x$LD_RPATH_OPT" in #(vi
7149 x-R*)
7150         echo "$as_me:7150: checking if we need a space after rpath option" >&5
7151 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
7152         cf_save_LIBS="$LIBS"
7153         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
7154         cat >conftest.$ac_ext <<_ACEOF
7155 #line 7155 "configure"
7156 #include "confdefs.h"
7157
7158 int
7159 main ()
7160 {
7161
7162   ;
7163   return 0;
7164 }
7165 _ACEOF
7166 rm -f conftest.$ac_objext conftest$ac_exeext
7167 if { (eval echo "$as_me:7167: \"$ac_link\"") >&5
7168   (eval $ac_link) 2>&5
7169   ac_status=$?
7170   echo "$as_me:7170: \$? = $ac_status" >&5
7171   (exit $ac_status); } &&
7172          { ac_try='test -s conftest$ac_exeext'
7173   { (eval echo "$as_me:7173: \"$ac_try\"") >&5
7174   (eval $ac_try) 2>&5
7175   ac_status=$?
7176   echo "$as_me:7176: \$? = $ac_status" >&5
7177   (exit $ac_status); }; }; then
7178   cf_rpath_space=no
7179 else
7180   echo "$as_me: failed program was:" >&5
7181 cat conftest.$ac_ext >&5
7182 cf_rpath_space=yes
7183 fi
7184 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7185         LIBS="$cf_save_LIBS"
7186         echo "$as_me:7186: result: $cf_rpath_space" >&5
7187 echo "${ECHO_T}$cf_rpath_space" >&6
7188         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
7189         ;;
7190 esac
7191
7192         LOCAL_LDFLAGS=
7193         LOCAL_LDFLAGS2=
7194         LD_SHARED_OPTS=
7195         INSTALL_LIB="-m 644"
7196
7197         cf_cv_do_symlinks=no
7198         cf_ld_rpath_opt=
7199         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
7200
7201         echo "$as_me:7201: checking if release/abi version should be used for shared libs" >&5
7202 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
7203
7204 # Check whether --with-shlib-version or --without-shlib-version was given.
7205 if test "${with_shlib_version+set}" = set; then
7206   withval="$with_shlib_version"
7207   test -z "$withval" && withval=auto
7208         case $withval in #(vi
7209         yes) #(vi
7210                 cf_cv_shlib_version=auto
7211                 ;;
7212         rel|abi|auto|no) #(vi
7213                 cf_cv_shlib_version=$withval
7214                 ;;
7215         *)
7216                 { { echo "$as_me:7216: error: option value must be one of: rel, abi, auto or no" >&5
7217 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
7218    { (exit 1); exit 1; }; }
7219                 ;;
7220         esac
7221
7222 else
7223   cf_cv_shlib_version=auto
7224 fi;
7225         echo "$as_me:7225: result: $cf_cv_shlib_version" >&5
7226 echo "${ECHO_T}$cf_cv_shlib_version" >&6
7227
7228         cf_cv_rm_so_locs=no
7229
7230         # Some less-capable ports of gcc support only -fpic
7231         CC_SHARED_OPTS=
7232         if test "$GCC" = yes
7233         then
7234                 echo "$as_me:7234: checking which $CC option to use" >&5
7235 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
7236                 cf_save_CFLAGS="$CFLAGS"
7237                 for CC_SHARED_OPTS in -fPIC -fpic ''
7238                 do
7239                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
7240                         cat >conftest.$ac_ext <<_ACEOF
7241 #line 7241 "configure"
7242 #include "confdefs.h"
7243 #include <stdio.h>
7244 int
7245 main ()
7246 {
7247 int x = 1
7248   ;
7249   return 0;
7250 }
7251 _ACEOF
7252 rm -f conftest.$ac_objext
7253 if { (eval echo "$as_me:7253: \"$ac_compile\"") >&5
7254   (eval $ac_compile) 2>&5
7255   ac_status=$?
7256   echo "$as_me:7256: \$? = $ac_status" >&5
7257   (exit $ac_status); } &&
7258          { ac_try='test -s conftest.$ac_objext'
7259   { (eval echo "$as_me:7259: \"$ac_try\"") >&5
7260   (eval $ac_try) 2>&5
7261   ac_status=$?
7262   echo "$as_me:7262: \$? = $ac_status" >&5
7263   (exit $ac_status); }; }; then
7264   break
7265 else
7266   echo "$as_me: failed program was:" >&5
7267 cat conftest.$ac_ext >&5
7268 fi
7269 rm -f conftest.$ac_objext conftest.$ac_ext
7270                 done
7271                 echo "$as_me:7271: result: $CC_SHARED_OPTS" >&5
7272 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
7273                 CFLAGS="$cf_save_CFLAGS"
7274         fi
7275
7276         cf_cv_shlib_version_infix=no
7277
7278         case $cf_cv_system_name in #(vi
7279         aix[56]*) #(vi
7280                 if test "$GCC" = yes; then
7281                         CC_SHARED_OPTS=
7282                         MK_SHARED_LIB='$(CC) -shared'
7283                 fi
7284                 ;;
7285         beos*) #(vi
7286                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
7287                 ;;
7288         cygwin*) #(vi
7289                 CC_SHARED_OPTS=
7290                 MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
7291                 cf_cv_shlib_version=cygdll
7292                 cf_cv_shlib_version_infix=cygdll
7293                 cat >mk_shared_lib.sh <<-CF_EOF
7294                 #!/bin/sh
7295                 SHARED_LIB=\$1
7296                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
7297                 shift
7298                 cat <<-EOF
7299                 Linking shared library
7300                 ** SHARED_LIB \$SHARED_LIB
7301                 ** IMPORT_LIB \$IMPORT_LIB
7302 EOF
7303                 exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
7304 CF_EOF
7305                 chmod +x mk_shared_lib.sh
7306                 ;;
7307         darwin*) #(vi
7308                 EXTRA_CFLAGS="-no-cpp-precomp"
7309                 CC_SHARED_OPTS="-dynamic"
7310                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
7311                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
7312                 cf_cv_shlib_version_infix=yes
7313                 echo "$as_me:7313: checking if ld -search_paths_first works" >&5
7314 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
7315 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
7316   echo $ECHO_N "(cached) $ECHO_C" >&6
7317 else
7318
7319                         cf_save_LDFLAGS=$LDFLAGS
7320                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7321                         cat >conftest.$ac_ext <<_ACEOF
7322 #line 7322 "configure"
7323 #include "confdefs.h"
7324
7325 int
7326 main ()
7327 {
7328 int i;
7329   ;
7330   return 0;
7331 }
7332 _ACEOF
7333 rm -f conftest.$ac_objext conftest$ac_exeext
7334 if { (eval echo "$as_me:7334: \"$ac_link\"") >&5
7335   (eval $ac_link) 2>&5
7336   ac_status=$?
7337   echo "$as_me:7337: \$? = $ac_status" >&5
7338   (exit $ac_status); } &&
7339          { ac_try='test -s conftest$ac_exeext'
7340   { (eval echo "$as_me:7340: \"$ac_try\"") >&5
7341   (eval $ac_try) 2>&5
7342   ac_status=$?
7343   echo "$as_me:7343: \$? = $ac_status" >&5
7344   (exit $ac_status); }; }; then
7345   cf_cv_ldflags_search_paths_first=yes
7346 else
7347   echo "$as_me: failed program was:" >&5
7348 cat conftest.$ac_ext >&5
7349 cf_cv_ldflags_search_paths_first=no
7350 fi
7351 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7352                                 LDFLAGS=$cf_save_LDFLAGS
7353 fi
7354 echo "$as_me:7354: result: $cf_cv_ldflags_search_paths_first" >&5
7355 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
7356                 if test $cf_cv_ldflags_search_paths_first = yes; then
7357                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
7358                 fi
7359                 ;;
7360         hpux*) #(vi
7361                 # (tested with gcc 2.7.2 -- I don't have c89)
7362                 if test "$GCC" = yes; then
7363                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
7364                 else
7365                         CC_SHARED_OPTS='+Z'
7366                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
7367                 fi
7368                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
7369                 # HP-UX shared libraries must be executable, and should be
7370                 # readonly to exploit a quirk in the memory manager.
7371                 INSTALL_LIB="-m 555"
7372                 ;;
7373         irix*) #(vi
7374                 if test "$cf_cv_enable_rpath" = yes ; then
7375                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7376                 fi
7377                 # tested with IRIX 5.2 and 'cc'.
7378                 if test "$GCC" != yes; then
7379                         CC_SHARED_OPTS='-KPIC'
7380                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
7381                 else
7382                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
7383                 fi
7384                 cf_cv_rm_so_locs=yes
7385                 ;;
7386         linux*|gnu*|k*bsd*-gnu) #(vi
7387                 if test "$DFT_LWR_MODEL" = "shared" ; then
7388                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7389                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7390                 fi
7391                 if test "$cf_cv_enable_rpath" = yes ; then
7392                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7393                 fi
7394
7395         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7396         if test "$cf_cv_shlib_version" = rel; then
7397                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7398         else
7399                 cf_cv_shared_soname='`basename $@`'
7400         fi
7401
7402                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7403                 ;;
7404         openbsd[2-9].*) #(vi
7405                 if test "$DFT_LWR_MODEL" = "shared" ; then
7406                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7407                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7408                 fi
7409                 if test "$cf_cv_enable_rpath" = yes ; then
7410                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7411                 fi
7412                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7413
7414         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7415         if test "$cf_cv_shlib_version" = rel; then
7416                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7417         else
7418                 cf_cv_shared_soname='`basename $@`'
7419         fi
7420
7421                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
7422                 ;;
7423         nto-qnx*|openbsd*|freebsd[12].*) #(vi
7424                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7425                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
7426                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7427                 ;;
7428         freebsd*) #(vi
7429                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
7430                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
7431                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
7432                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
7433                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7434                 fi
7435
7436         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7437         if test "$cf_cv_shlib_version" = rel; then
7438                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7439         else
7440                 cf_cv_shared_soname='`basename $@`'
7441         fi
7442
7443                 MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
7444                 ;;
7445         netbsd*) #(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="$LOCAL_LDFLAGS"
7450                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
7451                         if test "$cf_cv_shlib_version" = auto; then
7452                         if test -f /usr/libexec/ld.elf_so; then
7453                                 cf_cv_shlib_version=abi
7454                         else
7455                                 cf_cv_shlib_version=rel
7456                         fi
7457                         fi
7458
7459         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7460         if test "$cf_cv_shlib_version" = rel; then
7461                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7462         else
7463                 cf_cv_shared_soname='`basename $@`'
7464         fi
7465
7466                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
7467                 else
7468                         MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
7469                 fi
7470                 ;;
7471         osf*|mls+*) #(vi
7472                 # tested with OSF/1 V3.2 and 'cc'
7473                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
7474                 # link with shared libs).
7475                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
7476                 case $host_os in #(vi
7477                 osf4*)
7478                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
7479                         ;;
7480                 esac
7481                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
7482                 if test "$DFT_LWR_MODEL" = "shared" ; then
7483                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
7484                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7485                 fi
7486                 cf_cv_rm_so_locs=yes
7487                 ;;
7488         sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
7489                 # tested with osr5.0.5
7490                 if test "$GCC" != yes; then
7491                         CC_SHARED_OPTS='-belf -KPIC'
7492                 fi
7493                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
7494                 if test "$cf_cv_enable_rpath" = yes ; then
7495                         # only way is to set LD_RUN_PATH but no switch for it
7496                         RUN_PATH=$libdir
7497                 fi
7498                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7499                 LINK_PROGS='LD_RUN_PATH=${libdir}'
7500                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
7501                 ;;
7502         sunos4*) #(vi
7503                 # tested with SunOS 4.1.1 and gcc 2.7.0
7504                 if test "$GCC" != yes; then
7505                         CC_SHARED_OPTS='-KPIC'
7506                 fi
7507                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
7508                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7509                 ;;
7510         solaris2*) #(vi
7511                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
7512                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
7513                 if test "$DFT_LWR_MODEL" = "shared" ; then
7514                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
7515                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
7516                 fi
7517                 if test "$cf_cv_enable_rpath" = yes ; then
7518                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
7519                 fi
7520
7521         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
7522         if test "$cf_cv_shlib_version" = rel; then
7523                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
7524         else
7525                 cf_cv_shared_soname='`basename $@`'
7526         fi
7527
7528                 if test "$GCC" != yes; then
7529                         cf_save_CFLAGS="$CFLAGS"
7530                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
7531                         do
7532                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
7533                                 cat >conftest.$ac_ext <<_ACEOF
7534 #line 7534 "configure"
7535 #include "confdefs.h"
7536 #include <stdio.h>
7537 int
7538 main ()
7539 {
7540 printf("Hello\n");
7541   ;
7542   return 0;
7543 }
7544 _ACEOF
7545 rm -f conftest.$ac_objext
7546 if { (eval echo "$as_me:7546: \"$ac_compile\"") >&5
7547   (eval $ac_compile) 2>&5
7548   ac_status=$?
7549   echo "$as_me:7549: \$? = $ac_status" >&5
7550   (exit $ac_status); } &&
7551          { ac_try='test -s conftest.$ac_objext'
7552   { (eval echo "$as_me:7552: \"$ac_try\"") >&5
7553   (eval $ac_try) 2>&5
7554   ac_status=$?
7555   echo "$as_me:7555: \$? = $ac_status" >&5
7556   (exit $ac_status); }; }; then
7557   break
7558 else
7559   echo "$as_me: failed program was:" >&5
7560 cat conftest.$ac_ext >&5
7561 fi
7562 rm -f conftest.$ac_objext conftest.$ac_ext
7563                         done
7564                         CFLAGS="$cf_save_CFLAGS"
7565                         CC_SHARED_OPTS=$cf_shared_opts
7566                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
7567                 else
7568                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
7569                 fi
7570                 ;;
7571         sysv5uw7*|unix_sv*) #(vi
7572                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
7573                 if test "$GCC" != yes; then
7574                         CC_SHARED_OPTS='-KPIC'
7575                 fi
7576                 MK_SHARED_LIB='${LD} -d y -G -o $@'
7577                 ;;
7578         *)
7579                 CC_SHARED_OPTS='unknown'
7580                 MK_SHARED_LIB='echo unknown'
7581                 ;;
7582         esac
7583
7584         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
7585         case "$cf_cv_shlib_version" in #(vi
7586         rel|abi)
7587                 case "$MK_SHARED_LIB" in #(vi
7588                 *'-o $@') #(vi
7589                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
7590                         ;;
7591                 *)
7592                         { echo "$as_me:7592: WARNING: ignored --with-shlib-version" >&5
7593 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
7594                         ;;
7595                 esac
7596                 ;;
7597         esac
7598
7599         if test -n "$cf_ld_rpath_opt" ; then
7600                 MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
7601         fi
7602
7603 ###############################################################################
7604
7605         case $cf_cv_system_name in
7606         os2*)   PATH_SEPARATOR=';'  ;;
7607         *)      PATH_SEPARATOR=':'  ;;
7608         esac
7609
7610 ###   use option --enable-broken-linker to force on use of broken-linker support
7611 echo "$as_me:7611: checking if you want broken-linker support code" >&5
7612 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
7613
7614 # Check whether --enable-broken_linker or --disable-broken_linker was given.
7615 if test "${enable_broken_linker+set}" = set; then
7616   enableval="$enable_broken_linker"
7617   with_broken_linker=$enableval
7618 else
7619   with_broken_linker=${BROKEN_LINKER-no}
7620 fi;
7621 echo "$as_me:7621: result: $with_broken_linker" >&5
7622 echo "${ECHO_T}$with_broken_linker" >&6
7623
7624 BROKEN_LINKER=0
7625 if test "$with_broken_linker" = yes ; then
7626         cat >>confdefs.h <<\EOF
7627 #define BROKEN_LINKER 1
7628 EOF
7629
7630         BROKEN_LINKER=1
7631 elif test "$DFT_LWR_MODEL" = shared ; then
7632         case $cf_cv_system_name in #(vi
7633         cygwin*)
7634                 cat >>confdefs.h <<\EOF
7635 #define BROKEN_LINKER 1
7636 EOF
7637
7638                 BROKEN_LINKER=1
7639                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
7640
7641 echo "${as_me-configure}:7641: testing cygwin linker is broken anyway ..." 1>&5
7642
7643                 ;;
7644         esac
7645 fi
7646
7647 # Check to define _XOPEN_SOURCE "automatically"
7648
7649 cf_XOPEN_SOURCE=500
7650 cf_POSIX_C_SOURCE=199506L
7651 cf_xopen_source=
7652
7653 case $host_os in #(vi
7654 aix[456]*) #(vi
7655         cf_xopen_source="-D_ALL_SOURCE"
7656         ;;
7657 darwin[0-8].*) #(vi
7658         cf_xopen_source="-D_APPLE_C_SOURCE"
7659         ;;
7660 darwin*) #(vi
7661         cf_xopen_source="-D_DARWIN_C_SOURCE"
7662         ;;
7663 freebsd*|dragonfly*) #(vi
7664         # 5.x headers associate
7665         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
7666         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
7667         cf_POSIX_C_SOURCE=200112L
7668         cf_XOPEN_SOURCE=600
7669         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7670         ;;
7671 hpux11*) #(vi
7672         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
7673         ;;
7674 hpux*) #(vi
7675         cf_xopen_source="-D_HPUX_SOURCE"
7676         ;;
7677 irix[56].*) #(vi
7678         cf_xopen_source="-D_SGI_SOURCE"
7679         ;;
7680 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
7681
7682 echo "$as_me:7682: checking if we must define _GNU_SOURCE" >&5
7683 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
7684 if test "${cf_cv_gnu_source+set}" = set; then
7685   echo $ECHO_N "(cached) $ECHO_C" >&6
7686 else
7687
7688 cat >conftest.$ac_ext <<_ACEOF
7689 #line 7689 "configure"
7690 #include "confdefs.h"
7691 #include <sys/types.h>
7692 int
7693 main ()
7694 {
7695
7696 #ifndef _XOPEN_SOURCE
7697 make an error
7698 #endif
7699   ;
7700   return 0;
7701 }
7702 _ACEOF
7703 rm -f conftest.$ac_objext
7704 if { (eval echo "$as_me:7704: \"$ac_compile\"") >&5
7705   (eval $ac_compile) 2>&5
7706   ac_status=$?
7707   echo "$as_me:7707: \$? = $ac_status" >&5
7708   (exit $ac_status); } &&
7709          { ac_try='test -s conftest.$ac_objext'
7710   { (eval echo "$as_me:7710: \"$ac_try\"") >&5
7711   (eval $ac_try) 2>&5
7712   ac_status=$?
7713   echo "$as_me:7713: \$? = $ac_status" >&5
7714   (exit $ac_status); }; }; then
7715   cf_cv_gnu_source=no
7716 else
7717   echo "$as_me: failed program was:" >&5
7718 cat conftest.$ac_ext >&5
7719 cf_save="$CPPFLAGS"
7720          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7721          cat >conftest.$ac_ext <<_ACEOF
7722 #line 7722 "configure"
7723 #include "confdefs.h"
7724 #include <sys/types.h>
7725 int
7726 main ()
7727 {
7728
7729 #ifdef _XOPEN_SOURCE
7730 make an error
7731 #endif
7732   ;
7733   return 0;
7734 }
7735 _ACEOF
7736 rm -f conftest.$ac_objext
7737 if { (eval echo "$as_me:7737: \"$ac_compile\"") >&5
7738   (eval $ac_compile) 2>&5
7739   ac_status=$?
7740   echo "$as_me:7740: \$? = $ac_status" >&5
7741   (exit $ac_status); } &&
7742          { ac_try='test -s conftest.$ac_objext'
7743   { (eval echo "$as_me:7743: \"$ac_try\"") >&5
7744   (eval $ac_try) 2>&5
7745   ac_status=$?
7746   echo "$as_me:7746: \$? = $ac_status" >&5
7747   (exit $ac_status); }; }; then
7748   cf_cv_gnu_source=no
7749 else
7750   echo "$as_me: failed program was:" >&5
7751 cat conftest.$ac_ext >&5
7752 cf_cv_gnu_source=yes
7753 fi
7754 rm -f conftest.$ac_objext conftest.$ac_ext
7755         CPPFLAGS="$cf_save"
7756
7757 fi
7758 rm -f conftest.$ac_objext conftest.$ac_ext
7759
7760 fi
7761 echo "$as_me:7761: result: $cf_cv_gnu_source" >&5
7762 echo "${ECHO_T}$cf_cv_gnu_source" >&6
7763 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
7764
7765         ;;
7766 mirbsd*) #(vi
7767         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
7768         ;;
7769 netbsd*) #(vi
7770         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
7771         ;;
7772 openbsd*) #(vi
7773         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
7774         ;;
7775 osf[45]*) #(vi
7776         cf_xopen_source="-D_OSF_SOURCE"
7777         ;;
7778 nto-qnx*) #(vi
7779         cf_xopen_source="-D_QNX_SOURCE"
7780         ;;
7781 sco*) #(vi
7782         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
7783         ;;
7784 solaris2.1[0-9]) #(vi
7785         cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7786         ;;
7787 solaris2.[1-9]) #(vi
7788         cf_xopen_source="-D__EXTENSIONS__"
7789         ;;
7790 *)
7791         echo "$as_me:7791: checking if we should define _XOPEN_SOURCE" >&5
7792 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
7793 if test "${cf_cv_xopen_source+set}" = set; then
7794   echo $ECHO_N "(cached) $ECHO_C" >&6
7795 else
7796
7797         cat >conftest.$ac_ext <<_ACEOF
7798 #line 7798 "configure"
7799 #include "confdefs.h"
7800 #include <sys/types.h>
7801 int
7802 main ()
7803 {
7804
7805 #ifndef _XOPEN_SOURCE
7806 make an error
7807 #endif
7808   ;
7809   return 0;
7810 }
7811 _ACEOF
7812 rm -f conftest.$ac_objext
7813 if { (eval echo "$as_me:7813: \"$ac_compile\"") >&5
7814   (eval $ac_compile) 2>&5
7815   ac_status=$?
7816   echo "$as_me:7816: \$? = $ac_status" >&5
7817   (exit $ac_status); } &&
7818          { ac_try='test -s conftest.$ac_objext'
7819   { (eval echo "$as_me:7819: \"$ac_try\"") >&5
7820   (eval $ac_try) 2>&5
7821   ac_status=$?
7822   echo "$as_me:7822: \$? = $ac_status" >&5
7823   (exit $ac_status); }; }; then
7824   cf_cv_xopen_source=no
7825 else
7826   echo "$as_me: failed program was:" >&5
7827 cat conftest.$ac_ext >&5
7828 cf_save="$CPPFLAGS"
7829          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
7830          cat >conftest.$ac_ext <<_ACEOF
7831 #line 7831 "configure"
7832 #include "confdefs.h"
7833 #include <sys/types.h>
7834 int
7835 main ()
7836 {
7837
7838 #ifdef _XOPEN_SOURCE
7839 make an error
7840 #endif
7841   ;
7842   return 0;
7843 }
7844 _ACEOF
7845 rm -f conftest.$ac_objext
7846 if { (eval echo "$as_me:7846: \"$ac_compile\"") >&5
7847   (eval $ac_compile) 2>&5
7848   ac_status=$?
7849   echo "$as_me:7849: \$? = $ac_status" >&5
7850   (exit $ac_status); } &&
7851          { ac_try='test -s conftest.$ac_objext'
7852   { (eval echo "$as_me:7852: \"$ac_try\"") >&5
7853   (eval $ac_try) 2>&5
7854   ac_status=$?
7855   echo "$as_me:7855: \$? = $ac_status" >&5
7856   (exit $ac_status); }; }; then
7857   cf_cv_xopen_source=no
7858 else
7859   echo "$as_me: failed program was:" >&5
7860 cat conftest.$ac_ext >&5
7861 cf_cv_xopen_source=$cf_XOPEN_SOURCE
7862 fi
7863 rm -f conftest.$ac_objext conftest.$ac_ext
7864         CPPFLAGS="$cf_save"
7865
7866 fi
7867 rm -f conftest.$ac_objext conftest.$ac_ext
7868
7869 fi
7870 echo "$as_me:7870: result: $cf_cv_xopen_source" >&5
7871 echo "${ECHO_T}$cf_cv_xopen_source" >&6
7872         if test "$cf_cv_xopen_source" != no ; then
7873
7874 CFLAGS=`echo "$CFLAGS" | \
7875         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
7876                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
7877
7878 CPPFLAGS=`echo "$CPPFLAGS" | \
7879         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
7880                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
7881
7882                 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
7883
7884 cf_fix_cppflags=no
7885 cf_new_cflags=
7886 cf_new_cppflags=
7887 cf_new_extra_cppflags=
7888
7889 for cf_add_cflags in $cf_temp_xopen_source
7890 do
7891 case $cf_fix_cppflags in
7892 no)
7893         case $cf_add_cflags in #(vi
7894         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
7895                 case $cf_add_cflags in
7896                 -D*)
7897                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7898
7899                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7900                                 && test -z "${cf_tst_cflags}" \
7901                                 && cf_fix_cppflags=yes
7902
7903                         if test $cf_fix_cppflags = yes ; then
7904                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7905                                 continue
7906                         elif test "${cf_tst_cflags}" = "\"'" ; then
7907                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7908                                 continue
7909                         fi
7910                         ;;
7911                 esac
7912                 case "$CPPFLAGS" in
7913                 *$cf_add_cflags) #(vi
7914                         ;;
7915                 *) #(vi
7916                         case $cf_add_cflags in #(vi
7917                         -D*)
7918                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7919
7920 CPPFLAGS=`echo "$CPPFLAGS" | \
7921         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7922                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7923
7924                                 ;;
7925                         esac
7926                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
7927                         ;;
7928                 esac
7929                 ;;
7930         *)
7931                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
7932                 ;;
7933         esac
7934         ;;
7935 yes)
7936         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7937
7938         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7939
7940         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7941                 && test -z "${cf_tst_cflags}" \
7942                 && cf_fix_cppflags=no
7943         ;;
7944 esac
7945 done
7946
7947 if test -n "$cf_new_cflags" ; then
7948
7949         CFLAGS="$CFLAGS $cf_new_cflags"
7950 fi
7951
7952 if test -n "$cf_new_cppflags" ; then
7953
7954         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
7955 fi
7956
7957 if test -n "$cf_new_extra_cppflags" ; then
7958
7959         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
7960 fi
7961
7962         fi
7963
7964 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
7965
7966 cf_save_CFLAGS="$CFLAGS"
7967 cf_save_CPPFLAGS="$CPPFLAGS"
7968
7969 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
7970         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7971                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7972
7973 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
7974         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
7975                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
7976
7977 echo "$as_me:7977: checking if we should define _POSIX_C_SOURCE" >&5
7978 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
7979 if test "${cf_cv_posix_c_source+set}" = set; then
7980   echo $ECHO_N "(cached) $ECHO_C" >&6
7981 else
7982
7983 echo "${as_me-configure}:7983: testing if the symbol is already defined go no further ..." 1>&5
7984
7985         cat >conftest.$ac_ext <<_ACEOF
7986 #line 7986 "configure"
7987 #include "confdefs.h"
7988 #include <sys/types.h>
7989 int
7990 main ()
7991 {
7992
7993 #ifndef _POSIX_C_SOURCE
7994 make an error
7995 #endif
7996   ;
7997   return 0;
7998 }
7999 _ACEOF
8000 rm -f conftest.$ac_objext
8001 if { (eval echo "$as_me:8001: \"$ac_compile\"") >&5
8002   (eval $ac_compile) 2>&5
8003   ac_status=$?
8004   echo "$as_me:8004: \$? = $ac_status" >&5
8005   (exit $ac_status); } &&
8006          { ac_try='test -s conftest.$ac_objext'
8007   { (eval echo "$as_me:8007: \"$ac_try\"") >&5
8008   (eval $ac_try) 2>&5
8009   ac_status=$?
8010   echo "$as_me:8010: \$? = $ac_status" >&5
8011   (exit $ac_status); }; }; then
8012   cf_cv_posix_c_source=no
8013 else
8014   echo "$as_me: failed program was:" >&5
8015 cat conftest.$ac_ext >&5
8016 cf_want_posix_source=no
8017          case .$cf_POSIX_C_SOURCE in #(vi
8018          .[12]??*) #(vi
8019                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8020                 ;;
8021          .2) #(vi
8022                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
8023                 cf_want_posix_source=yes
8024                 ;;
8025          .*)
8026                 cf_want_posix_source=yes
8027                 ;;
8028          esac
8029          if test "$cf_want_posix_source" = yes ; then
8030                 cat >conftest.$ac_ext <<_ACEOF
8031 #line 8031 "configure"
8032 #include "confdefs.h"
8033 #include <sys/types.h>
8034 int
8035 main ()
8036 {
8037
8038 #ifdef _POSIX_SOURCE
8039 make an error
8040 #endif
8041   ;
8042   return 0;
8043 }
8044 _ACEOF
8045 rm -f conftest.$ac_objext
8046 if { (eval echo "$as_me:8046: \"$ac_compile\"") >&5
8047   (eval $ac_compile) 2>&5
8048   ac_status=$?
8049   echo "$as_me:8049: \$? = $ac_status" >&5
8050   (exit $ac_status); } &&
8051          { ac_try='test -s conftest.$ac_objext'
8052   { (eval echo "$as_me:8052: \"$ac_try\"") >&5
8053   (eval $ac_try) 2>&5
8054   ac_status=$?
8055   echo "$as_me:8055: \$? = $ac_status" >&5
8056   (exit $ac_status); }; }; then
8057   :
8058 else
8059   echo "$as_me: failed program was:" >&5
8060 cat conftest.$ac_ext >&5
8061 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
8062 fi
8063 rm -f conftest.$ac_objext conftest.$ac_ext
8064          fi
8065
8066 echo "${as_me-configure}:8066: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
8067
8068          CFLAGS="$cf_trim_CFLAGS"
8069          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
8070
8071 echo "${as_me-configure}:8071: testing if the second compile does not leave our definition intact error ..." 1>&5
8072
8073          cat >conftest.$ac_ext <<_ACEOF
8074 #line 8074 "configure"
8075 #include "confdefs.h"
8076 #include <sys/types.h>
8077 int
8078 main ()
8079 {
8080
8081 #ifndef _POSIX_C_SOURCE
8082 make an error
8083 #endif
8084   ;
8085   return 0;
8086 }
8087 _ACEOF
8088 rm -f conftest.$ac_objext
8089 if { (eval echo "$as_me:8089: \"$ac_compile\"") >&5
8090   (eval $ac_compile) 2>&5
8091   ac_status=$?
8092   echo "$as_me:8092: \$? = $ac_status" >&5
8093   (exit $ac_status); } &&
8094          { ac_try='test -s conftest.$ac_objext'
8095   { (eval echo "$as_me:8095: \"$ac_try\"") >&5
8096   (eval $ac_try) 2>&5
8097   ac_status=$?
8098   echo "$as_me:8098: \$? = $ac_status" >&5
8099   (exit $ac_status); }; }; then
8100   :
8101 else
8102   echo "$as_me: failed program was:" >&5
8103 cat conftest.$ac_ext >&5
8104 cf_cv_posix_c_source=no
8105 fi
8106 rm -f conftest.$ac_objext conftest.$ac_ext
8107          CFLAGS="$cf_save_CFLAGS"
8108          CPPFLAGS="$cf_save_CPPFLAGS"
8109
8110 fi
8111 rm -f conftest.$ac_objext conftest.$ac_ext
8112
8113 fi
8114 echo "$as_me:8114: result: $cf_cv_posix_c_source" >&5
8115 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
8116
8117 if test "$cf_cv_posix_c_source" != no ; then
8118         CFLAGS="$cf_trim_CFLAGS"
8119         CPPFLAGS="$cf_trim_CPPFLAGS"
8120
8121 cf_fix_cppflags=no
8122 cf_new_cflags=
8123 cf_new_cppflags=
8124 cf_new_extra_cppflags=
8125
8126 for cf_add_cflags in $cf_cv_posix_c_source
8127 do
8128 case $cf_fix_cppflags in
8129 no)
8130         case $cf_add_cflags in #(vi
8131         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8132                 case $cf_add_cflags in
8133                 -D*)
8134                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8135
8136                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8137                                 && test -z "${cf_tst_cflags}" \
8138                                 && cf_fix_cppflags=yes
8139
8140                         if test $cf_fix_cppflags = yes ; then
8141                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8142                                 continue
8143                         elif test "${cf_tst_cflags}" = "\"'" ; then
8144                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8145                                 continue
8146                         fi
8147                         ;;
8148                 esac
8149                 case "$CPPFLAGS" in
8150                 *$cf_add_cflags) #(vi
8151                         ;;
8152                 *) #(vi
8153                         case $cf_add_cflags in #(vi
8154                         -D*)
8155                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8156
8157 CPPFLAGS=`echo "$CPPFLAGS" | \
8158         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8159                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8160
8161                                 ;;
8162                         esac
8163                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8164                         ;;
8165                 esac
8166                 ;;
8167         *)
8168                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8169                 ;;
8170         esac
8171         ;;
8172 yes)
8173         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8174
8175         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8176
8177         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8178                 && test -z "${cf_tst_cflags}" \
8179                 && cf_fix_cppflags=no
8180         ;;
8181 esac
8182 done
8183
8184 if test -n "$cf_new_cflags" ; then
8185
8186         CFLAGS="$CFLAGS $cf_new_cflags"
8187 fi
8188
8189 if test -n "$cf_new_cppflags" ; then
8190
8191         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8192 fi
8193
8194 if test -n "$cf_new_extra_cppflags" ; then
8195
8196         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8197 fi
8198
8199 fi
8200
8201         ;;
8202 esac
8203
8204 if test -n "$cf_xopen_source" ; then
8205
8206 cf_fix_cppflags=no
8207 cf_new_cflags=
8208 cf_new_cppflags=
8209 cf_new_extra_cppflags=
8210
8211 for cf_add_cflags in $cf_xopen_source
8212 do
8213 case $cf_fix_cppflags in
8214 no)
8215         case $cf_add_cflags in #(vi
8216         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8217                 case $cf_add_cflags in
8218                 -D*)
8219                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8220
8221                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8222                                 && test -z "${cf_tst_cflags}" \
8223                                 && cf_fix_cppflags=yes
8224
8225                         if test $cf_fix_cppflags = yes ; then
8226                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8227                                 continue
8228                         elif test "${cf_tst_cflags}" = "\"'" ; then
8229                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8230                                 continue
8231                         fi
8232                         ;;
8233                 esac
8234                 case "$CPPFLAGS" in
8235                 *$cf_add_cflags) #(vi
8236                         ;;
8237                 *) #(vi
8238                         case $cf_add_cflags in #(vi
8239                         -D*)
8240                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8241
8242 CPPFLAGS=`echo "$CPPFLAGS" | \
8243         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8244                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8245
8246                                 ;;
8247                         esac
8248                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8249                         ;;
8250                 esac
8251                 ;;
8252         *)
8253                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8254                 ;;
8255         esac
8256         ;;
8257 yes)
8258         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8259
8260         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8261
8262         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8263                 && test -z "${cf_tst_cflags}" \
8264                 && cf_fix_cppflags=no
8265         ;;
8266 esac
8267 done
8268
8269 if test -n "$cf_new_cflags" ; then
8270
8271         CFLAGS="$CFLAGS $cf_new_cflags"
8272 fi
8273
8274 if test -n "$cf_new_cppflags" ; then
8275
8276         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8277 fi
8278
8279 if test -n "$cf_new_extra_cppflags" ; then
8280
8281         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8282 fi
8283
8284 fi
8285
8286 # Check whether --enable-largefile or --disable-largefile was given.
8287 if test "${enable_largefile+set}" = set; then
8288   enableval="$enable_largefile"
8289
8290 fi;
8291 if test "$enable_largefile" != no; then
8292
8293   echo "$as_me:8293: checking for special C compiler options needed for large files" >&5
8294 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
8295 if test "${ac_cv_sys_largefile_CC+set}" = set; then
8296   echo $ECHO_N "(cached) $ECHO_C" >&6
8297 else
8298   ac_cv_sys_largefile_CC=no
8299      if test "$GCC" != yes; then
8300        ac_save_CC=$CC
8301        while :; do
8302          # IRIX 6.2 and later do not support large files by default,
8303          # so use the C compiler's -n32 option if that helps.
8304          cat >conftest.$ac_ext <<_ACEOF
8305 #line 8305 "configure"
8306 #include "confdefs.h"
8307 #include <sys/types.h>
8308  /* Check that off_t can represent 2**63 - 1 correctly.
8309     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8310     since some C++ compilers masquerading as C compilers
8311     incorrectly reject 9223372036854775807.  */
8312 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8313   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8314                        && LARGE_OFF_T % 2147483647 == 1)
8315                       ? 1 : -1];
8316 int
8317 main ()
8318 {
8319
8320   ;
8321   return 0;
8322 }
8323 _ACEOF
8324          rm -f conftest.$ac_objext
8325 if { (eval echo "$as_me:8325: \"$ac_compile\"") >&5
8326   (eval $ac_compile) 2>&5
8327   ac_status=$?
8328   echo "$as_me:8328: \$? = $ac_status" >&5
8329   (exit $ac_status); } &&
8330          { ac_try='test -s conftest.$ac_objext'
8331   { (eval echo "$as_me:8331: \"$ac_try\"") >&5
8332   (eval $ac_try) 2>&5
8333   ac_status=$?
8334   echo "$as_me:8334: \$? = $ac_status" >&5
8335   (exit $ac_status); }; }; then
8336   break
8337 else
8338   echo "$as_me: failed program was:" >&5
8339 cat conftest.$ac_ext >&5
8340 fi
8341 rm -f conftest.$ac_objext
8342          CC="$CC -n32"
8343          rm -f conftest.$ac_objext
8344 if { (eval echo "$as_me:8344: \"$ac_compile\"") >&5
8345   (eval $ac_compile) 2>&5
8346   ac_status=$?
8347   echo "$as_me:8347: \$? = $ac_status" >&5
8348   (exit $ac_status); } &&
8349          { ac_try='test -s conftest.$ac_objext'
8350   { (eval echo "$as_me:8350: \"$ac_try\"") >&5
8351   (eval $ac_try) 2>&5
8352   ac_status=$?
8353   echo "$as_me:8353: \$? = $ac_status" >&5
8354   (exit $ac_status); }; }; then
8355   ac_cv_sys_largefile_CC=' -n32'; break
8356 else
8357   echo "$as_me: failed program was:" >&5
8358 cat conftest.$ac_ext >&5
8359 fi
8360 rm -f conftest.$ac_objext
8361          break
8362        done
8363        CC=$ac_save_CC
8364        rm -f conftest.$ac_ext
8365     fi
8366 fi
8367 echo "$as_me:8367: result: $ac_cv_sys_largefile_CC" >&5
8368 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
8369   if test "$ac_cv_sys_largefile_CC" != no; then
8370     CC=$CC$ac_cv_sys_largefile_CC
8371   fi
8372
8373   echo "$as_me:8373: checking for _FILE_OFFSET_BITS value needed for large files" >&5
8374 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
8375 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
8376   echo $ECHO_N "(cached) $ECHO_C" >&6
8377 else
8378   while :; do
8379   ac_cv_sys_file_offset_bits=no
8380   cat >conftest.$ac_ext <<_ACEOF
8381 #line 8381 "configure"
8382 #include "confdefs.h"
8383 #include <sys/types.h>
8384  /* Check that off_t can represent 2**63 - 1 correctly.
8385     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8386     since some C++ compilers masquerading as C compilers
8387     incorrectly reject 9223372036854775807.  */
8388 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8389   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8390                        && LARGE_OFF_T % 2147483647 == 1)
8391                       ? 1 : -1];
8392 int
8393 main ()
8394 {
8395
8396   ;
8397   return 0;
8398 }
8399 _ACEOF
8400 rm -f conftest.$ac_objext
8401 if { (eval echo "$as_me:8401: \"$ac_compile\"") >&5
8402   (eval $ac_compile) 2>&5
8403   ac_status=$?
8404   echo "$as_me:8404: \$? = $ac_status" >&5
8405   (exit $ac_status); } &&
8406          { ac_try='test -s conftest.$ac_objext'
8407   { (eval echo "$as_me:8407: \"$ac_try\"") >&5
8408   (eval $ac_try) 2>&5
8409   ac_status=$?
8410   echo "$as_me:8410: \$? = $ac_status" >&5
8411   (exit $ac_status); }; }; then
8412   break
8413 else
8414   echo "$as_me: failed program was:" >&5
8415 cat conftest.$ac_ext >&5
8416 fi
8417 rm -f conftest.$ac_objext conftest.$ac_ext
8418   cat >conftest.$ac_ext <<_ACEOF
8419 #line 8419 "configure"
8420 #include "confdefs.h"
8421 #define _FILE_OFFSET_BITS 64
8422 #include <sys/types.h>
8423  /* Check that off_t can represent 2**63 - 1 correctly.
8424     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8425     since some C++ compilers masquerading as C compilers
8426     incorrectly reject 9223372036854775807.  */
8427 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8428   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8429                        && LARGE_OFF_T % 2147483647 == 1)
8430                       ? 1 : -1];
8431 int
8432 main ()
8433 {
8434
8435   ;
8436   return 0;
8437 }
8438 _ACEOF
8439 rm -f conftest.$ac_objext
8440 if { (eval echo "$as_me:8440: \"$ac_compile\"") >&5
8441   (eval $ac_compile) 2>&5
8442   ac_status=$?
8443   echo "$as_me:8443: \$? = $ac_status" >&5
8444   (exit $ac_status); } &&
8445          { ac_try='test -s conftest.$ac_objext'
8446   { (eval echo "$as_me:8446: \"$ac_try\"") >&5
8447   (eval $ac_try) 2>&5
8448   ac_status=$?
8449   echo "$as_me:8449: \$? = $ac_status" >&5
8450   (exit $ac_status); }; }; then
8451   ac_cv_sys_file_offset_bits=64; break
8452 else
8453   echo "$as_me: failed program was:" >&5
8454 cat conftest.$ac_ext >&5
8455 fi
8456 rm -f conftest.$ac_objext conftest.$ac_ext
8457   break
8458 done
8459 fi
8460 echo "$as_me:8460: result: $ac_cv_sys_file_offset_bits" >&5
8461 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
8462 if test "$ac_cv_sys_file_offset_bits" != no; then
8463
8464 cat >>confdefs.h <<EOF
8465 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
8466 EOF
8467
8468 fi
8469 rm -f conftest*
8470   echo "$as_me:8470: checking for _LARGE_FILES value needed for large files" >&5
8471 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
8472 if test "${ac_cv_sys_large_files+set}" = set; then
8473   echo $ECHO_N "(cached) $ECHO_C" >&6
8474 else
8475   while :; do
8476   ac_cv_sys_large_files=no
8477   cat >conftest.$ac_ext <<_ACEOF
8478 #line 8478 "configure"
8479 #include "confdefs.h"
8480 #include <sys/types.h>
8481  /* Check that off_t can represent 2**63 - 1 correctly.
8482     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8483     since some C++ compilers masquerading as C compilers
8484     incorrectly reject 9223372036854775807.  */
8485 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8486   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8487                        && LARGE_OFF_T % 2147483647 == 1)
8488                       ? 1 : -1];
8489 int
8490 main ()
8491 {
8492
8493   ;
8494   return 0;
8495 }
8496 _ACEOF
8497 rm -f conftest.$ac_objext
8498 if { (eval echo "$as_me:8498: \"$ac_compile\"") >&5
8499   (eval $ac_compile) 2>&5
8500   ac_status=$?
8501   echo "$as_me:8501: \$? = $ac_status" >&5
8502   (exit $ac_status); } &&
8503          { ac_try='test -s conftest.$ac_objext'
8504   { (eval echo "$as_me:8504: \"$ac_try\"") >&5
8505   (eval $ac_try) 2>&5
8506   ac_status=$?
8507   echo "$as_me:8507: \$? = $ac_status" >&5
8508   (exit $ac_status); }; }; then
8509   break
8510 else
8511   echo "$as_me: failed program was:" >&5
8512 cat conftest.$ac_ext >&5
8513 fi
8514 rm -f conftest.$ac_objext conftest.$ac_ext
8515   cat >conftest.$ac_ext <<_ACEOF
8516 #line 8516 "configure"
8517 #include "confdefs.h"
8518 #define _LARGE_FILES 1
8519 #include <sys/types.h>
8520  /* Check that off_t can represent 2**63 - 1 correctly.
8521     We can't simply define LARGE_OFF_T to be 9223372036854775807,
8522     since some C++ compilers masquerading as C compilers
8523     incorrectly reject 9223372036854775807.  */
8524 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
8525   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
8526                        && LARGE_OFF_T % 2147483647 == 1)
8527                       ? 1 : -1];
8528 int
8529 main ()
8530 {
8531
8532   ;
8533   return 0;
8534 }
8535 _ACEOF
8536 rm -f conftest.$ac_objext
8537 if { (eval echo "$as_me:8537: \"$ac_compile\"") >&5
8538   (eval $ac_compile) 2>&5
8539   ac_status=$?
8540   echo "$as_me:8540: \$? = $ac_status" >&5
8541   (exit $ac_status); } &&
8542          { ac_try='test -s conftest.$ac_objext'
8543   { (eval echo "$as_me:8543: \"$ac_try\"") >&5
8544   (eval $ac_try) 2>&5
8545   ac_status=$?
8546   echo "$as_me:8546: \$? = $ac_status" >&5
8547   (exit $ac_status); }; }; then
8548   ac_cv_sys_large_files=1; break
8549 else
8550   echo "$as_me: failed program was:" >&5
8551 cat conftest.$ac_ext >&5
8552 fi
8553 rm -f conftest.$ac_objext conftest.$ac_ext
8554   break
8555 done
8556 fi
8557 echo "$as_me:8557: result: $ac_cv_sys_large_files" >&5
8558 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
8559 if test "$ac_cv_sys_large_files" != no; then
8560
8561 cat >>confdefs.h <<EOF
8562 #define _LARGE_FILES $ac_cv_sys_large_files
8563 EOF
8564
8565 fi
8566 rm -f conftest*
8567 fi
8568
8569     if test "$enable_largefile" != no ; then
8570         echo "$as_me:8570: checking for _LARGEFILE_SOURCE value needed for large files" >&5
8571 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
8572 if test "${ac_cv_sys_largefile_source+set}" = set; then
8573   echo $ECHO_N "(cached) $ECHO_C" >&6
8574 else
8575   while :; do
8576   ac_cv_sys_largefile_source=no
8577   cat >conftest.$ac_ext <<_ACEOF
8578 #line 8578 "configure"
8579 #include "confdefs.h"
8580 #include <stdio.h>
8581 int
8582 main ()
8583 {
8584 return !fseeko;
8585   ;
8586   return 0;
8587 }
8588 _ACEOF
8589 rm -f conftest.$ac_objext
8590 if { (eval echo "$as_me:8590: \"$ac_compile\"") >&5
8591   (eval $ac_compile) 2>&5
8592   ac_status=$?
8593   echo "$as_me:8593: \$? = $ac_status" >&5
8594   (exit $ac_status); } &&
8595          { ac_try='test -s conftest.$ac_objext'
8596   { (eval echo "$as_me:8596: \"$ac_try\"") >&5
8597   (eval $ac_try) 2>&5
8598   ac_status=$?
8599   echo "$as_me:8599: \$? = $ac_status" >&5
8600   (exit $ac_status); }; }; then
8601   break
8602 else
8603   echo "$as_me: failed program was:" >&5
8604 cat conftest.$ac_ext >&5
8605 fi
8606 rm -f conftest.$ac_objext conftest.$ac_ext
8607   cat >conftest.$ac_ext <<_ACEOF
8608 #line 8608 "configure"
8609 #include "confdefs.h"
8610 #define _LARGEFILE_SOURCE 1
8611 #include <stdio.h>
8612 int
8613 main ()
8614 {
8615 return !fseeko;
8616   ;
8617   return 0;
8618 }
8619 _ACEOF
8620 rm -f conftest.$ac_objext
8621 if { (eval echo "$as_me:8621: \"$ac_compile\"") >&5
8622   (eval $ac_compile) 2>&5
8623   ac_status=$?
8624   echo "$as_me:8624: \$? = $ac_status" >&5
8625   (exit $ac_status); } &&
8626          { ac_try='test -s conftest.$ac_objext'
8627   { (eval echo "$as_me:8627: \"$ac_try\"") >&5
8628   (eval $ac_try) 2>&5
8629   ac_status=$?
8630   echo "$as_me:8630: \$? = $ac_status" >&5
8631   (exit $ac_status); }; }; then
8632   ac_cv_sys_largefile_source=1; break
8633 else
8634   echo "$as_me: failed program was:" >&5
8635 cat conftest.$ac_ext >&5
8636 fi
8637 rm -f conftest.$ac_objext conftest.$ac_ext
8638   break
8639 done
8640 fi
8641 echo "$as_me:8641: result: $ac_cv_sys_largefile_source" >&5
8642 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
8643 if test "$ac_cv_sys_largefile_source" != no; then
8644
8645 cat >>confdefs.h <<EOF
8646 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
8647 EOF
8648
8649 fi
8650 rm -f conftest*
8651
8652 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
8653 # in glibc 2.1.3, but that breaks too many other things.
8654 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
8655 echo "$as_me:8655: checking for fseeko" >&5
8656 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
8657 if test "${ac_cv_func_fseeko+set}" = set; then
8658   echo $ECHO_N "(cached) $ECHO_C" >&6
8659 else
8660   cat >conftest.$ac_ext <<_ACEOF
8661 #line 8661 "configure"
8662 #include "confdefs.h"
8663 #include <stdio.h>
8664 int
8665 main ()
8666 {
8667 return fseeko && fseeko (stdin, 0, 0);
8668   ;
8669   return 0;
8670 }
8671 _ACEOF
8672 rm -f conftest.$ac_objext conftest$ac_exeext
8673 if { (eval echo "$as_me:8673: \"$ac_link\"") >&5
8674   (eval $ac_link) 2>&5
8675   ac_status=$?
8676   echo "$as_me:8676: \$? = $ac_status" >&5
8677   (exit $ac_status); } &&
8678          { ac_try='test -s conftest$ac_exeext'
8679   { (eval echo "$as_me:8679: \"$ac_try\"") >&5
8680   (eval $ac_try) 2>&5
8681   ac_status=$?
8682   echo "$as_me:8682: \$? = $ac_status" >&5
8683   (exit $ac_status); }; }; then
8684   ac_cv_func_fseeko=yes
8685 else
8686   echo "$as_me: failed program was:" >&5
8687 cat conftest.$ac_ext >&5
8688 ac_cv_func_fseeko=no
8689 fi
8690 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8691 fi
8692 echo "$as_me:8692: result: $ac_cv_func_fseeko" >&5
8693 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
8694 if test $ac_cv_func_fseeko = yes; then
8695
8696 cat >>confdefs.h <<\EOF
8697 #define HAVE_FSEEKO 1
8698 EOF
8699
8700 fi
8701
8702         # Normally we would collect these definitions in the config.h,
8703         # but (like _XOPEN_SOURCE), some environments rely on having these
8704         # defined before any of the system headers are included.  Another
8705         # case comes up with C++, e.g., on AIX the compiler compiles the
8706         # header files by themselves before looking at the body files it is
8707         # told to compile.  For ncurses, those header files do not include
8708         # the config.h
8709         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
8710         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
8711         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
8712
8713         echo "$as_me:8713: checking whether to use struct dirent64" >&5
8714 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
8715 if test "${cf_cv_struct_dirent64+set}" = set; then
8716   echo $ECHO_N "(cached) $ECHO_C" >&6
8717 else
8718
8719                 cat >conftest.$ac_ext <<_ACEOF
8720 #line 8720 "configure"
8721 #include "confdefs.h"
8722
8723 #include <sys/types.h>
8724 #include <dirent.h>
8725
8726 int
8727 main ()
8728 {
8729
8730                 /* if transitional largefile support is setup, this is true */
8731                 extern struct dirent64 * readdir(DIR *);
8732                 struct dirent64 *x = readdir((DIR *)0);
8733                 struct dirent *y = readdir((DIR *)0);
8734                 int z = x - y;
8735
8736   ;
8737   return 0;
8738 }
8739 _ACEOF
8740 rm -f conftest.$ac_objext
8741 if { (eval echo "$as_me:8741: \"$ac_compile\"") >&5
8742   (eval $ac_compile) 2>&5
8743   ac_status=$?
8744   echo "$as_me:8744: \$? = $ac_status" >&5
8745   (exit $ac_status); } &&
8746          { ac_try='test -s conftest.$ac_objext'
8747   { (eval echo "$as_me:8747: \"$ac_try\"") >&5
8748   (eval $ac_try) 2>&5
8749   ac_status=$?
8750   echo "$as_me:8750: \$? = $ac_status" >&5
8751   (exit $ac_status); }; }; then
8752   cf_cv_struct_dirent64=yes
8753 else
8754   echo "$as_me: failed program was:" >&5
8755 cat conftest.$ac_ext >&5
8756 cf_cv_struct_dirent64=no
8757 fi
8758 rm -f conftest.$ac_objext conftest.$ac_ext
8759
8760 fi
8761 echo "$as_me:8761: result: $cf_cv_struct_dirent64" >&5
8762 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
8763         test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
8764 #define HAVE_STRUCT_DIRENT64 1
8765 EOF
8766
8767     fi
8768
8769 ### Enable compiling-in rcs id's
8770 echo "$as_me:8770: checking if RCS identifiers should be compiled-in" >&5
8771 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
8772
8773 # Check whether --with-rcs-ids or --without-rcs-ids was given.
8774 if test "${with_rcs_ids+set}" = set; then
8775   withval="$with_rcs_ids"
8776   with_rcs_ids=$withval
8777 else
8778   with_rcs_ids=no
8779 fi;
8780 echo "$as_me:8780: result: $with_rcs_ids" >&5
8781 echo "${ECHO_T}$with_rcs_ids" >&6
8782 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF
8783 #define USE_RCS_IDS 1
8784 EOF
8785
8786 ###############################################################################
8787
8788 ### Note that some functions (such as const) are normally disabled anyway.
8789 echo "$as_me:8789: checking if you want to build with function extensions" >&5
8790 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
8791
8792 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
8793 if test "${enable_ext_funcs+set}" = set; then
8794   enableval="$enable_ext_funcs"
8795   with_ext_funcs=$enableval
8796 else
8797   with_ext_funcs=yes
8798 fi;
8799 echo "$as_me:8799: result: $with_ext_funcs" >&5
8800 echo "${ECHO_T}$with_ext_funcs" >&6
8801 if test "$with_ext_funcs" = yes ; then
8802         NCURSES_EXT_FUNCS=1
8803         cat >>confdefs.h <<\EOF
8804 #define HAVE_USE_DEFAULT_COLORS 1
8805 EOF
8806
8807         cat >>confdefs.h <<\EOF
8808 #define NCURSES_EXT_FUNCS 1
8809 EOF
8810
8811 else
8812         NCURSES_EXT_FUNCS=0
8813 fi
8814
8815 ###   use option --enable-const to turn on use of const beyond that in XSI.
8816 echo "$as_me:8816: checking for extended use of const keyword" >&5
8817 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
8818
8819 # Check whether --enable-const or --disable-const was given.
8820 if test "${enable_const+set}" = set; then
8821   enableval="$enable_const"
8822   with_ext_const=$enableval
8823 else
8824   with_ext_const=no
8825 fi;
8826 echo "$as_me:8826: result: $with_ext_const" >&5
8827 echo "${ECHO_T}$with_ext_const" >&6
8828 NCURSES_CONST='/*nothing*/'
8829 if test "$with_ext_const" = yes ; then
8830         NCURSES_CONST=const
8831 fi
8832
8833 ###############################################################################
8834 # These options are relatively safe to experiment with.
8835
8836 echo "$as_me:8836: checking if you want all development code" >&5
8837 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
8838
8839 # Check whether --with-develop or --without-develop was given.
8840 if test "${with_develop+set}" = set; then
8841   withval="$with_develop"
8842   with_develop=$withval
8843 else
8844   with_develop=no
8845 fi;
8846 echo "$as_me:8846: result: $with_develop" >&5
8847 echo "${ECHO_T}$with_develop" >&6
8848
8849 ###############################################################################
8850 # These are just experimental, probably should not be in a package:
8851
8852 # This is still experimental (20080329), but should ultimately be moved to
8853 # the script-block --with-normal, etc.
8854
8855 echo "$as_me:8855: checking if you want to link with the pthread library" >&5
8856 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
8857
8858 # Check whether --with-pthread or --without-pthread was given.
8859 if test "${with_pthread+set}" = set; then
8860   withval="$with_pthread"
8861   with_pthread=$withval
8862 else
8863   with_pthread=no
8864 fi;
8865 echo "$as_me:8865: result: $with_pthread" >&5
8866 echo "${ECHO_T}$with_pthread" >&6
8867
8868 if test "$with_pthread" != no ; then
8869     echo "$as_me:8869: checking for pthread.h" >&5
8870 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
8871 if test "${ac_cv_header_pthread_h+set}" = set; then
8872   echo $ECHO_N "(cached) $ECHO_C" >&6
8873 else
8874   cat >conftest.$ac_ext <<_ACEOF
8875 #line 8875 "configure"
8876 #include "confdefs.h"
8877 #include <pthread.h>
8878 _ACEOF
8879 if { (eval echo "$as_me:8879: \"$ac_cpp conftest.$ac_ext\"") >&5
8880   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8881   ac_status=$?
8882   egrep -v '^ *\+' conftest.er1 >conftest.err
8883   rm -f conftest.er1
8884   cat conftest.err >&5
8885   echo "$as_me:8885: \$? = $ac_status" >&5
8886   (exit $ac_status); } >/dev/null; then
8887   if test -s conftest.err; then
8888     ac_cpp_err=$ac_c_preproc_warn_flag
8889   else
8890     ac_cpp_err=
8891   fi
8892 else
8893   ac_cpp_err=yes
8894 fi
8895 if test -z "$ac_cpp_err"; then
8896   ac_cv_header_pthread_h=yes
8897 else
8898   echo "$as_me: failed program was:" >&5
8899   cat conftest.$ac_ext >&5
8900   ac_cv_header_pthread_h=no
8901 fi
8902 rm -f conftest.err conftest.$ac_ext
8903 fi
8904 echo "$as_me:8904: result: $ac_cv_header_pthread_h" >&5
8905 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
8906 if test $ac_cv_header_pthread_h = yes; then
8907
8908         cat >>confdefs.h <<\EOF
8909 #define HAVE_PTHREADS_H 1
8910 EOF
8911
8912         echo "$as_me:8912: checking if we can link with the pthread library" >&5
8913 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6
8914         cf_save_LIBS="$LIBS"
8915         LIBS="-lpthread $LIBS"
8916         cat >conftest.$ac_ext <<_ACEOF
8917 #line 8917 "configure"
8918 #include "confdefs.h"
8919
8920 #include <pthread.h>
8921
8922 int
8923 main ()
8924 {
8925
8926         int rc = pthread_create(0,0,0,0);
8927
8928   ;
8929   return 0;
8930 }
8931 _ACEOF
8932 rm -f conftest.$ac_objext conftest$ac_exeext
8933 if { (eval echo "$as_me:8933: \"$ac_link\"") >&5
8934   (eval $ac_link) 2>&5
8935   ac_status=$?
8936   echo "$as_me:8936: \$? = $ac_status" >&5
8937   (exit $ac_status); } &&
8938          { ac_try='test -s conftest$ac_exeext'
8939   { (eval echo "$as_me:8939: \"$ac_try\"") >&5
8940   (eval $ac_try) 2>&5
8941   ac_status=$?
8942   echo "$as_me:8942: \$? = $ac_status" >&5
8943   (exit $ac_status); }; }; then
8944   with_pthread=yes
8945 else
8946   echo "$as_me: failed program was:" >&5
8947 cat conftest.$ac_ext >&5
8948 with_pthread=no
8949 fi
8950 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8951         LIBS="$cf_save_LIBS"
8952         echo "$as_me:8952: result: $with_pthread" >&5
8953 echo "${ECHO_T}$with_pthread" >&6
8954
8955         if test "$with_pthread" = yes ; then
8956             LIBS="-lpthread $LIBS"
8957             cat >>confdefs.h <<\EOF
8958 #define HAVE_LIBPTHREADS 1
8959 EOF
8960
8961         else
8962             { { echo "$as_me:8962: error: Cannot link with pthread library" >&5
8963 echo "$as_me: error: Cannot link with pthread library" >&2;}
8964    { (exit 1); exit 1; }; }
8965         fi
8966
8967 fi
8968
8969 fi
8970
8971 echo "$as_me:8971: checking if you want to use weak-symbols for pthreads" >&5
8972 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
8973
8974 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
8975 if test "${enable_weak_symbols+set}" = set; then
8976   enableval="$enable_weak_symbols"
8977   use_weak_symbols=$withval
8978 else
8979   use_weak_symbols=no
8980 fi;
8981 echo "$as_me:8981: result: $use_weak_symbols" >&5
8982 echo "${ECHO_T}$use_weak_symbols" >&6
8983 if test "$use_weak_symbols" = yes ; then
8984
8985 echo "$as_me:8985: checking if $CC supports weak symbols" >&5
8986 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
8987 if test "${cf_cv_weak_symbols+set}" = set; then
8988   echo $ECHO_N "(cached) $ECHO_C" >&6
8989 else
8990
8991 cat >conftest.$ac_ext <<_ACEOF
8992 #line 8992 "configure"
8993 #include "confdefs.h"
8994
8995 #include <stdio.h>
8996 int
8997 main ()
8998 {
8999
9000 #if defined(__GNUC__)
9001 #  if defined __USE_ISOC99
9002 #    define _cat_pragma(exp)    _Pragma(#exp)
9003 #    define _weak_pragma(exp)   _cat_pragma(weak name)
9004 #  else
9005 #    define _weak_pragma(exp)
9006 #  endif
9007 #  define _declare(name)        __extension__ extern __typeof__(name) name
9008 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
9009 #endif
9010
9011 weak_symbol(fopen);
9012
9013   ;
9014   return 0;
9015 }
9016 _ACEOF
9017 rm -f conftest.$ac_objext
9018 if { (eval echo "$as_me:9018: \"$ac_compile\"") >&5
9019   (eval $ac_compile) 2>&5
9020   ac_status=$?
9021   echo "$as_me:9021: \$? = $ac_status" >&5
9022   (exit $ac_status); } &&
9023          { ac_try='test -s conftest.$ac_objext'
9024   { (eval echo "$as_me:9024: \"$ac_try\"") >&5
9025   (eval $ac_try) 2>&5
9026   ac_status=$?
9027   echo "$as_me:9027: \$? = $ac_status" >&5
9028   (exit $ac_status); }; }; then
9029   cf_cv_weak_symbols=yes
9030 else
9031   echo "$as_me: failed program was:" >&5
9032 cat conftest.$ac_ext >&5
9033 cf_cv_weak_symbols=no
9034 fi
9035 rm -f conftest.$ac_objext conftest.$ac_ext
9036
9037 fi
9038 echo "$as_me:9038: result: $cf_cv_weak_symbols" >&5
9039 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
9040
9041 else
9042     cf_cv_weak_symbols=no
9043 fi
9044
9045 if test $cf_cv_weak_symbols = yes ; then
9046     cat >>confdefs.h <<\EOF
9047 #define USE_WEAK_SYMBOLS 1
9048 EOF
9049
9050 fi
9051
9052 PTHREAD=
9053 if test "$with_pthread" = "yes" ; then
9054     cat >>confdefs.h <<\EOF
9055 #define USE_PTHREADS 1
9056 EOF
9057
9058     enable_reentrant=yes
9059     if test $cf_cv_weak_symbols = yes ; then
9060         PTHREAD=-lpthread
9061     fi
9062 fi
9063
9064 # Reentrant code has to be opaque; there's little advantage to making ncurses
9065 # opaque outside of that, so there is no --enable-opaque option.  We can use
9066 # this option without --with-pthreads, but this will be always set for
9067 # pthreads.
9068 echo "$as_me:9068: checking if you want experimental reentrant code" >&5
9069 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
9070
9071 # Check whether --enable-reentrant or --disable-reentrant was given.
9072 if test "${enable_reentrant+set}" = set; then
9073   enableval="$enable_reentrant"
9074   with_reentrant=$enableval
9075 else
9076   with_reentrant=no
9077 fi;
9078 echo "$as_me:9078: result: $with_reentrant" >&5
9079 echo "${ECHO_T}$with_reentrant" >&6
9080 if test "$with_reentrant" = yes ; then
9081         cf_cv_enable_reentrant=1
9082         if test $cf_cv_weak_symbols = yes ; then
9083
9084 # remove pthread library from $LIBS
9085 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
9086
9087         else
9088                 LIB_SUFFIX="t${LIB_SUFFIX}"
9089         fi
9090         cat >>confdefs.h <<\EOF
9091 #define USE_REENTRANT 1
9092 EOF
9093
9094 else
9095         cf_cv_enable_reentrant=0
9096 fi
9097
9098 ### Allow using a different wrap-prefix
9099 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
9100         echo "$as_me:9100: checking for prefix used to wrap public variables" >&5
9101 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
9102
9103 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
9104 if test "${with_wrap_prefix+set}" = set; then
9105   withval="$with_wrap_prefix"
9106   NCURSES_WRAP_PREFIX=$withval
9107 else
9108   NCURSES_WRAP_PREFIX=_nc_
9109 fi;
9110         echo "$as_me:9110: result: $NCURSES_WRAP_PREFIX" >&5
9111 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
9112 else
9113         NCURSES_WRAP_PREFIX=_nc_
9114 fi
9115
9116 cat >>confdefs.h <<EOF
9117 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
9118 EOF
9119
9120 ###############################################################################
9121
9122 ###     use option --disable-echo to suppress full display compiling commands
9123 echo "$as_me:9123: checking if you want to display full commands during build" >&5
9124 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6
9125
9126 # Check whether --enable-echo or --disable-echo was given.
9127 if test "${enable_echo+set}" = set; then
9128   enableval="$enable_echo"
9129   with_echo=$enableval
9130 else
9131   with_echo=yes
9132 fi;
9133 if test "$with_echo" = yes; then
9134         ECHO_LINK=
9135 else
9136         ECHO_LINK='@ echo linking $@ ... ;'
9137 fi
9138 echo "$as_me:9138: result: $with_echo" >&5
9139 echo "${ECHO_T}$with_echo" >&6
9140
9141 ###     use option --enable-warnings to turn on all gcc warnings
9142 echo "$as_me:9142: checking if you want to see compiler warnings" >&5
9143 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
9144
9145 # Check whether --enable-warnings or --disable-warnings was given.
9146 if test "${enable_warnings+set}" = set; then
9147   enableval="$enable_warnings"
9148   with_warnings=$enableval
9149 fi;
9150 echo "$as_me:9150: result: $with_warnings" >&5
9151 echo "${ECHO_T}$with_warnings" >&6
9152
9153 if test "x$with_warnings" = "xyes"; then
9154         ADAFLAGS="$ADAFLAGS -gnatg"
9155
9156 INTEL_COMPILER=no
9157
9158 if test "$GCC" = yes ; then
9159         case $host_os in
9160         linux*|gnu*)
9161                 echo "$as_me:9161: checking if this is really Intel C compiler" >&5
9162 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
9163                 cf_save_CFLAGS="$CFLAGS"
9164                 CFLAGS="$CFLAGS -no-gcc"
9165                 cat >conftest.$ac_ext <<_ACEOF
9166 #line 9166 "configure"
9167 #include "confdefs.h"
9168
9169 int
9170 main ()
9171 {
9172
9173 #ifdef __INTEL_COMPILER
9174 #else
9175 make an error
9176 #endif
9177
9178   ;
9179   return 0;
9180 }
9181 _ACEOF
9182 rm -f conftest.$ac_objext
9183 if { (eval echo "$as_me:9183: \"$ac_compile\"") >&5
9184   (eval $ac_compile) 2>&5
9185   ac_status=$?
9186   echo "$as_me:9186: \$? = $ac_status" >&5
9187   (exit $ac_status); } &&
9188          { ac_try='test -s conftest.$ac_objext'
9189   { (eval echo "$as_me:9189: \"$ac_try\"") >&5
9190   (eval $ac_try) 2>&5
9191   ac_status=$?
9192   echo "$as_me:9192: \$? = $ac_status" >&5
9193   (exit $ac_status); }; }; then
9194   INTEL_COMPILER=yes
9195 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
9196
9197 else
9198   echo "$as_me: failed program was:" >&5
9199 cat conftest.$ac_ext >&5
9200 fi
9201 rm -f conftest.$ac_objext conftest.$ac_ext
9202                 CFLAGS="$cf_save_CFLAGS"
9203                 echo "$as_me:9203: result: $INTEL_COMPILER" >&5
9204 echo "${ECHO_T}$INTEL_COMPILER" >&6
9205                 ;;
9206         esac
9207 fi
9208
9209 cat > conftest.$ac_ext <<EOF
9210 #line 9210 "${as_me-configure}"
9211 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
9212 EOF
9213
9214 if test "$INTEL_COMPILER" = yes
9215 then
9216 # The "-wdXXX" options suppress warnings:
9217 # remark #1419: external declaration in primary source file
9218 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
9219 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
9220 # remark #193: zero used for undefined preprocessing identifier
9221 # remark #593: variable "curs_sb_left_arrow" was set but never used
9222 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
9223 # remark #869: parameter "tw" was never referenced
9224 # remark #981: operands are evaluated in unspecified order
9225 # warning #279: controlling expression is constant
9226
9227         { echo "$as_me:9227: checking for $CC warning options..." >&5
9228 echo "$as_me: checking for $CC warning options..." >&6;}
9229         cf_save_CFLAGS="$CFLAGS"
9230         EXTRA_CFLAGS="-Wall"
9231         for cf_opt in \
9232                 wd1419 \
9233                 wd1683 \
9234                 wd1684 \
9235                 wd193 \
9236                 wd593 \
9237                 wd279 \
9238                 wd810 \
9239                 wd869 \
9240                 wd981
9241         do
9242                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
9243                 if { (eval echo "$as_me:9243: \"$ac_compile\"") >&5
9244   (eval $ac_compile) 2>&5
9245   ac_status=$?
9246   echo "$as_me:9246: \$? = $ac_status" >&5
9247   (exit $ac_status); }; then
9248                         test -n "$verbose" && echo "$as_me:9248: result: ... -$cf_opt" >&5
9249 echo "${ECHO_T}... -$cf_opt" >&6
9250                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
9251                 fi
9252         done
9253         CFLAGS="$cf_save_CFLAGS"
9254
9255 elif test "$GCC" = yes
9256 then
9257         { echo "$as_me:9257: checking for $CC warning options..." >&5
9258 echo "$as_me: checking for $CC warning options..." >&6;}
9259         cf_save_CFLAGS="$CFLAGS"
9260         EXTRA_CFLAGS=
9261         cf_warn_CONST=""
9262         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
9263         for cf_opt in W Wall \
9264                 Wbad-function-cast \
9265                 Wcast-align \
9266                 Wcast-qual \
9267                 Winline \
9268                 Wmissing-declarations \
9269                 Wmissing-prototypes \
9270                 Wnested-externs \
9271                 Wpointer-arith \
9272                 Wshadow \
9273                 Wstrict-prototypes \
9274                 Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
9275         do
9276                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
9277                 if { (eval echo "$as_me:9277: \"$ac_compile\"") >&5
9278   (eval $ac_compile) 2>&5
9279   ac_status=$?
9280   echo "$as_me:9280: \$? = $ac_status" >&5
9281   (exit $ac_status); }; then
9282                         test -n "$verbose" && echo "$as_me:9282: result: ... -$cf_opt" >&5
9283 echo "${ECHO_T}... -$cf_opt" >&6
9284                         case $cf_opt in #(vi
9285                         Wcast-qual) #(vi
9286                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
9287                                 ;;
9288                         Winline) #(vi
9289                                 case $GCC_VERSION in
9290                                 [34].*)
9291                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
9292
9293 echo "${as_me-configure}:9293: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
9294
9295                                         continue;;
9296                                 esac
9297                                 ;;
9298                         esac
9299                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
9300                 fi
9301         done
9302         CFLAGS="$cf_save_CFLAGS"
9303 fi
9304 rm -f conftest*
9305
9306 fi
9307
9308 if test "$GCC" = yes
9309 then
9310 cat > conftest.i <<EOF
9311 #ifndef GCC_PRINTF
9312 #define GCC_PRINTF 0
9313 #endif
9314 #ifndef GCC_SCANF
9315 #define GCC_SCANF 0
9316 #endif
9317 #ifndef GCC_NORETURN
9318 #define GCC_NORETURN /* nothing */
9319 #endif
9320 #ifndef GCC_UNUSED
9321 #define GCC_UNUSED /* nothing */
9322 #endif
9323 EOF
9324 if test "$GCC" = yes
9325 then
9326         { echo "$as_me:9326: checking for $CC __attribute__ directives..." >&5
9327 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
9328 cat > conftest.$ac_ext <<EOF
9329 #line 9329 "${as_me-configure}"
9330 #include "confdefs.h"
9331 #include "conftest.h"
9332 #include "conftest.i"
9333 #if     GCC_PRINTF
9334 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
9335 #else
9336 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
9337 #endif
9338 #if     GCC_SCANF
9339 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
9340 #else
9341 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
9342 #endif
9343 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
9344 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
9345 extern void foo(void) GCC_NORETURN;
9346 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
9347 EOF
9348         cf_printf_attribute=no
9349         cf_scanf_attribute=no
9350         for cf_attribute in scanf printf unused noreturn
9351         do
9352
9353 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9354
9355                 cf_directive="__attribute__(($cf_attribute))"
9356                 echo "checking for $CC $cf_directive" 1>&5
9357
9358                 case $cf_attribute in #(vi
9359                 printf) #(vi
9360                         cf_printf_attribute=yes
9361                         cat >conftest.h <<EOF
9362 #define GCC_$cf_ATTRIBUTE 1
9363 EOF
9364                         ;;
9365                 scanf) #(vi
9366                         cf_scanf_attribute=yes
9367                         cat >conftest.h <<EOF
9368 #define GCC_$cf_ATTRIBUTE 1
9369 EOF
9370                         ;;
9371                 *) #(vi
9372                         cat >conftest.h <<EOF
9373 #define GCC_$cf_ATTRIBUTE $cf_directive
9374 EOF
9375                         ;;
9376                 esac
9377
9378                 if { (eval echo "$as_me:9378: \"$ac_compile\"") >&5
9379   (eval $ac_compile) 2>&5
9380   ac_status=$?
9381   echo "$as_me:9381: \$? = $ac_status" >&5
9382   (exit $ac_status); }; then
9383                         test -n "$verbose" && echo "$as_me:9383: result: ... $cf_attribute" >&5
9384 echo "${ECHO_T}... $cf_attribute" >&6
9385                         cat conftest.h >>confdefs.h
9386                         case $cf_attribute in #(vi
9387                         printf) #(vi
9388                                 if test "$cf_printf_attribute" = no ; then
9389                                         cat >>confdefs.h <<EOF
9390 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
9391 EOF
9392                                 else
9393                                         cat >>confdefs.h <<EOF
9394 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
9395 EOF
9396                                 fi
9397                                 ;;
9398                         scanf) #(vi
9399                                 if test "$cf_scanf_attribute" = no ; then
9400                                         cat >>confdefs.h <<EOF
9401 #define GCC_SCANFLIKE(fmt,var) /* nothing */
9402 EOF
9403                                 else
9404                                         cat >>confdefs.h <<EOF
9405 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
9406 EOF
9407                                 fi
9408                                 ;;
9409                         esac
9410                 fi
9411         done
9412 else
9413         fgrep define conftest.i >>confdefs.h
9414 fi
9415 rm -rf conftest*
9416 fi
9417
9418 ###     use option --enable-assertions to turn on generation of assertion code
9419 echo "$as_me:9419: checking if you want to enable runtime assertions" >&5
9420 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
9421
9422 # Check whether --enable-assertions or --disable-assertions was given.
9423 if test "${enable_assertions+set}" = set; then
9424   enableval="$enable_assertions"
9425   with_assertions=$enableval
9426 else
9427   with_assertions=no
9428 fi;
9429 echo "$as_me:9429: result: $with_assertions" >&5
9430 echo "${ECHO_T}$with_assertions" >&6
9431 if test -n "$GCC"
9432 then
9433         if test "$with_assertions" = no
9434         then
9435                 cat >>confdefs.h <<\EOF
9436 #define NDEBUG 1
9437 EOF
9438
9439                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
9440         else
9441                 ADAFLAGS="$ADAFLAGS -gnata"
9442         fi
9443 fi
9444
9445 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
9446 cat >>confdefs.h <<\EOF
9447 #define HAVE_NC_ALLOC_H 1
9448 EOF
9449
9450 ###     use option --enable-expanded to generate certain macros as functions
9451
9452 # Check whether --enable-expanded or --disable-expanded was given.
9453 if test "${enable_expanded+set}" = set; then
9454   enableval="$enable_expanded"
9455   test "$enableval" = yes && cat >>confdefs.h <<\EOF
9456 #define NCURSES_EXPANDED 1
9457 EOF
9458
9459 fi;
9460
9461 ###     use option --disable-macros to suppress macros in favor of functions
9462
9463 # Check whether --enable-macros or --disable-macros was given.
9464 if test "${enable_macros+set}" = set; then
9465   enableval="$enable_macros"
9466   test "$enableval" = no && cat >>confdefs.h <<\EOF
9467 #define NCURSES_NOMACROS 1
9468 EOF
9469
9470 fi;
9471
9472 # Normally we only add trace() to the debug-library.  Allow this to be
9473 # extended to all models of the ncurses library:
9474 cf_all_traces=no
9475 case "$CFLAGS $CPPFLAGS" in
9476 *-DTRACE*)
9477         cf_all_traces=yes
9478         ;;
9479 esac
9480
9481 echo "$as_me:9481: checking whether to add trace feature to all models" >&5
9482 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
9483
9484 # Check whether --with-trace or --without-trace was given.
9485 if test "${with_trace+set}" = set; then
9486   withval="$with_trace"
9487   cf_with_trace=$withval
9488 else
9489   cf_with_trace=$cf_all_traces
9490 fi;
9491 echo "$as_me:9491: result: $cf_with_trace" >&5
9492 echo "${ECHO_T}$cf_with_trace" >&6
9493
9494 if test "$cf_with_trace" = yes ; then
9495         ADA_TRACE=TRUE
9496
9497 cf_fix_cppflags=no
9498 cf_new_cflags=
9499 cf_new_cppflags=
9500 cf_new_extra_cppflags=
9501
9502 for cf_add_cflags in -DTRACE
9503 do
9504 case $cf_fix_cppflags in
9505 no)
9506         case $cf_add_cflags in #(vi
9507         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9508                 case $cf_add_cflags in
9509                 -D*)
9510                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9511
9512                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9513                                 && test -z "${cf_tst_cflags}" \
9514                                 && cf_fix_cppflags=yes
9515
9516                         if test $cf_fix_cppflags = yes ; then
9517                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9518                                 continue
9519                         elif test "${cf_tst_cflags}" = "\"'" ; then
9520                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9521                                 continue
9522                         fi
9523                         ;;
9524                 esac
9525                 case "$CPPFLAGS" in
9526                 *$cf_add_cflags) #(vi
9527                         ;;
9528                 *) #(vi
9529                         case $cf_add_cflags in #(vi
9530                         -D*)
9531                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9532
9533 CPPFLAGS=`echo "$CPPFLAGS" | \
9534         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9535                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9536
9537                                 ;;
9538                         esac
9539                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9540                         ;;
9541                 esac
9542                 ;;
9543         *)
9544                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9545                 ;;
9546         esac
9547         ;;
9548 yes)
9549         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9550
9551         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9552
9553         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9554                 && test -z "${cf_tst_cflags}" \
9555                 && cf_fix_cppflags=no
9556         ;;
9557 esac
9558 done
9559
9560 if test -n "$cf_new_cflags" ; then
9561
9562         CFLAGS="$CFLAGS $cf_new_cflags"
9563 fi
9564
9565 if test -n "$cf_new_cppflags" ; then
9566
9567         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9568 fi
9569
9570 if test -n "$cf_new_extra_cppflags" ; then
9571
9572         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9573 fi
9574
9575 else
9576         ADA_TRACE=FALSE
9577 fi
9578
9579 ###     Checks for libraries.
9580 case $cf_cv_system_name in #(vi
9581 *mingw32*) #(vi
9582         ;;
9583 *)
9584 echo "$as_me:9584: checking for gettimeofday" >&5
9585 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
9586 if test "${ac_cv_func_gettimeofday+set}" = set; then
9587   echo $ECHO_N "(cached) $ECHO_C" >&6
9588 else
9589   cat >conftest.$ac_ext <<_ACEOF
9590 #line 9590 "configure"
9591 #include "confdefs.h"
9592 /* System header to define __stub macros and hopefully few prototypes,
9593     which can conflict with char gettimeofday (); below.  */
9594 #include <assert.h>
9595 /* Override any gcc2 internal prototype to avoid an error.  */
9596 #ifdef __cplusplus
9597 extern "C"
9598 #endif
9599 /* We use char because int might match the return type of a gcc2
9600    builtin and then its argument prototype would still apply.  */
9601 char gettimeofday ();
9602 char (*f) ();
9603
9604 int
9605 main ()
9606 {
9607 /* The GNU C library defines this for functions which it implements
9608     to always fail with ENOSYS.  Some functions are actually named
9609     something starting with __ and the normal name is an alias.  */
9610 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
9611 choke me
9612 #else
9613 f = gettimeofday;
9614 #endif
9615
9616   ;
9617   return 0;
9618 }
9619 _ACEOF
9620 rm -f conftest.$ac_objext conftest$ac_exeext
9621 if { (eval echo "$as_me:9621: \"$ac_link\"") >&5
9622   (eval $ac_link) 2>&5
9623   ac_status=$?
9624   echo "$as_me:9624: \$? = $ac_status" >&5
9625   (exit $ac_status); } &&
9626          { ac_try='test -s conftest$ac_exeext'
9627   { (eval echo "$as_me:9627: \"$ac_try\"") >&5
9628   (eval $ac_try) 2>&5
9629   ac_status=$?
9630   echo "$as_me:9630: \$? = $ac_status" >&5
9631   (exit $ac_status); }; }; then
9632   ac_cv_func_gettimeofday=yes
9633 else
9634   echo "$as_me: failed program was:" >&5
9635 cat conftest.$ac_ext >&5
9636 ac_cv_func_gettimeofday=no
9637 fi
9638 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9639 fi
9640 echo "$as_me:9640: result: $ac_cv_func_gettimeofday" >&5
9641 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
9642 if test $ac_cv_func_gettimeofday = yes; then
9643   cat >>confdefs.h <<\EOF
9644 #define HAVE_GETTIMEOFDAY 1
9645 EOF
9646
9647 else
9648
9649 echo "$as_me:9649: checking for gettimeofday in -lbsd" >&5
9650 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
9651 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
9652   echo $ECHO_N "(cached) $ECHO_C" >&6
9653 else
9654   ac_check_lib_save_LIBS=$LIBS
9655 LIBS="-lbsd  $LIBS"
9656 cat >conftest.$ac_ext <<_ACEOF
9657 #line 9657 "configure"
9658 #include "confdefs.h"
9659
9660 /* Override any gcc2 internal prototype to avoid an error.  */
9661 #ifdef __cplusplus
9662 extern "C"
9663 #endif
9664 /* We use char because int might match the return type of a gcc2
9665    builtin and then its argument prototype would still apply.  */
9666 char gettimeofday ();
9667 int
9668 main ()
9669 {
9670 gettimeofday ();
9671   ;
9672   return 0;
9673 }
9674 _ACEOF
9675 rm -f conftest.$ac_objext conftest$ac_exeext
9676 if { (eval echo "$as_me:9676: \"$ac_link\"") >&5
9677   (eval $ac_link) 2>&5
9678   ac_status=$?
9679   echo "$as_me:9679: \$? = $ac_status" >&5
9680   (exit $ac_status); } &&
9681          { ac_try='test -s conftest$ac_exeext'
9682   { (eval echo "$as_me:9682: \"$ac_try\"") >&5
9683   (eval $ac_try) 2>&5
9684   ac_status=$?
9685   echo "$as_me:9685: \$? = $ac_status" >&5
9686   (exit $ac_status); }; }; then
9687   ac_cv_lib_bsd_gettimeofday=yes
9688 else
9689   echo "$as_me: failed program was:" >&5
9690 cat conftest.$ac_ext >&5
9691 ac_cv_lib_bsd_gettimeofday=no
9692 fi
9693 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9694 LIBS=$ac_check_lib_save_LIBS
9695 fi
9696 echo "$as_me:9696: result: $ac_cv_lib_bsd_gettimeofday" >&5
9697 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
9698 if test $ac_cv_lib_bsd_gettimeofday = yes; then
9699   cat >>confdefs.h <<\EOF
9700 #define HAVE_GETTIMEOFDAY 1
9701 EOF
9702
9703         LIBS="$LIBS -lbsd"
9704 fi
9705
9706 fi
9707         ;;
9708 esac
9709
9710 ###     Checks for header files.
9711 echo "$as_me:9711: checking for ANSI C header files" >&5
9712 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
9713 if test "${ac_cv_header_stdc+set}" = set; then
9714   echo $ECHO_N "(cached) $ECHO_C" >&6
9715 else
9716   cat >conftest.$ac_ext <<_ACEOF
9717 #line 9717 "configure"
9718 #include "confdefs.h"
9719 #include <stdlib.h>
9720 #include <stdarg.h>
9721 #include <string.h>
9722 #include <float.h>
9723
9724 _ACEOF
9725 if { (eval echo "$as_me:9725: \"$ac_cpp conftest.$ac_ext\"") >&5
9726   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9727   ac_status=$?
9728   egrep -v '^ *\+' conftest.er1 >conftest.err
9729   rm -f conftest.er1
9730   cat conftest.err >&5
9731   echo "$as_me:9731: \$? = $ac_status" >&5
9732   (exit $ac_status); } >/dev/null; then
9733   if test -s conftest.err; then
9734     ac_cpp_err=$ac_c_preproc_warn_flag
9735   else
9736     ac_cpp_err=
9737   fi
9738 else
9739   ac_cpp_err=yes
9740 fi
9741 if test -z "$ac_cpp_err"; then
9742   ac_cv_header_stdc=yes
9743 else
9744   echo "$as_me: failed program was:" >&5
9745   cat conftest.$ac_ext >&5
9746   ac_cv_header_stdc=no
9747 fi
9748 rm -f conftest.err conftest.$ac_ext
9749
9750 if test $ac_cv_header_stdc = yes; then
9751   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9752   cat >conftest.$ac_ext <<_ACEOF
9753 #line 9753 "configure"
9754 #include "confdefs.h"
9755 #include <string.h>
9756
9757 _ACEOF
9758 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9759   egrep "memchr" >/dev/null 2>&1; then
9760   :
9761 else
9762   ac_cv_header_stdc=no
9763 fi
9764 rm -f conftest*
9765
9766 fi
9767
9768 if test $ac_cv_header_stdc = yes; then
9769   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9770   cat >conftest.$ac_ext <<_ACEOF
9771 #line 9771 "configure"
9772 #include "confdefs.h"
9773 #include <stdlib.h>
9774
9775 _ACEOF
9776 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9777   egrep "free" >/dev/null 2>&1; then
9778   :
9779 else
9780   ac_cv_header_stdc=no
9781 fi
9782 rm -f conftest*
9783
9784 fi
9785
9786 if test $ac_cv_header_stdc = yes; then
9787   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9788   if test "$cross_compiling" = yes; then
9789   :
9790 else
9791   cat >conftest.$ac_ext <<_ACEOF
9792 #line 9792 "configure"
9793 #include "confdefs.h"
9794 #include <ctype.h>
9795 #if ((' ' & 0x0FF) == 0x020)
9796 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9797 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9798 #else
9799 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9800                      || ('j' <= (c) && (c) <= 'r') \
9801                      || ('s' <= (c) && (c) <= 'z'))
9802 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
9803 #endif
9804
9805 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9806 int
9807 main ()
9808 {
9809   int i;
9810   for (i = 0; i < 256; i++)
9811     if (XOR (islower (i), ISLOWER (i))
9812         || toupper (i) != TOUPPER (i))
9813       $ac_main_return(2);
9814   $ac_main_return (0);
9815 }
9816 _ACEOF
9817 rm -f conftest$ac_exeext
9818 if { (eval echo "$as_me:9818: \"$ac_link\"") >&5
9819   (eval $ac_link) 2>&5
9820   ac_status=$?
9821   echo "$as_me:9821: \$? = $ac_status" >&5
9822   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9823   { (eval echo "$as_me:9823: \"$ac_try\"") >&5
9824   (eval $ac_try) 2>&5
9825   ac_status=$?
9826   echo "$as_me:9826: \$? = $ac_status" >&5
9827   (exit $ac_status); }; }; then
9828   :
9829 else
9830   echo "$as_me: program exited with status $ac_status" >&5
9831 echo "$as_me: failed program was:" >&5
9832 cat conftest.$ac_ext >&5
9833 ac_cv_header_stdc=no
9834 fi
9835 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9836 fi
9837 fi
9838 fi
9839 echo "$as_me:9839: result: $ac_cv_header_stdc" >&5
9840 echo "${ECHO_T}$ac_cv_header_stdc" >&6
9841 if test $ac_cv_header_stdc = yes; then
9842
9843 cat >>confdefs.h <<\EOF
9844 #define STDC_HEADERS 1
9845 EOF
9846
9847 fi
9848
9849 ac_header_dirent=no
9850 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
9851   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
9852 echo "$as_me:9852: checking for $ac_hdr that defines DIR" >&5
9853 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
9854 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9855   echo $ECHO_N "(cached) $ECHO_C" >&6
9856 else
9857   cat >conftest.$ac_ext <<_ACEOF
9858 #line 9858 "configure"
9859 #include "confdefs.h"
9860 #include <sys/types.h>
9861 #include <$ac_hdr>
9862
9863 int
9864 main ()
9865 {
9866 if ((DIR *) 0)
9867 return 0;
9868   ;
9869   return 0;
9870 }
9871 _ACEOF
9872 rm -f conftest.$ac_objext
9873 if { (eval echo "$as_me:9873: \"$ac_compile\"") >&5
9874   (eval $ac_compile) 2>&5
9875   ac_status=$?
9876   echo "$as_me:9876: \$? = $ac_status" >&5
9877   (exit $ac_status); } &&
9878          { ac_try='test -s conftest.$ac_objext'
9879   { (eval echo "$as_me:9879: \"$ac_try\"") >&5
9880   (eval $ac_try) 2>&5
9881   ac_status=$?
9882   echo "$as_me:9882: \$? = $ac_status" >&5
9883   (exit $ac_status); }; }; then
9884   eval "$as_ac_Header=yes"
9885 else
9886   echo "$as_me: failed program was:" >&5
9887 cat conftest.$ac_ext >&5
9888 eval "$as_ac_Header=no"
9889 fi
9890 rm -f conftest.$ac_objext conftest.$ac_ext
9891 fi
9892 echo "$as_me:9892: result: `eval echo '${'$as_ac_Header'}'`" >&5
9893 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9894 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9895   cat >>confdefs.h <<EOF
9896 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
9897 EOF
9898
9899 ac_header_dirent=$ac_hdr; break
9900 fi
9901
9902 done
9903 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9904 if test $ac_header_dirent = dirent.h; then
9905   echo "$as_me:9905: checking for opendir in -ldir" >&5
9906 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
9907 if test "${ac_cv_lib_dir_opendir+set}" = set; then
9908   echo $ECHO_N "(cached) $ECHO_C" >&6
9909 else
9910   ac_check_lib_save_LIBS=$LIBS
9911 LIBS="-ldir  $LIBS"
9912 cat >conftest.$ac_ext <<_ACEOF
9913 #line 9913 "configure"
9914 #include "confdefs.h"
9915
9916 /* Override any gcc2 internal prototype to avoid an error.  */
9917 #ifdef __cplusplus
9918 extern "C"
9919 #endif
9920 /* We use char because int might match the return type of a gcc2
9921    builtin and then its argument prototype would still apply.  */
9922 char opendir ();
9923 int
9924 main ()
9925 {
9926 opendir ();
9927   ;
9928   return 0;
9929 }
9930 _ACEOF
9931 rm -f conftest.$ac_objext conftest$ac_exeext
9932 if { (eval echo "$as_me:9932: \"$ac_link\"") >&5
9933   (eval $ac_link) 2>&5
9934   ac_status=$?
9935   echo "$as_me:9935: \$? = $ac_status" >&5
9936   (exit $ac_status); } &&
9937          { ac_try='test -s conftest$ac_exeext'
9938   { (eval echo "$as_me:9938: \"$ac_try\"") >&5
9939   (eval $ac_try) 2>&5
9940   ac_status=$?
9941   echo "$as_me:9941: \$? = $ac_status" >&5
9942   (exit $ac_status); }; }; then
9943   ac_cv_lib_dir_opendir=yes
9944 else
9945   echo "$as_me: failed program was:" >&5
9946 cat conftest.$ac_ext >&5
9947 ac_cv_lib_dir_opendir=no
9948 fi
9949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9950 LIBS=$ac_check_lib_save_LIBS
9951 fi
9952 echo "$as_me:9952: result: $ac_cv_lib_dir_opendir" >&5
9953 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
9954 if test $ac_cv_lib_dir_opendir = yes; then
9955   LIBS="$LIBS -ldir"
9956 fi
9957
9958 else
9959   echo "$as_me:9959: checking for opendir in -lx" >&5
9960 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
9961 if test "${ac_cv_lib_x_opendir+set}" = set; then
9962   echo $ECHO_N "(cached) $ECHO_C" >&6
9963 else
9964   ac_check_lib_save_LIBS=$LIBS
9965 LIBS="-lx  $LIBS"
9966 cat >conftest.$ac_ext <<_ACEOF
9967 #line 9967 "configure"
9968 #include "confdefs.h"
9969
9970 /* Override any gcc2 internal prototype to avoid an error.  */
9971 #ifdef __cplusplus
9972 extern "C"
9973 #endif
9974 /* We use char because int might match the return type of a gcc2
9975    builtin and then its argument prototype would still apply.  */
9976 char opendir ();
9977 int
9978 main ()
9979 {
9980 opendir ();
9981   ;
9982   return 0;
9983 }
9984 _ACEOF
9985 rm -f conftest.$ac_objext conftest$ac_exeext
9986 if { (eval echo "$as_me:9986: \"$ac_link\"") >&5
9987   (eval $ac_link) 2>&5
9988   ac_status=$?
9989   echo "$as_me:9989: \$? = $ac_status" >&5
9990   (exit $ac_status); } &&
9991          { ac_try='test -s conftest$ac_exeext'
9992   { (eval echo "$as_me:9992: \"$ac_try\"") >&5
9993   (eval $ac_try) 2>&5
9994   ac_status=$?
9995   echo "$as_me:9995: \$? = $ac_status" >&5
9996   (exit $ac_status); }; }; then
9997   ac_cv_lib_x_opendir=yes
9998 else
9999   echo "$as_me: failed program was:" >&5
10000 cat conftest.$ac_ext >&5
10001 ac_cv_lib_x_opendir=no
10002 fi
10003 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10004 LIBS=$ac_check_lib_save_LIBS
10005 fi
10006 echo "$as_me:10006: result: $ac_cv_lib_x_opendir" >&5
10007 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
10008 if test $ac_cv_lib_x_opendir = yes; then
10009   LIBS="$LIBS -lx"
10010 fi
10011
10012 fi
10013
10014 echo "$as_me:10014: checking whether time.h and sys/time.h may both be included" >&5
10015 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
10016 if test "${ac_cv_header_time+set}" = set; then
10017   echo $ECHO_N "(cached) $ECHO_C" >&6
10018 else
10019   cat >conftest.$ac_ext <<_ACEOF
10020 #line 10020 "configure"
10021 #include "confdefs.h"
10022 #include <sys/types.h>
10023 #include <sys/time.h>
10024 #include <time.h>
10025
10026 int
10027 main ()
10028 {
10029 if ((struct tm *) 0)
10030 return 0;
10031   ;
10032   return 0;
10033 }
10034 _ACEOF
10035 rm -f conftest.$ac_objext
10036 if { (eval echo "$as_me:10036: \"$ac_compile\"") >&5
10037   (eval $ac_compile) 2>&5
10038   ac_status=$?
10039   echo "$as_me:10039: \$? = $ac_status" >&5
10040   (exit $ac_status); } &&
10041          { ac_try='test -s conftest.$ac_objext'
10042   { (eval echo "$as_me:10042: \"$ac_try\"") >&5
10043   (eval $ac_try) 2>&5
10044   ac_status=$?
10045   echo "$as_me:10045: \$? = $ac_status" >&5
10046   (exit $ac_status); }; }; then
10047   ac_cv_header_time=yes
10048 else
10049   echo "$as_me: failed program was:" >&5
10050 cat conftest.$ac_ext >&5
10051 ac_cv_header_time=no
10052 fi
10053 rm -f conftest.$ac_objext conftest.$ac_ext
10054 fi
10055 echo "$as_me:10055: result: $ac_cv_header_time" >&5
10056 echo "${ECHO_T}$ac_cv_header_time" >&6
10057 if test $ac_cv_header_time = yes; then
10058
10059 cat >>confdefs.h <<\EOF
10060 #define TIME_WITH_SYS_TIME 1
10061 EOF
10062
10063 fi
10064
10065 ###     checks for compiler characteristics
10066 ac_ext=c
10067 ac_cpp='$CPP $CPPFLAGS'
10068 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10069 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10070 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10071 ac_main_return=return
10072
10073 echo "$as_me:10073: checking for $CC option to accept ANSI C" >&5
10074 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
10075 if test "${ac_cv_prog_cc_stdc+set}" = set; then
10076   echo $ECHO_N "(cached) $ECHO_C" >&6
10077 else
10078   ac_cv_prog_cc_stdc=no
10079 ac_save_CC=$CC
10080 cat >conftest.$ac_ext <<_ACEOF
10081 #line 10081 "configure"
10082 #include "confdefs.h"
10083 #include <stdarg.h>
10084 #include <stdio.h>
10085 #include <sys/types.h>
10086 #include <sys/stat.h>
10087 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
10088 struct buf { int x; };
10089 FILE * (*rcsopen) (struct buf *, struct stat *, int);
10090 static char *e (p, i)
10091      char **p;
10092      int i;
10093 {
10094   return p[i];
10095 }
10096 static char *f (char * (*g) (char **, int), char **p, ...)
10097 {
10098   char *s;
10099   va_list v;
10100   va_start (v,p);
10101   s = g (p, va_arg (v,int));
10102   va_end (v);
10103   return s;
10104 }
10105 int test (int i, double x);
10106 struct s1 {int (*f) (int a);};
10107 struct s2 {int (*f) (double a);};
10108 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
10109 int argc;
10110 char **argv;
10111 int
10112 main ()
10113 {
10114 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
10115   ;
10116   return 0;
10117 }
10118 _ACEOF
10119 # Don't try gcc -ansi; that turns off useful extensions and
10120 # breaks some systems' header files.
10121 # AIX                   -qlanglvl=ansi
10122 # Ultrix and OSF/1      -std1
10123 # HP-UX 10.20 and later -Ae
10124 # HP-UX older versions  -Aa -D_HPUX_SOURCE
10125 # SVR4                  -Xc -D__EXTENSIONS__
10126 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
10127 do
10128   CC="$ac_save_CC $ac_arg"
10129   rm -f conftest.$ac_objext
10130 if { (eval echo "$as_me:10130: \"$ac_compile\"") >&5
10131   (eval $ac_compile) 2>&5
10132   ac_status=$?
10133   echo "$as_me:10133: \$? = $ac_status" >&5
10134   (exit $ac_status); } &&
10135          { ac_try='test -s conftest.$ac_objext'
10136   { (eval echo "$as_me:10136: \"$ac_try\"") >&5
10137   (eval $ac_try) 2>&5
10138   ac_status=$?
10139   echo "$as_me:10139: \$? = $ac_status" >&5
10140   (exit $ac_status); }; }; then
10141   ac_cv_prog_cc_stdc=$ac_arg
10142 break
10143 else
10144   echo "$as_me: failed program was:" >&5
10145 cat conftest.$ac_ext >&5
10146 fi
10147 rm -f conftest.$ac_objext
10148 done
10149 rm -f conftest.$ac_ext conftest.$ac_objext
10150 CC=$ac_save_CC
10151
10152 fi
10153
10154 case "x$ac_cv_prog_cc_stdc" in
10155   x|xno)
10156     echo "$as_me:10156: result: none needed" >&5
10157 echo "${ECHO_T}none needed" >&6 ;;
10158   *)
10159     echo "$as_me:10159: result: $ac_cv_prog_cc_stdc" >&5
10160 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
10161     CC="$CC $ac_cv_prog_cc_stdc" ;;
10162 esac
10163
10164 echo "$as_me:10164: checking for an ANSI C-conforming const" >&5
10165 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
10166 if test "${ac_cv_c_const+set}" = set; then
10167   echo $ECHO_N "(cached) $ECHO_C" >&6
10168 else
10169   cat >conftest.$ac_ext <<_ACEOF
10170 #line 10170 "configure"
10171 #include "confdefs.h"
10172
10173 int
10174 main ()
10175 {
10176 /* FIXME: Include the comments suggested by Paul. */
10177 #ifndef __cplusplus
10178   /* Ultrix mips cc rejects this.  */
10179   typedef int charset[2];
10180   const charset x;
10181   /* SunOS 4.1.1 cc rejects this.  */
10182   char const *const *ccp;
10183   char **p;
10184   /* NEC SVR4.0.2 mips cc rejects this.  */
10185   struct point {int x, y;};
10186   static struct point const zero = {0,0};
10187   /* AIX XL C 1.02.0.0 rejects this.
10188      It does not let you subtract one const X* pointer from another in
10189      an arm of an if-expression whose if-part is not a constant
10190      expression */
10191   const char *g = "string";
10192   ccp = &g + (g ? g-g : 0);
10193   /* HPUX 7.0 cc rejects these. */
10194   ++ccp;
10195   p = (char**) ccp;
10196   ccp = (char const *const *) p;
10197   { /* SCO 3.2v4 cc rejects this.  */
10198     char *t;
10199     char const *s = 0 ? (char *) 0 : (char const *) 0;
10200
10201     *t++ = 0;
10202   }
10203   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10204     int x[] = {25, 17};
10205     const int *foo = &x[0];
10206     ++foo;
10207   }
10208   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10209     typedef const int *iptr;
10210     iptr p = 0;
10211     ++p;
10212   }
10213   { /* AIX XL C 1.02.0.0 rejects this saying
10214        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10215     struct s { int j; const int *ap[3]; };
10216     struct s *b; b->j = 5;
10217   }
10218   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10219     const int foo = 10;
10220   }
10221 #endif
10222
10223   ;
10224   return 0;
10225 }
10226 _ACEOF
10227 rm -f conftest.$ac_objext
10228 if { (eval echo "$as_me:10228: \"$ac_compile\"") >&5
10229   (eval $ac_compile) 2>&5
10230   ac_status=$?
10231   echo "$as_me:10231: \$? = $ac_status" >&5
10232   (exit $ac_status); } &&
10233          { ac_try='test -s conftest.$ac_objext'
10234   { (eval echo "$as_me:10234: \"$ac_try\"") >&5
10235   (eval $ac_try) 2>&5
10236   ac_status=$?
10237   echo "$as_me:10237: \$? = $ac_status" >&5
10238   (exit $ac_status); }; }; then
10239   ac_cv_c_const=yes
10240 else
10241   echo "$as_me: failed program was:" >&5
10242 cat conftest.$ac_ext >&5
10243 ac_cv_c_const=no
10244 fi
10245 rm -f conftest.$ac_objext conftest.$ac_ext
10246 fi
10247 echo "$as_me:10247: result: $ac_cv_c_const" >&5
10248 echo "${ECHO_T}$ac_cv_c_const" >&6
10249 if test $ac_cv_c_const = no; then
10250
10251 cat >>confdefs.h <<\EOF
10252 #define const
10253 EOF
10254
10255 fi
10256
10257 ###     Checks for external-data
10258
10259 echo "$as_me:10259: checking if data-only library module links" >&5
10260 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
10261 if test "${cf_cv_link_dataonly+set}" = set; then
10262   echo $ECHO_N "(cached) $ECHO_C" >&6
10263 else
10264
10265         rm -f conftest.a
10266         cat >conftest.$ac_ext <<EOF
10267 #line 10267 "configure"
10268 int     testdata[3] = { 123, 456, 789 };
10269 EOF
10270         if { (eval echo "$as_me:10270: \"$ac_compile\"") >&5
10271   (eval $ac_compile) 2>&5
10272   ac_status=$?
10273   echo "$as_me:10273: \$? = $ac_status" >&5
10274   (exit $ac_status); } ; then
10275                 mv conftest.o data.o && \
10276                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
10277         fi
10278         rm -f conftest.$ac_ext data.o
10279         cat >conftest.$ac_ext <<EOF
10280 #line 10280 "configure"
10281 int     testfunc()
10282 {
10283 #if defined(NeXT)
10284         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
10285 #else
10286         extern int testdata[3];
10287         return testdata[0] == 123
10288            &&  testdata[1] == 456
10289            &&  testdata[2] == 789;
10290 #endif
10291 }
10292 EOF
10293         if { (eval echo "$as_me:10293: \"$ac_compile\"") >&5
10294   (eval $ac_compile) 2>&5
10295   ac_status=$?
10296   echo "$as_me:10296: \$? = $ac_status" >&5
10297   (exit $ac_status); }; then
10298                 mv conftest.o func.o && \
10299                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
10300         fi
10301         rm -f conftest.$ac_ext func.o
10302         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
10303         cf_saveLIBS="$LIBS"
10304         LIBS="conftest.a $LIBS"
10305         if test "$cross_compiling" = yes; then
10306   cf_cv_link_dataonly=unknown
10307 else
10308   cat >conftest.$ac_ext <<_ACEOF
10309 #line 10309 "configure"
10310 #include "confdefs.h"
10311
10312         int main()
10313         {
10314                 extern int testfunc();
10315                 ${cf_cv_main_return:-return} (!testfunc());
10316         }
10317
10318 _ACEOF
10319 rm -f conftest$ac_exeext
10320 if { (eval echo "$as_me:10320: \"$ac_link\"") >&5
10321   (eval $ac_link) 2>&5
10322   ac_status=$?
10323   echo "$as_me:10323: \$? = $ac_status" >&5
10324   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10325   { (eval echo "$as_me:10325: \"$ac_try\"") >&5
10326   (eval $ac_try) 2>&5
10327   ac_status=$?
10328   echo "$as_me:10328: \$? = $ac_status" >&5
10329   (exit $ac_status); }; }; then
10330   cf_cv_link_dataonly=yes
10331 else
10332   echo "$as_me: program exited with status $ac_status" >&5
10333 echo "$as_me: failed program was:" >&5
10334 cat conftest.$ac_ext >&5
10335 cf_cv_link_dataonly=no
10336 fi
10337 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10338 fi
10339         LIBS="$cf_saveLIBS"
10340
10341 fi
10342
10343 echo "$as_me:10343: result: $cf_cv_link_dataonly" >&5
10344 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
10345
10346 if test "$cf_cv_link_dataonly" = no ; then
10347         cat >>confdefs.h <<\EOF
10348 #define BROKEN_LINKER 1
10349 EOF
10350
10351         BROKEN_LINKER=1
10352 fi
10353
10354 ###     Checks for library functions.
10355
10356 echo "$as_me:10356: checking for working mkstemp" >&5
10357 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
10358 if test "${cf_cv_func_mkstemp+set}" = set; then
10359   echo $ECHO_N "(cached) $ECHO_C" >&6
10360 else
10361
10362 rm -f conftest*
10363 if test "$cross_compiling" = yes; then
10364   echo "$as_me:10364: checking for mkstemp" >&5
10365 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
10366 if test "${ac_cv_func_mkstemp+set}" = set; then
10367   echo $ECHO_N "(cached) $ECHO_C" >&6
10368 else
10369   cat >conftest.$ac_ext <<_ACEOF
10370 #line 10370 "configure"
10371 #include "confdefs.h"
10372 /* System header to define __stub macros and hopefully few prototypes,
10373     which can conflict with char mkstemp (); below.  */
10374 #include <assert.h>
10375 /* Override any gcc2 internal prototype to avoid an error.  */
10376 #ifdef __cplusplus
10377 extern "C"
10378 #endif
10379 /* We use char because int might match the return type of a gcc2
10380    builtin and then its argument prototype would still apply.  */
10381 char mkstemp ();
10382 char (*f) ();
10383
10384 int
10385 main ()
10386 {
10387 /* The GNU C library defines this for functions which it implements
10388     to always fail with ENOSYS.  Some functions are actually named
10389     something starting with __ and the normal name is an alias.  */
10390 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
10391 choke me
10392 #else
10393 f = mkstemp;
10394 #endif
10395
10396   ;
10397   return 0;
10398 }
10399 _ACEOF
10400 rm -f conftest.$ac_objext conftest$ac_exeext
10401 if { (eval echo "$as_me:10401: \"$ac_link\"") >&5
10402   (eval $ac_link) 2>&5
10403   ac_status=$?
10404   echo "$as_me:10404: \$? = $ac_status" >&5
10405   (exit $ac_status); } &&
10406          { ac_try='test -s conftest$ac_exeext'
10407   { (eval echo "$as_me:10407: \"$ac_try\"") >&5
10408   (eval $ac_try) 2>&5
10409   ac_status=$?
10410   echo "$as_me:10410: \$? = $ac_status" >&5
10411   (exit $ac_status); }; }; then
10412   ac_cv_func_mkstemp=yes
10413 else
10414   echo "$as_me: failed program was:" >&5
10415 cat conftest.$ac_ext >&5
10416 ac_cv_func_mkstemp=no
10417 fi
10418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10419 fi
10420 echo "$as_me:10420: result: $ac_cv_func_mkstemp" >&5
10421 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
10422
10423 else
10424   cat >conftest.$ac_ext <<_ACEOF
10425 #line 10425 "configure"
10426 #include "confdefs.h"
10427
10428 #include <sys/types.h>
10429 #include <stdlib.h>
10430 #include <stdio.h>
10431 #include <string.h>
10432 #include <sys/stat.h>
10433 int main()
10434 {
10435         char *tmpl = "conftestXXXXXX";
10436         char name[2][80];
10437         int n;
10438         int result = 0;
10439         int fd;
10440         struct stat sb;
10441
10442         umask(077);
10443         for (n = 0; n < 2; ++n) {
10444                 strcpy(name[n], tmpl);
10445                 if ((fd = mkstemp(name[n])) >= 0) {
10446                         if (!strcmp(name[n], tmpl)
10447                          || stat(name[n], &sb) != 0
10448                          || (sb.st_mode & S_IFMT) != S_IFREG
10449                          || (sb.st_mode & 077) != 0) {
10450                                 result = 1;
10451                         }
10452                         close(fd);
10453                 }
10454         }
10455         if (result == 0
10456          && !strcmp(name[0], name[1]))
10457                 result = 1;
10458         ${cf_cv_main_return:-return}(result);
10459 }
10460
10461 _ACEOF
10462 rm -f conftest$ac_exeext
10463 if { (eval echo "$as_me:10463: \"$ac_link\"") >&5
10464   (eval $ac_link) 2>&5
10465   ac_status=$?
10466   echo "$as_me:10466: \$? = $ac_status" >&5
10467   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10468   { (eval echo "$as_me:10468: \"$ac_try\"") >&5
10469   (eval $ac_try) 2>&5
10470   ac_status=$?
10471   echo "$as_me:10471: \$? = $ac_status" >&5
10472   (exit $ac_status); }; }; then
10473   cf_cv_func_mkstemp=yes
10474
10475 else
10476   echo "$as_me: program exited with status $ac_status" >&5
10477 echo "$as_me: failed program was:" >&5
10478 cat conftest.$ac_ext >&5
10479 cf_cv_func_mkstemp=no
10480
10481 fi
10482 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10483 fi
10484
10485 fi
10486 echo "$as_me:10486: result: $cf_cv_func_mkstemp" >&5
10487 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
10488 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
10489         cat >>confdefs.h <<\EOF
10490 #define HAVE_MKSTEMP 1
10491 EOF
10492
10493 fi
10494
10495 echo "$as_me:10495: checking return type of signal handlers" >&5
10496 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
10497 if test "${ac_cv_type_signal+set}" = set; then
10498   echo $ECHO_N "(cached) $ECHO_C" >&6
10499 else
10500   cat >conftest.$ac_ext <<_ACEOF
10501 #line 10501 "configure"
10502 #include "confdefs.h"
10503 #include <sys/types.h>
10504 #include <signal.h>
10505 #ifdef signal
10506 # undef signal
10507 #endif
10508 #ifdef __cplusplus
10509 extern "C" void (*signal (int, void (*)(int)))(int);
10510 #else
10511 void (*signal ()) ();
10512 #endif
10513
10514 int
10515 main ()
10516 {
10517 int i;
10518   ;
10519   return 0;
10520 }
10521 _ACEOF
10522 rm -f conftest.$ac_objext
10523 if { (eval echo "$as_me:10523: \"$ac_compile\"") >&5
10524   (eval $ac_compile) 2>&5
10525   ac_status=$?
10526   echo "$as_me:10526: \$? = $ac_status" >&5
10527   (exit $ac_status); } &&
10528          { ac_try='test -s conftest.$ac_objext'
10529   { (eval echo "$as_me:10529: \"$ac_try\"") >&5
10530   (eval $ac_try) 2>&5
10531   ac_status=$?
10532   echo "$as_me:10532: \$? = $ac_status" >&5
10533   (exit $ac_status); }; }; then
10534   ac_cv_type_signal=void
10535 else
10536   echo "$as_me: failed program was:" >&5
10537 cat conftest.$ac_ext >&5
10538 ac_cv_type_signal=int
10539 fi
10540 rm -f conftest.$ac_objext conftest.$ac_ext
10541 fi
10542 echo "$as_me:10542: result: $ac_cv_type_signal" >&5
10543 echo "${ECHO_T}$ac_cv_type_signal" >&6
10544
10545 cat >>confdefs.h <<EOF
10546 #define RETSIGTYPE $ac_cv_type_signal
10547 EOF
10548
10549 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
10550         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
10551         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
10552 fi
10553
10554 if test "$cf_with_ada" != "no" ; then
10555
10556 cf_ada_make=gnatmake
10557 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
10558 set dummy $cf_ada_make; ac_word=$2
10559 echo "$as_me:10559: checking for $ac_word" >&5
10560 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10561 if test "${ac_cv_prog_gnat_exists+set}" = set; then
10562   echo $ECHO_N "(cached) $ECHO_C" >&6
10563 else
10564   if test -n "$gnat_exists"; then
10565   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
10566 else
10567   ac_save_IFS=$IFS; IFS=$ac_path_separator
10568 ac_dummy="$PATH"
10569 for ac_dir in $ac_dummy; do
10570   IFS=$ac_save_IFS
10571   test -z "$ac_dir" && ac_dir=.
10572   $as_executable_p "$ac_dir/$ac_word" || continue
10573 ac_cv_prog_gnat_exists="yes"
10574 echo "$as_me:10574: found $ac_dir/$ac_word" >&5
10575 break
10576 done
10577
10578   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
10579 fi
10580 fi
10581 gnat_exists=$ac_cv_prog_gnat_exists
10582 if test -n "$gnat_exists"; then
10583   echo "$as_me:10583: result: $gnat_exists" >&5
10584 echo "${ECHO_T}$gnat_exists" >&6
10585 else
10586   echo "$as_me:10586: result: no" >&5
10587 echo "${ECHO_T}no" >&6
10588 fi
10589
10590 if test "$ac_cv_prog_gnat_exists" = no; then
10591    cf_ada_make=
10592 else
10593
10594 echo "$as_me:10594: checking for gnat version" >&5
10595 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
10596 cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\
10597   sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
10598 echo "$as_me:10598: result: $cf_gnat_version" >&5
10599 echo "${ECHO_T}$cf_gnat_version" >&6
10600
10601 case $cf_gnat_version in
10602   3.1[1-9]*|3.[2-9]*|[4-9].*)
10603     cf_cv_prog_gnat_correct=yes
10604     ;;
10605   *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding.
10606      cf_cv_prog_gnat_correct=no
10607      ;;
10608 esac
10609 case $cf_gnat_version in
10610   3.[1-9]*|[4-9].*)
10611       cf_compile_generics=generics
10612       cf_generic_objects="\${GENOBJS}"
10613       ;;
10614   *)  cf_compile_generics=
10615       cf_generic_objects=
10616       ;;
10617 esac
10618
10619    # Extract the first word of "m4", so it can be a program name with args.
10620 set dummy m4; ac_word=$2
10621 echo "$as_me:10621: checking for $ac_word" >&5
10622 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10623 if test "${ac_cv_prog_M4_exists+set}" = set; then
10624   echo $ECHO_N "(cached) $ECHO_C" >&6
10625 else
10626   if test -n "$M4_exists"; then
10627   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
10628 else
10629   ac_save_IFS=$IFS; IFS=$ac_path_separator
10630 ac_dummy="$PATH"
10631 for ac_dir in $ac_dummy; do
10632   IFS=$ac_save_IFS
10633   test -z "$ac_dir" && ac_dir=.
10634   $as_executable_p "$ac_dir/$ac_word" || continue
10635 ac_cv_prog_M4_exists="yes"
10636 echo "$as_me:10636: found $ac_dir/$ac_word" >&5
10637 break
10638 done
10639
10640   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
10641 fi
10642 fi
10643 M4_exists=$ac_cv_prog_M4_exists
10644 if test -n "$M4_exists"; then
10645   echo "$as_me:10645: result: $M4_exists" >&5
10646 echo "${ECHO_T}$M4_exists" >&6
10647 else
10648   echo "$as_me:10648: result: no" >&5
10649 echo "${ECHO_T}no" >&6
10650 fi
10651
10652    if test "$ac_cv_prog_M4_exists" = no; then
10653       cf_cv_prog_gnat_correct=no
10654       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
10655    fi
10656    if test "$cf_cv_prog_gnat_correct" = yes; then
10657       echo "$as_me:10657: checking if GNAT works" >&5
10658 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
10659
10660 rm -f conftest*
10661 cat >>conftest.ads <<CF_EOF
10662 procedure conftest;
10663 CF_EOF
10664 cat >>conftest.adb <<CF_EOF
10665 with Text_IO;
10666 with GNAT.OS_Lib;
10667 procedure conftest is
10668 begin
10669    Text_IO.Put ("Hello World");
10670    Text_IO.New_Line;
10671    GNAT.OS_Lib.OS_Exit (0);
10672 end conftest;
10673 CF_EOF
10674 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
10675    if ( ./conftest 1>&5 2>&1 ) ; then
10676       cf_cv_prog_gnat_correct=yes
10677    else
10678       cf_cv_prog_gnat_correct=no
10679    fi
10680 else
10681    cf_cv_prog_gnat_correct=no
10682 fi
10683 rm -f conftest*
10684
10685       echo "$as_me:10685: result: $cf_cv_prog_gnat_correct" >&5
10686 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
10687    fi
10688 fi
10689
10690         if test "$cf_cv_prog_gnat_correct" = yes; then
10691
10692         ADAFLAGS="$ADAFLAGS -O3 -gnatpn"
10693
10694 echo "$as_me:10694: checking if GNAT pragma Unreferenced works" >&5
10695 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
10696 if test "${cf_cv_pragma_unreferenced+set}" = set; then
10697   echo $ECHO_N "(cached) $ECHO_C" >&6
10698 else
10699
10700 rm -f conftest*
10701 cat >>conftest.ads <<CF_EOF
10702 procedure conftest;
10703 CF_EOF
10704 cat >>conftest.adb <<CF_EOF
10705 with Text_IO;
10706 with GNAT.OS_Lib;
10707 procedure conftest is
10708    test : Integer;
10709    pragma Unreferenced (test);
10710 begin
10711    test := 1;
10712    Text_IO.Put ("Hello World");
10713    Text_IO.New_Line;
10714    GNAT.OS_Lib.OS_Exit (0);
10715 end conftest;
10716 CF_EOF
10717 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
10718       cf_cv_pragma_unreferenced=yes
10719 else
10720    cf_cv_pragma_unreferenced=no
10721 fi
10722 rm -f conftest*
10723
10724 fi
10725 echo "$as_me:10725: result: $cf_cv_pragma_unreferenced" >&5
10726 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
10727
10728 # if the pragma is supported, use it (needed in the Trace code).
10729 if test $cf_cv_pragma_unreferenced = yes ; then
10730         PRAGMA_UNREF=TRUE
10731 else
10732         PRAGMA_UNREF=FALSE
10733 fi
10734
10735 echo "$as_me:10735: checking for ada-compiler" >&5
10736 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
10737
10738 # Check whether --with-ada-compiler or --without-ada-compiler was given.
10739 if test "${with_ada_compiler+set}" = set; then
10740   withval="$with_ada_compiler"
10741   cf_ada_compiler=$withval
10742 else
10743   cf_ada_compiler=gnatmake
10744 fi;
10745
10746 echo "$as_me:10746: result: $cf_ada_compiler" >&5
10747 echo "${ECHO_T}$cf_ada_compiler" >&6
10748
10749                 cf_ada_package=terminal_interface
10750
10751 echo "$as_me:10751: checking for ada-include" >&5
10752 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
10753
10754 # Check whether --with-ada-include or --without-ada-include was given.
10755 if test "${with_ada_include+set}" = set; then
10756   withval="$with_ada_include"
10757
10758 else
10759   withval="${ADA_INCLUDE-$prefix/share/ada/adainclude}"
10760 fi; if test -n "$prefix/share/ada/adainclude" ; then
10761
10762 if test "x$prefix" != xNONE; then
10763   cf_path_syntax="$prefix"
10764 else
10765   cf_path_syntax="$ac_default_prefix"
10766 fi
10767
10768 case ".$withval" in #(vi
10769 .\$\(*\)*|.\'*\'*) #(vi
10770   ;;
10771 ..|./*|.\\*) #(vi
10772   ;;
10773 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
10774   ;;
10775 .\${*prefix}*) #(vi
10776   eval withval="$withval"
10777   case ".$withval" in #(vi
10778   .NONE/*)
10779     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
10780     ;;
10781   esac
10782   ;; #(vi
10783 .no|.NONE/*)
10784   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
10785   ;;
10786 *)
10787   { { echo "$as_me:10787: error: expected a pathname, not \"$withval\"" >&5
10788 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
10789    { (exit 1); exit 1; }; }
10790   ;;
10791 esac
10792
10793 fi
10794 ADA_INCLUDE="$withval"
10795
10796 echo "$as_me:10796: result: $ADA_INCLUDE" >&5
10797 echo "${ECHO_T}$ADA_INCLUDE" >&6
10798
10799 echo "$as_me:10799: checking for ada-objects" >&5
10800 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
10801
10802 # Check whether --with-ada-objects or --without-ada-objects was given.
10803 if test "${with_ada_objects+set}" = set; then
10804   withval="$with_ada_objects"
10805
10806 else
10807   withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}"
10808 fi; if test -n "$prefix/lib/ada/adalib" ; then
10809
10810 if test "x$prefix" != xNONE; then
10811   cf_path_syntax="$prefix"
10812 else
10813   cf_path_syntax="$ac_default_prefix"
10814 fi
10815
10816 case ".$withval" in #(vi
10817 .\$\(*\)*|.\'*\'*) #(vi
10818   ;;
10819 ..|./*|.\\*) #(vi
10820   ;;
10821 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
10822   ;;
10823 .\${*prefix}*) #(vi
10824   eval withval="$withval"
10825   case ".$withval" in #(vi
10826   .NONE/*)
10827     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
10828     ;;
10829   esac
10830   ;; #(vi
10831 .no|.NONE/*)
10832   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
10833   ;;
10834 *)
10835   { { echo "$as_me:10835: error: expected a pathname, not \"$withval\"" >&5
10836 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
10837    { (exit 1); exit 1; }; }
10838   ;;
10839 esac
10840
10841 fi
10842 ADA_OBJECTS="$withval"
10843
10844 echo "$as_me:10844: result: $ADA_OBJECTS" >&5
10845 echo "${ECHO_T}$ADA_OBJECTS" >&6
10846
10847 echo "$as_me:10847: checking if an Ada95 shared-library should be built" >&5
10848 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
10849
10850 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
10851 if test "${with_ada_sharedlib+set}" = set; then
10852   withval="$with_ada_sharedlib"
10853   with_ada_sharedlib=$withval
10854 else
10855   with_ada_sharedlib=no
10856 fi;
10857 echo "$as_me:10857: result: $with_ada_sharedlib" >&5
10858 echo "${ECHO_T}$with_ada_sharedlib" >&6
10859
10860 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
10861 MAKE_ADA_SHAREDLIB="#"
10862
10863 if test "x$with_ada_sharedlib" != xno
10864 then
10865         MAKE_ADA_SHAREDLIB=
10866         if test "x$with_ada_sharedlib" != xyes
10867         then
10868                 ADA_SHAREDLIB="$with_ada_sharedlib"
10869         fi
10870 fi
10871
10872         fi
10873 fi
10874
10875 ################################################################################
10876
10877 # not needed
10878 TINFO_ARGS2=
10879
10880 ### Construct the list of include-directories to be generated
10881
10882 CPPFLAGS="$CPPFLAGS -I. -I../include"
10883 if test "$srcdir" != "."; then
10884         CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
10885 fi
10886 if test "$GCC" != yes; then
10887         CPPFLAGS="$CPPFLAGS -I\${includedir}"
10888 elif test "$includedir" != "/usr/include"; then
10889         if test "$includedir" = '${prefix}/include' ; then
10890                 if test $prefix != /usr ; then
10891                         CPPFLAGS="$CPPFLAGS -I\${includedir}"
10892                 fi
10893         else
10894                 CPPFLAGS="$CPPFLAGS -I\${includedir}"
10895         fi
10896 fi
10897
10898 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
10899 if test "$srcdir" != "."; then
10900         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
10901 fi
10902 if test "$GCC" != yes; then
10903         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
10904 elif test "$includedir" != "/usr/include"; then
10905         if test "$includedir" = '${prefix}/include' ; then
10906                 if test $prefix != /usr ; then
10907                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
10908                 fi
10909         else
10910                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
10911         fi
10912 fi
10913
10914 ### Build up pieces for makefile rules
10915 echo "$as_me:10915: checking default library suffix" >&5
10916 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
10917
10918         case $DFT_LWR_MODEL in
10919         libtool) DFT_ARG_SUFFIX=''   ;;
10920         normal)  DFT_ARG_SUFFIX=''   ;;
10921         debug)   DFT_ARG_SUFFIX='_g' ;;
10922         profile) DFT_ARG_SUFFIX='_p' ;;
10923         shared)  DFT_ARG_SUFFIX=''   ;;
10924         esac
10925         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
10926 echo "$as_me:10926: result: $DFT_ARG_SUFFIX" >&5
10927 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
10928
10929 echo "$as_me:10929: checking default library-dependency suffix" >&5
10930 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
10931
10932         case $DFT_LWR_MODEL in #(vi
10933         libtool) #(vi
10934                 DFT_LIB_SUFFIX='.la'
10935                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10936                 ;;
10937         normal) #(vi
10938                 DFT_LIB_SUFFIX='.a'
10939                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10940                 ;;
10941         debug) #(vi
10942                 DFT_LIB_SUFFIX='_g.a'
10943                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10944                 ;;
10945         profile) #(vi
10946                 DFT_LIB_SUFFIX='_p.a'
10947                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10948                 ;;
10949         shared) #(vi
10950                 case $cf_cv_system_name in
10951                 aix[56]*) #(vi
10952                         DFT_LIB_SUFFIX='.a'
10953                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10954                         ;;
10955                 cygwin*) #(vi
10956                         DFT_LIB_SUFFIX='.dll'
10957                         DFT_DEP_SUFFIX='.dll.a'
10958                         ;;
10959                 darwin*) #(vi
10960                         DFT_LIB_SUFFIX='.dylib'
10961                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10962                         ;;
10963                 hpux*) #(vi
10964                         case $target in
10965                         ia64*) #(vi
10966                                 DFT_LIB_SUFFIX='.so'
10967                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10968                                 ;;
10969                         *) #(vi
10970                                 DFT_LIB_SUFFIX='.sl'
10971                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10972                                 ;;
10973                         esac
10974                         ;;
10975                 *)      DFT_LIB_SUFFIX='.so'
10976                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
10977                         ;;
10978                 esac
10979         esac
10980         test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
10981         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
10982 echo "$as_me:10982: result: $DFT_DEP_SUFFIX" >&5
10983 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
10984
10985 echo "$as_me:10985: checking default object directory" >&5
10986 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
10987
10988         case $DFT_LWR_MODEL in
10989         libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
10990         normal)  DFT_OBJ_SUBDIR='objects' ;;
10991         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
10992         profile) DFT_OBJ_SUBDIR='obj_p' ;;
10993         shared)
10994                 case $cf_cv_system_name in #(vi
10995                 cygwin) #(vi
10996                         DFT_OBJ_SUBDIR='objects' ;;
10997                 *)
10998                         DFT_OBJ_SUBDIR='obj_s' ;;
10999                 esac
11000         esac
11001 echo "$as_me:11001: result: $DFT_OBJ_SUBDIR" >&5
11002 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
11003
11004 ### Set up low-level terminfo dependencies for makefiles.
11005
11006 if test "$DFT_LWR_MODEL" = shared ; then
11007         case $cf_cv_system_name in #(vi
11008         cygwin*)
11009                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
11010                 ;;
11011         esac
11012 fi
11013
11014 ### Construct the list of subdirectories for which we'll customize makefiles
11015 ### with the appropriate compile-rules.
11016
11017 SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
11018
11019 cat >>confdefs.h <<EOF
11020 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
11021 EOF
11022
11023 ### Now that we're done running tests, add the compiler-warnings, if any
11024
11025 cf_fix_cppflags=no
11026 cf_new_cflags=
11027 cf_new_cppflags=
11028 cf_new_extra_cppflags=
11029
11030 for cf_add_cflags in $EXTRA_CFLAGS
11031 do
11032 case $cf_fix_cppflags in
11033 no)
11034         case $cf_add_cflags in #(vi
11035         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11036                 case $cf_add_cflags in
11037                 -D*)
11038                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11039
11040                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11041                                 && test -z "${cf_tst_cflags}" \
11042                                 && cf_fix_cppflags=yes
11043
11044                         if test $cf_fix_cppflags = yes ; then
11045                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11046                                 continue
11047                         elif test "${cf_tst_cflags}" = "\"'" ; then
11048                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11049                                 continue
11050                         fi
11051                         ;;
11052                 esac
11053                 case "$CPPFLAGS" in
11054                 *$cf_add_cflags) #(vi
11055                         ;;
11056                 *) #(vi
11057                         case $cf_add_cflags in #(vi
11058                         -D*)
11059                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11060
11061 CPPFLAGS=`echo "$CPPFLAGS" | \
11062         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11063                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11064
11065                                 ;;
11066                         esac
11067                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11068                         ;;
11069                 esac
11070                 ;;
11071         *)
11072                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11073                 ;;
11074         esac
11075         ;;
11076 yes)
11077         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11078
11079         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11080
11081         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11082                 && test -z "${cf_tst_cflags}" \
11083                 && cf_fix_cppflags=no
11084         ;;
11085 esac
11086 done
11087
11088 if test -n "$cf_new_cflags" ; then
11089
11090         CFLAGS="$CFLAGS $cf_new_cflags"
11091 fi
11092
11093 if test -n "$cf_new_cppflags" ; then
11094
11095         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11096 fi
11097
11098 if test -n "$cf_new_extra_cppflags" ; then
11099
11100         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11101 fi
11102
11103 ################################################################################
11104
11105 if test x"$enable_pc_files" = xyes ; then \
11106 SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
11107 MAKE_PC_FILES=
11108 else
11109 MAKE_PC_FILES="#"
11110 fi
11111
11112 ################################################################################
11113
11114 TEST_ARG2=
11115
11116 TEST_LIBS2=
11117
11118 NCURSES_SHLIB2="sh -c"
11119
11120 for cf_path in . .. ../..
11121 do
11122         if test -f $cf_path/tar-copy.sh
11123         then
11124                 NCURSES_COPY2=`echo 'sh $(top_srcdir)/'$cf_path'/tar-copy.sh' | sed -e 's,/./,/,'`
11125                 break
11126         fi
11127 done
11128
11129 ADA_SUBDIRS="include gen src samples"
11130 for cf_dir in $ADA_SUBDIRS
11131 do
11132         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
11133 done
11134
11135 NCURSES_TREE="#"
11136
11137 EXTERNAL_TREE=
11138
11139 ac_config_files="$ac_config_files $SUB_MAKEFILES Makefile"
11140 ac_config_commands="$ac_config_commands default"
11141 cat >confcache <<\_ACEOF
11142 # This file is a shell script that caches the results of configure
11143 # tests run on this system so they can be shared between configure
11144 # scripts and configure runs, see configure's option --config-cache.
11145 # It is not useful on other systems.  If it contains results you don't
11146 # want to keep, you may remove or edit it.
11147 #
11148 # config.status only pays attention to the cache file if you give it
11149 # the --recheck option to rerun configure.
11150 #
11151 # `ac_cv_env_foo' variables (set or unset) will be overriden when
11152 # loading this file, other *unset* `ac_cv_foo' will be assigned the
11153 # following values.
11154
11155 _ACEOF
11156
11157 # The following way of writing the cache mishandles newlines in values,
11158 # but we know of no workaround that is simple, portable, and efficient.
11159 # So, don't put newlines in cache variables' values.
11160 # Ultrix sh set writes to stderr and can't be redirected directly,
11161 # and sets the high bit in the cache file unless we assign to the vars.
11162 {
11163   (set) 2>&1 |
11164     case `(ac_space=' '; set | grep ac_space) 2>&1` in
11165     *ac_space=\ *)
11166       # `set' does not quote correctly, so add quotes (double-quote
11167       # substitution turns \\\\ into \\, and sed turns \\ into \).
11168       sed -n \
11169         "s/'/'\\\\''/g;
11170           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
11171       ;;
11172     *)
11173       # `set' quotes correctly as required by POSIX, so do not add quotes.
11174       sed -n \
11175         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
11176       ;;
11177     esac;
11178 } |
11179   sed '
11180      t clear
11181      : clear
11182      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
11183      t end
11184      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
11185      : end' >>confcache
11186 if cmp -s $cache_file confcache; then :; else
11187   if test -w $cache_file; then
11188     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
11189     cat confcache >$cache_file
11190   else
11191     echo "not updating unwritable cache $cache_file"
11192   fi
11193 fi
11194 rm -f confcache
11195
11196 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11197 # Let make expand exec_prefix.
11198 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11199
11200 # VPATH may cause trouble with some makes, so we remove $(srcdir),
11201 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
11202 # trailing colons and then remove the whole line if VPATH becomes empty
11203 # (actually we leave an empty line to preserve line numbers).
11204 if test "x$srcdir" = x.; then
11205   ac_vpsub='/^[         ]*VPATH[        ]*=/{
11206 s/:*\$(srcdir):*/:/;
11207 s/:*\${srcdir}:*/:/;
11208 s/:*@srcdir@:*/:/;
11209 s/^\([^=]*=[    ]*\):*/\1/;
11210 s/:*$//;
11211 s/^[^=]*=[      ]*$//;
11212 }'
11213 fi
11214
11215 DEFS=-DHAVE_CONFIG_H
11216
11217 : ${CONFIG_STATUS=./config.status}
11218 ac_clean_files_save=$ac_clean_files
11219 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
11220 { echo "$as_me:11220: creating $CONFIG_STATUS" >&5
11221 echo "$as_me: creating $CONFIG_STATUS" >&6;}
11222 cat >$CONFIG_STATUS <<_ACEOF
11223 #! $SHELL
11224 # Generated automatically by configure.
11225 # Run this file to recreate the current configuration.
11226 # Compiler output produced by configure, useful for debugging
11227 # configure, is in config.log if it exists.
11228
11229 debug=false
11230 SHELL=\${CONFIG_SHELL-$SHELL}
11231 ac_cs_invocation="\$0 \$@"
11232
11233 _ACEOF
11234
11235 cat >>$CONFIG_STATUS <<\_ACEOF
11236 # Be Bourne compatible
11237 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
11238   emulate sh
11239   NULLCMD=:
11240 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
11241   set -o posix
11242 fi
11243
11244 # Name of the executable.
11245 as_me=`echo "$0" |sed 's,.*[\\/],,'`
11246
11247 if expr a : '\(a\)' >/dev/null 2>&1; then
11248   as_expr=expr
11249 else
11250   as_expr=false
11251 fi
11252
11253 rm -f conf$$ conf$$.exe conf$$.file
11254 echo >conf$$.file
11255 if ln -s conf$$.file conf$$ 2>/dev/null; then
11256   # We could just check for DJGPP; but this test a) works b) is more generic
11257   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
11258   if test -f conf$$.exe; then
11259     # Don't use ln at all; we don't have any links
11260     as_ln_s='cp -p'
11261   else
11262     as_ln_s='ln -s'
11263   fi
11264 elif ln conf$$.file conf$$ 2>/dev/null; then
11265   as_ln_s=ln
11266 else
11267   as_ln_s='cp -p'
11268 fi
11269 rm -f conf$$ conf$$.exe conf$$.file
11270
11271 as_executable_p="test -f"
11272
11273 # Support unset when possible.
11274 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
11275   as_unset=unset
11276 else
11277   as_unset=false
11278 fi
11279
11280 # NLS nuisances.
11281 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
11282 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
11283 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
11284 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
11285 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
11286 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
11287 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
11288 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
11289
11290 # IFS
11291 # We need space, tab and new line, in precisely that order.
11292 as_nl='
11293 '
11294 IFS="   $as_nl"
11295
11296 # CDPATH.
11297 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
11298
11299 exec 6>&1
11300
11301 _ACEOF
11302
11303 # Files that config.status was made for.
11304 if test -n "$ac_config_files"; then
11305   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
11306 fi
11307
11308 if test -n "$ac_config_headers"; then
11309   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
11310 fi
11311
11312 if test -n "$ac_config_links"; then
11313   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
11314 fi
11315
11316 if test -n "$ac_config_commands"; then
11317   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
11318 fi
11319
11320 cat >>$CONFIG_STATUS <<\EOF
11321
11322 ac_cs_usage="\
11323 \`$as_me' instantiates files from templates according to the
11324 current configuration.
11325
11326 Usage: $0 [OPTIONS] [FILE]...
11327
11328   -h, --help       print this help, then exit
11329   -V, --version    print version number, then exit
11330   -d, --debug      don't remove temporary files
11331       --recheck    update $as_me by reconfiguring in the same conditions
11332   --file=FILE[:TEMPLATE]
11333                    instantiate the configuration file FILE
11334   --header=FILE[:TEMPLATE]
11335                    instantiate the configuration header FILE
11336
11337 Configuration files:
11338 $config_files
11339
11340 Configuration headers:
11341 $config_headers
11342
11343 Configuration commands:
11344 $config_commands
11345
11346 Report bugs to <bug-autoconf@gnu.org>."
11347 EOF
11348
11349 cat >>$CONFIG_STATUS <<EOF
11350 ac_cs_version="\\
11351 config.status
11352 configured by $0, generated by GNU Autoconf 2.52.20100530,
11353   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
11354
11355 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
11356 Free Software Foundation, Inc.
11357 This config.status script is free software; the Free Software Foundation
11358 gives unlimited permission to copy, distribute and modify it."
11359 srcdir=$srcdir
11360 INSTALL="$INSTALL"
11361 EOF
11362
11363 cat >>$CONFIG_STATUS <<\EOF
11364 # If no file are specified by the user, then we need to provide default
11365 # value.  By we need to know if files were specified by the user.
11366 ac_need_defaults=:
11367 while test $# != 0
11368 do
11369   case $1 in
11370   --*=*)
11371     ac_option=`expr "x$1" : 'x\([^=]*\)='`
11372     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
11373     shift
11374     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
11375     shift
11376     ;;
11377   -*);;
11378   *) # This is not an option, so the user has probably given explicit
11379      # arguments.
11380      ac_need_defaults=false;;
11381   esac
11382
11383   case $1 in
11384   # Handling of the options.
11385 EOF
11386 cat >>$CONFIG_STATUS <<EOF
11387   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11388     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
11389     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
11390 EOF
11391 cat >>$CONFIG_STATUS <<\EOF
11392   --version | --vers* | -V )
11393     echo "$ac_cs_version"; exit 0 ;;
11394   --he | --h)
11395     # Conflict between --help and --header
11396     { { echo "$as_me:11396: error: ambiguous option: $1
11397 Try \`$0 --help' for more information." >&5
11398 echo "$as_me: error: ambiguous option: $1
11399 Try \`$0 --help' for more information." >&2;}
11400    { (exit 1); exit 1; }; };;
11401   --help | --hel | -h )
11402     echo "$ac_cs_usage"; exit 0 ;;
11403   --debug | --d* | -d )
11404     debug=: ;;
11405   --file | --fil | --fi | --f )
11406     shift
11407     CONFIG_FILES="$CONFIG_FILES $1"
11408     ac_need_defaults=false;;
11409   --header | --heade | --head | --hea )
11410     shift
11411     CONFIG_HEADERS="$CONFIG_HEADERS $1"
11412     ac_need_defaults=false;;
11413
11414   # This is an error.
11415   -*) { { echo "$as_me:11415: error: unrecognized option: $1
11416 Try \`$0 --help' for more information." >&5
11417 echo "$as_me: error: unrecognized option: $1
11418 Try \`$0 --help' for more information." >&2;}
11419    { (exit 1); exit 1; }; } ;;
11420
11421   *) ac_config_targets="$ac_config_targets $1" ;;
11422
11423   esac
11424   shift
11425 done
11426
11427 exec 5>>config.log
11428 cat >&5 << _ACEOF
11429
11430 ## ----------------------- ##
11431 ## Running config.status.  ##
11432 ## ----------------------- ##
11433
11434 This file was extended by $as_me 2.52.20100530, executed with
11435   CONFIG_FILES    = $CONFIG_FILES
11436   CONFIG_HEADERS  = $CONFIG_HEADERS
11437   CONFIG_LINKS    = $CONFIG_LINKS
11438   CONFIG_COMMANDS = $CONFIG_COMMANDS
11439   > $ac_cs_invocation
11440 on `(hostname || uname -n) 2>/dev/null | sed 1q`
11441
11442 _ACEOF
11443 EOF
11444
11445 cat >>$CONFIG_STATUS <<EOF
11446 #
11447 # INIT-COMMANDS section.
11448 #
11449
11450 ### Special initialization commands, used to pass information from the
11451 ### configuration-run into config.status
11452
11453 AWK="$AWK"
11454 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
11455 DFT_LWR_MODEL="$DFT_LWR_MODEL"
11456 ECHO_LINK="$ECHO_LINK"
11457 LIB_NAME="$LIB_NAME"
11458 LIB_SUFFIX="$LIB_SUFFIX"
11459 NCURSES_MAJOR="$NCURSES_MAJOR"
11460 NCURSES_MINOR="$NCURSES_MINOR"
11461 NCURSES_PATCH="$NCURSES_PATCH"
11462 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
11463 cf_cv_abi_version="$cf_cv_abi_version"
11464 cf_cv_rel_version="$cf_cv_rel_version"
11465 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
11466 cf_cv_shared_soname='$cf_cv_shared_soname'
11467 cf_cv_shlib_version="$cf_cv_shlib_version"
11468 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
11469 cf_cv_system_name="$cf_cv_system_name"
11470 host="$host"
11471 target="$target"
11472
11473 EOF
11474
11475 cat >>$CONFIG_STATUS <<\EOF
11476 for ac_config_target in $ac_config_targets
11477 do
11478   case "$ac_config_target" in
11479   # Handling of arguments.
11480   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
11481   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
11482   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
11483   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
11484   *) { { echo "$as_me:11484: error: invalid argument: $ac_config_target" >&5
11485 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
11486    { (exit 1); exit 1; }; };;
11487   esac
11488 done
11489
11490 # If the user did not use the arguments to specify the items to instantiate,
11491 # then the envvar interface is used.  Set only those that are not.
11492 # We use the long form for the default assignment because of an extremely
11493 # bizarre bug on SunOS 4.1.3.
11494 if $ac_need_defaults; then
11495   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
11496   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
11497   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
11498 fi
11499
11500 # Create a temporary directory, and hook for its removal unless debugging.
11501 $debug ||
11502 {
11503   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
11504   trap '{ (exit 1); exit 1; }' 1 2 13 15
11505 }
11506
11507 # Create a (secure) tmp directory for tmp files.
11508 : ${TMPDIR=/tmp}
11509 {
11510   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
11511   test -n "$tmp" && test -d "$tmp"
11512 }  ||
11513 {
11514   tmp=$TMPDIR/cs$$-$RANDOM
11515   (umask 077 && mkdir $tmp)
11516 } ||
11517 {
11518    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
11519    { (exit 1); exit 1; }
11520 }
11521
11522 EOF
11523
11524 cat >>$CONFIG_STATUS <<EOF
11525
11526 #
11527 # CONFIG_FILES section.
11528 #
11529
11530 # No need to generate the scripts if there are no CONFIG_FILES.
11531 # This happens for instance when ./config.status config.h
11532 if test -n "\$CONFIG_FILES"; then
11533   # Protect against being on the right side of a sed subst in config.status.
11534   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
11535    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
11536 s,@SHELL@,$SHELL,;t t
11537 s,@exec_prefix@,$exec_prefix,;t t
11538 s,@prefix@,$prefix,;t t
11539 s,@program_transform_name@,$program_transform_name,;t t
11540 s,@bindir@,$bindir,;t t
11541 s,@sbindir@,$sbindir,;t t
11542 s,@libexecdir@,$libexecdir,;t t
11543 s,@datadir@,$datadir,;t t
11544 s,@sysconfdir@,$sysconfdir,;t t
11545 s,@sharedstatedir@,$sharedstatedir,;t t
11546 s,@localstatedir@,$localstatedir,;t t
11547 s,@libdir@,$libdir,;t t
11548 s,@includedir@,$includedir,;t t
11549 s,@oldincludedir@,$oldincludedir,;t t
11550 s,@infodir@,$infodir,;t t
11551 s,@mandir@,$mandir,;t t
11552 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
11553 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
11554 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
11555 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
11556 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
11557 s,@build_alias@,$build_alias,;t t
11558 s,@host_alias@,$host_alias,;t t
11559 s,@target_alias@,$target_alias,;t t
11560 s,@ECHO_C@,$ECHO_C,;t t
11561 s,@ECHO_N@,$ECHO_N,;t t
11562 s,@ECHO_T@,$ECHO_T,;t t
11563 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
11564 s,@DEFS@,$DEFS,;t t
11565 s,@LIBS@,$LIBS,;t t
11566 s,@top_builddir@,$top_builddir,;t t
11567 s,@build@,$build,;t t
11568 s,@build_cpu@,$build_cpu,;t t
11569 s,@build_vendor@,$build_vendor,;t t
11570 s,@build_os@,$build_os,;t t
11571 s,@host@,$host,;t t
11572 s,@host_cpu@,$host_cpu,;t t
11573 s,@host_vendor@,$host_vendor,;t t
11574 s,@host_os@,$host_os,;t t
11575 s,@target@,$target,;t t
11576 s,@target_cpu@,$target_cpu,;t t
11577 s,@target_vendor@,$target_vendor,;t t
11578 s,@target_os@,$target_os,;t t
11579 s,@CC@,$CC,;t t
11580 s,@CFLAGS@,$CFLAGS,;t t
11581 s,@LDFLAGS@,$LDFLAGS,;t t
11582 s,@CPPFLAGS@,$CPPFLAGS,;t t
11583 s,@ac_ct_CC@,$ac_ct_CC,;t t
11584 s,@EXEEXT@,$EXEEXT,;t t
11585 s,@OBJEXT@,$OBJEXT,;t t
11586 s,@CPP@,$CPP,;t t
11587 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
11588 s,@PROG_EXT@,$PROG_EXT,;t t
11589 s,@AWK@,$AWK,;t t
11590 s,@EGREP@,$EGREP,;t t
11591 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
11592 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
11593 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
11594 s,@LN_S@,$LN_S,;t t
11595 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
11596 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
11597 s,@SET_MAKE@,$SET_MAKE,;t t
11598 s,@CTAGS@,$CTAGS,;t t
11599 s,@ETAGS@,$ETAGS,;t t
11600 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
11601 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
11602 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
11603 s,@RANLIB@,$RANLIB,;t t
11604 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
11605 s,@LD@,$LD,;t t
11606 s,@ac_ct_LD@,$ac_ct_LD,;t t
11607 s,@AR@,$AR,;t t
11608 s,@ac_ct_AR@,$ac_ct_AR,;t t
11609 s,@ARFLAGS@,$ARFLAGS,;t t
11610 s,@DESTDIR@,$DESTDIR,;t t
11611 s,@BUILD_CC@,$BUILD_CC,;t t
11612 s,@BUILD_CPP@,$BUILD_CPP,;t t
11613 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
11614 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
11615 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
11616 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
11617 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
11618 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
11619 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
11620 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
11621 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
11622 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
11623 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
11624 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
11625 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
11626 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
11627 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
11628 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
11629 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
11630 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
11631 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
11632 s,@CC_G_OPT@,$CC_G_OPT,;t t
11633 s,@LD_MODEL@,$LD_MODEL,;t t
11634 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
11635 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
11636 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
11637 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
11638 s,@LINK_PROGS@,$LINK_PROGS,;t t
11639 s,@LINK_TESTS@,$LINK_TESTS,;t t
11640 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
11641 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
11642 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
11643 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
11644 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
11645 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
11646 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
11647 s,@PTHREAD@,$PTHREAD,;t t
11648 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
11649 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
11650 s,@ECHO_LINK@,$ECHO_LINK,;t t
11651 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
11652 s,@ADA_TRACE@,$ADA_TRACE,;t t
11653 s,@gnat_exists@,$gnat_exists,;t t
11654 s,@cf_compile_generics@,$cf_compile_generics,;t t
11655 s,@cf_generic_objects@,$cf_generic_objects,;t t
11656 s,@M4_exists@,$M4_exists,;t t
11657 s,@cf_ada_make@,$cf_ada_make,;t t
11658 s,@ADAFLAGS@,$ADAFLAGS,;t t
11659 s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
11660 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
11661 s,@cf_ada_package@,$cf_ada_package,;t t
11662 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
11663 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
11664 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
11665 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
11666 s,@TINFO_ARGS2@,$TINFO_ARGS2,;t t
11667 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
11668 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
11669 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
11670 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
11671 s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
11672 s,@cross_compiling@,$cross_compiling,;t t
11673 s,@TEST_ARG2@,$TEST_ARG2,;t t
11674 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
11675 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
11676 s,@NCURSES_COPY2@,$NCURSES_COPY2,;t t
11677 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
11678 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
11679 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
11680 CEOF
11681
11682 EOF
11683
11684   cat >>$CONFIG_STATUS <<\EOF
11685   # Split the substitutions into bite-sized pieces for seds with
11686   # small command number limits, like on Digital OSF/1 and HP-UX.
11687   ac_max_sed_lines=48
11688   ac_sed_frag=1 # Number of current file.
11689   ac_beg=1 # First line for current file.
11690   ac_end=$ac_max_sed_lines # Line after last line for current file.
11691   ac_more_lines=:
11692   ac_sed_cmds=
11693   while $ac_more_lines; do
11694     if test $ac_beg -gt 1; then
11695       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
11696     else
11697       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
11698     fi
11699     if test ! -s $tmp/subs.frag; then
11700       ac_more_lines=false
11701     else
11702       # The purpose of the label and of the branching condition is to
11703       # speed up the sed processing (if there are no `@' at all, there
11704       # is no need to browse any of the substitutions).
11705       # These are the two extra sed commands mentioned above.
11706       (echo ':t
11707   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
11708       if test -z "$ac_sed_cmds"; then
11709         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
11710       else
11711         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
11712       fi
11713       ac_sed_frag=`expr $ac_sed_frag + 1`
11714       ac_beg=$ac_end
11715       ac_end=`expr $ac_end + $ac_max_sed_lines`
11716     fi
11717   done
11718   if test -z "$ac_sed_cmds"; then
11719     ac_sed_cmds=cat
11720   fi
11721 fi # test -n "$CONFIG_FILES"
11722
11723 EOF
11724 cat >>$CONFIG_STATUS <<\EOF
11725 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
11726   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11727   case $ac_file in
11728   - | *:- | *:-:* ) # input from stdin
11729         cat >$tmp/stdin
11730         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
11731         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
11732   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
11733         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
11734   * )   ac_file_in=$ac_file.in ;;
11735   esac
11736
11737   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
11738   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
11739          X"$ac_file" : 'X\(//\)[^/]' \| \
11740          X"$ac_file" : 'X\(//\)$' \| \
11741          X"$ac_file" : 'X\(/\)' \| \
11742          .     : '\(.\)' 2>/dev/null ||
11743 echo X"$ac_file" |
11744     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
11745           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
11746           /^X\(\/\/\)$/{ s//\1/; q; }
11747           /^X\(\/\).*/{ s//\1/; q; }
11748           s/.*/./; q'`
11749   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11750     { case "$ac_dir" in
11751   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
11752   *)                      as_incr_dir=.;;
11753 esac
11754 as_dummy="$ac_dir"
11755 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
11756   case $as_mkdir_dir in
11757     # Skip DOS drivespec
11758     ?:) as_incr_dir=$as_mkdir_dir ;;
11759     *)
11760       as_incr_dir=$as_incr_dir/$as_mkdir_dir
11761       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
11762     ;;
11763   esac
11764 done; }
11765
11766     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
11767     # A "../" for each directory in $ac_dir_suffix.
11768     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
11769   else
11770     ac_dir_suffix= ac_dots=
11771   fi
11772
11773   case $srcdir in
11774   .)  ac_srcdir=.
11775       if test -z "$ac_dots"; then
11776          ac_top_srcdir=.
11777       else
11778          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
11779       fi ;;
11780   [\\/]* | ?:[\\/]* )
11781       ac_srcdir=$srcdir$ac_dir_suffix;
11782       ac_top_srcdir=$srcdir ;;
11783   *) # Relative path.
11784     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
11785     ac_top_srcdir=$ac_dots$srcdir ;;
11786   esac
11787
11788   case $INSTALL in
11789   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
11790   *) ac_INSTALL=$ac_dots$INSTALL ;;
11791   esac
11792
11793   if test x"$ac_file" != x-; then
11794     { echo "$as_me:11794: creating $ac_file" >&5
11795 echo "$as_me: creating $ac_file" >&6;}
11796     rm -f "$ac_file"
11797   fi
11798   # Let's still pretend it is `configure' which instantiates (i.e., don't
11799   # use $as_me), people would be surprised to read:
11800   #    /* config.h.  Generated automatically by config.status.  */
11801   configure_input="Generated automatically from `echo $ac_file_in |
11802                                                  sed 's,.*/,,'` by configure."
11803
11804   # First look for the input files in the build tree, otherwise in the
11805   # src tree.
11806   ac_file_inputs=`IFS=:
11807     for f in $ac_file_in; do
11808       case $f in
11809       -) echo $tmp/stdin ;;
11810       [\\/$]*)
11811          # Absolute (can't be DOS-style, as IFS=:)
11812          test -f "$f" || { { echo "$as_me:11812: error: cannot find input file: $f" >&5
11813 echo "$as_me: error: cannot find input file: $f" >&2;}
11814    { (exit 1); exit 1; }; }
11815          echo $f;;
11816       *) # Relative
11817          if test -f "$f"; then
11818            # Build tree
11819            echo $f
11820          elif test -f "$srcdir/$f"; then
11821            # Source tree
11822            echo $srcdir/$f
11823          else
11824            # /dev/null tree
11825            { { echo "$as_me:11825: error: cannot find input file: $f" >&5
11826 echo "$as_me: error: cannot find input file: $f" >&2;}
11827    { (exit 1); exit 1; }; }
11828          fi;;
11829       esac
11830     done` || { (exit 1); exit 1; }
11831 EOF
11832 cat >>$CONFIG_STATUS <<EOF
11833   sed "$ac_vpsub
11834 $extrasub
11835 EOF
11836 cat >>$CONFIG_STATUS <<\EOF
11837 :t
11838 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
11839 s,@configure_input@,$configure_input,;t t
11840 s,@srcdir@,$ac_srcdir,;t t
11841 s,@top_srcdir@,$ac_top_srcdir,;t t
11842 s,@INSTALL@,$ac_INSTALL,;t t
11843 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
11844   rm -f $tmp/stdin
11845   if test x"$ac_file" != x-; then
11846     mv $tmp/out $ac_file
11847   else
11848     cat $tmp/out
11849     rm -f $tmp/out
11850   fi
11851
11852 done
11853 EOF
11854 cat >>$CONFIG_STATUS <<\EOF
11855
11856 #
11857 # CONFIG_HEADER section.
11858 #
11859
11860 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
11861 # NAME is the cpp macro being defined and VALUE is the value it is being given.
11862 #
11863 # ac_d sets the value in "#define NAME VALUE" lines.
11864 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
11865 ac_dB='[        ].*$,\1#\2'
11866 ac_dC=' '
11867 ac_dD=',;t'
11868 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
11869 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11870 ac_iB='\([      ]\),\1#\2define\3'
11871 ac_iC=' '
11872 ac_iD='\4,;t'
11873 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
11874 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11875 ac_uB='$,\1#\2define\3'
11876 ac_uC=' '
11877 ac_uD=',;t'
11878
11879 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
11880   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11881   case $ac_file in
11882   - | *:- | *:-:* ) # input from stdin
11883         cat >$tmp/stdin
11884         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
11885         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
11886   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
11887         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
11888   * )   ac_file_in=$ac_file.in ;;
11889   esac
11890
11891   test x"$ac_file" != x- && { echo "$as_me:11891: creating $ac_file" >&5
11892 echo "$as_me: creating $ac_file" >&6;}
11893
11894   # First look for the input files in the build tree, otherwise in the
11895   # src tree.
11896   ac_file_inputs=`IFS=:
11897     for f in $ac_file_in; do
11898       case $f in
11899       -) echo $tmp/stdin ;;
11900       [\\/$]*)
11901          # Absolute (can't be DOS-style, as IFS=:)
11902          test -f "$f" || { { echo "$as_me:11902: error: cannot find input file: $f" >&5
11903 echo "$as_me: error: cannot find input file: $f" >&2;}
11904    { (exit 1); exit 1; }; }
11905          echo $f;;
11906       *) # Relative
11907          if test -f "$f"; then
11908            # Build tree
11909            echo $f
11910          elif test -f "$srcdir/$f"; then
11911            # Source tree
11912            echo $srcdir/$f
11913          else
11914            # /dev/null tree
11915            { { echo "$as_me:11915: error: cannot find input file: $f" >&5
11916 echo "$as_me: error: cannot find input file: $f" >&2;}
11917    { (exit 1); exit 1; }; }
11918          fi;;
11919       esac
11920     done` || { (exit 1); exit 1; }
11921   # Remove the trailing spaces.
11922   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
11923
11924 EOF
11925
11926 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
11927 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
11928 # be either 'cat' or 'sort'.
11929 cat confdefs.h | uniq >conftest.vals
11930
11931 # Break up conftest.vals because some shells have a limit on
11932 # the size of here documents, and old seds have small limits too.
11933
11934 rm -f conftest.tail
11935 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
11936 while grep . conftest.vals >/dev/null
11937 do
11938   # Write chunks of a limited-size here document to conftest.frag.
11939   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
11940   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
11941   echo 'CEOF' >> $CONFIG_STATUS
11942   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
11943   rm -f conftest.vals
11944   mv conftest.tail conftest.vals
11945 done
11946 rm -f conftest.vals
11947
11948 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
11949 # marker @DEFS@.
11950 echo '  cat >> conftest.edit <<CEOF
11951 /@DEFS@/r conftest.frag
11952 /@DEFS@/d
11953 CEOF
11954 sed -f conftest.edit $tmp/in > $tmp/out
11955 rm -f $tmp/in
11956 mv $tmp/out $tmp/in
11957 rm -f conftest.edit conftest.frag
11958 ' >> $CONFIG_STATUS
11959
11960 cat >>$CONFIG_STATUS <<\EOF
11961   # Let's still pretend it is `configure' which instantiates (i.e., don't
11962   # use $as_me), people would be surprised to read:
11963   #    /* config.h.  Generated automatically by config.status.  */
11964   if test x"$ac_file" = x-; then
11965     echo "/* Generated automatically by configure.  */" >$tmp/config.h
11966   else
11967     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
11968   fi
11969   cat $tmp/in >>$tmp/config.h
11970   rm -f $tmp/in
11971   if test x"$ac_file" != x-; then
11972     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
11973       { echo "$as_me:11973: $ac_file is unchanged" >&5
11974 echo "$as_me: $ac_file is unchanged" >&6;}
11975     else
11976       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
11977          X"$ac_file" : 'X\(//\)[^/]' \| \
11978          X"$ac_file" : 'X\(//\)$' \| \
11979          X"$ac_file" : 'X\(/\)' \| \
11980          .     : '\(.\)' 2>/dev/null ||
11981 echo X"$ac_file" |
11982     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
11983           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
11984           /^X\(\/\/\)$/{ s//\1/; q; }
11985           /^X\(\/\).*/{ s//\1/; q; }
11986           s/.*/./; q'`
11987       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11988         { case "$ac_dir" in
11989   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
11990   *)                      as_incr_dir=.;;
11991 esac
11992 as_dummy="$ac_dir"
11993 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
11994   case $as_mkdir_dir in
11995     # Skip DOS drivespec
11996     ?:) as_incr_dir=$as_mkdir_dir ;;
11997     *)
11998       as_incr_dir=$as_incr_dir/$as_mkdir_dir
11999       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
12000     ;;
12001   esac
12002 done; }
12003
12004       fi
12005       rm -f $ac_file
12006       mv $tmp/config.h $ac_file
12007     fi
12008   else
12009     cat $tmp/config.h
12010     rm -f $tmp/config.h
12011   fi
12012 done
12013 EOF
12014 cat >>$CONFIG_STATUS <<\EOF
12015 #
12016 # CONFIG_COMMANDS section.
12017 #
12018 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
12019   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
12020   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
12021
12022   case $ac_dest in
12023     default )
12024 if test -z "$USE_OLD_MAKERULES" ; then
12025         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
12026 fi
12027  ;;
12028   esac
12029 done
12030 EOF
12031
12032 cat >>$CONFIG_STATUS <<\EOF
12033
12034 { (exit 0); exit 0; }
12035 EOF
12036 chmod +x $CONFIG_STATUS
12037 ac_clean_files=$ac_clean_files_save
12038
12039 # configure is writing to config.log, and then calls config.status.
12040 # config.status does its own redirection, appending to config.log.
12041 # Unfortunately, on DOS this fails, as config.log is still kept open
12042 # by configure, so config.status won't be able to write to it; its
12043 # output is simply discarded.  So we exec the FD to /dev/null,
12044 # effectively closing config.log, so it can be properly (re)opened and
12045 # appended to by config.status.  When coming back to configure, we
12046 # need to make the FD available again.
12047 if test "$no_create" != yes; then
12048   ac_cs_success=:
12049   exec 5>/dev/null
12050   $SHELL $CONFIG_STATUS || ac_cs_success=false
12051   exec 5>>config.log
12052   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
12053   # would make configure fail if this is the last instruction.
12054   $ac_cs_success || { (exit 1); exit 1; }
12055 fi
12056 ${MAKE-make} preinstall