]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.7 - patch 20101106
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20101001.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108 # Factoring default headers for most tests.
109 ac_includes_default="\
110 #include <stdio.h>
111 #if HAVE_SYS_TYPES_H
112 # include <sys/types.h>
113 #endif
114 #if HAVE_SYS_STAT_H
115 # include <sys/stat.h>
116 #endif
117 #if STDC_HEADERS
118 # include <stdlib.h>
119 # include <stddef.h>
120 #else
121 # if HAVE_STDLIB_H
122 #  include <stdlib.h>
123 # endif
124 #endif
125 #if HAVE_STRING_H
126 # if !STDC_HEADERS && HAVE_MEMORY_H
127 #  include <memory.h>
128 # endif
129 # include <string.h>
130 #endif
131 #if HAVE_STRINGS_H
132 # include <strings.h>
133 #endif
134 #if HAVE_INTTYPES_H
135 # include <inttypes.h>
136 #else
137 # if HAVE_STDINT_H
138 #  include <stdint.h>
139 # endif
140 #endif
141 #if HAVE_UNISTD_H
142 # include <unistd.h>
143 #endif"
144
145 # Initialize some variables set by options.
146 ac_init_help=
147 ac_init_version=false
148 # The variables have the same names as the options, with
149 # dashes changed to underlines.
150 cache_file=/dev/null
151 exec_prefix=NONE
152 no_create=
153 no_recursion=
154 prefix=NONE
155 program_prefix=NONE
156 program_suffix=NONE
157 program_transform_name=s,x,x,
158 silent=
159 site=
160 srcdir=
161 verbose=
162 x_includes=NONE
163 x_libraries=NONE
164
165 # Installation directory options.
166 # These are left unexpanded so users can "make install exec_prefix=/foo"
167 # and all the variables that are supposed to be based on exec_prefix
168 # by default will actually change.
169 # Use braces instead of parens because sh, perl, etc. also accept them.
170 bindir='${exec_prefix}/bin'
171 sbindir='${exec_prefix}/sbin'
172 libexecdir='${exec_prefix}/libexec'
173 datadir='${prefix}/share'
174 sysconfdir='${prefix}/etc'
175 sharedstatedir='${prefix}/com'
176 localstatedir='${prefix}/var'
177 libdir='${exec_prefix}/lib'
178 includedir='${prefix}/include'
179 oldincludedir='/usr/include'
180 infodir='${prefix}/info'
181 mandir='${prefix}/man'
182
183 # Identity of this package.
184 PACKAGE_NAME=
185 PACKAGE_TARNAME=
186 PACKAGE_VERSION=
187 PACKAGE_STRING=
188 PACKAGE_BUGREPORT=
189
190 ac_prev=
191 for ac_option
192 do
193   # If the previous option needs an argument, assign it.
194   if test -n "$ac_prev"; then
195     eval "$ac_prev=\$ac_option"
196     ac_prev=
197     continue
198   fi
199
200   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
201
202   # Accept the important Cygnus configure options, so we can diagnose typos.
203
204   case $ac_option in
205
206   -bindir | --bindir | --bindi | --bind | --bin | --bi)
207     ac_prev=bindir ;;
208   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
209     bindir=$ac_optarg ;;
210
211   -build | --build | --buil | --bui | --bu)
212     ac_prev=build_alias ;;
213   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
214     build_alias=$ac_optarg ;;
215
216   -cache-file | --cache-file | --cache-fil | --cache-fi \
217   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
218     ac_prev=cache_file ;;
219   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
220   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
221     cache_file=$ac_optarg ;;
222
223   --config-cache | -C)
224     cache_file=config.cache ;;
225
226   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
227     ac_prev=datadir ;;
228   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
229   | --da=*)
230     datadir=$ac_optarg ;;
231
232   -disable-* | --disable-*)
233     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
234     # Reject names that are not valid shell variable names.
235     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
236       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
237    { (exit 1); exit 1; }; }
238     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
239     eval "enable_$ac_feature=no" ;;
240
241   -enable-* | --enable-*)
242     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
243     # Reject names that are not valid shell variable names.
244     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
245       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
246    { (exit 1); exit 1; }; }
247     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
248     case $ac_option in
249       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
250       *) ac_optarg=yes ;;
251     esac
252     eval "enable_$ac_feature='$ac_optarg'" ;;
253
254   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
255   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
256   | --exec | --exe | --ex)
257     ac_prev=exec_prefix ;;
258   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
259   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
260   | --exec=* | --exe=* | --ex=*)
261     exec_prefix=$ac_optarg ;;
262
263   -gas | --gas | --ga | --g)
264     # Obsolete; use --with-gas.
265     with_gas=yes ;;
266
267   -help | --help | --hel | --he | -h)
268     ac_init_help=long ;;
269   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
270     ac_init_help=recursive ;;
271   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
272     ac_init_help=short ;;
273
274   -host | --host | --hos | --ho)
275     ac_prev=host_alias ;;
276   -host=* | --host=* | --hos=* | --ho=*)
277     host_alias=$ac_optarg ;;
278
279   -includedir | --includedir | --includedi | --included | --include \
280   | --includ | --inclu | --incl | --inc)
281     ac_prev=includedir ;;
282   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
283   | --includ=* | --inclu=* | --incl=* | --inc=*)
284     includedir=$ac_optarg ;;
285
286   -infodir | --infodir | --infodi | --infod | --info | --inf)
287     ac_prev=infodir ;;
288   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
289     infodir=$ac_optarg ;;
290
291   -libdir | --libdir | --libdi | --libd)
292     ac_prev=libdir ;;
293   -libdir=* | --libdir=* | --libdi=* | --libd=*)
294     libdir=$ac_optarg ;;
295
296   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
297   | --libexe | --libex | --libe)
298     ac_prev=libexecdir ;;
299   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
300   | --libexe=* | --libex=* | --libe=*)
301     libexecdir=$ac_optarg ;;
302
303   -localstatedir | --localstatedir | --localstatedi | --localstated \
304   | --localstate | --localstat | --localsta | --localst \
305   | --locals | --local | --loca | --loc | --lo)
306     ac_prev=localstatedir ;;
307   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
308   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
309   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
310     localstatedir=$ac_optarg ;;
311
312   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
313     ac_prev=mandir ;;
314   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
315     mandir=$ac_optarg ;;
316
317   -nfp | --nfp | --nf)
318     # Obsolete; use --without-fp.
319     with_fp=no ;;
320
321   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
322   | --no-cr | --no-c)
323     no_create=yes ;;
324
325   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
326   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
327     no_recursion=yes ;;
328
329   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
330   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
331   | --oldin | --oldi | --old | --ol | --o)
332     ac_prev=oldincludedir ;;
333   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
334   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
335   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
336     oldincludedir=$ac_optarg ;;
337
338   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
339     ac_prev=prefix ;;
340   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
341     prefix=$ac_optarg ;;
342
343   -program-prefix | --program-prefix | --program-prefi | --program-pref \
344   | --program-pre | --program-pr | --program-p)
345     ac_prev=program_prefix ;;
346   -program-prefix=* | --program-prefix=* | --program-prefi=* \
347   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
348     program_prefix=$ac_optarg ;;
349
350   -program-suffix | --program-suffix | --program-suffi | --program-suff \
351   | --program-suf | --program-su | --program-s)
352     ac_prev=program_suffix ;;
353   -program-suffix=* | --program-suffix=* | --program-suffi=* \
354   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
355     program_suffix=$ac_optarg ;;
356
357   -program-transform-name | --program-transform-name \
358   | --program-transform-nam | --program-transform-na \
359   | --program-transform-n | --program-transform- \
360   | --program-transform | --program-transfor \
361   | --program-transfo | --program-transf \
362   | --program-trans | --program-tran \
363   | --progr-tra | --program-tr | --program-t)
364     ac_prev=program_transform_name ;;
365   -program-transform-name=* | --program-transform-name=* \
366   | --program-transform-nam=* | --program-transform-na=* \
367   | --program-transform-n=* | --program-transform-=* \
368   | --program-transform=* | --program-transfor=* \
369   | --program-transfo=* | --program-transf=* \
370   | --program-trans=* | --program-tran=* \
371   | --progr-tra=* | --program-tr=* | --program-t=*)
372     program_transform_name=$ac_optarg ;;
373
374   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
375   | -silent | --silent | --silen | --sile | --sil)
376     silent=yes ;;
377
378   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
379     ac_prev=sbindir ;;
380   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
381   | --sbi=* | --sb=*)
382     sbindir=$ac_optarg ;;
383
384   -sharedstatedir | --sharedstatedir | --sharedstatedi \
385   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
386   | --sharedst | --shareds | --shared | --share | --shar \
387   | --sha | --sh)
388     ac_prev=sharedstatedir ;;
389   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
390   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
391   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
392   | --sha=* | --sh=*)
393     sharedstatedir=$ac_optarg ;;
394
395   -site | --site | --sit)
396     ac_prev=site ;;
397   -site=* | --site=* | --sit=*)
398     site=$ac_optarg ;;
399
400   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
401     ac_prev=srcdir ;;
402   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
403     srcdir=$ac_optarg ;;
404
405   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
406   | --syscon | --sysco | --sysc | --sys | --sy)
407     ac_prev=sysconfdir ;;
408   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
409   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
410     sysconfdir=$ac_optarg ;;
411
412   -target | --target | --targe | --targ | --tar | --ta | --t)
413     ac_prev=target_alias ;;
414   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
415     target_alias=$ac_optarg ;;
416
417   -v | -verbose | --verbose | --verbos | --verbo | --verb)
418     verbose=yes ;;
419
420   -version | --version | --versio | --versi | --vers | -V)
421     ac_init_version=: ;;
422
423   -with-* | --with-*)
424     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
425     # Reject names that are not valid shell variable names.
426     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
427       { echo "$as_me: error: invalid package name: $ac_package" >&2
428    { (exit 1); exit 1; }; }
429     ac_package=`echo $ac_package| sed 's/-/_/g'`
430     case $ac_option in
431       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
432       *) ac_optarg=yes ;;
433     esac
434     eval "with_$ac_package='$ac_optarg'" ;;
435
436   -without-* | --without-*)
437     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
438     # Reject names that are not valid shell variable names.
439     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
440       { echo "$as_me: error: invalid package name: $ac_package" >&2
441    { (exit 1); exit 1; }; }
442     ac_package=`echo $ac_package | sed 's/-/_/g'`
443     eval "with_$ac_package=no" ;;
444
445   --x)
446     # Obsolete; use --with-x.
447     with_x=yes ;;
448
449   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
450   | --x-incl | --x-inc | --x-in | --x-i)
451     ac_prev=x_includes ;;
452   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
453   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
454     x_includes=$ac_optarg ;;
455
456   -x-libraries | --x-libraries | --x-librarie | --x-librari \
457   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
458     ac_prev=x_libraries ;;
459   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
460   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
461     x_libraries=$ac_optarg ;;
462
463   -*) { echo "$as_me: error: unrecognized option: $ac_option
464 Try \`$0 --help' for more information." >&2
465    { (exit 1); exit 1; }; }
466     ;;
467
468   *=*)
469     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
470     # Reject names that are not valid shell variable names.
471     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
472       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
473    { (exit 1); exit 1; }; }
474     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
475     eval "$ac_envvar='$ac_optarg'"
476     export $ac_envvar ;;
477
478   *)
479     # FIXME: should be removed in autoconf 3.0.
480     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
481     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
482       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
483     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
484     ;;
485
486   esac
487 done
488
489 if test -n "$ac_prev"; then
490   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
491   { echo "$as_me: error: missing argument to $ac_option" >&2
492    { (exit 1); exit 1; }; }
493 fi
494
495 # Be sure to have absolute paths.
496 for ac_var in exec_prefix prefix
497 do
498   eval ac_val=$`echo $ac_var`
499   case $ac_val in
500     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
501     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
502    { (exit 1); exit 1; }; };;
503   esac
504 done
505
506 # Be sure to have absolute paths.
507 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
508               localstatedir libdir includedir oldincludedir infodir mandir
509 do
510   eval ac_val=$`echo $ac_var`
511   case $ac_val in
512     [\\/$]* | ?:[\\/]* ) ;;
513     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
514    { (exit 1); exit 1; }; };;
515   esac
516 done
517
518 # There might be people who depend on the old broken behavior: `$host'
519 # used to hold the argument of --host etc.
520 build=$build_alias
521 host=$host_alias
522 target=$target_alias
523
524 # FIXME: should be removed in autoconf 3.0.
525 if test "x$host_alias" != x; then
526   if test "x$build_alias" = x; then
527     cross_compiling=maybe
528     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
529     If a cross compiler is detected then cross compile mode will be used." >&2
530   elif test "x$build_alias" != "x$host_alias"; then
531     cross_compiling=yes
532   fi
533 fi
534
535 ac_tool_prefix=
536 test -n "$host_alias" && ac_tool_prefix=$host_alias-
537
538 test "$silent" = yes && exec 6>/dev/null
539
540 # Find the source files, if location was not specified.
541 if test -z "$srcdir"; then
542   ac_srcdir_defaulted=yes
543   # Try the directory containing this script, then its parent.
544   ac_prog=$0
545   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
546   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
547   srcdir=$ac_confdir
548   if test ! -r $srcdir/$ac_unique_file; then
549     srcdir=..
550   fi
551 else
552   ac_srcdir_defaulted=no
553 fi
554 if test ! -r $srcdir/$ac_unique_file; then
555   if test "$ac_srcdir_defaulted" = yes; then
556     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
557    { (exit 1); exit 1; }; }
558   else
559     { echo "$as_me: error: cannot find sources in $srcdir" >&2
560    { (exit 1); exit 1; }; }
561   fi
562 fi
563 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
564 ac_env_build_alias_set=${build_alias+set}
565 ac_env_build_alias_value=$build_alias
566 ac_cv_env_build_alias_set=${build_alias+set}
567 ac_cv_env_build_alias_value=$build_alias
568 ac_env_host_alias_set=${host_alias+set}
569 ac_env_host_alias_value=$host_alias
570 ac_cv_env_host_alias_set=${host_alias+set}
571 ac_cv_env_host_alias_value=$host_alias
572 ac_env_target_alias_set=${target_alias+set}
573 ac_env_target_alias_value=$target_alias
574 ac_cv_env_target_alias_set=${target_alias+set}
575 ac_cv_env_target_alias_value=$target_alias
576 ac_env_CC_set=${CC+set}
577 ac_env_CC_value=$CC
578 ac_cv_env_CC_set=${CC+set}
579 ac_cv_env_CC_value=$CC
580 ac_env_CFLAGS_set=${CFLAGS+set}
581 ac_env_CFLAGS_value=$CFLAGS
582 ac_cv_env_CFLAGS_set=${CFLAGS+set}
583 ac_cv_env_CFLAGS_value=$CFLAGS
584 ac_env_LDFLAGS_set=${LDFLAGS+set}
585 ac_env_LDFLAGS_value=$LDFLAGS
586 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
587 ac_cv_env_LDFLAGS_value=$LDFLAGS
588 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
589 ac_env_CPPFLAGS_value=$CPPFLAGS
590 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
591 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
592 ac_env_CPP_set=${CPP+set}
593 ac_env_CPP_value=$CPP
594 ac_cv_env_CPP_set=${CPP+set}
595 ac_cv_env_CPP_value=$CPP
596
597 #
598 # Report the --help message.
599 #
600 if test "$ac_init_help" = "long"; then
601   # Omit some internal or obsolete options to make the list less imposing.
602   # This message is too long to be a string in the A/UX 3.1 sh.
603   cat <<EOF
604 \`configure' configures this package to adapt to many kinds of systems.
605
606 Usage: $0 [OPTION]... [VAR=VALUE]...
607
608 To assign environment variables (e.g., CC, CFLAGS...), specify them as
609 VAR=VALUE.  See below for descriptions of some of the useful variables.
610
611 Defaults for the options are specified in brackets.
612
613 Configuration:
614   -h, --help              display this help and exit
615       --help=short        display options specific to this package
616       --help=recursive    display the short help of all the included packages
617   -V, --version           display version information and exit
618   -q, --quiet, --silent   do not print \`checking...' messages
619       --cache-file=FILE   cache test results in FILE [disabled]
620   -C, --config-cache      alias for \`--cache-file=config.cache'
621   -n, --no-create         do not create output files
622       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
623
624 EOF
625
626   cat <<EOF
627 Installation directories:
628   --prefix=PREFIX         install architecture-independent files in PREFIX
629                           [$ac_default_prefix]
630   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
631                           [PREFIX]
632
633 By default, \`make install' will install all the files in
634 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
635 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
636 for instance \`--prefix=\$HOME'.
637
638 For better control, use the options below.
639
640 Fine tuning of the installation directories:
641   --bindir=DIR            user executables [EPREFIX/bin]
642   --sbindir=DIR           system admin executables [EPREFIX/sbin]
643   --libexecdir=DIR        program executables [EPREFIX/libexec]
644   --datadir=DIR           read-only architecture-independent data [PREFIX/share]
645   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
646   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
647   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
648   --libdir=DIR            object code libraries [EPREFIX/lib]
649   --includedir=DIR        C header files [PREFIX/include]
650   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
651   --infodir=DIR           info documentation [PREFIX/info]
652   --mandir=DIR            man documentation [PREFIX/man]
653 EOF
654
655   cat <<\EOF
656
657 Program names:
658   --program-prefix=PREFIX            prepend PREFIX to installed program names
659   --program-suffix=SUFFIX            append SUFFIX to installed program names
660   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
661
662 X features:
663   --x-includes=DIR    X include files are in DIR
664   --x-libraries=DIR   X library files are in DIR
665
666 System types:
667   --build=BUILD           configure for building on BUILD [guessed]
668   --host=HOST       build programs to run on HOST [BUILD]
669 EOF
670 fi
671
672 if test -n "$ac_init_help"; then
673
674   cat <<\EOF
675
676 Optional Features:
677   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
678   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
679
680 Optional Packages:
681   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
682   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
683
684   --disable-echo          display "compiling" commands
685   --enable-warnings       test: turn on gcc compiler warnings
686   --with-curses-dir=DIR   directory in which (n)curses is installed
687   --with-5lib             use SunOS sysv-libraries
688   --with-ncursesw         use wide ncurses-libraries (installed)
689   --with-ncurses          use ncurses-libraries (installed)
690   --with-pdcurses         compile/link with pdcurses X11 library
691   --with-Xaw3d            link with Xaw 3d library
692   --with-neXtaw           link with neXT Athena library
693   --with-XawPlus          link with Athena-Plus library
694   --with-pkg-config{=path} enable/disable use of pkg-config
695   --with-x                use the X Window System
696   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
697
698 Some influential environment variables:
699   CC          C compiler command
700   CFLAGS      C compiler flags
701   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
702               nonstandard directory <lib dir>
703   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
704               headers in a nonstandard directory <include dir>
705   CPP         C preprocessor
706
707 Use these variables to override the choices made by `configure' or to help
708 it to find libraries and programs with nonstandard names/locations.
709
710 EOF
711 fi
712
713 if test "$ac_init_help" = "recursive"; then
714   # If there are subdirs, report their specific --help.
715   ac_popdir=`pwd`
716   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
717     cd $ac_subdir
718     # A "../" for each directory in /$ac_subdir.
719     ac_dots=`echo $ac_subdir |
720              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
721
722     case $srcdir in
723     .) # No --srcdir option.  We are building in place.
724       ac_sub_srcdir=$srcdir ;;
725     [\\/]* | ?:[\\/]* ) # Absolute path.
726       ac_sub_srcdir=$srcdir/$ac_subdir ;;
727     *) # Relative path.
728       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
729     esac
730
731     # Check for guested configure; otherwise get Cygnus style configure.
732     if test -f $ac_sub_srcdir/configure.gnu; then
733       echo
734       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
735     elif test -f $ac_sub_srcdir/configure; then
736       echo
737       $SHELL $ac_sub_srcdir/configure  --help=recursive
738     elif test -f $ac_sub_srcdir/configure.ac ||
739            test -f $ac_sub_srcdir/configure.in; then
740       echo
741       $ac_configure --help
742     else
743       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
744     fi
745     cd $ac_popdir
746   done
747 fi
748
749 test -n "$ac_init_help" && exit 0
750 if $ac_init_version; then
751   cat <<\EOF
752
753 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
754 Free Software Foundation, Inc.
755 This configure script is free software; the Free Software Foundation
756 gives unlimited permission to copy, distribute and modify it.
757 EOF
758   exit 0
759 fi
760 exec 5>config.log
761 cat >&5 <<EOF
762 This file contains any messages produced by compilers while
763 running configure, to aid debugging if configure makes a mistake.
764
765 It was created by $as_me, which was
766 generated by GNU Autoconf 2.52.20101001.  Invocation command line was
767
768   $ $0 $@
769
770 EOF
771 {
772 cat <<_ASUNAME
773 ## ---------- ##
774 ## Platform.  ##
775 ## ---------- ##
776
777 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
778 uname -m = `(uname -m) 2>/dev/null || echo unknown`
779 uname -r = `(uname -r) 2>/dev/null || echo unknown`
780 uname -s = `(uname -s) 2>/dev/null || echo unknown`
781 uname -v = `(uname -v) 2>/dev/null || echo unknown`
782
783 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
784 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
785
786 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
787 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
788 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
789 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
790 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
791 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
792 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
793
794 PATH = $PATH
795
796 _ASUNAME
797 } >&5
798
799 cat >&5 <<EOF
800 ## ------------ ##
801 ## Core tests.  ##
802 ## ------------ ##
803
804 EOF
805
806 # Keep a trace of the command line.
807 # Strip out --no-create and --no-recursion so they do not pile up.
808 # Also quote any args containing shell meta-characters.
809 ac_configure_args=
810 ac_sep=
811 for ac_arg
812 do
813   case $ac_arg in
814   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
815   | --no-cr | --no-c) ;;
816   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
817   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
818   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
819     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
820     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
821     ac_sep=" " ;;
822   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
823      ac_sep=" " ;;
824   esac
825   # Get rid of the leading space.
826 done
827
828 # When interrupted or exit'd, cleanup temporary files, and complete
829 # config.log.  We remove comments because anyway the quotes in there
830 # would cause problems or look ugly.
831 trap 'exit_status=$?
832   # Save into config.log some information that might help in debugging.
833   echo >&5
834   echo "## ----------------- ##" >&5
835   echo "## Cache variables.  ##" >&5
836   echo "## ----------------- ##" >&5
837   echo >&5
838   # The following way of writing the cache mishandles newlines in values,
839 {
840   (set) 2>&1 |
841     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
842     *ac_space=\ *)
843       sed -n \
844         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
845           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
846       ;;
847     *)
848       sed -n \
849         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
850       ;;
851     esac;
852 } >&5
853   sed "/^$/d" confdefs.h >conftest.log
854   if test -s conftest.log; then
855     echo >&5
856     echo "## ------------ ##" >&5
857     echo "## confdefs.h.  ##" >&5
858     echo "## ------------ ##" >&5
859     echo >&5
860     cat conftest.log >&5
861   fi
862   (echo; echo) >&5
863   test "$ac_signal" != 0 &&
864     echo "$as_me: caught signal $ac_signal" >&5
865   echo "$as_me: exit $exit_status" >&5
866   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
867     exit $exit_status
868      ' 0
869 for ac_signal in 1 2 13 15; do
870   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
871 done
872 ac_signal=0
873
874 # confdefs.h avoids OS command line length limits that DEFS can exceed.
875 rm -rf conftest* confdefs.h
876 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
877 echo >confdefs.h
878
879 # Let the site file select an alternate cache file if it wants to.
880 # Prefer explicitly selected file to automatically selected ones.
881 if test -z "$CONFIG_SITE"; then
882   if test "x$prefix" != xNONE; then
883     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
884   else
885     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
886   fi
887 fi
888 for ac_site_file in $CONFIG_SITE; do
889   if test -r "$ac_site_file"; then
890     { echo "$as_me:890: loading site script $ac_site_file" >&5
891 echo "$as_me: loading site script $ac_site_file" >&6;}
892     cat "$ac_site_file" >&5
893     . "$ac_site_file"
894   fi
895 done
896
897 if test -r "$cache_file"; then
898   # Some versions of bash will fail to source /dev/null (special
899   # files actually), so we avoid doing that.
900   if test -f "$cache_file"; then
901     { echo "$as_me:901: loading cache $cache_file" >&5
902 echo "$as_me: loading cache $cache_file" >&6;}
903     case $cache_file in
904       [\\/]* | ?:[\\/]* ) . $cache_file;;
905       *)                      . ./$cache_file;;
906     esac
907   fi
908 else
909   { echo "$as_me:909: creating cache $cache_file" >&5
910 echo "$as_me: creating cache $cache_file" >&6;}
911   >$cache_file
912 fi
913
914 # Check that the precious variables saved in the cache have kept the same
915 # value.
916 ac_cache_corrupted=false
917 for ac_var in `(set) 2>&1 |
918                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
919   eval ac_old_set=\$ac_cv_env_${ac_var}_set
920   eval ac_new_set=\$ac_env_${ac_var}_set
921   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
922   eval ac_new_val="\$ac_env_${ac_var}_value"
923   case $ac_old_set,$ac_new_set in
924     set,)
925       { echo "$as_me:925: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
926 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
927       ac_cache_corrupted=: ;;
928     ,set)
929       { echo "$as_me:929: error: \`$ac_var' was not set in the previous run" >&5
930 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
931       ac_cache_corrupted=: ;;
932     ,);;
933     *)
934       if test "x$ac_old_val" != "x$ac_new_val"; then
935         { echo "$as_me:935: error: \`$ac_var' has changed since the previous run:" >&5
936 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
937         { echo "$as_me:937:   former value:  $ac_old_val" >&5
938 echo "$as_me:   former value:  $ac_old_val" >&2;}
939         { echo "$as_me:939:   current value: $ac_new_val" >&5
940 echo "$as_me:   current value: $ac_new_val" >&2;}
941         ac_cache_corrupted=:
942       fi;;
943   esac
944   # Pass precious variables to config.status.  It doesn't matter if
945   # we pass some twice (in addition to the command line arguments).
946   if test "$ac_new_set" = set; then
947     case $ac_new_val in
948     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
949       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
950       ac_configure_args="$ac_configure_args '$ac_arg'"
951       ;;
952     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
953        ;;
954     esac
955   fi
956 done
957 if $ac_cache_corrupted; then
958   { echo "$as_me:958: error: changes in the environment can compromise the build" >&5
959 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
960   { { echo "$as_me:960: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
961 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
962    { (exit 1); exit 1; }; }
963 fi
964
965 ac_ext=c
966 ac_cpp='$CPP $CPPFLAGS'
967 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
968 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
969 ac_compiler_gnu=$ac_cv_c_compiler_gnu
970 ac_main_return=return
971
972 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
973   *c*,-n*) ECHO_N= ECHO_C='
974 ' ECHO_T='      ' ;;
975   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
976   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
977 esac
978 echo "#! $SHELL" >conftest.sh
979 echo  "exit 0"   >>conftest.sh
980 chmod +x conftest.sh
981 if { (echo "$as_me:981: PATH=\".;.\"; conftest.sh") >&5
982   (PATH=".;."; conftest.sh) 2>&5
983   ac_status=$?
984   echo "$as_me:984: \$? = $ac_status" >&5
985   (exit $ac_status); }; then
986   ac_path_separator=';'
987 else
988   ac_path_separator=:
989 fi
990 PATH_SEPARATOR="$ac_path_separator"
991 rm -f conftest.sh
992
993 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
994
995 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
996
997 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
998
999 ac_aux_dir=
1000 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1001   if test -f $ac_dir/install-sh; then
1002     ac_aux_dir=$ac_dir
1003     ac_install_sh="$ac_aux_dir/install-sh -c"
1004     break
1005   elif test -f $ac_dir/install.sh; then
1006     ac_aux_dir=$ac_dir
1007     ac_install_sh="$ac_aux_dir/install.sh -c"
1008     break
1009   elif test -f $ac_dir/shtool; then
1010     ac_aux_dir=$ac_dir
1011     ac_install_sh="$ac_aux_dir/shtool install -c"
1012     break
1013   fi
1014 done
1015 if test -z "$ac_aux_dir"; then
1016   { { echo "$as_me:1016: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1017 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1018    { (exit 1); exit 1; }; }
1019 fi
1020 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1021 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1022 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1023
1024 # Make sure we can run config.sub.
1025 $ac_config_sub sun4 >/dev/null 2>&1 ||
1026   { { echo "$as_me:1026: error: cannot run $ac_config_sub" >&5
1027 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1028    { (exit 1); exit 1; }; }
1029
1030 echo "$as_me:1030: checking build system type" >&5
1031 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1032 if test "${ac_cv_build+set}" = set; then
1033   echo $ECHO_N "(cached) $ECHO_C" >&6
1034 else
1035   ac_cv_build_alias=$build_alias
1036 test -z "$ac_cv_build_alias" &&
1037   ac_cv_build_alias=`$ac_config_guess`
1038 test -z "$ac_cv_build_alias" &&
1039   { { echo "$as_me:1039: error: cannot guess build type; you must specify one" >&5
1040 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1041    { (exit 1); exit 1; }; }
1042 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1043   { { echo "$as_me:1043: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1044 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1045    { (exit 1); exit 1; }; }
1046
1047 fi
1048 echo "$as_me:1048: result: $ac_cv_build" >&5
1049 echo "${ECHO_T}$ac_cv_build" >&6
1050 build=$ac_cv_build
1051 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1052 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1053 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1054
1055 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1056         echo "$as_me:1056: checking host system type" >&5
1057 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1058 if test "${ac_cv_host+set}" = set; then
1059   echo $ECHO_N "(cached) $ECHO_C" >&6
1060 else
1061   ac_cv_host_alias=$host_alias
1062 test -z "$ac_cv_host_alias" &&
1063   ac_cv_host_alias=$ac_cv_build_alias
1064 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1065   { { echo "$as_me:1065: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1066 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1067    { (exit 1); exit 1; }; }
1068
1069 fi
1070 echo "$as_me:1070: result: $ac_cv_host" >&5
1071 echo "${ECHO_T}$ac_cv_host" >&6
1072 host=$ac_cv_host
1073 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1074 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1075 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1076
1077         system_name="$host_os"
1078 else
1079         system_name="`(uname -s -r) 2>/dev/null`"
1080         if test -z "$system_name" ; then
1081                 system_name="`(hostname) 2>/dev/null`"
1082         fi
1083 fi
1084 test -n "$system_name" && cat >>confdefs.h <<EOF
1085 #define SYSTEM_NAME "$system_name"
1086 EOF
1087
1088 if test "${cf_cv_system_name+set}" = set; then
1089   echo $ECHO_N "(cached) $ECHO_C" >&6
1090 else
1091   cf_cv_system_name="$system_name"
1092 fi
1093
1094 test -z "$system_name" && system_name="$cf_cv_system_name"
1095 test -n "$cf_cv_system_name" && echo "$as_me:1095: result: Configuring for $cf_cv_system_name" >&5
1096 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1097
1098 if test ".$system_name" != ".$cf_cv_system_name" ; then
1099         echo "$as_me:1099: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1100 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1101         { { echo "$as_me:1101: error: \"Please remove config.cache and try again.\"" >&5
1102 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1103    { (exit 1); exit 1; }; }
1104 fi
1105
1106 test "$program_prefix" != NONE &&
1107   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1108 # Use a double $ so make ignores it.
1109 test "$program_suffix" != NONE &&
1110   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1111 # Double any \ or $.  echo might interpret backslashes.
1112 # By default was `s,x,x', remove it if useless.
1113 cat <<\_ACEOF >conftest.sed
1114 s/[\\$]/&&/g;s/;s,x,x,$//
1115 _ACEOF
1116 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1117 rm conftest.sed
1118
1119 echo "$as_me:1119: checking whether ${MAKE-make} sets \${MAKE}" >&5
1120 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1121 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1122 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1123   echo $ECHO_N "(cached) $ECHO_C" >&6
1124 else
1125   cat >conftest.make <<\EOF
1126 all:
1127         @echo 'ac_maketemp="${MAKE}"'
1128 EOF
1129 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1130 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1131 if test -n "$ac_maketemp"; then
1132   eval ac_cv_prog_make_${ac_make}_set=yes
1133 else
1134   eval ac_cv_prog_make_${ac_make}_set=no
1135 fi
1136 rm -f conftest.make
1137 fi
1138 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1139   echo "$as_me:1139: result: yes" >&5
1140 echo "${ECHO_T}yes" >&6
1141   SET_MAKE=
1142 else
1143   echo "$as_me:1143: result: no" >&5
1144 echo "${ECHO_T}no" >&6
1145   SET_MAKE="MAKE=${MAKE-make}"
1146 fi
1147
1148 ac_ext=c
1149 ac_cpp='$CPP $CPPFLAGS'
1150 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1151 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1152 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1153 ac_main_return=return
1154 if test -n "$ac_tool_prefix"; then
1155   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1156 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1157 echo "$as_me:1157: checking for $ac_word" >&5
1158 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1159 if test "${ac_cv_prog_CC+set}" = set; then
1160   echo $ECHO_N "(cached) $ECHO_C" >&6
1161 else
1162   if test -n "$CC"; then
1163   ac_cv_prog_CC="$CC" # Let the user override the test.
1164 else
1165   ac_save_IFS=$IFS; IFS=$ac_path_separator
1166 ac_dummy="$PATH"
1167 for ac_dir in $ac_dummy; do
1168   IFS=$ac_save_IFS
1169   test -z "$ac_dir" && ac_dir=.
1170   $as_executable_p "$ac_dir/$ac_word" || continue
1171 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1172 echo "$as_me:1172: found $ac_dir/$ac_word" >&5
1173 break
1174 done
1175
1176 fi
1177 fi
1178 CC=$ac_cv_prog_CC
1179 if test -n "$CC"; then
1180   echo "$as_me:1180: result: $CC" >&5
1181 echo "${ECHO_T}$CC" >&6
1182 else
1183   echo "$as_me:1183: result: no" >&5
1184 echo "${ECHO_T}no" >&6
1185 fi
1186
1187 fi
1188 if test -z "$ac_cv_prog_CC"; then
1189   ac_ct_CC=$CC
1190   # Extract the first word of "gcc", so it can be a program name with args.
1191 set dummy gcc; ac_word=$2
1192 echo "$as_me:1192: checking for $ac_word" >&5
1193 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1194 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1195   echo $ECHO_N "(cached) $ECHO_C" >&6
1196 else
1197   if test -n "$ac_ct_CC"; then
1198   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1199 else
1200   ac_save_IFS=$IFS; IFS=$ac_path_separator
1201 ac_dummy="$PATH"
1202 for ac_dir in $ac_dummy; do
1203   IFS=$ac_save_IFS
1204   test -z "$ac_dir" && ac_dir=.
1205   $as_executable_p "$ac_dir/$ac_word" || continue
1206 ac_cv_prog_ac_ct_CC="gcc"
1207 echo "$as_me:1207: found $ac_dir/$ac_word" >&5
1208 break
1209 done
1210
1211 fi
1212 fi
1213 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1214 if test -n "$ac_ct_CC"; then
1215   echo "$as_me:1215: result: $ac_ct_CC" >&5
1216 echo "${ECHO_T}$ac_ct_CC" >&6
1217 else
1218   echo "$as_me:1218: result: no" >&5
1219 echo "${ECHO_T}no" >&6
1220 fi
1221
1222   CC=$ac_ct_CC
1223 else
1224   CC="$ac_cv_prog_CC"
1225 fi
1226
1227 if test -z "$CC"; then
1228   if test -n "$ac_tool_prefix"; then
1229   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1230 set dummy ${ac_tool_prefix}cc; ac_word=$2
1231 echo "$as_me:1231: checking for $ac_word" >&5
1232 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1233 if test "${ac_cv_prog_CC+set}" = set; then
1234   echo $ECHO_N "(cached) $ECHO_C" >&6
1235 else
1236   if test -n "$CC"; then
1237   ac_cv_prog_CC="$CC" # Let the user override the test.
1238 else
1239   ac_save_IFS=$IFS; IFS=$ac_path_separator
1240 ac_dummy="$PATH"
1241 for ac_dir in $ac_dummy; do
1242   IFS=$ac_save_IFS
1243   test -z "$ac_dir" && ac_dir=.
1244   $as_executable_p "$ac_dir/$ac_word" || continue
1245 ac_cv_prog_CC="${ac_tool_prefix}cc"
1246 echo "$as_me:1246: found $ac_dir/$ac_word" >&5
1247 break
1248 done
1249
1250 fi
1251 fi
1252 CC=$ac_cv_prog_CC
1253 if test -n "$CC"; then
1254   echo "$as_me:1254: result: $CC" >&5
1255 echo "${ECHO_T}$CC" >&6
1256 else
1257   echo "$as_me:1257: result: no" >&5
1258 echo "${ECHO_T}no" >&6
1259 fi
1260
1261 fi
1262 if test -z "$ac_cv_prog_CC"; then
1263   ac_ct_CC=$CC
1264   # Extract the first word of "cc", so it can be a program name with args.
1265 set dummy cc; ac_word=$2
1266 echo "$as_me:1266: checking for $ac_word" >&5
1267 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1268 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1269   echo $ECHO_N "(cached) $ECHO_C" >&6
1270 else
1271   if test -n "$ac_ct_CC"; then
1272   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1273 else
1274   ac_save_IFS=$IFS; IFS=$ac_path_separator
1275 ac_dummy="$PATH"
1276 for ac_dir in $ac_dummy; do
1277   IFS=$ac_save_IFS
1278   test -z "$ac_dir" && ac_dir=.
1279   $as_executable_p "$ac_dir/$ac_word" || continue
1280 ac_cv_prog_ac_ct_CC="cc"
1281 echo "$as_me:1281: found $ac_dir/$ac_word" >&5
1282 break
1283 done
1284
1285 fi
1286 fi
1287 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1288 if test -n "$ac_ct_CC"; then
1289   echo "$as_me:1289: result: $ac_ct_CC" >&5
1290 echo "${ECHO_T}$ac_ct_CC" >&6
1291 else
1292   echo "$as_me:1292: result: no" >&5
1293 echo "${ECHO_T}no" >&6
1294 fi
1295
1296   CC=$ac_ct_CC
1297 else
1298   CC="$ac_cv_prog_CC"
1299 fi
1300
1301 fi
1302 if test -z "$CC"; then
1303   # Extract the first word of "cc", so it can be a program name with args.
1304 set dummy cc; ac_word=$2
1305 echo "$as_me:1305: checking for $ac_word" >&5
1306 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1307 if test "${ac_cv_prog_CC+set}" = set; then
1308   echo $ECHO_N "(cached) $ECHO_C" >&6
1309 else
1310   if test -n "$CC"; then
1311   ac_cv_prog_CC="$CC" # Let the user override the test.
1312 else
1313   ac_prog_rejected=no
1314   ac_save_IFS=$IFS; IFS=$ac_path_separator
1315 ac_dummy="$PATH"
1316 for ac_dir in $ac_dummy; do
1317   IFS=$ac_save_IFS
1318   test -z "$ac_dir" && ac_dir=.
1319   $as_executable_p "$ac_dir/$ac_word" || continue
1320 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1321   ac_prog_rejected=yes
1322   continue
1323 fi
1324 ac_cv_prog_CC="cc"
1325 echo "$as_me:1325: found $ac_dir/$ac_word" >&5
1326 break
1327 done
1328
1329 if test $ac_prog_rejected = yes; then
1330   # We found a bogon in the path, so make sure we never use it.
1331   set dummy $ac_cv_prog_CC
1332   shift
1333   if test $# != 0; then
1334     # We chose a different compiler from the bogus one.
1335     # However, it has the same basename, so the bogon will be chosen
1336     # first if we set CC to just the basename; use the full file name.
1337     shift
1338     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1339     shift
1340     ac_cv_prog_CC="$@"
1341   fi
1342 fi
1343 fi
1344 fi
1345 CC=$ac_cv_prog_CC
1346 if test -n "$CC"; then
1347   echo "$as_me:1347: result: $CC" >&5
1348 echo "${ECHO_T}$CC" >&6
1349 else
1350   echo "$as_me:1350: result: no" >&5
1351 echo "${ECHO_T}no" >&6
1352 fi
1353
1354 fi
1355 if test -z "$CC"; then
1356   if test -n "$ac_tool_prefix"; then
1357   for ac_prog in cl
1358   do
1359     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1360 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1361 echo "$as_me:1361: checking for $ac_word" >&5
1362 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1363 if test "${ac_cv_prog_CC+set}" = set; then
1364   echo $ECHO_N "(cached) $ECHO_C" >&6
1365 else
1366   if test -n "$CC"; then
1367   ac_cv_prog_CC="$CC" # Let the user override the test.
1368 else
1369   ac_save_IFS=$IFS; IFS=$ac_path_separator
1370 ac_dummy="$PATH"
1371 for ac_dir in $ac_dummy; do
1372   IFS=$ac_save_IFS
1373   test -z "$ac_dir" && ac_dir=.
1374   $as_executable_p "$ac_dir/$ac_word" || continue
1375 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1376 echo "$as_me:1376: found $ac_dir/$ac_word" >&5
1377 break
1378 done
1379
1380 fi
1381 fi
1382 CC=$ac_cv_prog_CC
1383 if test -n "$CC"; then
1384   echo "$as_me:1384: result: $CC" >&5
1385 echo "${ECHO_T}$CC" >&6
1386 else
1387   echo "$as_me:1387: result: no" >&5
1388 echo "${ECHO_T}no" >&6
1389 fi
1390
1391     test -n "$CC" && break
1392   done
1393 fi
1394 if test -z "$CC"; then
1395   ac_ct_CC=$CC
1396   for ac_prog in cl
1397 do
1398   # Extract the first word of "$ac_prog", so it can be a program name with args.
1399 set dummy $ac_prog; ac_word=$2
1400 echo "$as_me:1400: checking for $ac_word" >&5
1401 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1402 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1403   echo $ECHO_N "(cached) $ECHO_C" >&6
1404 else
1405   if test -n "$ac_ct_CC"; then
1406   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1407 else
1408   ac_save_IFS=$IFS; IFS=$ac_path_separator
1409 ac_dummy="$PATH"
1410 for ac_dir in $ac_dummy; do
1411   IFS=$ac_save_IFS
1412   test -z "$ac_dir" && ac_dir=.
1413   $as_executable_p "$ac_dir/$ac_word" || continue
1414 ac_cv_prog_ac_ct_CC="$ac_prog"
1415 echo "$as_me:1415: found $ac_dir/$ac_word" >&5
1416 break
1417 done
1418
1419 fi
1420 fi
1421 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1422 if test -n "$ac_ct_CC"; then
1423   echo "$as_me:1423: result: $ac_ct_CC" >&5
1424 echo "${ECHO_T}$ac_ct_CC" >&6
1425 else
1426   echo "$as_me:1426: result: no" >&5
1427 echo "${ECHO_T}no" >&6
1428 fi
1429
1430   test -n "$ac_ct_CC" && break
1431 done
1432
1433   CC=$ac_ct_CC
1434 fi
1435
1436 fi
1437
1438 test -z "$CC" && { { echo "$as_me:1438: error: no acceptable cc found in \$PATH" >&5
1439 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1440    { (exit 1); exit 1; }; }
1441
1442 # Provide some information about the compiler.
1443 echo "$as_me:1443:" \
1444      "checking for C compiler version" >&5
1445 ac_compiler=`set X $ac_compile; echo $2`
1446 { (eval echo "$as_me:1446: \"$ac_compiler --version </dev/null >&5\"") >&5
1447   (eval $ac_compiler --version </dev/null >&5) 2>&5
1448   ac_status=$?
1449   echo "$as_me:1449: \$? = $ac_status" >&5
1450   (exit $ac_status); }
1451 { (eval echo "$as_me:1451: \"$ac_compiler -v </dev/null >&5\"") >&5
1452   (eval $ac_compiler -v </dev/null >&5) 2>&5
1453   ac_status=$?
1454   echo "$as_me:1454: \$? = $ac_status" >&5
1455   (exit $ac_status); }
1456 { (eval echo "$as_me:1456: \"$ac_compiler -V </dev/null >&5\"") >&5
1457   (eval $ac_compiler -V </dev/null >&5) 2>&5
1458   ac_status=$?
1459   echo "$as_me:1459: \$? = $ac_status" >&5
1460   (exit $ac_status); }
1461
1462 cat >conftest.$ac_ext <<_ACEOF
1463 #line 1463 "configure"
1464 #include "confdefs.h"
1465
1466 int
1467 main ()
1468 {
1469
1470   ;
1471   return 0;
1472 }
1473 _ACEOF
1474 ac_clean_files_save=$ac_clean_files
1475 ac_clean_files="$ac_clean_files a.out a.exe"
1476 # Try to create an executable without -o first, disregard a.out.
1477 # It will help us diagnose broken compilers, and finding out an intuition
1478 # of exeext.
1479 echo "$as_me:1479: checking for C compiler default output" >&5
1480 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1481 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1482 if { (eval echo "$as_me:1482: \"$ac_link_default\"") >&5
1483   (eval $ac_link_default) 2>&5
1484   ac_status=$?
1485   echo "$as_me:1485: \$? = $ac_status" >&5
1486   (exit $ac_status); }; then
1487   # Find the output, starting from the most likely.  This scheme is
1488 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1489 # resort.
1490 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1491                 ls a.out conftest 2>/dev/null;
1492                 ls a.* conftest.* 2>/dev/null`; do
1493   case $ac_file in
1494     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1495     a.out ) # We found the default executable, but exeext='' is most
1496             # certainly right.
1497             break;;
1498     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1499           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1500           export ac_cv_exeext
1501           break;;
1502     * ) break;;
1503   esac
1504 done
1505 else
1506   echo "$as_me: failed program was:" >&5
1507 cat conftest.$ac_ext >&5
1508 { { echo "$as_me:1508: error: C compiler cannot create executables" >&5
1509 echo "$as_me: error: C compiler cannot create executables" >&2;}
1510    { (exit 77); exit 77; }; }
1511 fi
1512
1513 ac_exeext=$ac_cv_exeext
1514 echo "$as_me:1514: result: $ac_file" >&5
1515 echo "${ECHO_T}$ac_file" >&6
1516
1517 # Check the compiler produces executables we can run.  If not, either
1518 # the compiler is broken, or we cross compile.
1519 echo "$as_me:1519: checking whether the C compiler works" >&5
1520 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1521 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1522 # If not cross compiling, check that we can run a simple program.
1523 if test "$cross_compiling" != yes; then
1524   if { ac_try='./$ac_file'
1525   { (eval echo "$as_me:1525: \"$ac_try\"") >&5
1526   (eval $ac_try) 2>&5
1527   ac_status=$?
1528   echo "$as_me:1528: \$? = $ac_status" >&5
1529   (exit $ac_status); }; }; then
1530     cross_compiling=no
1531   else
1532     if test "$cross_compiling" = maybe; then
1533         cross_compiling=yes
1534     else
1535         { { echo "$as_me:1535: error: cannot run C compiled programs.
1536 If you meant to cross compile, use \`--host'." >&5
1537 echo "$as_me: error: cannot run C compiled programs.
1538 If you meant to cross compile, use \`--host'." >&2;}
1539    { (exit 1); exit 1; }; }
1540     fi
1541   fi
1542 fi
1543 echo "$as_me:1543: result: yes" >&5
1544 echo "${ECHO_T}yes" >&6
1545
1546 rm -f a.out a.exe conftest$ac_cv_exeext
1547 ac_clean_files=$ac_clean_files_save
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 we are cross compiling" >&5
1551 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1552 echo "$as_me:1552: result: $cross_compiling" >&5
1553 echo "${ECHO_T}$cross_compiling" >&6
1554
1555 echo "$as_me:1555: checking for executable suffix" >&5
1556 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1557 if { (eval echo "$as_me:1557: \"$ac_link\"") >&5
1558   (eval $ac_link) 2>&5
1559   ac_status=$?
1560   echo "$as_me:1560: \$? = $ac_status" >&5
1561   (exit $ac_status); }; then
1562   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1563 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1564 # work properly (i.e., refer to `conftest.exe'), while it won't with
1565 # `rm'.
1566 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1567   case $ac_file in
1568     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1569     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1570           export ac_cv_exeext
1571           break;;
1572     * ) break;;
1573   esac
1574 done
1575 else
1576   { { echo "$as_me:1576: error: cannot compute EXEEXT: cannot compile and link" >&5
1577 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1578    { (exit 1); exit 1; }; }
1579 fi
1580
1581 rm -f conftest$ac_cv_exeext
1582 echo "$as_me:1582: result: $ac_cv_exeext" >&5
1583 echo "${ECHO_T}$ac_cv_exeext" >&6
1584
1585 rm -f conftest.$ac_ext
1586 EXEEXT=$ac_cv_exeext
1587 ac_exeext=$EXEEXT
1588 echo "$as_me:1588: checking for object suffix" >&5
1589 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1590 if test "${ac_cv_objext+set}" = set; then
1591   echo $ECHO_N "(cached) $ECHO_C" >&6
1592 else
1593   cat >conftest.$ac_ext <<_ACEOF
1594 #line 1594 "configure"
1595 #include "confdefs.h"
1596
1597 int
1598 main ()
1599 {
1600
1601   ;
1602   return 0;
1603 }
1604 _ACEOF
1605 rm -f conftest.o conftest.obj
1606 if { (eval echo "$as_me:1606: \"$ac_compile\"") >&5
1607   (eval $ac_compile) 2>&5
1608   ac_status=$?
1609   echo "$as_me:1609: \$? = $ac_status" >&5
1610   (exit $ac_status); }; then
1611   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1612   case $ac_file in
1613     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1614     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1615        break;;
1616   esac
1617 done
1618 else
1619   echo "$as_me: failed program was:" >&5
1620 cat conftest.$ac_ext >&5
1621 { { echo "$as_me:1621: error: cannot compute OBJEXT: cannot compile" >&5
1622 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1623    { (exit 1); exit 1; }; }
1624 fi
1625
1626 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1627 fi
1628 echo "$as_me:1628: result: $ac_cv_objext" >&5
1629 echo "${ECHO_T}$ac_cv_objext" >&6
1630 OBJEXT=$ac_cv_objext
1631 ac_objext=$OBJEXT
1632 echo "$as_me:1632: checking whether we are using the GNU C compiler" >&5
1633 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1634 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1635   echo $ECHO_N "(cached) $ECHO_C" >&6
1636 else
1637   cat >conftest.$ac_ext <<_ACEOF
1638 #line 1638 "configure"
1639 #include "confdefs.h"
1640
1641 int
1642 main ()
1643 {
1644 #ifndef __GNUC__
1645        choke me
1646 #endif
1647
1648   ;
1649   return 0;
1650 }
1651 _ACEOF
1652 rm -f conftest.$ac_objext
1653 if { (eval echo "$as_me:1653: \"$ac_compile\"") >&5
1654   (eval $ac_compile) 2>&5
1655   ac_status=$?
1656   echo "$as_me:1656: \$? = $ac_status" >&5
1657   (exit $ac_status); } &&
1658          { ac_try='test -s conftest.$ac_objext'
1659   { (eval echo "$as_me:1659: \"$ac_try\"") >&5
1660   (eval $ac_try) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit $ac_status); }; }; then
1664   ac_compiler_gnu=yes
1665 else
1666   echo "$as_me: failed program was:" >&5
1667 cat conftest.$ac_ext >&5
1668 ac_compiler_gnu=no
1669 fi
1670 rm -f conftest.$ac_objext conftest.$ac_ext
1671 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1672
1673 fi
1674 echo "$as_me:1674: result: $ac_cv_c_compiler_gnu" >&5
1675 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1676 GCC=`test $ac_compiler_gnu = yes && echo yes`
1677 ac_test_CFLAGS=${CFLAGS+set}
1678 ac_save_CFLAGS=$CFLAGS
1679 CFLAGS="-g"
1680 echo "$as_me:1680: checking whether $CC accepts -g" >&5
1681 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1682 if test "${ac_cv_prog_cc_g+set}" = set; then
1683   echo $ECHO_N "(cached) $ECHO_C" >&6
1684 else
1685   cat >conftest.$ac_ext <<_ACEOF
1686 #line 1686 "configure"
1687 #include "confdefs.h"
1688
1689 int
1690 main ()
1691 {
1692
1693   ;
1694   return 0;
1695 }
1696 _ACEOF
1697 rm -f conftest.$ac_objext
1698 if { (eval echo "$as_me:1698: \"$ac_compile\"") >&5
1699   (eval $ac_compile) 2>&5
1700   ac_status=$?
1701   echo "$as_me:1701: \$? = $ac_status" >&5
1702   (exit $ac_status); } &&
1703          { ac_try='test -s conftest.$ac_objext'
1704   { (eval echo "$as_me:1704: \"$ac_try\"") >&5
1705   (eval $ac_try) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit $ac_status); }; }; then
1709   ac_cv_prog_cc_g=yes
1710 else
1711   echo "$as_me: failed program was:" >&5
1712 cat conftest.$ac_ext >&5
1713 ac_cv_prog_cc_g=no
1714 fi
1715 rm -f conftest.$ac_objext conftest.$ac_ext
1716 fi
1717 echo "$as_me:1717: result: $ac_cv_prog_cc_g" >&5
1718 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1719 if test "$ac_test_CFLAGS" = set; then
1720   CFLAGS=$ac_save_CFLAGS
1721 elif test $ac_cv_prog_cc_g = yes; then
1722   if test "$GCC" = yes; then
1723     CFLAGS="-g -O2"
1724   else
1725     CFLAGS="-g"
1726   fi
1727 else
1728   if test "$GCC" = yes; then
1729     CFLAGS="-O2"
1730   else
1731     CFLAGS=
1732   fi
1733 fi
1734 # Some people use a C++ compiler to compile C.  Since we use `exit',
1735 # in C++ we need to declare it.  In case someone uses the same compiler
1736 # for both compiling C and C++ we need to have the C++ compiler decide
1737 # the declaration of exit, since it's the most demanding environment.
1738 cat >conftest.$ac_ext <<_ACEOF
1739 #ifndef __cplusplus
1740   choke me
1741 #endif
1742 _ACEOF
1743 rm -f conftest.$ac_objext
1744 if { (eval echo "$as_me:1744: \"$ac_compile\"") >&5
1745   (eval $ac_compile) 2>&5
1746   ac_status=$?
1747   echo "$as_me:1747: \$? = $ac_status" >&5
1748   (exit $ac_status); } &&
1749          { ac_try='test -s conftest.$ac_objext'
1750   { (eval echo "$as_me:1750: \"$ac_try\"") >&5
1751   (eval $ac_try) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit $ac_status); }; }; then
1755   for ac_declaration in \
1756    ''\
1757    '#include <stdlib.h>' \
1758    'extern "C" void std::exit (int) throw (); using std::exit;' \
1759    'extern "C" void std::exit (int); using std::exit;' \
1760    'extern "C" void exit (int) throw ();' \
1761    'extern "C" void exit (int);' \
1762    'void exit (int);'
1763 do
1764   cat >conftest.$ac_ext <<_ACEOF
1765 #line 1765 "configure"
1766 #include "confdefs.h"
1767 #include <stdlib.h>
1768 $ac_declaration
1769 int
1770 main ()
1771 {
1772 exit (42);
1773   ;
1774   return 0;
1775 }
1776 _ACEOF
1777 rm -f conftest.$ac_objext
1778 if { (eval echo "$as_me:1778: \"$ac_compile\"") >&5
1779   (eval $ac_compile) 2>&5
1780   ac_status=$?
1781   echo "$as_me:1781: \$? = $ac_status" >&5
1782   (exit $ac_status); } &&
1783          { ac_try='test -s conftest.$ac_objext'
1784   { (eval echo "$as_me:1784: \"$ac_try\"") >&5
1785   (eval $ac_try) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit $ac_status); }; }; then
1789   :
1790 else
1791   echo "$as_me: failed program was:" >&5
1792 cat conftest.$ac_ext >&5
1793 continue
1794 fi
1795 rm -f conftest.$ac_objext conftest.$ac_ext
1796   cat >conftest.$ac_ext <<_ACEOF
1797 #line 1797 "configure"
1798 #include "confdefs.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   break
1821 else
1822   echo "$as_me: failed program was:" >&5
1823 cat conftest.$ac_ext >&5
1824 fi
1825 rm -f conftest.$ac_objext conftest.$ac_ext
1826 done
1827 rm -rf conftest*
1828 if test -n "$ac_declaration"; then
1829   echo '#ifdef __cplusplus' >>confdefs.h
1830   echo $ac_declaration      >>confdefs.h
1831   echo '#endif'             >>confdefs.h
1832 fi
1833
1834 else
1835   echo "$as_me: failed program was:" >&5
1836 cat conftest.$ac_ext >&5
1837 fi
1838 rm -f conftest.$ac_objext conftest.$ac_ext
1839 ac_ext=c
1840 ac_cpp='$CPP $CPPFLAGS'
1841 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1842 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1843 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1844 ac_main_return=return
1845
1846 ac_ext=c
1847 ac_cpp='$CPP $CPPFLAGS'
1848 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1849 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1850 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1851 ac_main_return=return
1852 echo "$as_me:1852: checking how to run the C preprocessor" >&5
1853 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1854 # On Suns, sometimes $CPP names a directory.
1855 if test -n "$CPP" && test -d "$CPP"; then
1856   CPP=
1857 fi
1858 if test -z "$CPP"; then
1859   if test "${ac_cv_prog_CPP+set}" = set; then
1860   echo $ECHO_N "(cached) $ECHO_C" >&6
1861 else
1862       # Double quotes because CPP needs to be expanded
1863     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1864     do
1865       ac_preproc_ok=false
1866 for ac_c_preproc_warn_flag in '' yes
1867 do
1868   # Use a header file that comes with gcc, so configuring glibc
1869   # with a fresh cross-compiler works.
1870   # On the NeXT, cc -E runs the code through the compiler's parser,
1871   # not just through cpp. "Syntax error" is here to catch this case.
1872   cat >conftest.$ac_ext <<_ACEOF
1873 #line 1873 "configure"
1874 #include "confdefs.h"
1875 #include <assert.h>
1876                      Syntax error
1877 _ACEOF
1878 if { (eval echo "$as_me:1878: \"$ac_cpp conftest.$ac_ext\"") >&5
1879   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1880   ac_status=$?
1881   egrep -v '^ *\+' conftest.er1 >conftest.err
1882   rm -f conftest.er1
1883   cat conftest.err >&5
1884   echo "$as_me:1884: \$? = $ac_status" >&5
1885   (exit $ac_status); } >/dev/null; then
1886   if test -s conftest.err; then
1887     ac_cpp_err=$ac_c_preproc_warn_flag
1888   else
1889     ac_cpp_err=
1890   fi
1891 else
1892   ac_cpp_err=yes
1893 fi
1894 if test -z "$ac_cpp_err"; then
1895   :
1896 else
1897   echo "$as_me: failed program was:" >&5
1898   cat conftest.$ac_ext >&5
1899   # Broken: fails on valid input.
1900 continue
1901 fi
1902 rm -f conftest.err conftest.$ac_ext
1903
1904   # OK, works on sane cases.  Now check whether non-existent headers
1905   # can be detected and how.
1906   cat >conftest.$ac_ext <<_ACEOF
1907 #line 1907 "configure"
1908 #include "confdefs.h"
1909 #include <ac_nonexistent.h>
1910 _ACEOF
1911 if { (eval echo "$as_me:1911: \"$ac_cpp conftest.$ac_ext\"") >&5
1912   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1913   ac_status=$?
1914   egrep -v '^ *\+' conftest.er1 >conftest.err
1915   rm -f conftest.er1
1916   cat conftest.err >&5
1917   echo "$as_me:1917: \$? = $ac_status" >&5
1918   (exit $ac_status); } >/dev/null; then
1919   if test -s conftest.err; then
1920     ac_cpp_err=$ac_c_preproc_warn_flag
1921   else
1922     ac_cpp_err=
1923   fi
1924 else
1925   ac_cpp_err=yes
1926 fi
1927 if test -z "$ac_cpp_err"; then
1928   # Broken: success on invalid input.
1929 continue
1930 else
1931   echo "$as_me: failed program was:" >&5
1932   cat conftest.$ac_ext >&5
1933   # Passes both tests.
1934 ac_preproc_ok=:
1935 break
1936 fi
1937 rm -f conftest.err conftest.$ac_ext
1938
1939 done
1940 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1941 rm -f conftest.err conftest.$ac_ext
1942 if $ac_preproc_ok; then
1943   break
1944 fi
1945
1946     done
1947     ac_cv_prog_CPP=$CPP
1948
1949 fi
1950   CPP=$ac_cv_prog_CPP
1951 else
1952   ac_cv_prog_CPP=$CPP
1953 fi
1954 echo "$as_me:1954: result: $CPP" >&5
1955 echo "${ECHO_T}$CPP" >&6
1956 ac_preproc_ok=false
1957 for ac_c_preproc_warn_flag in '' yes
1958 do
1959   # Use a header file that comes with gcc, so configuring glibc
1960   # with a fresh cross-compiler works.
1961   # On the NeXT, cc -E runs the code through the compiler's parser,
1962   # not just through cpp. "Syntax error" is here to catch this case.
1963   cat >conftest.$ac_ext <<_ACEOF
1964 #line 1964 "configure"
1965 #include "confdefs.h"
1966 #include <assert.h>
1967                      Syntax error
1968 _ACEOF
1969 if { (eval echo "$as_me:1969: \"$ac_cpp conftest.$ac_ext\"") >&5
1970   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1971   ac_status=$?
1972   egrep -v '^ *\+' conftest.er1 >conftest.err
1973   rm -f conftest.er1
1974   cat conftest.err >&5
1975   echo "$as_me:1975: \$? = $ac_status" >&5
1976   (exit $ac_status); } >/dev/null; then
1977   if test -s conftest.err; then
1978     ac_cpp_err=$ac_c_preproc_warn_flag
1979   else
1980     ac_cpp_err=
1981   fi
1982 else
1983   ac_cpp_err=yes
1984 fi
1985 if test -z "$ac_cpp_err"; then
1986   :
1987 else
1988   echo "$as_me: failed program was:" >&5
1989   cat conftest.$ac_ext >&5
1990   # Broken: fails on valid input.
1991 continue
1992 fi
1993 rm -f conftest.err conftest.$ac_ext
1994
1995   # OK, works on sane cases.  Now check whether non-existent headers
1996   # can be detected and how.
1997   cat >conftest.$ac_ext <<_ACEOF
1998 #line 1998 "configure"
1999 #include "confdefs.h"
2000 #include <ac_nonexistent.h>
2001 _ACEOF
2002 if { (eval echo "$as_me:2002: \"$ac_cpp conftest.$ac_ext\"") >&5
2003   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2004   ac_status=$?
2005   egrep -v '^ *\+' conftest.er1 >conftest.err
2006   rm -f conftest.er1
2007   cat conftest.err >&5
2008   echo "$as_me:2008: \$? = $ac_status" >&5
2009   (exit $ac_status); } >/dev/null; then
2010   if test -s conftest.err; then
2011     ac_cpp_err=$ac_c_preproc_warn_flag
2012   else
2013     ac_cpp_err=
2014   fi
2015 else
2016   ac_cpp_err=yes
2017 fi
2018 if test -z "$ac_cpp_err"; then
2019   # Broken: success on invalid input.
2020 continue
2021 else
2022   echo "$as_me: failed program was:" >&5
2023   cat conftest.$ac_ext >&5
2024   # Passes both tests.
2025 ac_preproc_ok=:
2026 break
2027 fi
2028 rm -f conftest.err conftest.$ac_ext
2029
2030 done
2031 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2032 rm -f conftest.err conftest.$ac_ext
2033 if $ac_preproc_ok; then
2034   :
2035 else
2036   { { echo "$as_me:2036: error: C preprocessor \"$CPP\" fails sanity check" >&5
2037 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2038    { (exit 1); exit 1; }; }
2039 fi
2040
2041 ac_ext=c
2042 ac_cpp='$CPP $CPPFLAGS'
2043 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2044 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2045 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2046 ac_main_return=return
2047
2048 for ac_prog in mawk gawk nawk awk
2049 do
2050   # Extract the first word of "$ac_prog", so it can be a program name with args.
2051 set dummy $ac_prog; ac_word=$2
2052 echo "$as_me:2052: checking for $ac_word" >&5
2053 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2054 if test "${ac_cv_prog_AWK+set}" = set; then
2055   echo $ECHO_N "(cached) $ECHO_C" >&6
2056 else
2057   if test -n "$AWK"; then
2058   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2059 else
2060   ac_save_IFS=$IFS; IFS=$ac_path_separator
2061 ac_dummy="$PATH"
2062 for ac_dir in $ac_dummy; do
2063   IFS=$ac_save_IFS
2064   test -z "$ac_dir" && ac_dir=.
2065   $as_executable_p "$ac_dir/$ac_word" || continue
2066 ac_cv_prog_AWK="$ac_prog"
2067 echo "$as_me:2067: found $ac_dir/$ac_word" >&5
2068 break
2069 done
2070
2071 fi
2072 fi
2073 AWK=$ac_cv_prog_AWK
2074 if test -n "$AWK"; then
2075   echo "$as_me:2075: result: $AWK" >&5
2076 echo "${ECHO_T}$AWK" >&6
2077 else
2078   echo "$as_me:2078: result: no" >&5
2079 echo "${ECHO_T}no" >&6
2080 fi
2081
2082   test -n "$AWK" && break
2083 done
2084
2085 # Find a good install program.  We prefer a C program (faster),
2086 # so one script is as good as another.  But avoid the broken or
2087 # incompatible versions:
2088 # SysV /etc/install, /usr/sbin/install
2089 # SunOS /usr/etc/install
2090 # IRIX /sbin/install
2091 # AIX /bin/install
2092 # AmigaOS /C/install, which installs bootblocks on floppy discs
2093 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2094 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2095 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2096 # ./install, which can be erroneously created by make from ./install.sh.
2097 echo "$as_me:2097: checking for a BSD compatible install" >&5
2098 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2099 if test -z "$INSTALL"; then
2100 if test "${ac_cv_path_install+set}" = set; then
2101   echo $ECHO_N "(cached) $ECHO_C" >&6
2102 else
2103     ac_save_IFS=$IFS; IFS=$ac_path_separator
2104   for ac_dir in $PATH; do
2105     IFS=$ac_save_IFS
2106     # Account for people who put trailing slashes in PATH elements.
2107     case $ac_dir/ in
2108     / | ./ | .// | /cC/* \
2109     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2110     | /usr/ucb/* ) ;;
2111     *)
2112       # OSF1 and SCO ODT 3.0 have their own names for install.
2113       # Don't use installbsd from OSF since it installs stuff as root
2114       # by default.
2115       for ac_prog in ginstall scoinst install; do
2116         if $as_executable_p "$ac_dir/$ac_prog"; then
2117           if test $ac_prog = install &&
2118             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2119             # AIX install.  It has an incompatible calling convention.
2120             :
2121           elif test $ac_prog = install &&
2122             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2123             # program-specific install script used by HP pwplus--don't use.
2124             :
2125           else
2126             ac_cv_path_install="$ac_dir/$ac_prog -c"
2127             break 2
2128           fi
2129         fi
2130       done
2131       ;;
2132     esac
2133   done
2134
2135 fi
2136   if test "${ac_cv_path_install+set}" = set; then
2137     INSTALL=$ac_cv_path_install
2138   else
2139     # As a last resort, use the slow shell script.  We don't cache a
2140     # path for INSTALL within a source directory, because that will
2141     # break other packages using the cache if that directory is
2142     # removed, or if the path is relative.
2143     INSTALL=$ac_install_sh
2144   fi
2145 fi
2146 echo "$as_me:2146: result: $INSTALL" >&5
2147 echo "${ECHO_T}$INSTALL" >&6
2148
2149 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2150 # It thinks the first close brace ends the variable substitution.
2151 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2152
2153 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2154
2155 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2156
2157 case $INSTALL in
2158 /*)
2159   ;;
2160 *)
2161   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2162   test -z "$cf_dir" && cf_dir=.
2163   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2164   ;;
2165 esac
2166
2167 for ac_prog in tdlint lint alint splint lclint
2168 do
2169   # Extract the first word of "$ac_prog", so it can be a program name with args.
2170 set dummy $ac_prog; ac_word=$2
2171 echo "$as_me:2171: checking for $ac_word" >&5
2172 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2173 if test "${ac_cv_prog_LINT+set}" = set; then
2174   echo $ECHO_N "(cached) $ECHO_C" >&6
2175 else
2176   if test -n "$LINT"; then
2177   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2178 else
2179   ac_save_IFS=$IFS; IFS=$ac_path_separator
2180 ac_dummy="$PATH"
2181 for ac_dir in $ac_dummy; do
2182   IFS=$ac_save_IFS
2183   test -z "$ac_dir" && ac_dir=.
2184   $as_executable_p "$ac_dir/$ac_word" || continue
2185 ac_cv_prog_LINT="$ac_prog"
2186 echo "$as_me:2186: found $ac_dir/$ac_word" >&5
2187 break
2188 done
2189
2190 fi
2191 fi
2192 LINT=$ac_cv_prog_LINT
2193 if test -n "$LINT"; then
2194   echo "$as_me:2194: result: $LINT" >&5
2195 echo "${ECHO_T}$LINT" >&6
2196 else
2197   echo "$as_me:2197: result: no" >&5
2198 echo "${ECHO_T}no" >&6
2199 fi
2200
2201   test -n "$LINT" && break
2202 done
2203
2204 echo "$as_me:2204: checking if filesystem supports mixed-case filenames" >&5
2205 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2206 if test "${cf_cv_mixedcase+set}" = set; then
2207   echo $ECHO_N "(cached) $ECHO_C" >&6
2208 else
2209
2210 if test "$cross_compiling" = yes ; then
2211         case $target_alias in #(vi
2212         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2213                 cf_cv_mixedcase=no
2214                 ;;
2215         *)
2216                 cf_cv_mixedcase=yes
2217                 ;;
2218         esac
2219 else
2220         rm -f conftest CONFTEST
2221         echo test >conftest
2222         if test -f CONFTEST ; then
2223                 cf_cv_mixedcase=no
2224         else
2225                 cf_cv_mixedcase=yes
2226         fi
2227         rm -f conftest CONFTEST
2228 fi
2229
2230 fi
2231 echo "$as_me:2231: result: $cf_cv_mixedcase" >&5
2232 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2233 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2234 #define MIXEDCASE_FILENAMES 1
2235 EOF
2236
2237 for ac_prog in exctags ctags
2238 do
2239   # Extract the first word of "$ac_prog", so it can be a program name with args.
2240 set dummy $ac_prog; ac_word=$2
2241 echo "$as_me:2241: checking for $ac_word" >&5
2242 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2243 if test "${ac_cv_prog_CTAGS+set}" = set; then
2244   echo $ECHO_N "(cached) $ECHO_C" >&6
2245 else
2246   if test -n "$CTAGS"; then
2247   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2248 else
2249   ac_save_IFS=$IFS; IFS=$ac_path_separator
2250 ac_dummy="$PATH"
2251 for ac_dir in $ac_dummy; do
2252   IFS=$ac_save_IFS
2253   test -z "$ac_dir" && ac_dir=.
2254   $as_executable_p "$ac_dir/$ac_word" || continue
2255 ac_cv_prog_CTAGS="$ac_prog"
2256 echo "$as_me:2256: found $ac_dir/$ac_word" >&5
2257 break
2258 done
2259
2260 fi
2261 fi
2262 CTAGS=$ac_cv_prog_CTAGS
2263 if test -n "$CTAGS"; then
2264   echo "$as_me:2264: result: $CTAGS" >&5
2265 echo "${ECHO_T}$CTAGS" >&6
2266 else
2267   echo "$as_me:2267: result: no" >&5
2268 echo "${ECHO_T}no" >&6
2269 fi
2270
2271   test -n "$CTAGS" && break
2272 done
2273
2274 for ac_prog in exetags etags
2275 do
2276   # Extract the first word of "$ac_prog", so it can be a program name with args.
2277 set dummy $ac_prog; ac_word=$2
2278 echo "$as_me:2278: checking for $ac_word" >&5
2279 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2280 if test "${ac_cv_prog_ETAGS+set}" = set; then
2281   echo $ECHO_N "(cached) $ECHO_C" >&6
2282 else
2283   if test -n "$ETAGS"; then
2284   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2285 else
2286   ac_save_IFS=$IFS; IFS=$ac_path_separator
2287 ac_dummy="$PATH"
2288 for ac_dir in $ac_dummy; do
2289   IFS=$ac_save_IFS
2290   test -z "$ac_dir" && ac_dir=.
2291   $as_executable_p "$ac_dir/$ac_word" || continue
2292 ac_cv_prog_ETAGS="$ac_prog"
2293 echo "$as_me:2293: found $ac_dir/$ac_word" >&5
2294 break
2295 done
2296
2297 fi
2298 fi
2299 ETAGS=$ac_cv_prog_ETAGS
2300 if test -n "$ETAGS"; then
2301   echo "$as_me:2301: result: $ETAGS" >&5
2302 echo "${ECHO_T}$ETAGS" >&6
2303 else
2304   echo "$as_me:2304: result: no" >&5
2305 echo "${ECHO_T}no" >&6
2306 fi
2307
2308   test -n "$ETAGS" && break
2309 done
2310
2311 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2312 set dummy ${CTAGS:-ctags}; ac_word=$2
2313 echo "$as_me:2313: checking for $ac_word" >&5
2314 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2315 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2316   echo $ECHO_N "(cached) $ECHO_C" >&6
2317 else
2318   if test -n "$MAKE_LOWER_TAGS"; then
2319   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2320 else
2321   ac_save_IFS=$IFS; IFS=$ac_path_separator
2322 ac_dummy="$PATH"
2323 for ac_dir in $ac_dummy; do
2324   IFS=$ac_save_IFS
2325   test -z "$ac_dir" && ac_dir=.
2326   $as_executable_p "$ac_dir/$ac_word" || continue
2327 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2328 echo "$as_me:2328: found $ac_dir/$ac_word" >&5
2329 break
2330 done
2331
2332   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2333 fi
2334 fi
2335 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2336 if test -n "$MAKE_LOWER_TAGS"; then
2337   echo "$as_me:2337: result: $MAKE_LOWER_TAGS" >&5
2338 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2339 else
2340   echo "$as_me:2340: result: no" >&5
2341 echo "${ECHO_T}no" >&6
2342 fi
2343
2344 if test "$cf_cv_mixedcase" = yes ; then
2345         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2346 set dummy ${ETAGS:-etags}; ac_word=$2
2347 echo "$as_me:2347: checking for $ac_word" >&5
2348 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2349 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2350   echo $ECHO_N "(cached) $ECHO_C" >&6
2351 else
2352   if test -n "$MAKE_UPPER_TAGS"; then
2353   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2354 else
2355   ac_save_IFS=$IFS; IFS=$ac_path_separator
2356 ac_dummy="$PATH"
2357 for ac_dir in $ac_dummy; do
2358   IFS=$ac_save_IFS
2359   test -z "$ac_dir" && ac_dir=.
2360   $as_executable_p "$ac_dir/$ac_word" || continue
2361 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2362 echo "$as_me:2362: found $ac_dir/$ac_word" >&5
2363 break
2364 done
2365
2366   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2367 fi
2368 fi
2369 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2370 if test -n "$MAKE_UPPER_TAGS"; then
2371   echo "$as_me:2371: result: $MAKE_UPPER_TAGS" >&5
2372 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2373 else
2374   echo "$as_me:2374: result: no" >&5
2375 echo "${ECHO_T}no" >&6
2376 fi
2377
2378 else
2379         MAKE_UPPER_TAGS=no
2380 fi
2381
2382 if test "$MAKE_UPPER_TAGS" = yes ; then
2383         MAKE_UPPER_TAGS=
2384 else
2385         MAKE_UPPER_TAGS="#"
2386 fi
2387
2388 if test "$MAKE_LOWER_TAGS" = yes ; then
2389         MAKE_LOWER_TAGS=
2390 else
2391         MAKE_LOWER_TAGS="#"
2392 fi
2393
2394 echo "$as_me:2394: checking if -lm needed for math functions" >&5
2395 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2396 if test "${cf_cv_need_libm+set}" = set; then
2397   echo $ECHO_N "(cached) $ECHO_C" >&6
2398 else
2399
2400         cat >conftest.$ac_ext <<_ACEOF
2401 #line 2401 "configure"
2402 #include "confdefs.h"
2403
2404         #include <stdio.h>
2405         #include <math.h>
2406
2407 int
2408 main ()
2409 {
2410 double x = rand(); printf("result = %g\n", sin(x))
2411   ;
2412   return 0;
2413 }
2414 _ACEOF
2415 rm -f conftest.$ac_objext conftest$ac_exeext
2416 if { (eval echo "$as_me:2416: \"$ac_link\"") >&5
2417   (eval $ac_link) 2>&5
2418   ac_status=$?
2419   echo "$as_me:2419: \$? = $ac_status" >&5
2420   (exit $ac_status); } &&
2421          { ac_try='test -s conftest$ac_exeext'
2422   { (eval echo "$as_me:2422: \"$ac_try\"") >&5
2423   (eval $ac_try) 2>&5
2424   ac_status=$?
2425   echo "$as_me:2425: \$? = $ac_status" >&5
2426   (exit $ac_status); }; }; then
2427   cf_cv_need_libm=no
2428 else
2429   echo "$as_me: failed program was:" >&5
2430 cat conftest.$ac_ext >&5
2431 cf_cv_need_libm=yes
2432 fi
2433 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2434 fi
2435 echo "$as_me:2435: result: $cf_cv_need_libm" >&5
2436 echo "${ECHO_T}$cf_cv_need_libm" >&6
2437 if test "$cf_cv_need_libm" = yes
2438 then
2439 MATH_LIB=-lm
2440 fi
2441
2442 CC_G_OPT="-g"
2443 CC_SHARED_OPTS=unknown
2444 CPPFLAGS="$CPPFLAGS"
2445 DFT_DEP_SUFFIX=""
2446 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2447 DFT_UPR_MODEL="NORMAL"
2448 LD="ld"
2449 LDFLAGS_SHARED=""
2450 LDFLAGS_STATIC=""
2451 LD_MODEL=""
2452 LD_SHARED_OPTS=""
2453 LIBTOOL=""
2454 LIB_CLEAN=""
2455 LIB_COMPILE=""
2456 LIB_LINK='${CC}'
2457 LINK_TESTS=""
2458 LOCAL_LDFLAGS=""
2459 PTHREAD="-lm"
2460 TEST_ARGS=""
2461 TEST_DEPS=""
2462 TEST_LIBS=""
2463 TINFO_ARGS='$(LIBS_CURSES)'
2464 cf_cv_abi_version=""
2465 cf_cv_rel_version=""
2466
2467 cf_cv_screen=curses
2468 cf_cv_libtype=
2469
2470 echo "$as_me:2470: checking for ${CC:-cc} option to accept ANSI C" >&5
2471 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
2472 if test "${cf_cv_ansi_cc+set}" = set; then
2473   echo $ECHO_N "(cached) $ECHO_C" >&6
2474 else
2475
2476 cf_cv_ansi_cc=no
2477 cf_save_CFLAGS="$CFLAGS"
2478 cf_save_CPPFLAGS="$CPPFLAGS"
2479 # Don't try gcc -ansi; that turns off useful extensions and
2480 # breaks some systems' header files.
2481 # AIX                   -qlanglvl=ansi
2482 # Ultrix and OSF/1      -std1
2483 # HP-UX                 -Aa -D_HPUX_SOURCE
2484 # SVR4                  -Xc
2485 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2486 for cf_arg in "-DCC_HAS_PROTOS" \
2487         "" \
2488         -qlanglvl=ansi \
2489         -std1 \
2490         -Ae \
2491         "-Aa -D_HPUX_SOURCE" \
2492         -Xc
2493 do
2494
2495 cf_fix_cppflags=no
2496 cf_new_cflags=
2497 cf_new_cppflags=
2498 cf_new_extra_cppflags=
2499
2500 for cf_add_cflags in $cf_arg
2501 do
2502 case $cf_fix_cppflags in
2503 no)
2504         case $cf_add_cflags in #(vi
2505         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2506                 case $cf_add_cflags in
2507                 -D*)
2508                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2509
2510                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2511                                 && test -z "${cf_tst_cflags}" \
2512                                 && cf_fix_cppflags=yes
2513
2514                         if test $cf_fix_cppflags = yes ; then
2515                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2516                                 continue
2517                         elif test "${cf_tst_cflags}" = "\"'" ; then
2518                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2519                                 continue
2520                         fi
2521                         ;;
2522                 esac
2523                 case "$CPPFLAGS" in
2524                 *$cf_add_cflags) #(vi
2525                         ;;
2526                 *) #(vi
2527                         case $cf_add_cflags in #(vi
2528                         -D*)
2529                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2530
2531 CPPFLAGS=`echo "$CPPFLAGS" | \
2532         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2533                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2534
2535                                 ;;
2536                         esac
2537                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2538                         ;;
2539                 esac
2540                 ;;
2541         *)
2542                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2543                 ;;
2544         esac
2545         ;;
2546 yes)
2547         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2548
2549         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2550
2551         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2552                 && test -z "${cf_tst_cflags}" \
2553                 && cf_fix_cppflags=no
2554         ;;
2555 esac
2556 done
2557
2558 if test -n "$cf_new_cflags" ; then
2559
2560         CFLAGS="$CFLAGS $cf_new_cflags"
2561 fi
2562
2563 if test -n "$cf_new_cppflags" ; then
2564
2565         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2566 fi
2567
2568 if test -n "$cf_new_extra_cppflags" ; then
2569
2570         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2571 fi
2572
2573         cat >conftest.$ac_ext <<_ACEOF
2574 #line 2574 "configure"
2575 #include "confdefs.h"
2576
2577 #ifndef CC_HAS_PROTOS
2578 #if !defined(__STDC__) || (__STDC__ != 1)
2579 choke me
2580 #endif
2581 #endif
2582
2583 int
2584 main ()
2585 {
2586
2587         int test (int i, double x);
2588         struct s1 {int (*f) (int a);};
2589         struct s2 {int (*f) (double a);};
2590   ;
2591   return 0;
2592 }
2593 _ACEOF
2594 rm -f conftest.$ac_objext
2595 if { (eval echo "$as_me:2595: \"$ac_compile\"") >&5
2596   (eval $ac_compile) 2>&5
2597   ac_status=$?
2598   echo "$as_me:2598: \$? = $ac_status" >&5
2599   (exit $ac_status); } &&
2600          { ac_try='test -s conftest.$ac_objext'
2601   { (eval echo "$as_me:2601: \"$ac_try\"") >&5
2602   (eval $ac_try) 2>&5
2603   ac_status=$?
2604   echo "$as_me:2604: \$? = $ac_status" >&5
2605   (exit $ac_status); }; }; then
2606   cf_cv_ansi_cc="$cf_arg"; break
2607 else
2608   echo "$as_me: failed program was:" >&5
2609 cat conftest.$ac_ext >&5
2610 fi
2611 rm -f conftest.$ac_objext conftest.$ac_ext
2612 done
2613 CFLAGS="$cf_save_CFLAGS"
2614 CPPFLAGS="$cf_save_CPPFLAGS"
2615
2616 fi
2617 echo "$as_me:2617: result: $cf_cv_ansi_cc" >&5
2618 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2619
2620 if test "$cf_cv_ansi_cc" != "no"; then
2621 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2622
2623 cf_fix_cppflags=no
2624 cf_new_cflags=
2625 cf_new_cppflags=
2626 cf_new_extra_cppflags=
2627
2628 for cf_add_cflags in $cf_cv_ansi_cc
2629 do
2630 case $cf_fix_cppflags in
2631 no)
2632         case $cf_add_cflags in #(vi
2633         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2634                 case $cf_add_cflags in
2635                 -D*)
2636                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2637
2638                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2639                                 && test -z "${cf_tst_cflags}" \
2640                                 && cf_fix_cppflags=yes
2641
2642                         if test $cf_fix_cppflags = yes ; then
2643                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2644                                 continue
2645                         elif test "${cf_tst_cflags}" = "\"'" ; then
2646                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2647                                 continue
2648                         fi
2649                         ;;
2650                 esac
2651                 case "$CPPFLAGS" in
2652                 *$cf_add_cflags) #(vi
2653                         ;;
2654                 *) #(vi
2655                         case $cf_add_cflags in #(vi
2656                         -D*)
2657                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2658
2659 CPPFLAGS=`echo "$CPPFLAGS" | \
2660         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2661                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2662
2663                                 ;;
2664                         esac
2665                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2666                         ;;
2667                 esac
2668                 ;;
2669         *)
2670                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2671                 ;;
2672         esac
2673         ;;
2674 yes)
2675         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2676
2677         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2678
2679         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2680                 && test -z "${cf_tst_cflags}" \
2681                 && cf_fix_cppflags=no
2682         ;;
2683 esac
2684 done
2685
2686 if test -n "$cf_new_cflags" ; then
2687
2688         CFLAGS="$CFLAGS $cf_new_cflags"
2689 fi
2690
2691 if test -n "$cf_new_cppflags" ; then
2692
2693         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2694 fi
2695
2696 if test -n "$cf_new_extra_cppflags" ; then
2697
2698         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2699 fi
2700
2701 else
2702         cat >>confdefs.h <<\EOF
2703 #define CC_HAS_PROTOS 1
2704 EOF
2705
2706 fi
2707 fi
2708
2709 if test "$cf_cv_ansi_cc" = "no"; then
2710         { { echo "$as_me:2710: error: Your compiler does not appear to recognize prototypes.
2711 You have the following choices:
2712         a. adjust your compiler options
2713         b. get an up-to-date compiler
2714         c. use a wrapper such as unproto" >&5
2715 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2716 You have the following choices:
2717         a. adjust your compiler options
2718         b. get an up-to-date compiler
2719         c. use a wrapper such as unproto" >&2;}
2720    { (exit 1); exit 1; }; }
2721 fi
2722
2723 if test "$GCC" = yes
2724 then
2725 cat > conftest.i <<EOF
2726 #ifndef GCC_PRINTF
2727 #define GCC_PRINTF 0
2728 #endif
2729 #ifndef GCC_SCANF
2730 #define GCC_SCANF 0
2731 #endif
2732 #ifndef GCC_NORETURN
2733 #define GCC_NORETURN /* nothing */
2734 #endif
2735 #ifndef GCC_UNUSED
2736 #define GCC_UNUSED /* nothing */
2737 #endif
2738 EOF
2739 if test "$GCC" = yes
2740 then
2741         { echo "$as_me:2741: checking for $CC __attribute__ directives..." >&5
2742 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2743 cat > conftest.$ac_ext <<EOF
2744 #line 2744 "${as_me:-configure}"
2745 #include "confdefs.h"
2746 #include "conftest.h"
2747 #include "conftest.i"
2748 #if     GCC_PRINTF
2749 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2750 #else
2751 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2752 #endif
2753 #if     GCC_SCANF
2754 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2755 #else
2756 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2757 #endif
2758 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2759 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2760 extern void foo(void) GCC_NORETURN;
2761 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2762 EOF
2763         cf_printf_attribute=no
2764         cf_scanf_attribute=no
2765         for cf_attribute in scanf printf unused noreturn
2766         do
2767
2768 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2769
2770                 cf_directive="__attribute__(($cf_attribute))"
2771                 echo "checking for $CC $cf_directive" 1>&5
2772
2773                 case $cf_attribute in #(vi
2774                 printf) #(vi
2775                         cf_printf_attribute=yes
2776                         cat >conftest.h <<EOF
2777 #define GCC_$cf_ATTRIBUTE 1
2778 EOF
2779                         ;;
2780                 scanf) #(vi
2781                         cf_scanf_attribute=yes
2782                         cat >conftest.h <<EOF
2783 #define GCC_$cf_ATTRIBUTE 1
2784 EOF
2785                         ;;
2786                 *) #(vi
2787                         cat >conftest.h <<EOF
2788 #define GCC_$cf_ATTRIBUTE $cf_directive
2789 EOF
2790                         ;;
2791                 esac
2792
2793                 if { (eval echo "$as_me:2793: \"$ac_compile\"") >&5
2794   (eval $ac_compile) 2>&5
2795   ac_status=$?
2796   echo "$as_me:2796: \$? = $ac_status" >&5
2797   (exit $ac_status); }; then
2798                         test -n "$verbose" && echo "$as_me:2798: result: ... $cf_attribute" >&5
2799 echo "${ECHO_T}... $cf_attribute" >&6
2800                         cat conftest.h >>confdefs.h
2801                         case $cf_attribute in #(vi
2802                         printf) #(vi
2803                                 if test "$cf_printf_attribute" = no ; then
2804                                         cat >>confdefs.h <<EOF
2805 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
2806 EOF
2807                                 else
2808                                         cat >>confdefs.h <<EOF
2809 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2810 EOF
2811                                 fi
2812                                 ;;
2813                         scanf) #(vi
2814                                 if test "$cf_scanf_attribute" = no ; then
2815                                         cat >>confdefs.h <<EOF
2816 #define GCC_SCANFLIKE(fmt,var) /* nothing */
2817 EOF
2818                                 else
2819                                         cat >>confdefs.h <<EOF
2820 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2821 EOF
2822                                 fi
2823                                 ;;
2824                         esac
2825                 fi
2826         done
2827 else
2828         fgrep define conftest.i >>confdefs.h
2829 fi
2830 rm -rf conftest*
2831 fi
2832
2833 cf_XOPEN_SOURCE=500
2834 cf_POSIX_C_SOURCE=199506L
2835 cf_xopen_source=
2836
2837 case $host_os in #(vi
2838 aix[456]*) #(vi
2839         cf_xopen_source="-D_ALL_SOURCE"
2840         ;;
2841 darwin[0-8].*) #(vi
2842         cf_xopen_source="-D_APPLE_C_SOURCE"
2843         ;;
2844 darwin*) #(vi
2845         cf_xopen_source="-D_DARWIN_C_SOURCE"
2846         ;;
2847 freebsd*|dragonfly*) #(vi
2848         # 5.x headers associate
2849         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2850         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2851         cf_POSIX_C_SOURCE=200112L
2852         cf_XOPEN_SOURCE=600
2853         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2854         ;;
2855 hpux11*) #(vi
2856         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2857         ;;
2858 hpux*) #(vi
2859         cf_xopen_source="-D_HPUX_SOURCE"
2860         ;;
2861 irix[56].*) #(vi
2862         cf_xopen_source="-D_SGI_SOURCE"
2863         ;;
2864 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2865
2866 echo "$as_me:2866: checking if we must define _GNU_SOURCE" >&5
2867 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2868 if test "${cf_cv_gnu_source+set}" = set; then
2869   echo $ECHO_N "(cached) $ECHO_C" >&6
2870 else
2871
2872 cat >conftest.$ac_ext <<_ACEOF
2873 #line 2873 "configure"
2874 #include "confdefs.h"
2875 #include <sys/types.h>
2876 int
2877 main ()
2878 {
2879
2880 #ifndef _XOPEN_SOURCE
2881 make an error
2882 #endif
2883   ;
2884   return 0;
2885 }
2886 _ACEOF
2887 rm -f conftest.$ac_objext
2888 if { (eval echo "$as_me:2888: \"$ac_compile\"") >&5
2889   (eval $ac_compile) 2>&5
2890   ac_status=$?
2891   echo "$as_me:2891: \$? = $ac_status" >&5
2892   (exit $ac_status); } &&
2893          { ac_try='test -s conftest.$ac_objext'
2894   { (eval echo "$as_me:2894: \"$ac_try\"") >&5
2895   (eval $ac_try) 2>&5
2896   ac_status=$?
2897   echo "$as_me:2897: \$? = $ac_status" >&5
2898   (exit $ac_status); }; }; then
2899   cf_cv_gnu_source=no
2900 else
2901   echo "$as_me: failed program was:" >&5
2902 cat conftest.$ac_ext >&5
2903 cf_save="$CPPFLAGS"
2904          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2905          cat >conftest.$ac_ext <<_ACEOF
2906 #line 2906 "configure"
2907 #include "confdefs.h"
2908 #include <sys/types.h>
2909 int
2910 main ()
2911 {
2912
2913 #ifdef _XOPEN_SOURCE
2914 make an error
2915 #endif
2916   ;
2917   return 0;
2918 }
2919 _ACEOF
2920 rm -f conftest.$ac_objext
2921 if { (eval echo "$as_me:2921: \"$ac_compile\"") >&5
2922   (eval $ac_compile) 2>&5
2923   ac_status=$?
2924   echo "$as_me:2924: \$? = $ac_status" >&5
2925   (exit $ac_status); } &&
2926          { ac_try='test -s conftest.$ac_objext'
2927   { (eval echo "$as_me:2927: \"$ac_try\"") >&5
2928   (eval $ac_try) 2>&5
2929   ac_status=$?
2930   echo "$as_me:2930: \$? = $ac_status" >&5
2931   (exit $ac_status); }; }; then
2932   cf_cv_gnu_source=no
2933 else
2934   echo "$as_me: failed program was:" >&5
2935 cat conftest.$ac_ext >&5
2936 cf_cv_gnu_source=yes
2937 fi
2938 rm -f conftest.$ac_objext conftest.$ac_ext
2939         CPPFLAGS="$cf_save"
2940
2941 fi
2942 rm -f conftest.$ac_objext conftest.$ac_ext
2943
2944 fi
2945 echo "$as_me:2945: result: $cf_cv_gnu_source" >&5
2946 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2947 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2948
2949         ;;
2950 mirbsd*) #(vi
2951         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
2952         ;;
2953 netbsd*) #(vi
2954         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
2955         ;;
2956 openbsd*) #(vi
2957         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
2958         ;;
2959 osf[45]*) #(vi
2960         cf_xopen_source="-D_OSF_SOURCE"
2961         ;;
2962 nto-qnx*) #(vi
2963         cf_xopen_source="-D_QNX_SOURCE"
2964         ;;
2965 sco*) #(vi
2966         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
2967         ;;
2968 solaris2.1[0-9]) #(vi
2969         cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2970         ;;
2971 solaris2.[1-9]) #(vi
2972         cf_xopen_source="-D__EXTENSIONS__"
2973         ;;
2974 *)
2975         echo "$as_me:2975: checking if we should define _XOPEN_SOURCE" >&5
2976 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
2977 if test "${cf_cv_xopen_source+set}" = set; then
2978   echo $ECHO_N "(cached) $ECHO_C" >&6
2979 else
2980
2981         cat >conftest.$ac_ext <<_ACEOF
2982 #line 2982 "configure"
2983 #include "confdefs.h"
2984 #include <sys/types.h>
2985 int
2986 main ()
2987 {
2988
2989 #ifndef _XOPEN_SOURCE
2990 make an error
2991 #endif
2992   ;
2993   return 0;
2994 }
2995 _ACEOF
2996 rm -f conftest.$ac_objext
2997 if { (eval echo "$as_me:2997: \"$ac_compile\"") >&5
2998   (eval $ac_compile) 2>&5
2999   ac_status=$?
3000   echo "$as_me:3000: \$? = $ac_status" >&5
3001   (exit $ac_status); } &&
3002          { ac_try='test -s conftest.$ac_objext'
3003   { (eval echo "$as_me:3003: \"$ac_try\"") >&5
3004   (eval $ac_try) 2>&5
3005   ac_status=$?
3006   echo "$as_me:3006: \$? = $ac_status" >&5
3007   (exit $ac_status); }; }; then
3008   cf_cv_xopen_source=no
3009 else
3010   echo "$as_me: failed program was:" >&5
3011 cat conftest.$ac_ext >&5
3012 cf_save="$CPPFLAGS"
3013          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3014          cat >conftest.$ac_ext <<_ACEOF
3015 #line 3015 "configure"
3016 #include "confdefs.h"
3017 #include <sys/types.h>
3018 int
3019 main ()
3020 {
3021
3022 #ifdef _XOPEN_SOURCE
3023 make an error
3024 #endif
3025   ;
3026   return 0;
3027 }
3028 _ACEOF
3029 rm -f conftest.$ac_objext
3030 if { (eval echo "$as_me:3030: \"$ac_compile\"") >&5
3031   (eval $ac_compile) 2>&5
3032   ac_status=$?
3033   echo "$as_me:3033: \$? = $ac_status" >&5
3034   (exit $ac_status); } &&
3035          { ac_try='test -s conftest.$ac_objext'
3036   { (eval echo "$as_me:3036: \"$ac_try\"") >&5
3037   (eval $ac_try) 2>&5
3038   ac_status=$?
3039   echo "$as_me:3039: \$? = $ac_status" >&5
3040   (exit $ac_status); }; }; then
3041   cf_cv_xopen_source=no
3042 else
3043   echo "$as_me: failed program was:" >&5
3044 cat conftest.$ac_ext >&5
3045 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3046 fi
3047 rm -f conftest.$ac_objext conftest.$ac_ext
3048         CPPFLAGS="$cf_save"
3049
3050 fi
3051 rm -f conftest.$ac_objext conftest.$ac_ext
3052
3053 fi
3054 echo "$as_me:3054: result: $cf_cv_xopen_source" >&5
3055 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3056         if test "$cf_cv_xopen_source" != no ; then
3057
3058 CFLAGS=`echo "$CFLAGS" | \
3059         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3060                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3061
3062 CPPFLAGS=`echo "$CPPFLAGS" | \
3063         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3064                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3065
3066                 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3067
3068 cf_fix_cppflags=no
3069 cf_new_cflags=
3070 cf_new_cppflags=
3071 cf_new_extra_cppflags=
3072
3073 for cf_add_cflags in $cf_temp_xopen_source
3074 do
3075 case $cf_fix_cppflags in
3076 no)
3077         case $cf_add_cflags in #(vi
3078         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3079                 case $cf_add_cflags in
3080                 -D*)
3081                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3082
3083                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3084                                 && test -z "${cf_tst_cflags}" \
3085                                 && cf_fix_cppflags=yes
3086
3087                         if test $cf_fix_cppflags = yes ; then
3088                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3089                                 continue
3090                         elif test "${cf_tst_cflags}" = "\"'" ; then
3091                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3092                                 continue
3093                         fi
3094                         ;;
3095                 esac
3096                 case "$CPPFLAGS" in
3097                 *$cf_add_cflags) #(vi
3098                         ;;
3099                 *) #(vi
3100                         case $cf_add_cflags in #(vi
3101                         -D*)
3102                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3103
3104 CPPFLAGS=`echo "$CPPFLAGS" | \
3105         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3106                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3107
3108                                 ;;
3109                         esac
3110                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3111                         ;;
3112                 esac
3113                 ;;
3114         *)
3115                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3116                 ;;
3117         esac
3118         ;;
3119 yes)
3120         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3121
3122         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3123
3124         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3125                 && test -z "${cf_tst_cflags}" \
3126                 && cf_fix_cppflags=no
3127         ;;
3128 esac
3129 done
3130
3131 if test -n "$cf_new_cflags" ; then
3132
3133         CFLAGS="$CFLAGS $cf_new_cflags"
3134 fi
3135
3136 if test -n "$cf_new_cppflags" ; then
3137
3138         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3139 fi
3140
3141 if test -n "$cf_new_extra_cppflags" ; then
3142
3143         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3144 fi
3145
3146         fi
3147
3148 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3149
3150 cf_save_CFLAGS="$CFLAGS"
3151 cf_save_CPPFLAGS="$CPPFLAGS"
3152
3153 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3154         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3155                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3156
3157 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3158         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3159                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3160
3161 echo "$as_me:3161: checking if we should define _POSIX_C_SOURCE" >&5
3162 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3163 if test "${cf_cv_posix_c_source+set}" = set; then
3164   echo $ECHO_N "(cached) $ECHO_C" >&6
3165 else
3166
3167 echo "${as_me:-configure}:3167: testing if the symbol is already defined go no further ..." 1>&5
3168
3169         cat >conftest.$ac_ext <<_ACEOF
3170 #line 3170 "configure"
3171 #include "confdefs.h"
3172 #include <sys/types.h>
3173 int
3174 main ()
3175 {
3176
3177 #ifndef _POSIX_C_SOURCE
3178 make an error
3179 #endif
3180   ;
3181   return 0;
3182 }
3183 _ACEOF
3184 rm -f conftest.$ac_objext
3185 if { (eval echo "$as_me:3185: \"$ac_compile\"") >&5
3186   (eval $ac_compile) 2>&5
3187   ac_status=$?
3188   echo "$as_me:3188: \$? = $ac_status" >&5
3189   (exit $ac_status); } &&
3190          { ac_try='test -s conftest.$ac_objext'
3191   { (eval echo "$as_me:3191: \"$ac_try\"") >&5
3192   (eval $ac_try) 2>&5
3193   ac_status=$?
3194   echo "$as_me:3194: \$? = $ac_status" >&5
3195   (exit $ac_status); }; }; then
3196   cf_cv_posix_c_source=no
3197 else
3198   echo "$as_me: failed program was:" >&5
3199 cat conftest.$ac_ext >&5
3200 cf_want_posix_source=no
3201          case .$cf_POSIX_C_SOURCE in #(vi
3202          .[12]??*) #(vi
3203                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3204                 ;;
3205          .2) #(vi
3206                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3207                 cf_want_posix_source=yes
3208                 ;;
3209          .*)
3210                 cf_want_posix_source=yes
3211                 ;;
3212          esac
3213          if test "$cf_want_posix_source" = yes ; then
3214                 cat >conftest.$ac_ext <<_ACEOF
3215 #line 3215 "configure"
3216 #include "confdefs.h"
3217 #include <sys/types.h>
3218 int
3219 main ()
3220 {
3221
3222 #ifdef _POSIX_SOURCE
3223 make an error
3224 #endif
3225   ;
3226   return 0;
3227 }
3228 _ACEOF
3229 rm -f conftest.$ac_objext
3230 if { (eval echo "$as_me:3230: \"$ac_compile\"") >&5
3231   (eval $ac_compile) 2>&5
3232   ac_status=$?
3233   echo "$as_me:3233: \$? = $ac_status" >&5
3234   (exit $ac_status); } &&
3235          { ac_try='test -s conftest.$ac_objext'
3236   { (eval echo "$as_me:3236: \"$ac_try\"") >&5
3237   (eval $ac_try) 2>&5
3238   ac_status=$?
3239   echo "$as_me:3239: \$? = $ac_status" >&5
3240   (exit $ac_status); }; }; then
3241   :
3242 else
3243   echo "$as_me: failed program was:" >&5
3244 cat conftest.$ac_ext >&5
3245 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3246 fi
3247 rm -f conftest.$ac_objext conftest.$ac_ext
3248          fi
3249
3250 echo "${as_me:-configure}:3250: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3251
3252          CFLAGS="$cf_trim_CFLAGS"
3253          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3254
3255 echo "${as_me:-configure}:3255: testing if the second compile does not leave our definition intact error ..." 1>&5
3256
3257          cat >conftest.$ac_ext <<_ACEOF
3258 #line 3258 "configure"
3259 #include "confdefs.h"
3260 #include <sys/types.h>
3261 int
3262 main ()
3263 {
3264
3265 #ifndef _POSIX_C_SOURCE
3266 make an error
3267 #endif
3268   ;
3269   return 0;
3270 }
3271 _ACEOF
3272 rm -f conftest.$ac_objext
3273 if { (eval echo "$as_me:3273: \"$ac_compile\"") >&5
3274   (eval $ac_compile) 2>&5
3275   ac_status=$?
3276   echo "$as_me:3276: \$? = $ac_status" >&5
3277   (exit $ac_status); } &&
3278          { ac_try='test -s conftest.$ac_objext'
3279   { (eval echo "$as_me:3279: \"$ac_try\"") >&5
3280   (eval $ac_try) 2>&5
3281   ac_status=$?
3282   echo "$as_me:3282: \$? = $ac_status" >&5
3283   (exit $ac_status); }; }; then
3284   :
3285 else
3286   echo "$as_me: failed program was:" >&5
3287 cat conftest.$ac_ext >&5
3288 cf_cv_posix_c_source=no
3289 fi
3290 rm -f conftest.$ac_objext conftest.$ac_ext
3291          CFLAGS="$cf_save_CFLAGS"
3292          CPPFLAGS="$cf_save_CPPFLAGS"
3293
3294 fi
3295 rm -f conftest.$ac_objext conftest.$ac_ext
3296
3297 fi
3298 echo "$as_me:3298: result: $cf_cv_posix_c_source" >&5
3299 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3300
3301 if test "$cf_cv_posix_c_source" != no ; then
3302         CFLAGS="$cf_trim_CFLAGS"
3303         CPPFLAGS="$cf_trim_CPPFLAGS"
3304
3305 cf_fix_cppflags=no
3306 cf_new_cflags=
3307 cf_new_cppflags=
3308 cf_new_extra_cppflags=
3309
3310 for cf_add_cflags in $cf_cv_posix_c_source
3311 do
3312 case $cf_fix_cppflags in
3313 no)
3314         case $cf_add_cflags in #(vi
3315         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3316                 case $cf_add_cflags in
3317                 -D*)
3318                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3319
3320                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3321                                 && test -z "${cf_tst_cflags}" \
3322                                 && cf_fix_cppflags=yes
3323
3324                         if test $cf_fix_cppflags = yes ; then
3325                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3326                                 continue
3327                         elif test "${cf_tst_cflags}" = "\"'" ; then
3328                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3329                                 continue
3330                         fi
3331                         ;;
3332                 esac
3333                 case "$CPPFLAGS" in
3334                 *$cf_add_cflags) #(vi
3335                         ;;
3336                 *) #(vi
3337                         case $cf_add_cflags in #(vi
3338                         -D*)
3339                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3340
3341 CPPFLAGS=`echo "$CPPFLAGS" | \
3342         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3343                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3344
3345                                 ;;
3346                         esac
3347                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3348                         ;;
3349                 esac
3350                 ;;
3351         *)
3352                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3353                 ;;
3354         esac
3355         ;;
3356 yes)
3357         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3358
3359         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3360
3361         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3362                 && test -z "${cf_tst_cflags}" \
3363                 && cf_fix_cppflags=no
3364         ;;
3365 esac
3366 done
3367
3368 if test -n "$cf_new_cflags" ; then
3369
3370         CFLAGS="$CFLAGS $cf_new_cflags"
3371 fi
3372
3373 if test -n "$cf_new_cppflags" ; then
3374
3375         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3376 fi
3377
3378 if test -n "$cf_new_extra_cppflags" ; then
3379
3380         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3381 fi
3382
3383 fi
3384
3385         ;;
3386 esac
3387
3388 if test -n "$cf_xopen_source" ; then
3389
3390 cf_fix_cppflags=no
3391 cf_new_cflags=
3392 cf_new_cppflags=
3393 cf_new_extra_cppflags=
3394
3395 for cf_add_cflags in $cf_xopen_source
3396 do
3397 case $cf_fix_cppflags in
3398 no)
3399         case $cf_add_cflags in #(vi
3400         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3401                 case $cf_add_cflags in
3402                 -D*)
3403                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3404
3405                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3406                                 && test -z "${cf_tst_cflags}" \
3407                                 && cf_fix_cppflags=yes
3408
3409                         if test $cf_fix_cppflags = yes ; then
3410                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3411                                 continue
3412                         elif test "${cf_tst_cflags}" = "\"'" ; then
3413                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3414                                 continue
3415                         fi
3416                         ;;
3417                 esac
3418                 case "$CPPFLAGS" in
3419                 *$cf_add_cflags) #(vi
3420                         ;;
3421                 *) #(vi
3422                         case $cf_add_cflags in #(vi
3423                         -D*)
3424                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3425
3426 CPPFLAGS=`echo "$CPPFLAGS" | \
3427         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3428                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3429
3430                                 ;;
3431                         esac
3432                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3433                         ;;
3434                 esac
3435                 ;;
3436         *)
3437                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3438                 ;;
3439         esac
3440         ;;
3441 yes)
3442         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3443
3444         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3445
3446         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3447                 && test -z "${cf_tst_cflags}" \
3448                 && cf_fix_cppflags=no
3449         ;;
3450 esac
3451 done
3452
3453 if test -n "$cf_new_cflags" ; then
3454
3455         CFLAGS="$CFLAGS $cf_new_cflags"
3456 fi
3457
3458 if test -n "$cf_new_cppflags" ; then
3459
3460         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3461 fi
3462
3463 if test -n "$cf_new_extra_cppflags" ; then
3464
3465         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3466 fi
3467
3468 fi
3469
3470 echo "$as_me:3470: checking for $CC option to accept ANSI C" >&5
3471 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
3472 if test "${ac_cv_prog_cc_stdc+set}" = set; then
3473   echo $ECHO_N "(cached) $ECHO_C" >&6
3474 else
3475   ac_cv_prog_cc_stdc=no
3476 ac_save_CC=$CC
3477 cat >conftest.$ac_ext <<_ACEOF
3478 #line 3478 "configure"
3479 #include "confdefs.h"
3480 #include <stdarg.h>
3481 #include <stdio.h>
3482 #include <sys/types.h>
3483 #include <sys/stat.h>
3484 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3485 struct buf { int x; };
3486 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3487 static char *e (p, i)
3488      char **p;
3489      int i;
3490 {
3491   return p[i];
3492 }
3493 static char *f (char * (*g) (char **, int), char **p, ...)
3494 {
3495   char *s;
3496   va_list v;
3497   va_start (v,p);
3498   s = g (p, va_arg (v,int));
3499   va_end (v);
3500   return s;
3501 }
3502 int test (int i, double x);
3503 struct s1 {int (*f) (int a);};
3504 struct s2 {int (*f) (double a);};
3505 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3506 int argc;
3507 char **argv;
3508 int
3509 main ()
3510 {
3511 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3512   ;
3513   return 0;
3514 }
3515 _ACEOF
3516 # Don't try gcc -ansi; that turns off useful extensions and
3517 # breaks some systems' header files.
3518 # AIX                   -qlanglvl=ansi
3519 # Ultrix and OSF/1      -std1
3520 # HP-UX 10.20 and later -Ae
3521 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3522 # SVR4                  -Xc -D__EXTENSIONS__
3523 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3524 do
3525   CC="$ac_save_CC $ac_arg"
3526   rm -f conftest.$ac_objext
3527 if { (eval echo "$as_me:3527: \"$ac_compile\"") >&5
3528   (eval $ac_compile) 2>&5
3529   ac_status=$?
3530   echo "$as_me:3530: \$? = $ac_status" >&5
3531   (exit $ac_status); } &&
3532          { ac_try='test -s conftest.$ac_objext'
3533   { (eval echo "$as_me:3533: \"$ac_try\"") >&5
3534   (eval $ac_try) 2>&5
3535   ac_status=$?
3536   echo "$as_me:3536: \$? = $ac_status" >&5
3537   (exit $ac_status); }; }; then
3538   ac_cv_prog_cc_stdc=$ac_arg
3539 break
3540 else
3541   echo "$as_me: failed program was:" >&5
3542 cat conftest.$ac_ext >&5
3543 fi
3544 rm -f conftest.$ac_objext
3545 done
3546 rm -f conftest.$ac_ext conftest.$ac_objext
3547 CC=$ac_save_CC
3548
3549 fi
3550
3551 case "x$ac_cv_prog_cc_stdc" in
3552   x|xno)
3553     echo "$as_me:3553: result: none needed" >&5
3554 echo "${ECHO_T}none needed" >&6 ;;
3555   *)
3556     echo "$as_me:3556: result: $ac_cv_prog_cc_stdc" >&5
3557 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
3558     CC="$CC $ac_cv_prog_cc_stdc" ;;
3559 esac
3560
3561 echo "$as_me:3561: checking for an ANSI C-conforming const" >&5
3562 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
3563 if test "${ac_cv_c_const+set}" = set; then
3564   echo $ECHO_N "(cached) $ECHO_C" >&6
3565 else
3566   cat >conftest.$ac_ext <<_ACEOF
3567 #line 3567 "configure"
3568 #include "confdefs.h"
3569
3570 int
3571 main ()
3572 {
3573 /* FIXME: Include the comments suggested by Paul. */
3574 #ifndef __cplusplus
3575   /* Ultrix mips cc rejects this.  */
3576   typedef int charset[2];
3577   const charset x;
3578   /* SunOS 4.1.1 cc rejects this.  */
3579   char const *const *ccp;
3580   char **p;
3581   /* NEC SVR4.0.2 mips cc rejects this.  */
3582   struct point {int x, y;};
3583   static struct point const zero = {0,0};
3584   /* AIX XL C 1.02.0.0 rejects this.
3585      It does not let you subtract one const X* pointer from another in
3586      an arm of an if-expression whose if-part is not a constant
3587      expression */
3588   const char *g = "string";
3589   ccp = &g + (g ? g-g : 0);
3590   /* HPUX 7.0 cc rejects these. */
3591   ++ccp;
3592   p = (char**) ccp;
3593   ccp = (char const *const *) p;
3594   { /* SCO 3.2v4 cc rejects this.  */
3595     char *t;
3596     char const *s = 0 ? (char *) 0 : (char const *) 0;
3597
3598     *t++ = 0;
3599   }
3600   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3601     int x[] = {25, 17};
3602     const int *foo = &x[0];
3603     ++foo;
3604   }
3605   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3606     typedef const int *iptr;
3607     iptr p = 0;
3608     ++p;
3609   }
3610   { /* AIX XL C 1.02.0.0 rejects this saying
3611        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3612     struct s { int j; const int *ap[3]; };
3613     struct s *b; b->j = 5;
3614   }
3615   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3616     const int foo = 10;
3617   }
3618 #endif
3619
3620   ;
3621   return 0;
3622 }
3623 _ACEOF
3624 rm -f conftest.$ac_objext
3625 if { (eval echo "$as_me:3625: \"$ac_compile\"") >&5
3626   (eval $ac_compile) 2>&5
3627   ac_status=$?
3628   echo "$as_me:3628: \$? = $ac_status" >&5
3629   (exit $ac_status); } &&
3630          { ac_try='test -s conftest.$ac_objext'
3631   { (eval echo "$as_me:3631: \"$ac_try\"") >&5
3632   (eval $ac_try) 2>&5
3633   ac_status=$?
3634   echo "$as_me:3634: \$? = $ac_status" >&5
3635   (exit $ac_status); }; }; then
3636   ac_cv_c_const=yes
3637 else
3638   echo "$as_me: failed program was:" >&5
3639 cat conftest.$ac_ext >&5
3640 ac_cv_c_const=no
3641 fi
3642 rm -f conftest.$ac_objext conftest.$ac_ext
3643 fi
3644 echo "$as_me:3644: result: $ac_cv_c_const" >&5
3645 echo "${ECHO_T}$ac_cv_c_const" >&6
3646 if test $ac_cv_c_const = no; then
3647
3648 cat >>confdefs.h <<\EOF
3649 #define const
3650 EOF
3651
3652 fi
3653
3654 echo "$as_me:3654: checking for signal global datatype" >&5
3655 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3656 if test "${cf_cv_sig_atomic_t+set}" = set; then
3657   echo $ECHO_N "(cached) $ECHO_C" >&6
3658 else
3659
3660         for cf_type in \
3661                 "volatile sig_atomic_t" \
3662                 "sig_atomic_t" \
3663                 "int"
3664         do
3665         cat >conftest.$ac_ext <<_ACEOF
3666 #line 3666 "configure"
3667 #include "confdefs.h"
3668
3669 #include <sys/types.h>
3670 #include <signal.h>
3671 #include <stdio.h>
3672
3673 extern $cf_type x;
3674 $cf_type x;
3675 static void handler(int sig)
3676 {
3677         x = 5;
3678 }
3679 int
3680 main ()
3681 {
3682 signal(SIGINT, handler);
3683                  x = 1
3684   ;
3685   return 0;
3686 }
3687 _ACEOF
3688 rm -f conftest.$ac_objext
3689 if { (eval echo "$as_me:3689: \"$ac_compile\"") >&5
3690   (eval $ac_compile) 2>&5
3691   ac_status=$?
3692   echo "$as_me:3692: \$? = $ac_status" >&5
3693   (exit $ac_status); } &&
3694          { ac_try='test -s conftest.$ac_objext'
3695   { (eval echo "$as_me:3695: \"$ac_try\"") >&5
3696   (eval $ac_try) 2>&5
3697   ac_status=$?
3698   echo "$as_me:3698: \$? = $ac_status" >&5
3699   (exit $ac_status); }; }; then
3700   cf_cv_sig_atomic_t=$cf_type
3701 else
3702   echo "$as_me: failed program was:" >&5
3703 cat conftest.$ac_ext >&5
3704 cf_cv_sig_atomic_t=no
3705 fi
3706 rm -f conftest.$ac_objext conftest.$ac_ext
3707                 test "$cf_cv_sig_atomic_t" != no && break
3708         done
3709
3710 fi
3711
3712 echo "$as_me:3712: result: $cf_cv_sig_atomic_t" >&5
3713 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
3714 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
3715 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
3716 EOF
3717
3718 echo "$as_me:3718: checking if you want to see long compiling messages" >&5
3719 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
3720
3721 # Check whether --enable-echo or --disable-echo was given.
3722 if test "${enable_echo+set}" = set; then
3723   enableval="$enable_echo"
3724   test "$enableval" != no && enableval=yes
3725   if test "$enableval" != "yes" ; then
3726
3727     ECHO_LT='--silent'
3728     ECHO_LD='@echo linking $@;'
3729     RULE_CC='@echo compiling $<'
3730     SHOW_CC='@echo compiling $@'
3731     ECHO_CC='@'
3732
3733   else
3734
3735     ECHO_LT=''
3736     ECHO_LD=''
3737     RULE_CC=''
3738     SHOW_CC=''
3739     ECHO_CC=''
3740
3741   fi
3742 else
3743   enableval=yes
3744
3745     ECHO_LT=''
3746     ECHO_LD=''
3747     RULE_CC=''
3748     SHOW_CC=''
3749     ECHO_CC=''
3750
3751 fi;
3752 echo "$as_me:3752: result: $enableval" >&5
3753 echo "${ECHO_T}$enableval" >&6
3754
3755 GCC_VERSION=none
3756 if test "$GCC" = yes ; then
3757         echo "$as_me:3757: checking version of $CC" >&5
3758 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
3759         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
3760         test -z "$GCC_VERSION" && GCC_VERSION=unknown
3761         echo "$as_me:3761: result: $GCC_VERSION" >&5
3762 echo "${ECHO_T}$GCC_VERSION" >&6
3763 fi
3764
3765 if ( test "$GCC" = yes || test "$GXX" = yes )
3766 then
3767 echo "$as_me:3767: checking if you want to turn on gcc warnings" >&5
3768 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
3769
3770 # Check whether --enable-warnings or --disable-warnings was given.
3771 if test "${enable_warnings+set}" = set; then
3772   enableval="$enable_warnings"
3773   test "$enableval" != yes && enableval=no
3774   if test "$enableval" != "no" ; then
3775     with_warnings=yes
3776   else
3777     with_warnings=no
3778   fi
3779 else
3780   enableval=no
3781   with_warnings=no
3782
3783 fi;
3784 echo "$as_me:3784: result: $with_warnings" >&5
3785 echo "${ECHO_T}$with_warnings" >&6
3786 if test "$with_warnings" = "yes"
3787 then
3788
3789 if test "$GCC" = yes
3790 then
3791 cat > conftest.i <<EOF
3792 #ifndef GCC_PRINTF
3793 #define GCC_PRINTF 0
3794 #endif
3795 #ifndef GCC_SCANF
3796 #define GCC_SCANF 0
3797 #endif
3798 #ifndef GCC_NORETURN
3799 #define GCC_NORETURN /* nothing */
3800 #endif
3801 #ifndef GCC_UNUSED
3802 #define GCC_UNUSED /* nothing */
3803 #endif
3804 EOF
3805 if test "$GCC" = yes
3806 then
3807         { echo "$as_me:3807: checking for $CC __attribute__ directives..." >&5
3808 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3809 cat > conftest.$ac_ext <<EOF
3810 #line 3810 "${as_me:-configure}"
3811 #include "confdefs.h"
3812 #include "conftest.h"
3813 #include "conftest.i"
3814 #if     GCC_PRINTF
3815 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3816 #else
3817 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3818 #endif
3819 #if     GCC_SCANF
3820 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3821 #else
3822 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3823 #endif
3824 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3825 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3826 extern void foo(void) GCC_NORETURN;
3827 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3828 EOF
3829         cf_printf_attribute=no
3830         cf_scanf_attribute=no
3831         for cf_attribute in scanf printf unused noreturn
3832         do
3833
3834 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3835
3836                 cf_directive="__attribute__(($cf_attribute))"
3837                 echo "checking for $CC $cf_directive" 1>&5
3838
3839                 case $cf_attribute in #(vi
3840                 printf) #(vi
3841                         cf_printf_attribute=yes
3842                         cat >conftest.h <<EOF
3843 #define GCC_$cf_ATTRIBUTE 1
3844 EOF
3845                         ;;
3846                 scanf) #(vi
3847                         cf_scanf_attribute=yes
3848                         cat >conftest.h <<EOF
3849 #define GCC_$cf_ATTRIBUTE 1
3850 EOF
3851                         ;;
3852                 *) #(vi
3853                         cat >conftest.h <<EOF
3854 #define GCC_$cf_ATTRIBUTE $cf_directive
3855 EOF
3856                         ;;
3857                 esac
3858
3859                 if { (eval echo "$as_me:3859: \"$ac_compile\"") >&5
3860   (eval $ac_compile) 2>&5
3861   ac_status=$?
3862   echo "$as_me:3862: \$? = $ac_status" >&5
3863   (exit $ac_status); }; then
3864                         test -n "$verbose" && echo "$as_me:3864: result: ... $cf_attribute" >&5
3865 echo "${ECHO_T}... $cf_attribute" >&6
3866                         cat conftest.h >>confdefs.h
3867                         case $cf_attribute in #(vi
3868                         printf) #(vi
3869                                 if test "$cf_printf_attribute" = no ; then
3870                                         cat >>confdefs.h <<EOF
3871 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
3872 EOF
3873                                 else
3874                                         cat >>confdefs.h <<EOF
3875 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3876 EOF
3877                                 fi
3878                                 ;;
3879                         scanf) #(vi
3880                                 if test "$cf_scanf_attribute" = no ; then
3881                                         cat >>confdefs.h <<EOF
3882 #define GCC_SCANFLIKE(fmt,var) /* nothing */
3883 EOF
3884                                 else
3885                                         cat >>confdefs.h <<EOF
3886 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3887 EOF
3888                                 fi
3889                                 ;;
3890                         esac
3891                 fi
3892         done
3893 else
3894         fgrep define conftest.i >>confdefs.h
3895 fi
3896 rm -rf conftest*
3897 fi
3898
3899 INTEL_COMPILER=no
3900
3901 if test "$GCC" = yes ; then
3902         case $host_os in
3903         linux*|gnu*)
3904                 echo "$as_me:3904: checking if this is really Intel C compiler" >&5
3905 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
3906                 cf_save_CFLAGS="$CFLAGS"
3907                 CFLAGS="$CFLAGS -no-gcc"
3908                 cat >conftest.$ac_ext <<_ACEOF
3909 #line 3909 "configure"
3910 #include "confdefs.h"
3911
3912 int
3913 main ()
3914 {
3915
3916 #ifdef __INTEL_COMPILER
3917 #else
3918 make an error
3919 #endif
3920
3921   ;
3922   return 0;
3923 }
3924 _ACEOF
3925 rm -f conftest.$ac_objext
3926 if { (eval echo "$as_me:3926: \"$ac_compile\"") >&5
3927   (eval $ac_compile) 2>&5
3928   ac_status=$?
3929   echo "$as_me:3929: \$? = $ac_status" >&5
3930   (exit $ac_status); } &&
3931          { ac_try='test -s conftest.$ac_objext'
3932   { (eval echo "$as_me:3932: \"$ac_try\"") >&5
3933   (eval $ac_try) 2>&5
3934   ac_status=$?
3935   echo "$as_me:3935: \$? = $ac_status" >&5
3936   (exit $ac_status); }; }; then
3937   INTEL_COMPILER=yes
3938 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
3939
3940 else
3941   echo "$as_me: failed program was:" >&5
3942 cat conftest.$ac_ext >&5
3943 fi
3944 rm -f conftest.$ac_objext conftest.$ac_ext
3945                 CFLAGS="$cf_save_CFLAGS"
3946                 echo "$as_me:3946: result: $INTEL_COMPILER" >&5
3947 echo "${ECHO_T}$INTEL_COMPILER" >&6
3948                 ;;
3949         esac
3950 fi
3951
3952 cat > conftest.$ac_ext <<EOF
3953 #line 3953 "${as_me:-configure}"
3954 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
3955 EOF
3956
3957 if test "$INTEL_COMPILER" = yes
3958 then
3959 # The "-wdXXX" options suppress warnings:
3960 # remark #1419: external declaration in primary source file
3961 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
3962 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
3963 # remark #193: zero used for undefined preprocessing identifier
3964 # remark #593: variable "curs_sb_left_arrow" was set but never used
3965 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
3966 # remark #869: parameter "tw" was never referenced
3967 # remark #981: operands are evaluated in unspecified order
3968 # warning #279: controlling expression is constant
3969
3970         { echo "$as_me:3970: checking for $CC warning options..." >&5
3971 echo "$as_me: checking for $CC warning options..." >&6;}
3972         cf_save_CFLAGS="$CFLAGS"
3973         EXTRA_CFLAGS="-Wall"
3974         for cf_opt in \
3975                 wd1419 \
3976                 wd1683 \
3977                 wd1684 \
3978                 wd193 \
3979                 wd593 \
3980                 wd279 \
3981                 wd810 \
3982                 wd869 \
3983                 wd981
3984         do
3985                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
3986                 if { (eval echo "$as_me:3986: \"$ac_compile\"") >&5
3987   (eval $ac_compile) 2>&5
3988   ac_status=$?
3989   echo "$as_me:3989: \$? = $ac_status" >&5
3990   (exit $ac_status); }; then
3991                         test -n "$verbose" && echo "$as_me:3991: result: ... -$cf_opt" >&5
3992 echo "${ECHO_T}... -$cf_opt" >&6
3993                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
3994                 fi
3995         done
3996         CFLAGS="$cf_save_CFLAGS"
3997
3998 elif test "$GCC" = yes
3999 then
4000         { echo "$as_me:4000: checking for $CC warning options..." >&5
4001 echo "$as_me: checking for $CC warning options..." >&6;}
4002         cf_save_CFLAGS="$CFLAGS"
4003         EXTRA_CFLAGS=
4004         cf_warn_CONST=""
4005         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4006         for cf_opt in W Wall \
4007                 Wbad-function-cast \
4008                 Wcast-align \
4009                 Wcast-qual \
4010                 Winline \
4011                 Wmissing-declarations \
4012                 Wmissing-prototypes \
4013                 Wnested-externs \
4014                 Wpointer-arith \
4015                 Wshadow \
4016                 Wstrict-prototypes \
4017                 Wundef $cf_warn_CONST
4018         do
4019                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4020                 if { (eval echo "$as_me:4020: \"$ac_compile\"") >&5
4021   (eval $ac_compile) 2>&5
4022   ac_status=$?
4023   echo "$as_me:4023: \$? = $ac_status" >&5
4024   (exit $ac_status); }; then
4025                         test -n "$verbose" && echo "$as_me:4025: result: ... -$cf_opt" >&5
4026 echo "${ECHO_T}... -$cf_opt" >&6
4027                         case $cf_opt in #(vi
4028                         Wcast-qual) #(vi
4029                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
4030                                 ;;
4031                         Winline) #(vi
4032                                 case $GCC_VERSION in
4033                                 [34].*)
4034                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4035
4036 echo "${as_me:-configure}:4036: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4037
4038                                         continue;;
4039                                 esac
4040                                 ;;
4041                         esac
4042                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4043                 fi
4044         done
4045         CFLAGS="$cf_save_CFLAGS"
4046 fi
4047 rm -rf conftest*
4048
4049 fi
4050 fi
4051
4052 # Check whether --with-curses-dir or --without-curses-dir was given.
4053 if test "${with_curses_dir+set}" = set; then
4054   withval="$with_curses_dir"
4055
4056 if test "x$prefix" != xNONE; then
4057   cf_path_syntax="$prefix"
4058 else
4059   cf_path_syntax="$ac_default_prefix"
4060 fi
4061
4062 case ".$withval" in #(vi
4063 .\$\(*\)*|.\'*\'*) #(vi
4064   ;;
4065 ..|./*|.\\*) #(vi
4066   ;;
4067 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4068   ;;
4069 .\${*prefix}*) #(vi
4070   eval withval="$withval"
4071   case ".$withval" in #(vi
4072   .NONE/*)
4073     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4074     ;;
4075   esac
4076   ;; #(vi
4077 .no|.NONE/*)
4078   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4079   ;;
4080 *)
4081   { { echo "$as_me:4081: error: expected a pathname, not \"$withval\"" >&5
4082 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4083    { (exit 1); exit 1; }; }
4084   ;;
4085 esac
4086
4087          cf_cv_curses_dir=$withval
4088 else
4089   cf_cv_curses_dir=no
4090 fi;
4091
4092 # Check whether --with-5lib or --without-5lib was given.
4093 if test "${with_5lib+set}" = set; then
4094   withval="$with_5lib"
4095   LIBS="-L/usr/5lib $LIBS"
4096          CPPFLAGS="$CPPFLAGS -I/usr/5include"
4097 fi;
4098
4099 # Check whether --with-ncursesw or --without-ncursesw was given.
4100 if test "${with_ncursesw+set}" = set; then
4101   withval="$with_ncursesw"
4102   cf_cv_screen=ncursesw
4103 else
4104
4105 # Check whether --with-ncurses or --without-ncurses was given.
4106 if test "${with_ncurses+set}" = set; then
4107   withval="$with_ncurses"
4108   cf_cv_screen=ncurses
4109 else
4110
4111 # Check whether --with-pdcurses or --without-pdcurses was given.
4112 if test "${with_pdcurses+set}" = set; then
4113   withval="$with_pdcurses"
4114   cf_cv_screen=pdcurses
4115 fi;
4116 fi;
4117 fi;
4118
4119 case $cf_cv_screen in
4120 curses)
4121
4122 echo "$as_me:4122: checking for extra include directories" >&5
4123 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4124 if test "${cf_cv_curses_incdir+set}" = set; then
4125   echo $ECHO_N "(cached) $ECHO_C" >&6
4126 else
4127
4128 cf_cv_curses_incdir=no
4129 case $host_os in #(vi
4130 hpux10.*) #(vi
4131         test -d /usr/include/curses_colr && \
4132         cf_cv_curses_incdir="-I/usr/include/curses_colr"
4133         ;;
4134 sunos3*|sunos4*)
4135         test -d /usr/5lib && \
4136         test -d /usr/5include && \
4137         cf_cv_curses_incdir="-I/usr/5include"
4138         ;;
4139 esac
4140
4141 fi
4142 echo "$as_me:4142: result: $cf_cv_curses_incdir" >&5
4143 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4144 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4145
4146 echo "$as_me:4146: checking if we have identified curses headers" >&5
4147 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4148 if test "${cf_cv_ncurses_header+set}" = set; then
4149   echo $ECHO_N "(cached) $ECHO_C" >&6
4150 else
4151
4152 cf_cv_ncurses_header=none
4153 for cf_header in  \
4154         curses.h \
4155         ncurses.h ncurses/curses.h ncurses/ncurses.h
4156 do
4157 cat >conftest.$ac_ext <<_ACEOF
4158 #line 4158 "configure"
4159 #include "confdefs.h"
4160 #include <${cf_header}>
4161 int
4162 main ()
4163 {
4164 initscr(); tgoto("?", 0,0)
4165   ;
4166   return 0;
4167 }
4168 _ACEOF
4169 rm -f conftest.$ac_objext
4170 if { (eval echo "$as_me:4170: \"$ac_compile\"") >&5
4171   (eval $ac_compile) 2>&5
4172   ac_status=$?
4173   echo "$as_me:4173: \$? = $ac_status" >&5
4174   (exit $ac_status); } &&
4175          { ac_try='test -s conftest.$ac_objext'
4176   { (eval echo "$as_me:4176: \"$ac_try\"") >&5
4177   (eval $ac_try) 2>&5
4178   ac_status=$?
4179   echo "$as_me:4179: \$? = $ac_status" >&5
4180   (exit $ac_status); }; }; then
4181   cf_cv_ncurses_header=$cf_header; break
4182 else
4183   echo "$as_me: failed program was:" >&5
4184 cat conftest.$ac_ext >&5
4185 fi
4186 rm -f conftest.$ac_objext conftest.$ac_ext
4187 done
4188
4189 fi
4190 echo "$as_me:4190: result: $cf_cv_ncurses_header" >&5
4191 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4192
4193 if test "$cf_cv_ncurses_header" = none ; then
4194         { { echo "$as_me:4194: error: No curses header-files found" >&5
4195 echo "$as_me: error: No curses header-files found" >&2;}
4196    { (exit 1); exit 1; }; }
4197 fi
4198
4199 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4200
4201 for ac_header in $cf_cv_ncurses_header
4202 do
4203 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4204 echo "$as_me:4204: checking for $ac_header" >&5
4205 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4206 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4207   echo $ECHO_N "(cached) $ECHO_C" >&6
4208 else
4209   cat >conftest.$ac_ext <<_ACEOF
4210 #line 4210 "configure"
4211 #include "confdefs.h"
4212 #include <$ac_header>
4213 _ACEOF
4214 if { (eval echo "$as_me:4214: \"$ac_cpp conftest.$ac_ext\"") >&5
4215   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4216   ac_status=$?
4217   egrep -v '^ *\+' conftest.er1 >conftest.err
4218   rm -f conftest.er1
4219   cat conftest.err >&5
4220   echo "$as_me:4220: \$? = $ac_status" >&5
4221   (exit $ac_status); } >/dev/null; then
4222   if test -s conftest.err; then
4223     ac_cpp_err=$ac_c_preproc_warn_flag
4224   else
4225     ac_cpp_err=
4226   fi
4227 else
4228   ac_cpp_err=yes
4229 fi
4230 if test -z "$ac_cpp_err"; then
4231   eval "$as_ac_Header=yes"
4232 else
4233   echo "$as_me: failed program was:" >&5
4234   cat conftest.$ac_ext >&5
4235   eval "$as_ac_Header=no"
4236 fi
4237 rm -f conftest.err conftest.$ac_ext
4238 fi
4239 echo "$as_me:4239: result: `eval echo '${'$as_ac_Header'}'`" >&5
4240 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4241 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4242   cat >>confdefs.h <<EOF
4243 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4244 EOF
4245
4246 fi
4247 done
4248
4249 echo "$as_me:4249: checking for terminfo header" >&5
4250 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4251 if test "${cf_cv_term_header+set}" = set; then
4252   echo $ECHO_N "(cached) $ECHO_C" >&6
4253 else
4254
4255 case ${cf_cv_ncurses_header} in #(vi
4256 */ncurses.h|*/ncursesw.h) #(vi
4257         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4258         ;;
4259 *)
4260         cf_term_header=term.h
4261         ;;
4262 esac
4263
4264 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4265 do
4266 cat >conftest.$ac_ext <<_ACEOF
4267 #line 4267 "configure"
4268 #include "confdefs.h"
4269 #include <stdio.h>
4270 #include <${cf_cv_ncurses_header:-curses.h}>
4271 #include <$cf_test>
4272
4273 int
4274 main ()
4275 {
4276 int x = auto_left_margin
4277   ;
4278   return 0;
4279 }
4280 _ACEOF
4281 rm -f conftest.$ac_objext
4282 if { (eval echo "$as_me:4282: \"$ac_compile\"") >&5
4283   (eval $ac_compile) 2>&5
4284   ac_status=$?
4285   echo "$as_me:4285: \$? = $ac_status" >&5
4286   (exit $ac_status); } &&
4287          { ac_try='test -s conftest.$ac_objext'
4288   { (eval echo "$as_me:4288: \"$ac_try\"") >&5
4289   (eval $ac_try) 2>&5
4290   ac_status=$?
4291   echo "$as_me:4291: \$? = $ac_status" >&5
4292   (exit $ac_status); }; }; then
4293
4294         cf_cv_term_header="$cf_test"
4295 else
4296   echo "$as_me: failed program was:" >&5
4297 cat conftest.$ac_ext >&5
4298
4299         cf_cv_term_header=unknown
4300
4301 fi
4302 rm -f conftest.$ac_objext conftest.$ac_ext
4303         test "$cf_cv_term_header" != unknown && break
4304 done
4305
4306 fi
4307 echo "$as_me:4307: result: $cf_cv_term_header" >&5
4308 echo "${ECHO_T}$cf_cv_term_header" >&6
4309
4310 # Set definitions to allow ifdef'ing to accommodate subdirectories
4311
4312 case $cf_cv_term_header in # (vi
4313 *term.h)
4314         cat >>confdefs.h <<\EOF
4315 #define HAVE_TERM_H 1
4316 EOF
4317
4318         ;;
4319 esac
4320
4321 case $cf_cv_term_header in # (vi
4322 ncurses/term.h) #(vi
4323         cat >>confdefs.h <<\EOF
4324 #define HAVE_NCURSES_TERM_H 1
4325 EOF
4326
4327         ;;
4328 ncursesw/term.h)
4329         cat >>confdefs.h <<\EOF
4330 #define HAVE_NCURSESW_TERM_H 1
4331 EOF
4332
4333         ;;
4334 esac
4335
4336 echo "$as_me:4336: checking for ncurses version" >&5
4337 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4338 if test "${cf_cv_ncurses_version+set}" = set; then
4339   echo $ECHO_N "(cached) $ECHO_C" >&6
4340 else
4341
4342         cf_cv_ncurses_version=no
4343         cf_tempfile=out$$
4344         rm -f $cf_tempfile
4345         if test "$cross_compiling" = yes; then
4346
4347         # This will not work if the preprocessor splits the line after the
4348         # Autoconf token.  The 'unproto' program does that.
4349         cat > conftest.$ac_ext <<EOF
4350 #include <${cf_cv_ncurses_header:-curses.h}>
4351 #undef Autoconf
4352 #ifdef NCURSES_VERSION
4353 Autoconf NCURSES_VERSION
4354 #else
4355 #ifdef __NCURSES_H
4356 Autoconf "old"
4357 #endif
4358 ;
4359 #endif
4360 EOF
4361         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4362         { (eval echo "$as_me:4362: \"$cf_try\"") >&5
4363   (eval $cf_try) 2>&5
4364   ac_status=$?
4365   echo "$as_me:4365: \$? = $ac_status" >&5
4366   (exit $ac_status); }
4367         if test -f conftest.out ; then
4368                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4369                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4370                 rm -f conftest.out
4371         fi
4372
4373 else
4374   cat >conftest.$ac_ext <<_ACEOF
4375 #line 4375 "configure"
4376 #include "confdefs.h"
4377
4378 #include <${cf_cv_ncurses_header:-curses.h}>
4379 #include <stdio.h>
4380 int main()
4381 {
4382         FILE *fp = fopen("$cf_tempfile", "w");
4383 #ifdef NCURSES_VERSION
4384 # ifdef NCURSES_VERSION_PATCH
4385         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4386 # else
4387         fprintf(fp, "%s\n", NCURSES_VERSION);
4388 # endif
4389 #else
4390 # ifdef __NCURSES_H
4391         fprintf(fp, "old\n");
4392 # else
4393         make an error
4394 # endif
4395 #endif
4396         ${cf_cv_main_return:-return}(0);
4397 }
4398 _ACEOF
4399 rm -f conftest$ac_exeext
4400 if { (eval echo "$as_me:4400: \"$ac_link\"") >&5
4401   (eval $ac_link) 2>&5
4402   ac_status=$?
4403   echo "$as_me:4403: \$? = $ac_status" >&5
4404   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4405   { (eval echo "$as_me:4405: \"$ac_try\"") >&5
4406   (eval $ac_try) 2>&5
4407   ac_status=$?
4408   echo "$as_me:4408: \$? = $ac_status" >&5
4409   (exit $ac_status); }; }; then
4410
4411         cf_cv_ncurses_version=`cat $cf_tempfile`
4412 else
4413   echo "$as_me: program exited with status $ac_status" >&5
4414 echo "$as_me: failed program was:" >&5
4415 cat conftest.$ac_ext >&5
4416 fi
4417 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4418 fi
4419         rm -f $cf_tempfile
4420
4421 fi
4422 echo "$as_me:4422: result: $cf_cv_ncurses_version" >&5
4423 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4424 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
4425 #define NCURSES 1
4426 EOF
4427
4428 echo "$as_me:4428: checking if we have identified curses libraries" >&5
4429 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4430 cat >conftest.$ac_ext <<_ACEOF
4431 #line 4431 "configure"
4432 #include "confdefs.h"
4433 #include <${cf_cv_ncurses_header:-curses.h}>
4434 int
4435 main ()
4436 {
4437 initscr(); tgoto("?", 0,0)
4438   ;
4439   return 0;
4440 }
4441 _ACEOF
4442 rm -f conftest.$ac_objext conftest$ac_exeext
4443 if { (eval echo "$as_me:4443: \"$ac_link\"") >&5
4444   (eval $ac_link) 2>&5
4445   ac_status=$?
4446   echo "$as_me:4446: \$? = $ac_status" >&5
4447   (exit $ac_status); } &&
4448          { ac_try='test -s conftest$ac_exeext'
4449   { (eval echo "$as_me:4449: \"$ac_try\"") >&5
4450   (eval $ac_try) 2>&5
4451   ac_status=$?
4452   echo "$as_me:4452: \$? = $ac_status" >&5
4453   (exit $ac_status); }; }; then
4454   cf_result=yes
4455 else
4456   echo "$as_me: failed program was:" >&5
4457 cat conftest.$ac_ext >&5
4458 cf_result=no
4459 fi
4460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4461 echo "$as_me:4461: result: $cf_result" >&5
4462 echo "${ECHO_T}$cf_result" >&6
4463
4464 if test "$cf_result" = no ; then
4465 case $host_os in #(vi
4466 freebsd*) #(vi
4467     echo "$as_me:4467: checking for tgoto in -lmytinfo" >&5
4468 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4469 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4470   echo $ECHO_N "(cached) $ECHO_C" >&6
4471 else
4472   ac_check_lib_save_LIBS=$LIBS
4473 LIBS="-lmytinfo  $LIBS"
4474 cat >conftest.$ac_ext <<_ACEOF
4475 #line 4475 "configure"
4476 #include "confdefs.h"
4477
4478 /* Override any gcc2 internal prototype to avoid an error.  */
4479 #ifdef __cplusplus
4480 extern "C"
4481 #endif
4482 /* We use char because int might match the return type of a gcc2
4483    builtin and then its argument prototype would still apply.  */
4484 char tgoto ();
4485 int
4486 main ()
4487 {
4488 tgoto ();
4489   ;
4490   return 0;
4491 }
4492 _ACEOF
4493 rm -f conftest.$ac_objext conftest$ac_exeext
4494 if { (eval echo "$as_me:4494: \"$ac_link\"") >&5
4495   (eval $ac_link) 2>&5
4496   ac_status=$?
4497   echo "$as_me:4497: \$? = $ac_status" >&5
4498   (exit $ac_status); } &&
4499          { ac_try='test -s conftest$ac_exeext'
4500   { (eval echo "$as_me:4500: \"$ac_try\"") >&5
4501   (eval $ac_try) 2>&5
4502   ac_status=$?
4503   echo "$as_me:4503: \$? = $ac_status" >&5
4504   (exit $ac_status); }; }; then
4505   ac_cv_lib_mytinfo_tgoto=yes
4506 else
4507   echo "$as_me: failed program was:" >&5
4508 cat conftest.$ac_ext >&5
4509 ac_cv_lib_mytinfo_tgoto=no
4510 fi
4511 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4512 LIBS=$ac_check_lib_save_LIBS
4513 fi
4514 echo "$as_me:4514: result: $ac_cv_lib_mytinfo_tgoto" >&5
4515 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4516 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4517   LIBS="-lmytinfo $LIBS"
4518 fi
4519
4520     ;;
4521 hpux10.*) #(vi
4522     echo "$as_me:4522: checking for initscr in -lcur_colr" >&5
4523 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4524 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4525   echo $ECHO_N "(cached) $ECHO_C" >&6
4526 else
4527   ac_check_lib_save_LIBS=$LIBS
4528 LIBS="-lcur_colr  $LIBS"
4529 cat >conftest.$ac_ext <<_ACEOF
4530 #line 4530 "configure"
4531 #include "confdefs.h"
4532
4533 /* Override any gcc2 internal prototype to avoid an error.  */
4534 #ifdef __cplusplus
4535 extern "C"
4536 #endif
4537 /* We use char because int might match the return type of a gcc2
4538    builtin and then its argument prototype would still apply.  */
4539 char initscr ();
4540 int
4541 main ()
4542 {
4543 initscr ();
4544   ;
4545   return 0;
4546 }
4547 _ACEOF
4548 rm -f conftest.$ac_objext conftest$ac_exeext
4549 if { (eval echo "$as_me:4549: \"$ac_link\"") >&5
4550   (eval $ac_link) 2>&5
4551   ac_status=$?
4552   echo "$as_me:4552: \$? = $ac_status" >&5
4553   (exit $ac_status); } &&
4554          { ac_try='test -s conftest$ac_exeext'
4555   { (eval echo "$as_me:4555: \"$ac_try\"") >&5
4556   (eval $ac_try) 2>&5
4557   ac_status=$?
4558   echo "$as_me:4558: \$? = $ac_status" >&5
4559   (exit $ac_status); }; }; then
4560   ac_cv_lib_cur_colr_initscr=yes
4561 else
4562   echo "$as_me: failed program was:" >&5
4563 cat conftest.$ac_ext >&5
4564 ac_cv_lib_cur_colr_initscr=no
4565 fi
4566 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4567 LIBS=$ac_check_lib_save_LIBS
4568 fi
4569 echo "$as_me:4569: result: $ac_cv_lib_cur_colr_initscr" >&5
4570 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4571 if test $ac_cv_lib_cur_colr_initscr = yes; then
4572
4573         LIBS="-lcur_colr $LIBS"
4574         ac_cv_func_initscr=yes
4575
4576 else
4577
4578     echo "$as_me:4578: checking for initscr in -lHcurses" >&5
4579 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4580 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4581   echo $ECHO_N "(cached) $ECHO_C" >&6
4582 else
4583   ac_check_lib_save_LIBS=$LIBS
4584 LIBS="-lHcurses  $LIBS"
4585 cat >conftest.$ac_ext <<_ACEOF
4586 #line 4586 "configure"
4587 #include "confdefs.h"
4588
4589 /* Override any gcc2 internal prototype to avoid an error.  */
4590 #ifdef __cplusplus
4591 extern "C"
4592 #endif
4593 /* We use char because int might match the return type of a gcc2
4594    builtin and then its argument prototype would still apply.  */
4595 char initscr ();
4596 int
4597 main ()
4598 {
4599 initscr ();
4600   ;
4601   return 0;
4602 }
4603 _ACEOF
4604 rm -f conftest.$ac_objext conftest$ac_exeext
4605 if { (eval echo "$as_me:4605: \"$ac_link\"") >&5
4606   (eval $ac_link) 2>&5
4607   ac_status=$?
4608   echo "$as_me:4608: \$? = $ac_status" >&5
4609   (exit $ac_status); } &&
4610          { ac_try='test -s conftest$ac_exeext'
4611   { (eval echo "$as_me:4611: \"$ac_try\"") >&5
4612   (eval $ac_try) 2>&5
4613   ac_status=$?
4614   echo "$as_me:4614: \$? = $ac_status" >&5
4615   (exit $ac_status); }; }; then
4616   ac_cv_lib_Hcurses_initscr=yes
4617 else
4618   echo "$as_me: failed program was:" >&5
4619 cat conftest.$ac_ext >&5
4620 ac_cv_lib_Hcurses_initscr=no
4621 fi
4622 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4623 LIBS=$ac_check_lib_save_LIBS
4624 fi
4625 echo "$as_me:4625: result: $ac_cv_lib_Hcurses_initscr" >&5
4626 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
4627 if test $ac_cv_lib_Hcurses_initscr = yes; then
4628
4629         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
4630         LIBS="-lHcurses $LIBS"
4631         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
4632         ac_cv_func_initscr=yes
4633
4634 fi
4635
4636 fi
4637
4638     ;;
4639 linux*) # Suse Linux does not follow /usr/lib convention
4640
4641 if test -n "/lib" ; then
4642   for cf_add_libdir in /lib
4643   do
4644     if test $cf_add_libdir = /usr/lib ; then
4645       :
4646     elif test -d $cf_add_libdir
4647     then
4648       cf_have_libdir=no
4649       if test -n "$LDFLAGS$LIBS" ; then
4650         # a loop is needed to ensure we can add subdirs of existing dirs
4651         for cf_test_libdir in $LDFLAGS $LIBS ; do
4652           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4653             cf_have_libdir=yes; break
4654           fi
4655         done
4656       fi
4657       if test "$cf_have_libdir" = no ; then
4658         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4659
4660 echo "${as_me:-configure}:4660: testing adding $cf_add_libdir to library-path ..." 1>&5
4661
4662         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4663       fi
4664     fi
4665   done
4666 fi
4667
4668     ;;
4669 sunos3*|sunos4*)
4670     if test -d /usr/5lib ; then
4671
4672 if test -n "/usr/5lib" ; then
4673   for cf_add_libdir in /usr/5lib
4674   do
4675     if test $cf_add_libdir = /usr/lib ; then
4676       :
4677     elif test -d $cf_add_libdir
4678     then
4679       cf_have_libdir=no
4680       if test -n "$LDFLAGS$LIBS" ; then
4681         # a loop is needed to ensure we can add subdirs of existing dirs
4682         for cf_test_libdir in $LDFLAGS $LIBS ; do
4683           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4684             cf_have_libdir=yes; break
4685           fi
4686         done
4687       fi
4688       if test "$cf_have_libdir" = no ; then
4689         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4690
4691 echo "${as_me:-configure}:4691: testing adding $cf_add_libdir to library-path ..." 1>&5
4692
4693         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4694       fi
4695     fi
4696   done
4697 fi
4698
4699       LIBS="-lcurses -ltermcap $LIBS"
4700     fi
4701     ac_cv_func_initscr=yes
4702     ;;
4703 esac
4704
4705 if test ".$ac_cv_func_initscr" != .yes ; then
4706     cf_save_LIBS="$LIBS"
4707     cf_term_lib=""
4708     cf_curs_lib=""
4709
4710     if test ".${cf_cv_ncurses_version:-no}" != .no
4711     then
4712         cf_check_list="ncurses curses cursesX"
4713     else
4714         cf_check_list="cursesX curses ncurses"
4715     fi
4716
4717     # Check for library containing tgoto.  Do this before curses library
4718     # because it may be needed to link the test-case for initscr.
4719     echo "$as_me:4719: checking for tgoto" >&5
4720 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
4721 if test "${ac_cv_func_tgoto+set}" = set; then
4722   echo $ECHO_N "(cached) $ECHO_C" >&6
4723 else
4724   cat >conftest.$ac_ext <<_ACEOF
4725 #line 4725 "configure"
4726 #include "confdefs.h"
4727 /* System header to define __stub macros and hopefully few prototypes,
4728     which can conflict with char tgoto (); below.  */
4729 #include <assert.h>
4730 /* Override any gcc2 internal prototype to avoid an error.  */
4731 #ifdef __cplusplus
4732 extern "C"
4733 #endif
4734 /* We use char because int might match the return type of a gcc2
4735    builtin and then its argument prototype would still apply.  */
4736 char tgoto ();
4737 char (*f) ();
4738
4739 int
4740 main ()
4741 {
4742 /* The GNU C library defines this for functions which it implements
4743     to always fail with ENOSYS.  Some functions are actually named
4744     something starting with __ and the normal name is an alias.  */
4745 #if defined (__stub_tgoto) || defined (__stub___tgoto)
4746 choke me
4747 #else
4748 f = tgoto;
4749 #endif
4750
4751   ;
4752   return 0;
4753 }
4754 _ACEOF
4755 rm -f conftest.$ac_objext conftest$ac_exeext
4756 if { (eval echo "$as_me:4756: \"$ac_link\"") >&5
4757   (eval $ac_link) 2>&5
4758   ac_status=$?
4759   echo "$as_me:4759: \$? = $ac_status" >&5
4760   (exit $ac_status); } &&
4761          { ac_try='test -s conftest$ac_exeext'
4762   { (eval echo "$as_me:4762: \"$ac_try\"") >&5
4763   (eval $ac_try) 2>&5
4764   ac_status=$?
4765   echo "$as_me:4765: \$? = $ac_status" >&5
4766   (exit $ac_status); }; }; then
4767   ac_cv_func_tgoto=yes
4768 else
4769   echo "$as_me: failed program was:" >&5
4770 cat conftest.$ac_ext >&5
4771 ac_cv_func_tgoto=no
4772 fi
4773 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4774 fi
4775 echo "$as_me:4775: result: $ac_cv_func_tgoto" >&5
4776 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
4777 if test $ac_cv_func_tgoto = yes; then
4778   cf_term_lib=predefined
4779 else
4780
4781         for cf_term_lib in $cf_check_list termcap termlib unknown
4782         do
4783             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
4784 echo "$as_me:4784: checking for tgoto in -l$cf_term_lib" >&5
4785 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
4786 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
4787   echo $ECHO_N "(cached) $ECHO_C" >&6
4788 else
4789   ac_check_lib_save_LIBS=$LIBS
4790 LIBS="-l$cf_term_lib  $LIBS"
4791 cat >conftest.$ac_ext <<_ACEOF
4792 #line 4792 "configure"
4793 #include "confdefs.h"
4794
4795 /* Override any gcc2 internal prototype to avoid an error.  */
4796 #ifdef __cplusplus
4797 extern "C"
4798 #endif
4799 /* We use char because int might match the return type of a gcc2
4800    builtin and then its argument prototype would still apply.  */
4801 char tgoto ();
4802 int
4803 main ()
4804 {
4805 tgoto ();
4806   ;
4807   return 0;
4808 }
4809 _ACEOF
4810 rm -f conftest.$ac_objext conftest$ac_exeext
4811 if { (eval echo "$as_me:4811: \"$ac_link\"") >&5
4812   (eval $ac_link) 2>&5
4813   ac_status=$?
4814   echo "$as_me:4814: \$? = $ac_status" >&5
4815   (exit $ac_status); } &&
4816          { ac_try='test -s conftest$ac_exeext'
4817   { (eval echo "$as_me:4817: \"$ac_try\"") >&5
4818   (eval $ac_try) 2>&5
4819   ac_status=$?
4820   echo "$as_me:4820: \$? = $ac_status" >&5
4821   (exit $ac_status); }; }; then
4822   eval "$as_ac_Lib=yes"
4823 else
4824   echo "$as_me: failed program was:" >&5
4825 cat conftest.$ac_ext >&5
4826 eval "$as_ac_Lib=no"
4827 fi
4828 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4829 LIBS=$ac_check_lib_save_LIBS
4830 fi
4831 echo "$as_me:4831: result: `eval echo '${'$as_ac_Lib'}'`" >&5
4832 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
4833 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
4834   break
4835 fi
4836
4837         done
4838
4839 fi
4840
4841     # Check for library containing initscr
4842     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
4843         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
4844     do
4845         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
4846 echo "$as_me:4846: checking for initscr in -l$cf_curs_lib" >&5
4847 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
4848 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
4849   echo $ECHO_N "(cached) $ECHO_C" >&6
4850 else
4851   ac_check_lib_save_LIBS=$LIBS
4852 LIBS="-l$cf_curs_lib  $LIBS"
4853 cat >conftest.$ac_ext <<_ACEOF
4854 #line 4854 "configure"
4855 #include "confdefs.h"
4856
4857 /* Override any gcc2 internal prototype to avoid an error.  */
4858 #ifdef __cplusplus
4859 extern "C"
4860 #endif
4861 /* We use char because int might match the return type of a gcc2
4862    builtin and then its argument prototype would still apply.  */
4863 char initscr ();
4864 int
4865 main ()
4866 {
4867 initscr ();
4868   ;
4869   return 0;
4870 }
4871 _ACEOF
4872 rm -f conftest.$ac_objext conftest$ac_exeext
4873 if { (eval echo "$as_me:4873: \"$ac_link\"") >&5
4874   (eval $ac_link) 2>&5
4875   ac_status=$?
4876   echo "$as_me:4876: \$? = $ac_status" >&5
4877   (exit $ac_status); } &&
4878          { ac_try='test -s conftest$ac_exeext'
4879   { (eval echo "$as_me:4879: \"$ac_try\"") >&5
4880   (eval $ac_try) 2>&5
4881   ac_status=$?
4882   echo "$as_me:4882: \$? = $ac_status" >&5
4883   (exit $ac_status); }; }; then
4884   eval "$as_ac_Lib=yes"
4885 else
4886   echo "$as_me: failed program was:" >&5
4887 cat conftest.$ac_ext >&5
4888 eval "$as_ac_Lib=no"
4889 fi
4890 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4891 LIBS=$ac_check_lib_save_LIBS
4892 fi
4893 echo "$as_me:4893: result: `eval echo '${'$as_ac_Lib'}'`" >&5
4894 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
4895 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
4896   break
4897 fi
4898
4899     done
4900     test $cf_curs_lib = unknown && { { echo "$as_me:4900: error: no curses library found" >&5
4901 echo "$as_me: error: no curses library found" >&2;}
4902    { (exit 1); exit 1; }; }
4903
4904     LIBS="-l$cf_curs_lib $cf_save_LIBS"
4905     if test "$cf_term_lib" = unknown ; then
4906         echo "$as_me:4906: checking if we can link with $cf_curs_lib library" >&5
4907 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
4908         cat >conftest.$ac_ext <<_ACEOF
4909 #line 4909 "configure"
4910 #include "confdefs.h"
4911 #include <${cf_cv_ncurses_header:-curses.h}>
4912 int
4913 main ()
4914 {
4915 initscr()
4916   ;
4917   return 0;
4918 }
4919 _ACEOF
4920 rm -f conftest.$ac_objext conftest$ac_exeext
4921 if { (eval echo "$as_me:4921: \"$ac_link\"") >&5
4922   (eval $ac_link) 2>&5
4923   ac_status=$?
4924   echo "$as_me:4924: \$? = $ac_status" >&5
4925   (exit $ac_status); } &&
4926          { ac_try='test -s conftest$ac_exeext'
4927   { (eval echo "$as_me:4927: \"$ac_try\"") >&5
4928   (eval $ac_try) 2>&5
4929   ac_status=$?
4930   echo "$as_me:4930: \$? = $ac_status" >&5
4931   (exit $ac_status); }; }; then
4932   cf_result=yes
4933 else
4934   echo "$as_me: failed program was:" >&5
4935 cat conftest.$ac_ext >&5
4936 cf_result=no
4937 fi
4938 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4939         echo "$as_me:4939: result: $cf_result" >&5
4940 echo "${ECHO_T}$cf_result" >&6
4941         test $cf_result = no && { { echo "$as_me:4941: error: Cannot link curses library" >&5
4942 echo "$as_me: error: Cannot link curses library" >&2;}
4943    { (exit 1); exit 1; }; }
4944     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
4945         :
4946     elif test "$cf_term_lib" != predefined ; then
4947         echo "$as_me:4947: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
4948 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
4949         cat >conftest.$ac_ext <<_ACEOF
4950 #line 4950 "configure"
4951 #include "confdefs.h"
4952 #include <${cf_cv_ncurses_header:-curses.h}>
4953 int
4954 main ()
4955 {
4956 initscr(); tgoto((char *)0, 0, 0);
4957   ;
4958   return 0;
4959 }
4960 _ACEOF
4961 rm -f conftest.$ac_objext conftest$ac_exeext
4962 if { (eval echo "$as_me:4962: \"$ac_link\"") >&5
4963   (eval $ac_link) 2>&5
4964   ac_status=$?
4965   echo "$as_me:4965: \$? = $ac_status" >&5
4966   (exit $ac_status); } &&
4967          { ac_try='test -s conftest$ac_exeext'
4968   { (eval echo "$as_me:4968: \"$ac_try\"") >&5
4969   (eval $ac_try) 2>&5
4970   ac_status=$?
4971   echo "$as_me:4971: \$? = $ac_status" >&5
4972   (exit $ac_status); }; }; then
4973   cf_result=no
4974 else
4975   echo "$as_me: failed program was:" >&5
4976 cat conftest.$ac_ext >&5
4977
4978             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
4979             cat >conftest.$ac_ext <<_ACEOF
4980 #line 4980 "configure"
4981 #include "confdefs.h"
4982 #include <${cf_cv_ncurses_header:-curses.h}>
4983 int
4984 main ()
4985 {
4986 initscr()
4987   ;
4988   return 0;
4989 }
4990 _ACEOF
4991 rm -f conftest.$ac_objext conftest$ac_exeext
4992 if { (eval echo "$as_me:4992: \"$ac_link\"") >&5
4993   (eval $ac_link) 2>&5
4994   ac_status=$?
4995   echo "$as_me:4995: \$? = $ac_status" >&5
4996   (exit $ac_status); } &&
4997          { ac_try='test -s conftest$ac_exeext'
4998   { (eval echo "$as_me:4998: \"$ac_try\"") >&5
4999   (eval $ac_try) 2>&5
5000   ac_status=$?
5001   echo "$as_me:5001: \$? = $ac_status" >&5
5002   (exit $ac_status); }; }; then
5003   cf_result=yes
5004 else
5005   echo "$as_me: failed program was:" >&5
5006 cat conftest.$ac_ext >&5
5007 cf_result=error
5008 fi
5009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5010
5011 fi
5012 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5013         echo "$as_me:5013: result: $cf_result" >&5
5014 echo "${ECHO_T}$cf_result" >&6
5015     fi
5016 fi
5017 fi
5018
5019         ;;
5020 ncurses)
5021
5022 cf_ncuconfig_root=ncurses
5023
5024 echo "Looking for ${cf_ncuconfig_root}-config"
5025 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5026 do
5027   # Extract the first word of "$ac_prog", so it can be a program name with args.
5028 set dummy $ac_prog; ac_word=$2
5029 echo "$as_me:5029: checking for $ac_word" >&5
5030 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5031 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
5032   echo $ECHO_N "(cached) $ECHO_C" >&6
5033 else
5034   case $NCURSES_CONFIG in
5035   [\\/]* | ?:[\\/]*)
5036   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
5037   ;;
5038   *)
5039   ac_save_IFS=$IFS; IFS=$ac_path_separator
5040 ac_dummy="$PATH"
5041 for ac_dir in $ac_dummy; do
5042   IFS=$ac_save_IFS
5043   test -z "$ac_dir" && ac_dir=.
5044   if $as_executable_p "$ac_dir/$ac_word"; then
5045    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
5046    echo "$as_me:5046: found $ac_dir/$ac_word" >&5
5047    break
5048 fi
5049 done
5050
5051   ;;
5052 esac
5053 fi
5054 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
5055
5056 if test -n "$NCURSES_CONFIG"; then
5057   echo "$as_me:5057: result: $NCURSES_CONFIG" >&5
5058 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5059 else
5060   echo "$as_me:5060: result: no" >&5
5061 echo "${ECHO_T}no" >&6
5062 fi
5063
5064   test -n "$NCURSES_CONFIG" && break
5065 done
5066 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
5067
5068 if test "$NCURSES_CONFIG" != none ; then
5069
5070 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5071 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5072
5073 # even with config script, some packages use no-override for curses.h
5074
5075 echo "$as_me:5075: checking if we have identified curses headers" >&5
5076 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5077 if test "${cf_cv_ncurses_header+set}" = set; then
5078   echo $ECHO_N "(cached) $ECHO_C" >&6
5079 else
5080
5081 cf_cv_ncurses_header=none
5082 for cf_header in  \
5083     ncurses/curses.h \
5084         ncurses/ncurses.h \
5085         curses.h \
5086         ncurses.h
5087 do
5088 cat >conftest.$ac_ext <<_ACEOF
5089 #line 5089 "configure"
5090 #include "confdefs.h"
5091 #include <${cf_header}>
5092 int
5093 main ()
5094 {
5095 initscr(); tgoto("?", 0,0)
5096   ;
5097   return 0;
5098 }
5099 _ACEOF
5100 rm -f conftest.$ac_objext
5101 if { (eval echo "$as_me:5101: \"$ac_compile\"") >&5
5102   (eval $ac_compile) 2>&5
5103   ac_status=$?
5104   echo "$as_me:5104: \$? = $ac_status" >&5
5105   (exit $ac_status); } &&
5106          { ac_try='test -s conftest.$ac_objext'
5107   { (eval echo "$as_me:5107: \"$ac_try\"") >&5
5108   (eval $ac_try) 2>&5
5109   ac_status=$?
5110   echo "$as_me:5110: \$? = $ac_status" >&5
5111   (exit $ac_status); }; }; then
5112   cf_cv_ncurses_header=$cf_header; break
5113 else
5114   echo "$as_me: failed program was:" >&5
5115 cat conftest.$ac_ext >&5
5116 fi
5117 rm -f conftest.$ac_objext conftest.$ac_ext
5118 done
5119
5120 fi
5121 echo "$as_me:5121: result: $cf_cv_ncurses_header" >&5
5122 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5123
5124 if test "$cf_cv_ncurses_header" = none ; then
5125         { { echo "$as_me:5125: error: No curses header-files found" >&5
5126 echo "$as_me: error: No curses header-files found" >&2;}
5127    { (exit 1); exit 1; }; }
5128 fi
5129
5130 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5131
5132 for ac_header in $cf_cv_ncurses_header
5133 do
5134 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5135 echo "$as_me:5135: checking for $ac_header" >&5
5136 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5137 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5138   echo $ECHO_N "(cached) $ECHO_C" >&6
5139 else
5140   cat >conftest.$ac_ext <<_ACEOF
5141 #line 5141 "configure"
5142 #include "confdefs.h"
5143 #include <$ac_header>
5144 _ACEOF
5145 if { (eval echo "$as_me:5145: \"$ac_cpp conftest.$ac_ext\"") >&5
5146   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5147   ac_status=$?
5148   egrep -v '^ *\+' conftest.er1 >conftest.err
5149   rm -f conftest.er1
5150   cat conftest.err >&5
5151   echo "$as_me:5151: \$? = $ac_status" >&5
5152   (exit $ac_status); } >/dev/null; then
5153   if test -s conftest.err; then
5154     ac_cpp_err=$ac_c_preproc_warn_flag
5155   else
5156     ac_cpp_err=
5157   fi
5158 else
5159   ac_cpp_err=yes
5160 fi
5161 if test -z "$ac_cpp_err"; then
5162   eval "$as_ac_Header=yes"
5163 else
5164   echo "$as_me: failed program was:" >&5
5165   cat conftest.$ac_ext >&5
5166   eval "$as_ac_Header=no"
5167 fi
5168 rm -f conftest.err conftest.$ac_ext
5169 fi
5170 echo "$as_me:5170: result: `eval echo '${'$as_ac_Header'}'`" >&5
5171 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5172 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5173   cat >>confdefs.h <<EOF
5174 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5175 EOF
5176
5177 fi
5178 done
5179
5180 cat >>confdefs.h <<\EOF
5181 #define NCURSES 1
5182 EOF
5183
5184 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5185
5186 cat >>confdefs.h <<EOF
5187 #define $cf_nculib_ROOT 1
5188 EOF
5189
5190 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5191
5192 else
5193
5194 cf_ncuhdr_root=ncurses
5195
5196 test -n "$cf_cv_curses_dir" && \
5197 test "$cf_cv_curses_dir" != "no" && { \
5198
5199 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5200   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
5201   do
5202         while test $cf_add_incdir != /usr/include
5203         do
5204           if test -d $cf_add_incdir
5205           then
5206                 cf_have_incdir=no
5207                 if test -n "$CFLAGS$CPPFLAGS" ; then
5208                   # a loop is needed to ensure we can add subdirs of existing dirs
5209                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5210                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5211                           cf_have_incdir=yes; break
5212                         fi
5213                   done
5214                 fi
5215
5216                 if test "$cf_have_incdir" = no ; then
5217                   if test "$cf_add_incdir" = /usr/local/include ; then
5218                         if test "$GCC" = yes
5219                         then
5220                           cf_save_CPPFLAGS=$CPPFLAGS
5221                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5222                           cat >conftest.$ac_ext <<_ACEOF
5223 #line 5223 "configure"
5224 #include "confdefs.h"
5225 #include <stdio.h>
5226 int
5227 main ()
5228 {
5229 printf("Hello")
5230   ;
5231   return 0;
5232 }
5233 _ACEOF
5234 rm -f conftest.$ac_objext
5235 if { (eval echo "$as_me:5235: \"$ac_compile\"") >&5
5236   (eval $ac_compile) 2>&5
5237   ac_status=$?
5238   echo "$as_me:5238: \$? = $ac_status" >&5
5239   (exit $ac_status); } &&
5240          { ac_try='test -s conftest.$ac_objext'
5241   { (eval echo "$as_me:5241: \"$ac_try\"") >&5
5242   (eval $ac_try) 2>&5
5243   ac_status=$?
5244   echo "$as_me:5244: \$? = $ac_status" >&5
5245   (exit $ac_status); }; }; then
5246   :
5247 else
5248   echo "$as_me: failed program was:" >&5
5249 cat conftest.$ac_ext >&5
5250 cf_have_incdir=yes
5251 fi
5252 rm -f conftest.$ac_objext conftest.$ac_ext
5253                           CPPFLAGS=$cf_save_CPPFLAGS
5254                         fi
5255                   fi
5256                 fi
5257
5258                 if test "$cf_have_incdir" = no ; then
5259                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5260
5261 echo "${as_me:-configure}:5261: testing adding $cf_add_incdir to include-path ..." 1>&5
5262
5263                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5264
5265                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5266                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5267                   cf_add_incdir="$cf_top_incdir"
5268                 else
5269                   break
5270                 fi
5271           fi
5272         done
5273   done
5274 fi
5275
5276 }
5277
5278 echo "$as_me:5278: checking for $cf_ncuhdr_root header in include-path" >&5
5279 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5280 if test "${cf_cv_ncurses_h+set}" = set; then
5281   echo $ECHO_N "(cached) $ECHO_C" >&6
5282 else
5283
5284         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5285         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5286         for cf_header in $cf_header_list
5287         do
5288
5289         cat >conftest.$ac_ext <<_ACEOF
5290 #line 5290 "configure"
5291 #include "confdefs.h"
5292
5293 #include <$cf_header>
5294 int
5295 main ()
5296 {
5297
5298 #ifdef NCURSES_VERSION
5299
5300 printf("%s\n", NCURSES_VERSION);
5301 #else
5302 #ifdef __NCURSES_H
5303 printf("old\n");
5304 #else
5305         make an error
5306 #endif
5307 #endif
5308
5309   ;
5310   return 0;
5311 }
5312 _ACEOF
5313 rm -f conftest.$ac_objext
5314 if { (eval echo "$as_me:5314: \"$ac_compile\"") >&5
5315   (eval $ac_compile) 2>&5
5316   ac_status=$?
5317   echo "$as_me:5317: \$? = $ac_status" >&5
5318   (exit $ac_status); } &&
5319          { ac_try='test -s conftest.$ac_objext'
5320   { (eval echo "$as_me:5320: \"$ac_try\"") >&5
5321   (eval $ac_try) 2>&5
5322   ac_status=$?
5323   echo "$as_me:5323: \$? = $ac_status" >&5
5324   (exit $ac_status); }; }; then
5325   cf_cv_ncurses_h=$cf_header
5326
5327 else
5328   echo "$as_me: failed program was:" >&5
5329 cat conftest.$ac_ext >&5
5330 cf_cv_ncurses_h=no
5331 fi
5332 rm -f conftest.$ac_objext conftest.$ac_ext
5333
5334                 test "$cf_cv_ncurses_h" != no && break
5335         done
5336
5337 fi
5338 echo "$as_me:5338: result: $cf_cv_ncurses_h" >&5
5339 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5340
5341 if test "$cf_cv_ncurses_h" != no ; then
5342         cf_cv_ncurses_header=$cf_cv_ncurses_h
5343 else
5344
5345 echo "$as_me:5345: checking for $cf_ncuhdr_root include-path" >&5
5346 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5347 if test "${cf_cv_ncurses_h2+set}" = set; then
5348   echo $ECHO_N "(cached) $ECHO_C" >&6
5349 else
5350
5351         test -n "$verbose" && echo
5352
5353 cf_search=
5354
5355 # collect the current set of include-directories from compiler flags
5356 cf_header_path_list=""
5357 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5358         for cf_header_path in $CPPFLAGS $CFLAGS
5359         do
5360                 case $cf_header_path in #(vi
5361                 -I*)
5362                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5363
5364 test "$cf_header_path" != "NONE" && \
5365 test -d "$cf_header_path" && \
5366  {
5367         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5368         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5369         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5370         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5371         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5372         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"
5373 }
5374
5375                         cf_header_path_list="$cf_header_path_list $cf_search"
5376                         ;;
5377                 esac
5378         done
5379 fi
5380
5381 # add the variations for the package we are looking for
5382
5383 cf_search=
5384
5385 test "/usr" != "$prefix" && \
5386 test -d "/usr" && \
5387 (test $prefix = NONE || test "/usr" != "$prefix") && {
5388         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5389         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5390         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5391         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5392         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5393         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5394 }
5395
5396 test "$prefix" != "NONE" && \
5397 test -d "$prefix" && \
5398  {
5399         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5400         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5401         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5402         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5403         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5404         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5405 }
5406
5407 test "/usr/local" != "$prefix" && \
5408 test -d "/usr/local" && \
5409 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
5410         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5411         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5412         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5413         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5414         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5415         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5416 }
5417
5418 test "/opt" != "$prefix" && \
5419 test -d "/opt" && \
5420 (test $prefix = NONE || test "/opt" != "$prefix") && {
5421         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5422         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5423         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5424         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5425         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5426         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5427 }
5428
5429 test "$HOME" != "$prefix" && \
5430 test -d "$HOME" && \
5431 (test $prefix = NONE || test "$HOME" != "$prefix") && {
5432         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5433         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5434         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5435         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5436         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5437         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5438 }
5439
5440 test "$includedir" != NONE && \
5441 test "$includedir" != "/usr/include" && \
5442 test -d "$includedir" && {
5443         test -d $includedir &&    cf_search="$cf_search $includedir"
5444         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5445 }
5446
5447 test "$oldincludedir" != NONE && \
5448 test "$oldincludedir" != "/usr/include" && \
5449 test -d "$oldincludedir" && {
5450         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5451         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5452 }
5453
5454 cf_search="$cf_search $cf_header_path_list"
5455
5456         test -n "$verbose" && echo search path $cf_search
5457         cf_save2_CPPFLAGS="$CPPFLAGS"
5458         for cf_incdir in $cf_search
5459         do
5460
5461 if test -n "$cf_incdir" ; then
5462   for cf_add_incdir in $cf_incdir
5463   do
5464         while test $cf_add_incdir != /usr/include
5465         do
5466           if test -d $cf_add_incdir
5467           then
5468                 cf_have_incdir=no
5469                 if test -n "$CFLAGS$CPPFLAGS" ; then
5470                   # a loop is needed to ensure we can add subdirs of existing dirs
5471                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5472                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5473                           cf_have_incdir=yes; break
5474                         fi
5475                   done
5476                 fi
5477
5478                 if test "$cf_have_incdir" = no ; then
5479                   if test "$cf_add_incdir" = /usr/local/include ; then
5480                         if test "$GCC" = yes
5481                         then
5482                           cf_save_CPPFLAGS=$CPPFLAGS
5483                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5484                           cat >conftest.$ac_ext <<_ACEOF
5485 #line 5485 "configure"
5486 #include "confdefs.h"
5487 #include <stdio.h>
5488 int
5489 main ()
5490 {
5491 printf("Hello")
5492   ;
5493   return 0;
5494 }
5495 _ACEOF
5496 rm -f conftest.$ac_objext
5497 if { (eval echo "$as_me:5497: \"$ac_compile\"") >&5
5498   (eval $ac_compile) 2>&5
5499   ac_status=$?
5500   echo "$as_me:5500: \$? = $ac_status" >&5
5501   (exit $ac_status); } &&
5502          { ac_try='test -s conftest.$ac_objext'
5503   { (eval echo "$as_me:5503: \"$ac_try\"") >&5
5504   (eval $ac_try) 2>&5
5505   ac_status=$?
5506   echo "$as_me:5506: \$? = $ac_status" >&5
5507   (exit $ac_status); }; }; then
5508   :
5509 else
5510   echo "$as_me: failed program was:" >&5
5511 cat conftest.$ac_ext >&5
5512 cf_have_incdir=yes
5513 fi
5514 rm -f conftest.$ac_objext conftest.$ac_ext
5515                           CPPFLAGS=$cf_save_CPPFLAGS
5516                         fi
5517                   fi
5518                 fi
5519
5520                 if test "$cf_have_incdir" = no ; then
5521                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5522
5523 echo "${as_me:-configure}:5523: testing adding $cf_add_incdir to include-path ..." 1>&5
5524
5525                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5526
5527                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5528                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5529                   cf_add_incdir="$cf_top_incdir"
5530                 else
5531                   break
5532                 fi
5533           fi
5534         done
5535   done
5536 fi
5537
5538                 for cf_header in \
5539                         ncurses.h \
5540                         curses.h
5541                 do
5542
5543         cat >conftest.$ac_ext <<_ACEOF
5544 #line 5544 "configure"
5545 #include "confdefs.h"
5546
5547 #include <$cf_header>
5548 int
5549 main ()
5550 {
5551
5552 #ifdef NCURSES_VERSION
5553
5554 printf("%s\n", NCURSES_VERSION);
5555 #else
5556 #ifdef __NCURSES_H
5557 printf("old\n");
5558 #else
5559         make an error
5560 #endif
5561 #endif
5562
5563   ;
5564   return 0;
5565 }
5566 _ACEOF
5567 rm -f conftest.$ac_objext
5568 if { (eval echo "$as_me:5568: \"$ac_compile\"") >&5
5569   (eval $ac_compile) 2>&5
5570   ac_status=$?
5571   echo "$as_me:5571: \$? = $ac_status" >&5
5572   (exit $ac_status); } &&
5573          { ac_try='test -s conftest.$ac_objext'
5574   { (eval echo "$as_me:5574: \"$ac_try\"") >&5
5575   (eval $ac_try) 2>&5
5576   ac_status=$?
5577   echo "$as_me:5577: \$? = $ac_status" >&5
5578   (exit $ac_status); }; }; then
5579   cf_cv_ncurses_h2=$cf_header
5580
5581 else
5582   echo "$as_me: failed program was:" >&5
5583 cat conftest.$ac_ext >&5
5584 cf_cv_ncurses_h2=no
5585 fi
5586 rm -f conftest.$ac_objext conftest.$ac_ext
5587
5588                         if test "$cf_cv_ncurses_h2" != no ; then
5589                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5590                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5591                                 break
5592                         fi
5593                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5594                 done
5595                 CPPFLAGS="$cf_save2_CPPFLAGS"
5596                 test "$cf_cv_ncurses_h2" != no && break
5597         done
5598         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5598: error: not found" >&5
5599 echo "$as_me: error: not found" >&2;}
5600    { (exit 1); exit 1; }; }
5601
5602 fi
5603 echo "$as_me:5603: result: $cf_cv_ncurses_h2" >&5
5604 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5605
5606         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5607         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5608         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5609                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5610         fi
5611
5612 if test -n "$cf_1st_incdir" ; then
5613   for cf_add_incdir in $cf_1st_incdir
5614   do
5615         while test $cf_add_incdir != /usr/include
5616         do
5617           if test -d $cf_add_incdir
5618           then
5619                 cf_have_incdir=no
5620                 if test -n "$CFLAGS$CPPFLAGS" ; then
5621                   # a loop is needed to ensure we can add subdirs of existing dirs
5622                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5623                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5624                           cf_have_incdir=yes; break
5625                         fi
5626                   done
5627                 fi
5628
5629                 if test "$cf_have_incdir" = no ; then
5630                   if test "$cf_add_incdir" = /usr/local/include ; then
5631                         if test "$GCC" = yes
5632                         then
5633                           cf_save_CPPFLAGS=$CPPFLAGS
5634                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5635                           cat >conftest.$ac_ext <<_ACEOF
5636 #line 5636 "configure"
5637 #include "confdefs.h"
5638 #include <stdio.h>
5639 int
5640 main ()
5641 {
5642 printf("Hello")
5643   ;
5644   return 0;
5645 }
5646 _ACEOF
5647 rm -f conftest.$ac_objext
5648 if { (eval echo "$as_me:5648: \"$ac_compile\"") >&5
5649   (eval $ac_compile) 2>&5
5650   ac_status=$?
5651   echo "$as_me:5651: \$? = $ac_status" >&5
5652   (exit $ac_status); } &&
5653          { ac_try='test -s conftest.$ac_objext'
5654   { (eval echo "$as_me:5654: \"$ac_try\"") >&5
5655   (eval $ac_try) 2>&5
5656   ac_status=$?
5657   echo "$as_me:5657: \$? = $ac_status" >&5
5658   (exit $ac_status); }; }; then
5659   :
5660 else
5661   echo "$as_me: failed program was:" >&5
5662 cat conftest.$ac_ext >&5
5663 cf_have_incdir=yes
5664 fi
5665 rm -f conftest.$ac_objext conftest.$ac_ext
5666                           CPPFLAGS=$cf_save_CPPFLAGS
5667                         fi
5668                   fi
5669                 fi
5670
5671                 if test "$cf_have_incdir" = no ; then
5672                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5673
5674 echo "${as_me:-configure}:5674: testing adding $cf_add_incdir to include-path ..." 1>&5
5675
5676                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5677
5678                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5679                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5680                   cf_add_incdir="$cf_top_incdir"
5681                 else
5682                   break
5683                 fi
5684           fi
5685         done
5686   done
5687 fi
5688
5689 fi
5690
5691 # Set definitions to allow ifdef'ing for ncurses.h
5692
5693 case $cf_cv_ncurses_header in # (vi
5694 *ncurses.h)
5695         cat >>confdefs.h <<\EOF
5696 #define HAVE_NCURSES_H 1
5697 EOF
5698
5699         ;;
5700 esac
5701
5702 case $cf_cv_ncurses_header in # (vi
5703 ncurses/curses.h|ncurses/ncurses.h)
5704         cat >>confdefs.h <<\EOF
5705 #define HAVE_NCURSES_NCURSES_H 1
5706 EOF
5707
5708         ;;
5709 ncursesw/curses.h|ncursesw/ncurses.h)
5710         cat >>confdefs.h <<\EOF
5711 #define HAVE_NCURSESW_NCURSES_H 1
5712 EOF
5713
5714         ;;
5715 esac
5716
5717 echo "$as_me:5717: checking for terminfo header" >&5
5718 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5719 if test "${cf_cv_term_header+set}" = set; then
5720   echo $ECHO_N "(cached) $ECHO_C" >&6
5721 else
5722
5723 case ${cf_cv_ncurses_header} in #(vi
5724 */ncurses.h|*/ncursesw.h) #(vi
5725         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5726         ;;
5727 *)
5728         cf_term_header=term.h
5729         ;;
5730 esac
5731
5732 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5733 do
5734 cat >conftest.$ac_ext <<_ACEOF
5735 #line 5735 "configure"
5736 #include "confdefs.h"
5737 #include <stdio.h>
5738 #include <${cf_cv_ncurses_header:-curses.h}>
5739 #include <$cf_test>
5740
5741 int
5742 main ()
5743 {
5744 int x = auto_left_margin
5745   ;
5746   return 0;
5747 }
5748 _ACEOF
5749 rm -f conftest.$ac_objext
5750 if { (eval echo "$as_me:5750: \"$ac_compile\"") >&5
5751   (eval $ac_compile) 2>&5
5752   ac_status=$?
5753   echo "$as_me:5753: \$? = $ac_status" >&5
5754   (exit $ac_status); } &&
5755          { ac_try='test -s conftest.$ac_objext'
5756   { (eval echo "$as_me:5756: \"$ac_try\"") >&5
5757   (eval $ac_try) 2>&5
5758   ac_status=$?
5759   echo "$as_me:5759: \$? = $ac_status" >&5
5760   (exit $ac_status); }; }; then
5761
5762         cf_cv_term_header="$cf_test"
5763 else
5764   echo "$as_me: failed program was:" >&5
5765 cat conftest.$ac_ext >&5
5766
5767         cf_cv_term_header=unknown
5768
5769 fi
5770 rm -f conftest.$ac_objext conftest.$ac_ext
5771         test "$cf_cv_term_header" != unknown && break
5772 done
5773
5774 fi
5775 echo "$as_me:5775: result: $cf_cv_term_header" >&5
5776 echo "${ECHO_T}$cf_cv_term_header" >&6
5777
5778 # Set definitions to allow ifdef'ing to accommodate subdirectories
5779
5780 case $cf_cv_term_header in # (vi
5781 *term.h)
5782         cat >>confdefs.h <<\EOF
5783 #define HAVE_TERM_H 1
5784 EOF
5785
5786         ;;
5787 esac
5788
5789 case $cf_cv_term_header in # (vi
5790 ncurses/term.h) #(vi
5791         cat >>confdefs.h <<\EOF
5792 #define HAVE_NCURSES_TERM_H 1
5793 EOF
5794
5795         ;;
5796 ncursesw/term.h)
5797         cat >>confdefs.h <<\EOF
5798 #define HAVE_NCURSESW_TERM_H 1
5799 EOF
5800
5801         ;;
5802 esac
5803
5804 # some applications need this, but should check for NCURSES_VERSION
5805 cat >>confdefs.h <<\EOF
5806 #define NCURSES 1
5807 EOF
5808
5809 echo "$as_me:5809: checking for ncurses version" >&5
5810 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5811 if test "${cf_cv_ncurses_version+set}" = set; then
5812   echo $ECHO_N "(cached) $ECHO_C" >&6
5813 else
5814
5815         cf_cv_ncurses_version=no
5816         cf_tempfile=out$$
5817         rm -f $cf_tempfile
5818         if test "$cross_compiling" = yes; then
5819
5820         # This will not work if the preprocessor splits the line after the
5821         # Autoconf token.  The 'unproto' program does that.
5822         cat > conftest.$ac_ext <<EOF
5823 #include <${cf_cv_ncurses_header:-curses.h}>
5824 #undef Autoconf
5825 #ifdef NCURSES_VERSION
5826 Autoconf NCURSES_VERSION
5827 #else
5828 #ifdef __NCURSES_H
5829 Autoconf "old"
5830 #endif
5831 ;
5832 #endif
5833 EOF
5834         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5835         { (eval echo "$as_me:5835: \"$cf_try\"") >&5
5836   (eval $cf_try) 2>&5
5837   ac_status=$?
5838   echo "$as_me:5838: \$? = $ac_status" >&5
5839   (exit $ac_status); }
5840         if test -f conftest.out ; then
5841                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5842                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5843                 rm -f conftest.out
5844         fi
5845
5846 else
5847   cat >conftest.$ac_ext <<_ACEOF
5848 #line 5848 "configure"
5849 #include "confdefs.h"
5850
5851 #include <${cf_cv_ncurses_header:-curses.h}>
5852 #include <stdio.h>
5853 int main()
5854 {
5855         FILE *fp = fopen("$cf_tempfile", "w");
5856 #ifdef NCURSES_VERSION
5857 # ifdef NCURSES_VERSION_PATCH
5858         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5859 # else
5860         fprintf(fp, "%s\n", NCURSES_VERSION);
5861 # endif
5862 #else
5863 # ifdef __NCURSES_H
5864         fprintf(fp, "old\n");
5865 # else
5866         make an error
5867 # endif
5868 #endif
5869         ${cf_cv_main_return:-return}(0);
5870 }
5871 _ACEOF
5872 rm -f conftest$ac_exeext
5873 if { (eval echo "$as_me:5873: \"$ac_link\"") >&5
5874   (eval $ac_link) 2>&5
5875   ac_status=$?
5876   echo "$as_me:5876: \$? = $ac_status" >&5
5877   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5878   { (eval echo "$as_me:5878: \"$ac_try\"") >&5
5879   (eval $ac_try) 2>&5
5880   ac_status=$?
5881   echo "$as_me:5881: \$? = $ac_status" >&5
5882   (exit $ac_status); }; }; then
5883
5884         cf_cv_ncurses_version=`cat $cf_tempfile`
5885 else
5886   echo "$as_me: program exited with status $ac_status" >&5
5887 echo "$as_me: failed program was:" >&5
5888 cat conftest.$ac_ext >&5
5889 fi
5890 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5891 fi
5892         rm -f $cf_tempfile
5893
5894 fi
5895 echo "$as_me:5895: result: $cf_cv_ncurses_version" >&5
5896 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5897 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5898 #define NCURSES 1
5899 EOF
5900
5901 cf_nculib_root=ncurses
5902         # This works, except for the special case where we find gpm, but
5903         # ncurses is in a nonstandard location via $LIBS, and we really want
5904         # to link gpm.
5905 cf_ncurses_LIBS=""
5906 cf_ncurses_SAVE="$LIBS"
5907 echo "$as_me:5907: checking for Gpm_Open in -lgpm" >&5
5908 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5909 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5910   echo $ECHO_N "(cached) $ECHO_C" >&6
5911 else
5912   ac_check_lib_save_LIBS=$LIBS
5913 LIBS="-lgpm  $LIBS"
5914 cat >conftest.$ac_ext <<_ACEOF
5915 #line 5915 "configure"
5916 #include "confdefs.h"
5917
5918 /* Override any gcc2 internal prototype to avoid an error.  */
5919 #ifdef __cplusplus
5920 extern "C"
5921 #endif
5922 /* We use char because int might match the return type of a gcc2
5923    builtin and then its argument prototype would still apply.  */
5924 char Gpm_Open ();
5925 int
5926 main ()
5927 {
5928 Gpm_Open ();
5929   ;
5930   return 0;
5931 }
5932 _ACEOF
5933 rm -f conftest.$ac_objext conftest$ac_exeext
5934 if { (eval echo "$as_me:5934: \"$ac_link\"") >&5
5935   (eval $ac_link) 2>&5
5936   ac_status=$?
5937   echo "$as_me:5937: \$? = $ac_status" >&5
5938   (exit $ac_status); } &&
5939          { ac_try='test -s conftest$ac_exeext'
5940   { (eval echo "$as_me:5940: \"$ac_try\"") >&5
5941   (eval $ac_try) 2>&5
5942   ac_status=$?
5943   echo "$as_me:5943: \$? = $ac_status" >&5
5944   (exit $ac_status); }; }; then
5945   ac_cv_lib_gpm_Gpm_Open=yes
5946 else
5947   echo "$as_me: failed program was:" >&5
5948 cat conftest.$ac_ext >&5
5949 ac_cv_lib_gpm_Gpm_Open=no
5950 fi
5951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5952 LIBS=$ac_check_lib_save_LIBS
5953 fi
5954 echo "$as_me:5954: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5955 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5956 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5957   echo "$as_me:5957: checking for initscr in -lgpm" >&5
5958 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5959 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5960   echo $ECHO_N "(cached) $ECHO_C" >&6
5961 else
5962   ac_check_lib_save_LIBS=$LIBS
5963 LIBS="-lgpm  $LIBS"
5964 cat >conftest.$ac_ext <<_ACEOF
5965 #line 5965 "configure"
5966 #include "confdefs.h"
5967
5968 /* Override any gcc2 internal prototype to avoid an error.  */
5969 #ifdef __cplusplus
5970 extern "C"
5971 #endif
5972 /* We use char because int might match the return type of a gcc2
5973    builtin and then its argument prototype would still apply.  */
5974 char initscr ();
5975 int
5976 main ()
5977 {
5978 initscr ();
5979   ;
5980   return 0;
5981 }
5982 _ACEOF
5983 rm -f conftest.$ac_objext conftest$ac_exeext
5984 if { (eval echo "$as_me:5984: \"$ac_link\"") >&5
5985   (eval $ac_link) 2>&5
5986   ac_status=$?
5987   echo "$as_me:5987: \$? = $ac_status" >&5
5988   (exit $ac_status); } &&
5989          { ac_try='test -s conftest$ac_exeext'
5990   { (eval echo "$as_me:5990: \"$ac_try\"") >&5
5991   (eval $ac_try) 2>&5
5992   ac_status=$?
5993   echo "$as_me:5993: \$? = $ac_status" >&5
5994   (exit $ac_status); }; }; then
5995   ac_cv_lib_gpm_initscr=yes
5996 else
5997   echo "$as_me: failed program was:" >&5
5998 cat conftest.$ac_ext >&5
5999 ac_cv_lib_gpm_initscr=no
6000 fi
6001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6002 LIBS=$ac_check_lib_save_LIBS
6003 fi
6004 echo "$as_me:6004: result: $ac_cv_lib_gpm_initscr" >&5
6005 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6006 if test $ac_cv_lib_gpm_initscr = yes; then
6007   LIBS="$cf_ncurses_SAVE"
6008 else
6009   cf_ncurses_LIBS="-lgpm"
6010 fi
6011
6012 fi
6013
6014 case $host_os in #(vi
6015 freebsd*)
6016         # This is only necessary if you are linking against an obsolete
6017         # version of ncurses (but it should do no harm, since it's static).
6018         if test "$cf_nculib_root" = ncurses ; then
6019                 echo "$as_me:6019: checking for tgoto in -lmytinfo" >&5
6020 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6021 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6022   echo $ECHO_N "(cached) $ECHO_C" >&6
6023 else
6024   ac_check_lib_save_LIBS=$LIBS
6025 LIBS="-lmytinfo  $LIBS"
6026 cat >conftest.$ac_ext <<_ACEOF
6027 #line 6027 "configure"
6028 #include "confdefs.h"
6029
6030 /* Override any gcc2 internal prototype to avoid an error.  */
6031 #ifdef __cplusplus
6032 extern "C"
6033 #endif
6034 /* We use char because int might match the return type of a gcc2
6035    builtin and then its argument prototype would still apply.  */
6036 char tgoto ();
6037 int
6038 main ()
6039 {
6040 tgoto ();
6041   ;
6042   return 0;
6043 }
6044 _ACEOF
6045 rm -f conftest.$ac_objext conftest$ac_exeext
6046 if { (eval echo "$as_me:6046: \"$ac_link\"") >&5
6047   (eval $ac_link) 2>&5
6048   ac_status=$?
6049   echo "$as_me:6049: \$? = $ac_status" >&5
6050   (exit $ac_status); } &&
6051          { ac_try='test -s conftest$ac_exeext'
6052   { (eval echo "$as_me:6052: \"$ac_try\"") >&5
6053   (eval $ac_try) 2>&5
6054   ac_status=$?
6055   echo "$as_me:6055: \$? = $ac_status" >&5
6056   (exit $ac_status); }; }; then
6057   ac_cv_lib_mytinfo_tgoto=yes
6058 else
6059   echo "$as_me: failed program was:" >&5
6060 cat conftest.$ac_ext >&5
6061 ac_cv_lib_mytinfo_tgoto=no
6062 fi
6063 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6064 LIBS=$ac_check_lib_save_LIBS
6065 fi
6066 echo "$as_me:6066: result: $ac_cv_lib_mytinfo_tgoto" >&5
6067 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6068 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6069   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6070 fi
6071
6072         fi
6073         ;;
6074 esac
6075
6076 LIBS="$cf_ncurses_LIBS $LIBS"
6077
6078 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6079 then
6080
6081 if test -n "$cf_cv_curses_dir/lib" ; then
6082   for cf_add_libdir in $cf_cv_curses_dir/lib
6083   do
6084     if test $cf_add_libdir = /usr/lib ; then
6085       :
6086     elif test -d $cf_add_libdir
6087     then
6088       cf_have_libdir=no
6089       if test -n "$LDFLAGS$LIBS" ; then
6090         # a loop is needed to ensure we can add subdirs of existing dirs
6091         for cf_test_libdir in $LDFLAGS $LIBS ; do
6092           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6093             cf_have_libdir=yes; break
6094           fi
6095         done
6096       fi
6097       if test "$cf_have_libdir" = no ; then
6098         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6099
6100 echo "${as_me:-configure}:6100: testing adding $cf_add_libdir to library-path ..." 1>&5
6101
6102         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6103       fi
6104     fi
6105   done
6106 fi
6107
6108         LIBS="-l$cf_nculib_root $LIBS"
6109 else
6110
6111         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6112         cf_libdir=""
6113         echo "$as_me:6113: checking for initscr" >&5
6114 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6115 if test "${ac_cv_func_initscr+set}" = set; then
6116   echo $ECHO_N "(cached) $ECHO_C" >&6
6117 else
6118   cat >conftest.$ac_ext <<_ACEOF
6119 #line 6119 "configure"
6120 #include "confdefs.h"
6121 /* System header to define __stub macros and hopefully few prototypes,
6122     which can conflict with char initscr (); below.  */
6123 #include <assert.h>
6124 /* Override any gcc2 internal prototype to avoid an error.  */
6125 #ifdef __cplusplus
6126 extern "C"
6127 #endif
6128 /* We use char because int might match the return type of a gcc2
6129    builtin and then its argument prototype would still apply.  */
6130 char initscr ();
6131 char (*f) ();
6132
6133 int
6134 main ()
6135 {
6136 /* The GNU C library defines this for functions which it implements
6137     to always fail with ENOSYS.  Some functions are actually named
6138     something starting with __ and the normal name is an alias.  */
6139 #if defined (__stub_initscr) || defined (__stub___initscr)
6140 choke me
6141 #else
6142 f = initscr;
6143 #endif
6144
6145   ;
6146   return 0;
6147 }
6148 _ACEOF
6149 rm -f conftest.$ac_objext conftest$ac_exeext
6150 if { (eval echo "$as_me:6150: \"$ac_link\"") >&5
6151   (eval $ac_link) 2>&5
6152   ac_status=$?
6153   echo "$as_me:6153: \$? = $ac_status" >&5
6154   (exit $ac_status); } &&
6155          { ac_try='test -s conftest$ac_exeext'
6156   { (eval echo "$as_me:6156: \"$ac_try\"") >&5
6157   (eval $ac_try) 2>&5
6158   ac_status=$?
6159   echo "$as_me:6159: \$? = $ac_status" >&5
6160   (exit $ac_status); }; }; then
6161   ac_cv_func_initscr=yes
6162 else
6163   echo "$as_me: failed program was:" >&5
6164 cat conftest.$ac_ext >&5
6165 ac_cv_func_initscr=no
6166 fi
6167 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6168 fi
6169 echo "$as_me:6169: result: $ac_cv_func_initscr" >&5
6170 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6171 if test $ac_cv_func_initscr = yes; then
6172   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6173 else
6174
6175                 cf_save_LIBS="$LIBS"
6176                 echo "$as_me:6176: checking for initscr in -l$cf_nculib_root" >&5
6177 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6178                 LIBS="-l$cf_nculib_root $LIBS"
6179                 cat >conftest.$ac_ext <<_ACEOF
6180 #line 6180 "configure"
6181 #include "confdefs.h"
6182 #include <${cf_cv_ncurses_header:-curses.h}>
6183 int
6184 main ()
6185 {
6186 initscr()
6187   ;
6188   return 0;
6189 }
6190 _ACEOF
6191 rm -f conftest.$ac_objext conftest$ac_exeext
6192 if { (eval echo "$as_me:6192: \"$ac_link\"") >&5
6193   (eval $ac_link) 2>&5
6194   ac_status=$?
6195   echo "$as_me:6195: \$? = $ac_status" >&5
6196   (exit $ac_status); } &&
6197          { ac_try='test -s conftest$ac_exeext'
6198   { (eval echo "$as_me:6198: \"$ac_try\"") >&5
6199   (eval $ac_try) 2>&5
6200   ac_status=$?
6201   echo "$as_me:6201: \$? = $ac_status" >&5
6202   (exit $ac_status); }; }; then
6203   echo "$as_me:6203: result: yes" >&5
6204 echo "${ECHO_T}yes" >&6
6205                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6206
6207 else
6208   echo "$as_me: failed program was:" >&5
6209 cat conftest.$ac_ext >&5
6210 echo "$as_me:6210: result: no" >&5
6211 echo "${ECHO_T}no" >&6
6212
6213 cf_search=
6214 cf_library_path_list=""
6215 if test -n "${LDFLAGS}${LIBS}" ; then
6216         for cf_library_path in $LDFLAGS $LIBS
6217         do
6218                 case $cf_library_path in #(vi
6219                 -L*)
6220                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6221
6222 test "$cf_library_path" != "NONE" && \
6223 test -d "$cf_library_path" && \
6224  {
6225         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6226         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6227         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6228         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6229         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6230         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"
6231 }
6232
6233                         cf_library_path_list="$cf_library_path_list $cf_search"
6234                         ;;
6235                 esac
6236         done
6237 fi
6238
6239 cf_search=
6240
6241 test "/usr" != "$prefix" && \
6242 test -d "/usr" && \
6243 (test $prefix = NONE || test "/usr" != "$prefix") && {
6244         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6245         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6246         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6247         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6248         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6249         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6250 }
6251
6252 test "$prefix" != "NONE" && \
6253 test -d "$prefix" && \
6254  {
6255         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6256         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6257         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6258         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6259         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6260         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6261 }
6262
6263 test "/usr/local" != "$prefix" && \
6264 test -d "/usr/local" && \
6265 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6266         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6267         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6268         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6269         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6270         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6271         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6272 }
6273
6274 test "/opt" != "$prefix" && \
6275 test -d "/opt" && \
6276 (test $prefix = NONE || test "/opt" != "$prefix") && {
6277         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6278         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6279         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6280         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6281         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6282         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6283 }
6284
6285 test "$HOME" != "$prefix" && \
6286 test -d "$HOME" && \
6287 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6288         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6289         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6290         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6291         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6292         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6293         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6294 }
6295
6296 cf_search="$cf_library_path_list $cf_search"
6297
6298                         for cf_libdir in $cf_search
6299                         do
6300                                 echo "$as_me:6300: checking for -l$cf_nculib_root in $cf_libdir" >&5
6301 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6302                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6303                                 cat >conftest.$ac_ext <<_ACEOF
6304 #line 6304 "configure"
6305 #include "confdefs.h"
6306 #include <${cf_cv_ncurses_header:-curses.h}>
6307 int
6308 main ()
6309 {
6310 initscr()
6311   ;
6312   return 0;
6313 }
6314 _ACEOF
6315 rm -f conftest.$ac_objext conftest$ac_exeext
6316 if { (eval echo "$as_me:6316: \"$ac_link\"") >&5
6317   (eval $ac_link) 2>&5
6318   ac_status=$?
6319   echo "$as_me:6319: \$? = $ac_status" >&5
6320   (exit $ac_status); } &&
6321          { ac_try='test -s conftest$ac_exeext'
6322   { (eval echo "$as_me:6322: \"$ac_try\"") >&5
6323   (eval $ac_try) 2>&5
6324   ac_status=$?
6325   echo "$as_me:6325: \$? = $ac_status" >&5
6326   (exit $ac_status); }; }; then
6327   echo "$as_me:6327: result: yes" >&5
6328 echo "${ECHO_T}yes" >&6
6329                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6330                                          break
6331 else
6332   echo "$as_me: failed program was:" >&5
6333 cat conftest.$ac_ext >&5
6334 echo "$as_me:6334: result: no" >&5
6335 echo "${ECHO_T}no" >&6
6336                                          LIBS="$cf_save_LIBS"
6337 fi
6338 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6339                         done
6340
6341 fi
6342 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6343
6344 fi
6345
6346 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6347
6348 if test $cf_found_library = no ; then
6349         { { echo "$as_me:6349: error: Cannot link $cf_nculib_root library" >&5
6350 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6351    { (exit 1); exit 1; }; }
6352 fi
6353
6354 fi
6355
6356 if test -n "$cf_ncurses_LIBS" ; then
6357         echo "$as_me:6357: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6358 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6359         cf_ncurses_SAVE="$LIBS"
6360         for p in $cf_ncurses_LIBS ; do
6361                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6362                 if test "$q" != "$LIBS" ; then
6363                         LIBS="$q"
6364                 fi
6365         done
6366         cat >conftest.$ac_ext <<_ACEOF
6367 #line 6367 "configure"
6368 #include "confdefs.h"
6369 #include <${cf_cv_ncurses_header:-curses.h}>
6370 int
6371 main ()
6372 {
6373 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6374   ;
6375   return 0;
6376 }
6377 _ACEOF
6378 rm -f conftest.$ac_objext conftest$ac_exeext
6379 if { (eval echo "$as_me:6379: \"$ac_link\"") >&5
6380   (eval $ac_link) 2>&5
6381   ac_status=$?
6382   echo "$as_me:6382: \$? = $ac_status" >&5
6383   (exit $ac_status); } &&
6384          { ac_try='test -s conftest$ac_exeext'
6385   { (eval echo "$as_me:6385: \"$ac_try\"") >&5
6386   (eval $ac_try) 2>&5
6387   ac_status=$?
6388   echo "$as_me:6388: \$? = $ac_status" >&5
6389   (exit $ac_status); }; }; then
6390   echo "$as_me:6390: result: yes" >&5
6391 echo "${ECHO_T}yes" >&6
6392 else
6393   echo "$as_me: failed program was:" >&5
6394 cat conftest.$ac_ext >&5
6395 echo "$as_me:6395: result: no" >&5
6396 echo "${ECHO_T}no" >&6
6397                  LIBS="$cf_ncurses_SAVE"
6398 fi
6399 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6400 fi
6401
6402 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6403
6404 cat >>confdefs.h <<EOF
6405 #define $cf_nculib_ROOT 1
6406 EOF
6407
6408 fi
6409
6410         ;;
6411 ncursesw)
6412         cf_cv_libtype=w
6413
6414 echo "$as_me:6414: checking for multibyte character support" >&5
6415 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6416 if test "${cf_cv_utf8_lib+set}" = set; then
6417   echo $ECHO_N "(cached) $ECHO_C" >&6
6418 else
6419
6420         cf_save_LIBS="$LIBS"
6421         cat >conftest.$ac_ext <<_ACEOF
6422 #line 6422 "configure"
6423 #include "confdefs.h"
6424
6425 #include <stdlib.h>
6426 int
6427 main ()
6428 {
6429 putwc(0,0);
6430   ;
6431   return 0;
6432 }
6433 _ACEOF
6434 rm -f conftest.$ac_objext conftest$ac_exeext
6435 if { (eval echo "$as_me:6435: \"$ac_link\"") >&5
6436   (eval $ac_link) 2>&5
6437   ac_status=$?
6438   echo "$as_me:6438: \$? = $ac_status" >&5
6439   (exit $ac_status); } &&
6440          { ac_try='test -s conftest$ac_exeext'
6441   { (eval echo "$as_me:6441: \"$ac_try\"") >&5
6442   (eval $ac_try) 2>&5
6443   ac_status=$?
6444   echo "$as_me:6444: \$? = $ac_status" >&5
6445   (exit $ac_status); }; }; then
6446   cf_cv_utf8_lib=yes
6447 else
6448   echo "$as_me: failed program was:" >&5
6449 cat conftest.$ac_ext >&5
6450
6451 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6452 # will be set on completion of the AC_TRY_LINK below.
6453 cf_cv_header_path_utf8=
6454 cf_cv_library_path_utf8=
6455
6456 echo "${as_me:-configure}:6456: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6457
6458 cf_save_LIBS="$LIBS"
6459
6460 cat >conftest.$ac_ext <<_ACEOF
6461 #line 6461 "configure"
6462 #include "confdefs.h"
6463
6464 #include <libutf8.h>
6465 int
6466 main ()
6467 {
6468 putwc(0,0);
6469   ;
6470   return 0;
6471 }
6472 _ACEOF
6473 rm -f conftest.$ac_objext conftest$ac_exeext
6474 if { (eval echo "$as_me:6474: \"$ac_link\"") >&5
6475   (eval $ac_link) 2>&5
6476   ac_status=$?
6477   echo "$as_me:6477: \$? = $ac_status" >&5
6478   (exit $ac_status); } &&
6479          { ac_try='test -s conftest$ac_exeext'
6480   { (eval echo "$as_me:6480: \"$ac_try\"") >&5
6481   (eval $ac_try) 2>&5
6482   ac_status=$?
6483   echo "$as_me:6483: \$? = $ac_status" >&5
6484   (exit $ac_status); }; }; then
6485
6486         cf_cv_find_linkage_utf8=yes
6487         cf_cv_header_path_utf8=/usr/include
6488         cf_cv_library_path_utf8=/usr/lib
6489
6490 else
6491   echo "$as_me: failed program was:" >&5
6492 cat conftest.$ac_ext >&5
6493
6494 LIBS="-lutf8  $cf_save_LIBS"
6495
6496 cat >conftest.$ac_ext <<_ACEOF
6497 #line 6497 "configure"
6498 #include "confdefs.h"
6499
6500 #include <libutf8.h>
6501 int
6502 main ()
6503 {
6504 putwc(0,0);
6505   ;
6506   return 0;
6507 }
6508 _ACEOF
6509 rm -f conftest.$ac_objext conftest$ac_exeext
6510 if { (eval echo "$as_me:6510: \"$ac_link\"") >&5
6511   (eval $ac_link) 2>&5
6512   ac_status=$?
6513   echo "$as_me:6513: \$? = $ac_status" >&5
6514   (exit $ac_status); } &&
6515          { ac_try='test -s conftest$ac_exeext'
6516   { (eval echo "$as_me:6516: \"$ac_try\"") >&5
6517   (eval $ac_try) 2>&5
6518   ac_status=$?
6519   echo "$as_me:6519: \$? = $ac_status" >&5
6520   (exit $ac_status); }; }; then
6521
6522         cf_cv_find_linkage_utf8=yes
6523         cf_cv_header_path_utf8=/usr/include
6524         cf_cv_library_path_utf8=/usr/lib
6525         cf_cv_library_file_utf8="-lutf8"
6526
6527 else
6528   echo "$as_me: failed program was:" >&5
6529 cat conftest.$ac_ext >&5
6530
6531         cf_cv_find_linkage_utf8=no
6532         LIBS="$cf_save_LIBS"
6533
6534     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
6535
6536 echo "${as_me:-configure}:6536: testing find linkage for utf8 library ..." 1>&5
6537
6538 echo "${as_me:-configure}:6538: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6539
6540     cf_save_CPPFLAGS="$CPPFLAGS"
6541     cf_test_CPPFLAGS="$CPPFLAGS"
6542
6543 cf_search=
6544
6545 # collect the current set of include-directories from compiler flags
6546 cf_header_path_list=""
6547 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6548         for cf_header_path in $CPPFLAGS $CFLAGS
6549         do
6550                 case $cf_header_path in #(vi
6551                 -I*)
6552                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6553
6554 test "$cf_header_path" != "NONE" && \
6555 test -d "$cf_header_path" && \
6556  {
6557         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6558         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6559         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6560         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6561         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6562         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6563 }
6564
6565                         cf_header_path_list="$cf_header_path_list $cf_search"
6566                         ;;
6567                 esac
6568         done
6569 fi
6570
6571 # add the variations for the package we are looking for
6572
6573 cf_search=
6574
6575 test "/usr" != "$prefix" && \
6576 test -d "/usr" && \
6577 (test $prefix = NONE || test "/usr" != "$prefix") && {
6578         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6579         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6580         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
6581         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
6582         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
6583         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
6584 }
6585
6586 test "$prefix" != "NONE" && \
6587 test -d "$prefix" && \
6588  {
6589         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6590         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6591         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6592         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6593         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6594         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6595 }
6596
6597 test "/usr/local" != "$prefix" && \
6598 test -d "/usr/local" && \
6599 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6600         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6601         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6602         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
6603         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
6604         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
6605         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
6606 }
6607
6608 test "/opt" != "$prefix" && \
6609 test -d "/opt" && \
6610 (test $prefix = NONE || test "/opt" != "$prefix") && {
6611         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6612         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6613         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
6614         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
6615         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
6616         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
6617 }
6618
6619 test "$HOME" != "$prefix" && \
6620 test -d "$HOME" && \
6621 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6622         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6623         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6624         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
6625         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
6626         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
6627         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
6628 }
6629
6630 test "$includedir" != NONE && \
6631 test "$includedir" != "/usr/include" && \
6632 test -d "$includedir" && {
6633         test -d $includedir &&    cf_search="$cf_search $includedir"
6634         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6635 }
6636
6637 test "$oldincludedir" != NONE && \
6638 test "$oldincludedir" != "/usr/include" && \
6639 test -d "$oldincludedir" && {
6640         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6641         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6642 }
6643
6644 cf_search="$cf_search $cf_header_path_list"
6645
6646     for cf_cv_header_path_utf8 in $cf_search
6647     do
6648       if test -d $cf_cv_header_path_utf8 ; then
6649         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6650
6651 echo "${as_me:-configure}:6651: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6652
6653         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6654         cat >conftest.$ac_ext <<_ACEOF
6655 #line 6655 "configure"
6656 #include "confdefs.h"
6657
6658 #include <libutf8.h>
6659 int
6660 main ()
6661 {
6662 putwc(0,0);
6663   ;
6664   return 0;
6665 }
6666 _ACEOF
6667 rm -f conftest.$ac_objext
6668 if { (eval echo "$as_me:6668: \"$ac_compile\"") >&5
6669   (eval $ac_compile) 2>&5
6670   ac_status=$?
6671   echo "$as_me:6671: \$? = $ac_status" >&5
6672   (exit $ac_status); } &&
6673          { ac_try='test -s conftest.$ac_objext'
6674   { (eval echo "$as_me:6674: \"$ac_try\"") >&5
6675   (eval $ac_try) 2>&5
6676   ac_status=$?
6677   echo "$as_me:6677: \$? = $ac_status" >&5
6678   (exit $ac_status); }; }; then
6679
6680             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6681
6682 echo "${as_me:-configure}:6682: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6683
6684             cf_cv_find_linkage_utf8=maybe
6685             cf_test_CPPFLAGS="$CPPFLAGS"
6686             break
6687 else
6688   echo "$as_me: failed program was:" >&5
6689 cat conftest.$ac_ext >&5
6690
6691             CPPFLAGS="$cf_save_CPPFLAGS"
6692
6693 fi
6694 rm -f conftest.$ac_objext conftest.$ac_ext
6695       fi
6696     done
6697
6698     if test "$cf_cv_find_linkage_utf8" = maybe ; then
6699
6700 echo "${as_me:-configure}:6700: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6701
6702       cf_save_LIBS="$LIBS"
6703       cf_save_LDFLAGS="$LDFLAGS"
6704
6705       if test "$cf_cv_find_linkage_utf8" != yes ; then
6706
6707 cf_search=
6708 cf_library_path_list=""
6709 if test -n "${LDFLAGS}${LIBS}" ; then
6710         for cf_library_path in $LDFLAGS $LIBS
6711         do
6712                 case $cf_library_path in #(vi
6713                 -L*)
6714                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6715
6716 test "$cf_library_path" != "NONE" && \
6717 test -d "$cf_library_path" && \
6718  {
6719         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6720         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6721         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6722         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6723         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6724         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6725 }
6726
6727                         cf_library_path_list="$cf_library_path_list $cf_search"
6728                         ;;
6729                 esac
6730         done
6731 fi
6732
6733 cf_search=
6734
6735 test "/usr" != "$prefix" && \
6736 test -d "/usr" && \
6737 (test $prefix = NONE || test "/usr" != "$prefix") && {
6738         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6739         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6740         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
6741         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
6742         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
6743         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
6744 }
6745
6746 test "$prefix" != "NONE" && \
6747 test -d "$prefix" && \
6748  {
6749         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6750         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6751         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6752         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6753         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6754         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6755 }
6756
6757 test "/usr/local" != "$prefix" && \
6758 test -d "/usr/local" && \
6759 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6760         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6761         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6762         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
6763         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
6764         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
6765         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
6766 }
6767
6768 test "/opt" != "$prefix" && \
6769 test -d "/opt" && \
6770 (test $prefix = NONE || test "/opt" != "$prefix") && {
6771         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6772         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6773         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
6774         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
6775         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
6776         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
6777 }
6778
6779 test "$HOME" != "$prefix" && \
6780 test -d "$HOME" && \
6781 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6782         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6783         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6784         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
6785         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
6786         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
6787         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
6788 }
6789
6790 cf_search="$cf_library_path_list $cf_search"
6791
6792         for cf_cv_library_path_utf8 in $cf_search
6793         do
6794           if test -d $cf_cv_library_path_utf8 ; then
6795             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
6796
6797 echo "${as_me:-configure}:6797: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6798
6799             CPPFLAGS="$cf_test_CPPFLAGS"
6800             LIBS="-lutf8  $cf_save_LIBS"
6801             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6802             cat >conftest.$ac_ext <<_ACEOF
6803 #line 6803 "configure"
6804 #include "confdefs.h"
6805
6806 #include <libutf8.h>
6807 int
6808 main ()
6809 {
6810 putwc(0,0);
6811   ;
6812   return 0;
6813 }
6814 _ACEOF
6815 rm -f conftest.$ac_objext conftest$ac_exeext
6816 if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
6817   (eval $ac_link) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit $ac_status); } &&
6821          { ac_try='test -s conftest$ac_exeext'
6822   { (eval echo "$as_me:6822: \"$ac_try\"") >&5
6823   (eval $ac_try) 2>&5
6824   ac_status=$?
6825   echo "$as_me:6825: \$? = $ac_status" >&5
6826   (exit $ac_status); }; }; then
6827
6828                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6829
6830 echo "${as_me:-configure}:6830: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6831
6832                 cf_cv_find_linkage_utf8=yes
6833                 cf_cv_library_file_utf8="-lutf8"
6834                 break
6835 else
6836   echo "$as_me: failed program was:" >&5
6837 cat conftest.$ac_ext >&5
6838
6839                 CPPFLAGS="$cf_save_CPPFLAGS"
6840                 LIBS="$cf_save_LIBS"
6841                 LDFLAGS="$cf_save_LDFLAGS"
6842
6843 fi
6844 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6845           fi
6846         done
6847         CPPFLAGS="$cf_save_CPPFLAGS"
6848         LDFLAGS="$cf_save_LDFLAGS"
6849       fi
6850
6851     else
6852       cf_cv_find_linkage_utf8=no
6853     fi
6854
6855 fi
6856 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6857
6858 fi
6859 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6860
6861 LIBS="$cf_save_LIBS"
6862
6863 if test "$cf_cv_find_linkage_utf8" = yes ; then
6864 cf_cv_utf8_lib=add-on
6865 else
6866 cf_cv_utf8_lib=no
6867 fi
6868
6869 fi
6870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6871 fi
6872 echo "$as_me:6872: result: $cf_cv_utf8_lib" >&5
6873 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6874
6875 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6876 # ncurses/ncursesw:
6877 if test "$cf_cv_utf8_lib" = "add-on" ; then
6878         cat >>confdefs.h <<\EOF
6879 #define HAVE_LIBUTF8_H 1
6880 EOF
6881
6882 if test -n "$cf_cv_header_path_utf8" ; then
6883   for cf_add_incdir in $cf_cv_header_path_utf8
6884   do
6885         while test $cf_add_incdir != /usr/include
6886         do
6887           if test -d $cf_add_incdir
6888           then
6889                 cf_have_incdir=no
6890                 if test -n "$CFLAGS$CPPFLAGS" ; then
6891                   # a loop is needed to ensure we can add subdirs of existing dirs
6892                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6893                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6894                           cf_have_incdir=yes; break
6895                         fi
6896                   done
6897                 fi
6898
6899                 if test "$cf_have_incdir" = no ; then
6900                   if test "$cf_add_incdir" = /usr/local/include ; then
6901                         if test "$GCC" = yes
6902                         then
6903                           cf_save_CPPFLAGS=$CPPFLAGS
6904                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6905                           cat >conftest.$ac_ext <<_ACEOF
6906 #line 6906 "configure"
6907 #include "confdefs.h"
6908 #include <stdio.h>
6909 int
6910 main ()
6911 {
6912 printf("Hello")
6913   ;
6914   return 0;
6915 }
6916 _ACEOF
6917 rm -f conftest.$ac_objext
6918 if { (eval echo "$as_me:6918: \"$ac_compile\"") >&5
6919   (eval $ac_compile) 2>&5
6920   ac_status=$?
6921   echo "$as_me:6921: \$? = $ac_status" >&5
6922   (exit $ac_status); } &&
6923          { ac_try='test -s conftest.$ac_objext'
6924   { (eval echo "$as_me:6924: \"$ac_try\"") >&5
6925   (eval $ac_try) 2>&5
6926   ac_status=$?
6927   echo "$as_me:6927: \$? = $ac_status" >&5
6928   (exit $ac_status); }; }; then
6929   :
6930 else
6931   echo "$as_me: failed program was:" >&5
6932 cat conftest.$ac_ext >&5
6933 cf_have_incdir=yes
6934 fi
6935 rm -f conftest.$ac_objext conftest.$ac_ext
6936                           CPPFLAGS=$cf_save_CPPFLAGS
6937                         fi
6938                   fi
6939                 fi
6940
6941                 if test "$cf_have_incdir" = no ; then
6942                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6943
6944 echo "${as_me:-configure}:6944: testing adding $cf_add_incdir to include-path ..." 1>&5
6945
6946                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6947
6948                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6949                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6950                   cf_add_incdir="$cf_top_incdir"
6951                 else
6952                   break
6953                 fi
6954           fi
6955         done
6956   done
6957 fi
6958
6959 if test -n "$cf_cv_library_path_utf8" ; then
6960   for cf_add_libdir in $cf_cv_library_path_utf8
6961   do
6962     if test $cf_add_libdir = /usr/lib ; then
6963       :
6964     elif test -d $cf_add_libdir
6965     then
6966       cf_have_libdir=no
6967       if test -n "$LDFLAGS$LIBS" ; then
6968         # a loop is needed to ensure we can add subdirs of existing dirs
6969         for cf_test_libdir in $LDFLAGS $LIBS ; do
6970           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6971             cf_have_libdir=yes; break
6972           fi
6973         done
6974       fi
6975       if test "$cf_have_libdir" = no ; then
6976         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6977
6978 echo "${as_me:-configure}:6978: testing adding $cf_add_libdir to library-path ..." 1>&5
6979
6980         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6981       fi
6982     fi
6983   done
6984 fi
6985
6986         LIBS="$cf_cv_library_file_utf8 $LIBS"
6987 fi
6988
6989 cf_ncuconfig_root=ncursesw
6990
6991 echo "Looking for ${cf_ncuconfig_root}-config"
6992 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6993 do
6994   # Extract the first word of "$ac_prog", so it can be a program name with args.
6995 set dummy $ac_prog; ac_word=$2
6996 echo "$as_me:6996: checking for $ac_word" >&5
6997 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6998 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
6999   echo $ECHO_N "(cached) $ECHO_C" >&6
7000 else
7001   case $NCURSES_CONFIG in
7002   [\\/]* | ?:[\\/]*)
7003   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
7004   ;;
7005   *)
7006   ac_save_IFS=$IFS; IFS=$ac_path_separator
7007 ac_dummy="$PATH"
7008 for ac_dir in $ac_dummy; do
7009   IFS=$ac_save_IFS
7010   test -z "$ac_dir" && ac_dir=.
7011   if $as_executable_p "$ac_dir/$ac_word"; then
7012    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
7013    echo "$as_me:7013: found $ac_dir/$ac_word" >&5
7014    break
7015 fi
7016 done
7017
7018   ;;
7019 esac
7020 fi
7021 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
7022
7023 if test -n "$NCURSES_CONFIG"; then
7024   echo "$as_me:7024: result: $NCURSES_CONFIG" >&5
7025 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7026 else
7027   echo "$as_me:7027: result: no" >&5
7028 echo "${ECHO_T}no" >&6
7029 fi
7030
7031   test -n "$NCURSES_CONFIG" && break
7032 done
7033 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
7034
7035 if test "$NCURSES_CONFIG" != none ; then
7036
7037 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7038 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
7039
7040 # even with config script, some packages use no-override for curses.h
7041
7042 echo "$as_me:7042: checking if we have identified curses headers" >&5
7043 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7044 if test "${cf_cv_ncurses_header+set}" = set; then
7045   echo $ECHO_N "(cached) $ECHO_C" >&6
7046 else
7047
7048 cf_cv_ncurses_header=none
7049 for cf_header in  \
7050     ncursesw/curses.h \
7051         ncursesw/ncurses.h \
7052         curses.h \
7053         ncurses.h
7054 do
7055 cat >conftest.$ac_ext <<_ACEOF
7056 #line 7056 "configure"
7057 #include "confdefs.h"
7058 #include <${cf_header}>
7059 int
7060 main ()
7061 {
7062 initscr(); tgoto("?", 0,0)
7063   ;
7064   return 0;
7065 }
7066 _ACEOF
7067 rm -f conftest.$ac_objext
7068 if { (eval echo "$as_me:7068: \"$ac_compile\"") >&5
7069   (eval $ac_compile) 2>&5
7070   ac_status=$?
7071   echo "$as_me:7071: \$? = $ac_status" >&5
7072   (exit $ac_status); } &&
7073          { ac_try='test -s conftest.$ac_objext'
7074   { (eval echo "$as_me:7074: \"$ac_try\"") >&5
7075   (eval $ac_try) 2>&5
7076   ac_status=$?
7077   echo "$as_me:7077: \$? = $ac_status" >&5
7078   (exit $ac_status); }; }; then
7079   cf_cv_ncurses_header=$cf_header; break
7080 else
7081   echo "$as_me: failed program was:" >&5
7082 cat conftest.$ac_ext >&5
7083 fi
7084 rm -f conftest.$ac_objext conftest.$ac_ext
7085 done
7086
7087 fi
7088 echo "$as_me:7088: result: $cf_cv_ncurses_header" >&5
7089 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7090
7091 if test "$cf_cv_ncurses_header" = none ; then
7092         { { echo "$as_me:7092: error: No curses header-files found" >&5
7093 echo "$as_me: error: No curses header-files found" >&2;}
7094    { (exit 1); exit 1; }; }
7095 fi
7096
7097 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7098
7099 for ac_header in $cf_cv_ncurses_header
7100 do
7101 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7102 echo "$as_me:7102: checking for $ac_header" >&5
7103 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7104 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7105   echo $ECHO_N "(cached) $ECHO_C" >&6
7106 else
7107   cat >conftest.$ac_ext <<_ACEOF
7108 #line 7108 "configure"
7109 #include "confdefs.h"
7110 #include <$ac_header>
7111 _ACEOF
7112 if { (eval echo "$as_me:7112: \"$ac_cpp conftest.$ac_ext\"") >&5
7113   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7114   ac_status=$?
7115   egrep -v '^ *\+' conftest.er1 >conftest.err
7116   rm -f conftest.er1
7117   cat conftest.err >&5
7118   echo "$as_me:7118: \$? = $ac_status" >&5
7119   (exit $ac_status); } >/dev/null; then
7120   if test -s conftest.err; then
7121     ac_cpp_err=$ac_c_preproc_warn_flag
7122   else
7123     ac_cpp_err=
7124   fi
7125 else
7126   ac_cpp_err=yes
7127 fi
7128 if test -z "$ac_cpp_err"; then
7129   eval "$as_ac_Header=yes"
7130 else
7131   echo "$as_me: failed program was:" >&5
7132   cat conftest.$ac_ext >&5
7133   eval "$as_ac_Header=no"
7134 fi
7135 rm -f conftest.err conftest.$ac_ext
7136 fi
7137 echo "$as_me:7137: result: `eval echo '${'$as_ac_Header'}'`" >&5
7138 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7139 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7140   cat >>confdefs.h <<EOF
7141 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7142 EOF
7143
7144 fi
7145 done
7146
7147 cat >>confdefs.h <<\EOF
7148 #define NCURSES 1
7149 EOF
7150
7151 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7152
7153 cat >>confdefs.h <<EOF
7154 #define $cf_nculib_ROOT 1
7155 EOF
7156
7157 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7158
7159 else
7160
7161 cf_ncuhdr_root=ncursesw
7162
7163 test -n "$cf_cv_curses_dir" && \
7164 test "$cf_cv_curses_dir" != "no" && { \
7165
7166 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7167   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
7168   do
7169         while test $cf_add_incdir != /usr/include
7170         do
7171           if test -d $cf_add_incdir
7172           then
7173                 cf_have_incdir=no
7174                 if test -n "$CFLAGS$CPPFLAGS" ; then
7175                   # a loop is needed to ensure we can add subdirs of existing dirs
7176                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7177                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7178                           cf_have_incdir=yes; break
7179                         fi
7180                   done
7181                 fi
7182
7183                 if test "$cf_have_incdir" = no ; then
7184                   if test "$cf_add_incdir" = /usr/local/include ; then
7185                         if test "$GCC" = yes
7186                         then
7187                           cf_save_CPPFLAGS=$CPPFLAGS
7188                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7189                           cat >conftest.$ac_ext <<_ACEOF
7190 #line 7190 "configure"
7191 #include "confdefs.h"
7192 #include <stdio.h>
7193 int
7194 main ()
7195 {
7196 printf("Hello")
7197   ;
7198   return 0;
7199 }
7200 _ACEOF
7201 rm -f conftest.$ac_objext
7202 if { (eval echo "$as_me:7202: \"$ac_compile\"") >&5
7203   (eval $ac_compile) 2>&5
7204   ac_status=$?
7205   echo "$as_me:7205: \$? = $ac_status" >&5
7206   (exit $ac_status); } &&
7207          { ac_try='test -s conftest.$ac_objext'
7208   { (eval echo "$as_me:7208: \"$ac_try\"") >&5
7209   (eval $ac_try) 2>&5
7210   ac_status=$?
7211   echo "$as_me:7211: \$? = $ac_status" >&5
7212   (exit $ac_status); }; }; then
7213   :
7214 else
7215   echo "$as_me: failed program was:" >&5
7216 cat conftest.$ac_ext >&5
7217 cf_have_incdir=yes
7218 fi
7219 rm -f conftest.$ac_objext conftest.$ac_ext
7220                           CPPFLAGS=$cf_save_CPPFLAGS
7221                         fi
7222                   fi
7223                 fi
7224
7225                 if test "$cf_have_incdir" = no ; then
7226                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7227
7228 echo "${as_me:-configure}:7228: testing adding $cf_add_incdir to include-path ..." 1>&5
7229
7230                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7231
7232                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7233                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7234                   cf_add_incdir="$cf_top_incdir"
7235                 else
7236                   break
7237                 fi
7238           fi
7239         done
7240   done
7241 fi
7242
7243 }
7244
7245 echo "$as_me:7245: checking for $cf_ncuhdr_root header in include-path" >&5
7246 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7247 if test "${cf_cv_ncurses_h+set}" = set; then
7248   echo $ECHO_N "(cached) $ECHO_C" >&6
7249 else
7250
7251         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7252         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7253         for cf_header in $cf_header_list
7254         do
7255
7256         cat >conftest.$ac_ext <<_ACEOF
7257 #line 7257 "configure"
7258 #include "confdefs.h"
7259
7260 #define _XOPEN_SOURCE_EXTENDED
7261 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7262 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7263
7264 #include <$cf_header>
7265 int
7266 main ()
7267 {
7268
7269 #ifdef NCURSES_VERSION
7270
7271 #ifndef WACS_BSSB
7272         make an error
7273 #endif
7274
7275 printf("%s\n", NCURSES_VERSION);
7276 #else
7277 #ifdef __NCURSES_H
7278 printf("old\n");
7279 #else
7280         make an error
7281 #endif
7282 #endif
7283
7284   ;
7285   return 0;
7286 }
7287 _ACEOF
7288 rm -f conftest.$ac_objext
7289 if { (eval echo "$as_me:7289: \"$ac_compile\"") >&5
7290   (eval $ac_compile) 2>&5
7291   ac_status=$?
7292   echo "$as_me:7292: \$? = $ac_status" >&5
7293   (exit $ac_status); } &&
7294          { ac_try='test -s conftest.$ac_objext'
7295   { (eval echo "$as_me:7295: \"$ac_try\"") >&5
7296   (eval $ac_try) 2>&5
7297   ac_status=$?
7298   echo "$as_me:7298: \$? = $ac_status" >&5
7299   (exit $ac_status); }; }; then
7300   cf_cv_ncurses_h=$cf_header
7301
7302 else
7303   echo "$as_me: failed program was:" >&5
7304 cat conftest.$ac_ext >&5
7305 cf_cv_ncurses_h=no
7306 fi
7307 rm -f conftest.$ac_objext conftest.$ac_ext
7308
7309                 test "$cf_cv_ncurses_h" != no && break
7310         done
7311
7312 fi
7313 echo "$as_me:7313: result: $cf_cv_ncurses_h" >&5
7314 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7315
7316 if test "$cf_cv_ncurses_h" != no ; then
7317         cf_cv_ncurses_header=$cf_cv_ncurses_h
7318 else
7319
7320 echo "$as_me:7320: checking for $cf_ncuhdr_root include-path" >&5
7321 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7322 if test "${cf_cv_ncurses_h2+set}" = set; then
7323   echo $ECHO_N "(cached) $ECHO_C" >&6
7324 else
7325
7326         test -n "$verbose" && echo
7327
7328 cf_search=
7329
7330 # collect the current set of include-directories from compiler flags
7331 cf_header_path_list=""
7332 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7333         for cf_header_path in $CPPFLAGS $CFLAGS
7334         do
7335                 case $cf_header_path in #(vi
7336                 -I*)
7337                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7338
7339 test "$cf_header_path" != "NONE" && \
7340 test -d "$cf_header_path" && \
7341  {
7342         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7343         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7344         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7345         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7346         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7347         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"
7348 }
7349
7350                         cf_header_path_list="$cf_header_path_list $cf_search"
7351                         ;;
7352                 esac
7353         done
7354 fi
7355
7356 # add the variations for the package we are looking for
7357
7358 cf_search=
7359
7360 test "/usr" != "$prefix" && \
7361 test -d "/usr" && \
7362 (test $prefix = NONE || test "/usr" != "$prefix") && {
7363         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7364         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7365         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
7366         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
7367         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
7368         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7369 }
7370
7371 test "$prefix" != "NONE" && \
7372 test -d "$prefix" && \
7373  {
7374         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7375         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7376         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7377         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7378         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7379         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7380 }
7381
7382 test "/usr/local" != "$prefix" && \
7383 test -d "/usr/local" && \
7384 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7385         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7386         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7387         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
7388         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
7389         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
7390         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7391 }
7392
7393 test "/opt" != "$prefix" && \
7394 test -d "/opt" && \
7395 (test $prefix = NONE || test "/opt" != "$prefix") && {
7396         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7397         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7398         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
7399         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
7400         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
7401         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7402 }
7403
7404 test "$HOME" != "$prefix" && \
7405 test -d "$HOME" && \
7406 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7407         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7408         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7409         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
7410         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
7411         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
7412         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7413 }
7414
7415 test "$includedir" != NONE && \
7416 test "$includedir" != "/usr/include" && \
7417 test -d "$includedir" && {
7418         test -d $includedir &&    cf_search="$cf_search $includedir"
7419         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7420 }
7421
7422 test "$oldincludedir" != NONE && \
7423 test "$oldincludedir" != "/usr/include" && \
7424 test -d "$oldincludedir" && {
7425         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7426         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7427 }
7428
7429 cf_search="$cf_search $cf_header_path_list"
7430
7431         test -n "$verbose" && echo search path $cf_search
7432         cf_save2_CPPFLAGS="$CPPFLAGS"
7433         for cf_incdir in $cf_search
7434         do
7435
7436 if test -n "$cf_incdir" ; then
7437   for cf_add_incdir in $cf_incdir
7438   do
7439         while test $cf_add_incdir != /usr/include
7440         do
7441           if test -d $cf_add_incdir
7442           then
7443                 cf_have_incdir=no
7444                 if test -n "$CFLAGS$CPPFLAGS" ; then
7445                   # a loop is needed to ensure we can add subdirs of existing dirs
7446                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7447                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7448                           cf_have_incdir=yes; break
7449                         fi
7450                   done
7451                 fi
7452
7453                 if test "$cf_have_incdir" = no ; then
7454                   if test "$cf_add_incdir" = /usr/local/include ; then
7455                         if test "$GCC" = yes
7456                         then
7457                           cf_save_CPPFLAGS=$CPPFLAGS
7458                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7459                           cat >conftest.$ac_ext <<_ACEOF
7460 #line 7460 "configure"
7461 #include "confdefs.h"
7462 #include <stdio.h>
7463 int
7464 main ()
7465 {
7466 printf("Hello")
7467   ;
7468   return 0;
7469 }
7470 _ACEOF
7471 rm -f conftest.$ac_objext
7472 if { (eval echo "$as_me:7472: \"$ac_compile\"") >&5
7473   (eval $ac_compile) 2>&5
7474   ac_status=$?
7475   echo "$as_me:7475: \$? = $ac_status" >&5
7476   (exit $ac_status); } &&
7477          { ac_try='test -s conftest.$ac_objext'
7478   { (eval echo "$as_me:7478: \"$ac_try\"") >&5
7479   (eval $ac_try) 2>&5
7480   ac_status=$?
7481   echo "$as_me:7481: \$? = $ac_status" >&5
7482   (exit $ac_status); }; }; then
7483   :
7484 else
7485   echo "$as_me: failed program was:" >&5
7486 cat conftest.$ac_ext >&5
7487 cf_have_incdir=yes
7488 fi
7489 rm -f conftest.$ac_objext conftest.$ac_ext
7490                           CPPFLAGS=$cf_save_CPPFLAGS
7491                         fi
7492                   fi
7493                 fi
7494
7495                 if test "$cf_have_incdir" = no ; then
7496                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7497
7498 echo "${as_me:-configure}:7498: testing adding $cf_add_incdir to include-path ..." 1>&5
7499
7500                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7501
7502                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7503                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7504                   cf_add_incdir="$cf_top_incdir"
7505                 else
7506                   break
7507                 fi
7508           fi
7509         done
7510   done
7511 fi
7512
7513                 for cf_header in \
7514                         ncurses.h \
7515                         curses.h
7516                 do
7517
7518         cat >conftest.$ac_ext <<_ACEOF
7519 #line 7519 "configure"
7520 #include "confdefs.h"
7521
7522 #include <$cf_header>
7523 int
7524 main ()
7525 {
7526
7527 #ifdef NCURSES_VERSION
7528
7529 printf("%s\n", NCURSES_VERSION);
7530 #else
7531 #ifdef __NCURSES_H
7532 printf("old\n");
7533 #else
7534         make an error
7535 #endif
7536 #endif
7537
7538   ;
7539   return 0;
7540 }
7541 _ACEOF
7542 rm -f conftest.$ac_objext
7543 if { (eval echo "$as_me:7543: \"$ac_compile\"") >&5
7544   (eval $ac_compile) 2>&5
7545   ac_status=$?
7546   echo "$as_me:7546: \$? = $ac_status" >&5
7547   (exit $ac_status); } &&
7548          { ac_try='test -s conftest.$ac_objext'
7549   { (eval echo "$as_me:7549: \"$ac_try\"") >&5
7550   (eval $ac_try) 2>&5
7551   ac_status=$?
7552   echo "$as_me:7552: \$? = $ac_status" >&5
7553   (exit $ac_status); }; }; then
7554   cf_cv_ncurses_h2=$cf_header
7555
7556 else
7557   echo "$as_me: failed program was:" >&5
7558 cat conftest.$ac_ext >&5
7559 cf_cv_ncurses_h2=no
7560 fi
7561 rm -f conftest.$ac_objext conftest.$ac_ext
7562
7563                         if test "$cf_cv_ncurses_h2" != no ; then
7564                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7565                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7566                                 break
7567                         fi
7568                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7569                 done
7570                 CPPFLAGS="$cf_save2_CPPFLAGS"
7571                 test "$cf_cv_ncurses_h2" != no && break
7572         done
7573         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7573: error: not found" >&5
7574 echo "$as_me: error: not found" >&2;}
7575    { (exit 1); exit 1; }; }
7576
7577 fi
7578 echo "$as_me:7578: result: $cf_cv_ncurses_h2" >&5
7579 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7580
7581         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7582         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7583         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7584                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7585         fi
7586
7587 if test -n "$cf_1st_incdir" ; then
7588   for cf_add_incdir in $cf_1st_incdir
7589   do
7590         while test $cf_add_incdir != /usr/include
7591         do
7592           if test -d $cf_add_incdir
7593           then
7594                 cf_have_incdir=no
7595                 if test -n "$CFLAGS$CPPFLAGS" ; then
7596                   # a loop is needed to ensure we can add subdirs of existing dirs
7597                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7598                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7599                           cf_have_incdir=yes; break
7600                         fi
7601                   done
7602                 fi
7603
7604                 if test "$cf_have_incdir" = no ; then
7605                   if test "$cf_add_incdir" = /usr/local/include ; then
7606                         if test "$GCC" = yes
7607                         then
7608                           cf_save_CPPFLAGS=$CPPFLAGS
7609                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7610                           cat >conftest.$ac_ext <<_ACEOF
7611 #line 7611 "configure"
7612 #include "confdefs.h"
7613 #include <stdio.h>
7614 int
7615 main ()
7616 {
7617 printf("Hello")
7618   ;
7619   return 0;
7620 }
7621 _ACEOF
7622 rm -f conftest.$ac_objext
7623 if { (eval echo "$as_me:7623: \"$ac_compile\"") >&5
7624   (eval $ac_compile) 2>&5
7625   ac_status=$?
7626   echo "$as_me:7626: \$? = $ac_status" >&5
7627   (exit $ac_status); } &&
7628          { ac_try='test -s conftest.$ac_objext'
7629   { (eval echo "$as_me:7629: \"$ac_try\"") >&5
7630   (eval $ac_try) 2>&5
7631   ac_status=$?
7632   echo "$as_me:7632: \$? = $ac_status" >&5
7633   (exit $ac_status); }; }; then
7634   :
7635 else
7636   echo "$as_me: failed program was:" >&5
7637 cat conftest.$ac_ext >&5
7638 cf_have_incdir=yes
7639 fi
7640 rm -f conftest.$ac_objext conftest.$ac_ext
7641                           CPPFLAGS=$cf_save_CPPFLAGS
7642                         fi
7643                   fi
7644                 fi
7645
7646                 if test "$cf_have_incdir" = no ; then
7647                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7648
7649 echo "${as_me:-configure}:7649: testing adding $cf_add_incdir to include-path ..." 1>&5
7650
7651                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7652
7653                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7654                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7655                   cf_add_incdir="$cf_top_incdir"
7656                 else
7657                   break
7658                 fi
7659           fi
7660         done
7661   done
7662 fi
7663
7664 fi
7665
7666 # Set definitions to allow ifdef'ing for ncurses.h
7667
7668 case $cf_cv_ncurses_header in # (vi
7669 *ncurses.h)
7670         cat >>confdefs.h <<\EOF
7671 #define HAVE_NCURSES_H 1
7672 EOF
7673
7674         ;;
7675 esac
7676
7677 case $cf_cv_ncurses_header in # (vi
7678 ncurses/curses.h|ncurses/ncurses.h)
7679         cat >>confdefs.h <<\EOF
7680 #define HAVE_NCURSES_NCURSES_H 1
7681 EOF
7682
7683         ;;
7684 ncursesw/curses.h|ncursesw/ncurses.h)
7685         cat >>confdefs.h <<\EOF
7686 #define HAVE_NCURSESW_NCURSES_H 1
7687 EOF
7688
7689         ;;
7690 esac
7691
7692 echo "$as_me:7692: checking for terminfo header" >&5
7693 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7694 if test "${cf_cv_term_header+set}" = set; then
7695   echo $ECHO_N "(cached) $ECHO_C" >&6
7696 else
7697
7698 case ${cf_cv_ncurses_header} in #(vi
7699 */ncurses.h|*/ncursesw.h) #(vi
7700         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7701         ;;
7702 *)
7703         cf_term_header=term.h
7704         ;;
7705 esac
7706
7707 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7708 do
7709 cat >conftest.$ac_ext <<_ACEOF
7710 #line 7710 "configure"
7711 #include "confdefs.h"
7712 #include <stdio.h>
7713 #include <${cf_cv_ncurses_header:-curses.h}>
7714 #include <$cf_test>
7715
7716 int
7717 main ()
7718 {
7719 int x = auto_left_margin
7720   ;
7721   return 0;
7722 }
7723 _ACEOF
7724 rm -f conftest.$ac_objext
7725 if { (eval echo "$as_me:7725: \"$ac_compile\"") >&5
7726   (eval $ac_compile) 2>&5
7727   ac_status=$?
7728   echo "$as_me:7728: \$? = $ac_status" >&5
7729   (exit $ac_status); } &&
7730          { ac_try='test -s conftest.$ac_objext'
7731   { (eval echo "$as_me:7731: \"$ac_try\"") >&5
7732   (eval $ac_try) 2>&5
7733   ac_status=$?
7734   echo "$as_me:7734: \$? = $ac_status" >&5
7735   (exit $ac_status); }; }; then
7736
7737         cf_cv_term_header="$cf_test"
7738 else
7739   echo "$as_me: failed program was:" >&5
7740 cat conftest.$ac_ext >&5
7741
7742         cf_cv_term_header=unknown
7743
7744 fi
7745 rm -f conftest.$ac_objext conftest.$ac_ext
7746         test "$cf_cv_term_header" != unknown && break
7747 done
7748
7749 fi
7750 echo "$as_me:7750: result: $cf_cv_term_header" >&5
7751 echo "${ECHO_T}$cf_cv_term_header" >&6
7752
7753 # Set definitions to allow ifdef'ing to accommodate subdirectories
7754
7755 case $cf_cv_term_header in # (vi
7756 *term.h)
7757         cat >>confdefs.h <<\EOF
7758 #define HAVE_TERM_H 1
7759 EOF
7760
7761         ;;
7762 esac
7763
7764 case $cf_cv_term_header in # (vi
7765 ncurses/term.h) #(vi
7766         cat >>confdefs.h <<\EOF
7767 #define HAVE_NCURSES_TERM_H 1
7768 EOF
7769
7770         ;;
7771 ncursesw/term.h)
7772         cat >>confdefs.h <<\EOF
7773 #define HAVE_NCURSESW_TERM_H 1
7774 EOF
7775
7776         ;;
7777 esac
7778
7779 # some applications need this, but should check for NCURSES_VERSION
7780 cat >>confdefs.h <<\EOF
7781 #define NCURSES 1
7782 EOF
7783
7784 echo "$as_me:7784: checking for ncurses version" >&5
7785 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7786 if test "${cf_cv_ncurses_version+set}" = set; then
7787   echo $ECHO_N "(cached) $ECHO_C" >&6
7788 else
7789
7790         cf_cv_ncurses_version=no
7791         cf_tempfile=out$$
7792         rm -f $cf_tempfile
7793         if test "$cross_compiling" = yes; then
7794
7795         # This will not work if the preprocessor splits the line after the
7796         # Autoconf token.  The 'unproto' program does that.
7797         cat > conftest.$ac_ext <<EOF
7798 #include <${cf_cv_ncurses_header:-curses.h}>
7799 #undef Autoconf
7800 #ifdef NCURSES_VERSION
7801 Autoconf NCURSES_VERSION
7802 #else
7803 #ifdef __NCURSES_H
7804 Autoconf "old"
7805 #endif
7806 ;
7807 #endif
7808 EOF
7809         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7810         { (eval echo "$as_me:7810: \"$cf_try\"") >&5
7811   (eval $cf_try) 2>&5
7812   ac_status=$?
7813   echo "$as_me:7813: \$? = $ac_status" >&5
7814   (exit $ac_status); }
7815         if test -f conftest.out ; then
7816                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7817                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7818                 rm -f conftest.out
7819         fi
7820
7821 else
7822   cat >conftest.$ac_ext <<_ACEOF
7823 #line 7823 "configure"
7824 #include "confdefs.h"
7825
7826 #include <${cf_cv_ncurses_header:-curses.h}>
7827 #include <stdio.h>
7828 int main()
7829 {
7830         FILE *fp = fopen("$cf_tempfile", "w");
7831 #ifdef NCURSES_VERSION
7832 # ifdef NCURSES_VERSION_PATCH
7833         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7834 # else
7835         fprintf(fp, "%s\n", NCURSES_VERSION);
7836 # endif
7837 #else
7838 # ifdef __NCURSES_H
7839         fprintf(fp, "old\n");
7840 # else
7841         make an error
7842 # endif
7843 #endif
7844         ${cf_cv_main_return:-return}(0);
7845 }
7846 _ACEOF
7847 rm -f conftest$ac_exeext
7848 if { (eval echo "$as_me:7848: \"$ac_link\"") >&5
7849   (eval $ac_link) 2>&5
7850   ac_status=$?
7851   echo "$as_me:7851: \$? = $ac_status" >&5
7852   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7853   { (eval echo "$as_me:7853: \"$ac_try\"") >&5
7854   (eval $ac_try) 2>&5
7855   ac_status=$?
7856   echo "$as_me:7856: \$? = $ac_status" >&5
7857   (exit $ac_status); }; }; then
7858
7859         cf_cv_ncurses_version=`cat $cf_tempfile`
7860 else
7861   echo "$as_me: program exited with status $ac_status" >&5
7862 echo "$as_me: failed program was:" >&5
7863 cat conftest.$ac_ext >&5
7864 fi
7865 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7866 fi
7867         rm -f $cf_tempfile
7868
7869 fi
7870 echo "$as_me:7870: result: $cf_cv_ncurses_version" >&5
7871 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7872 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
7873 #define NCURSES 1
7874 EOF
7875
7876 cf_nculib_root=ncursesw
7877         # This works, except for the special case where we find gpm, but
7878         # ncurses is in a nonstandard location via $LIBS, and we really want
7879         # to link gpm.
7880 cf_ncurses_LIBS=""
7881 cf_ncurses_SAVE="$LIBS"
7882 echo "$as_me:7882: checking for Gpm_Open in -lgpm" >&5
7883 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7884 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7885   echo $ECHO_N "(cached) $ECHO_C" >&6
7886 else
7887   ac_check_lib_save_LIBS=$LIBS
7888 LIBS="-lgpm  $LIBS"
7889 cat >conftest.$ac_ext <<_ACEOF
7890 #line 7890 "configure"
7891 #include "confdefs.h"
7892
7893 /* Override any gcc2 internal prototype to avoid an error.  */
7894 #ifdef __cplusplus
7895 extern "C"
7896 #endif
7897 /* We use char because int might match the return type of a gcc2
7898    builtin and then its argument prototype would still apply.  */
7899 char Gpm_Open ();
7900 int
7901 main ()
7902 {
7903 Gpm_Open ();
7904   ;
7905   return 0;
7906 }
7907 _ACEOF
7908 rm -f conftest.$ac_objext conftest$ac_exeext
7909 if { (eval echo "$as_me:7909: \"$ac_link\"") >&5
7910   (eval $ac_link) 2>&5
7911   ac_status=$?
7912   echo "$as_me:7912: \$? = $ac_status" >&5
7913   (exit $ac_status); } &&
7914          { ac_try='test -s conftest$ac_exeext'
7915   { (eval echo "$as_me:7915: \"$ac_try\"") >&5
7916   (eval $ac_try) 2>&5
7917   ac_status=$?
7918   echo "$as_me:7918: \$? = $ac_status" >&5
7919   (exit $ac_status); }; }; then
7920   ac_cv_lib_gpm_Gpm_Open=yes
7921 else
7922   echo "$as_me: failed program was:" >&5
7923 cat conftest.$ac_ext >&5
7924 ac_cv_lib_gpm_Gpm_Open=no
7925 fi
7926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7927 LIBS=$ac_check_lib_save_LIBS
7928 fi
7929 echo "$as_me:7929: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7930 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7931 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7932   echo "$as_me:7932: checking for initscr in -lgpm" >&5
7933 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7934 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7935   echo $ECHO_N "(cached) $ECHO_C" >&6
7936 else
7937   ac_check_lib_save_LIBS=$LIBS
7938 LIBS="-lgpm  $LIBS"
7939 cat >conftest.$ac_ext <<_ACEOF
7940 #line 7940 "configure"
7941 #include "confdefs.h"
7942
7943 /* Override any gcc2 internal prototype to avoid an error.  */
7944 #ifdef __cplusplus
7945 extern "C"
7946 #endif
7947 /* We use char because int might match the return type of a gcc2
7948    builtin and then its argument prototype would still apply.  */
7949 char initscr ();
7950 int
7951 main ()
7952 {
7953 initscr ();
7954   ;
7955   return 0;
7956 }
7957 _ACEOF
7958 rm -f conftest.$ac_objext conftest$ac_exeext
7959 if { (eval echo "$as_me:7959: \"$ac_link\"") >&5
7960   (eval $ac_link) 2>&5
7961   ac_status=$?
7962   echo "$as_me:7962: \$? = $ac_status" >&5
7963   (exit $ac_status); } &&
7964          { ac_try='test -s conftest$ac_exeext'
7965   { (eval echo "$as_me:7965: \"$ac_try\"") >&5
7966   (eval $ac_try) 2>&5
7967   ac_status=$?
7968   echo "$as_me:7968: \$? = $ac_status" >&5
7969   (exit $ac_status); }; }; then
7970   ac_cv_lib_gpm_initscr=yes
7971 else
7972   echo "$as_me: failed program was:" >&5
7973 cat conftest.$ac_ext >&5
7974 ac_cv_lib_gpm_initscr=no
7975 fi
7976 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7977 LIBS=$ac_check_lib_save_LIBS
7978 fi
7979 echo "$as_me:7979: result: $ac_cv_lib_gpm_initscr" >&5
7980 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7981 if test $ac_cv_lib_gpm_initscr = yes; then
7982   LIBS="$cf_ncurses_SAVE"
7983 else
7984   cf_ncurses_LIBS="-lgpm"
7985 fi
7986
7987 fi
7988
7989 case $host_os in #(vi
7990 freebsd*)
7991         # This is only necessary if you are linking against an obsolete
7992         # version of ncurses (but it should do no harm, since it's static).
7993         if test "$cf_nculib_root" = ncurses ; then
7994                 echo "$as_me:7994: checking for tgoto in -lmytinfo" >&5
7995 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7996 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7997   echo $ECHO_N "(cached) $ECHO_C" >&6
7998 else
7999   ac_check_lib_save_LIBS=$LIBS
8000 LIBS="-lmytinfo  $LIBS"
8001 cat >conftest.$ac_ext <<_ACEOF
8002 #line 8002 "configure"
8003 #include "confdefs.h"
8004
8005 /* Override any gcc2 internal prototype to avoid an error.  */
8006 #ifdef __cplusplus
8007 extern "C"
8008 #endif
8009 /* We use char because int might match the return type of a gcc2
8010    builtin and then its argument prototype would still apply.  */
8011 char tgoto ();
8012 int
8013 main ()
8014 {
8015 tgoto ();
8016   ;
8017   return 0;
8018 }
8019 _ACEOF
8020 rm -f conftest.$ac_objext conftest$ac_exeext
8021 if { (eval echo "$as_me:8021: \"$ac_link\"") >&5
8022   (eval $ac_link) 2>&5
8023   ac_status=$?
8024   echo "$as_me:8024: \$? = $ac_status" >&5
8025   (exit $ac_status); } &&
8026          { ac_try='test -s conftest$ac_exeext'
8027   { (eval echo "$as_me:8027: \"$ac_try\"") >&5
8028   (eval $ac_try) 2>&5
8029   ac_status=$?
8030   echo "$as_me:8030: \$? = $ac_status" >&5
8031   (exit $ac_status); }; }; then
8032   ac_cv_lib_mytinfo_tgoto=yes
8033 else
8034   echo "$as_me: failed program was:" >&5
8035 cat conftest.$ac_ext >&5
8036 ac_cv_lib_mytinfo_tgoto=no
8037 fi
8038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8039 LIBS=$ac_check_lib_save_LIBS
8040 fi
8041 echo "$as_me:8041: result: $ac_cv_lib_mytinfo_tgoto" >&5
8042 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8043 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8044   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8045 fi
8046
8047         fi
8048         ;;
8049 esac
8050
8051 LIBS="$cf_ncurses_LIBS $LIBS"
8052
8053 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8054 then
8055
8056 if test -n "$cf_cv_curses_dir/lib" ; then
8057   for cf_add_libdir in $cf_cv_curses_dir/lib
8058   do
8059     if test $cf_add_libdir = /usr/lib ; then
8060       :
8061     elif test -d $cf_add_libdir
8062     then
8063       cf_have_libdir=no
8064       if test -n "$LDFLAGS$LIBS" ; then
8065         # a loop is needed to ensure we can add subdirs of existing dirs
8066         for cf_test_libdir in $LDFLAGS $LIBS ; do
8067           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8068             cf_have_libdir=yes; break
8069           fi
8070         done
8071       fi
8072       if test "$cf_have_libdir" = no ; then
8073         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8074
8075 echo "${as_me:-configure}:8075: testing adding $cf_add_libdir to library-path ..." 1>&5
8076
8077         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8078       fi
8079     fi
8080   done
8081 fi
8082
8083         LIBS="-l$cf_nculib_root $LIBS"
8084 else
8085
8086         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8087         cf_libdir=""
8088         echo "$as_me:8088: checking for initscr" >&5
8089 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8090 if test "${ac_cv_func_initscr+set}" = set; then
8091   echo $ECHO_N "(cached) $ECHO_C" >&6
8092 else
8093   cat >conftest.$ac_ext <<_ACEOF
8094 #line 8094 "configure"
8095 #include "confdefs.h"
8096 /* System header to define __stub macros and hopefully few prototypes,
8097     which can conflict with char initscr (); below.  */
8098 #include <assert.h>
8099 /* Override any gcc2 internal prototype to avoid an error.  */
8100 #ifdef __cplusplus
8101 extern "C"
8102 #endif
8103 /* We use char because int might match the return type of a gcc2
8104    builtin and then its argument prototype would still apply.  */
8105 char initscr ();
8106 char (*f) ();
8107
8108 int
8109 main ()
8110 {
8111 /* The GNU C library defines this for functions which it implements
8112     to always fail with ENOSYS.  Some functions are actually named
8113     something starting with __ and the normal name is an alias.  */
8114 #if defined (__stub_initscr) || defined (__stub___initscr)
8115 choke me
8116 #else
8117 f = initscr;
8118 #endif
8119
8120   ;
8121   return 0;
8122 }
8123 _ACEOF
8124 rm -f conftest.$ac_objext conftest$ac_exeext
8125 if { (eval echo "$as_me:8125: \"$ac_link\"") >&5
8126   (eval $ac_link) 2>&5
8127   ac_status=$?
8128   echo "$as_me:8128: \$? = $ac_status" >&5
8129   (exit $ac_status); } &&
8130          { ac_try='test -s conftest$ac_exeext'
8131   { (eval echo "$as_me:8131: \"$ac_try\"") >&5
8132   (eval $ac_try) 2>&5
8133   ac_status=$?
8134   echo "$as_me:8134: \$? = $ac_status" >&5
8135   (exit $ac_status); }; }; then
8136   ac_cv_func_initscr=yes
8137 else
8138   echo "$as_me: failed program was:" >&5
8139 cat conftest.$ac_ext >&5
8140 ac_cv_func_initscr=no
8141 fi
8142 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8143 fi
8144 echo "$as_me:8144: result: $ac_cv_func_initscr" >&5
8145 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8146 if test $ac_cv_func_initscr = yes; then
8147   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8148 else
8149
8150                 cf_save_LIBS="$LIBS"
8151                 echo "$as_me:8151: checking for initscr in -l$cf_nculib_root" >&5
8152 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8153                 LIBS="-l$cf_nculib_root $LIBS"
8154                 cat >conftest.$ac_ext <<_ACEOF
8155 #line 8155 "configure"
8156 #include "confdefs.h"
8157 #include <${cf_cv_ncurses_header:-curses.h}>
8158 int
8159 main ()
8160 {
8161 initscr()
8162   ;
8163   return 0;
8164 }
8165 _ACEOF
8166 rm -f conftest.$ac_objext conftest$ac_exeext
8167 if { (eval echo "$as_me:8167: \"$ac_link\"") >&5
8168   (eval $ac_link) 2>&5
8169   ac_status=$?
8170   echo "$as_me:8170: \$? = $ac_status" >&5
8171   (exit $ac_status); } &&
8172          { ac_try='test -s conftest$ac_exeext'
8173   { (eval echo "$as_me:8173: \"$ac_try\"") >&5
8174   (eval $ac_try) 2>&5
8175   ac_status=$?
8176   echo "$as_me:8176: \$? = $ac_status" >&5
8177   (exit $ac_status); }; }; then
8178   echo "$as_me:8178: result: yes" >&5
8179 echo "${ECHO_T}yes" >&6
8180                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8181
8182 else
8183   echo "$as_me: failed program was:" >&5
8184 cat conftest.$ac_ext >&5
8185 echo "$as_me:8185: result: no" >&5
8186 echo "${ECHO_T}no" >&6
8187
8188 cf_search=
8189 cf_library_path_list=""
8190 if test -n "${LDFLAGS}${LIBS}" ; then
8191         for cf_library_path in $LDFLAGS $LIBS
8192         do
8193                 case $cf_library_path in #(vi
8194                 -L*)
8195                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8196
8197 test "$cf_library_path" != "NONE" && \
8198 test -d "$cf_library_path" && \
8199  {
8200         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8201         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8202         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8203         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8204         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8205         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"
8206 }
8207
8208                         cf_library_path_list="$cf_library_path_list $cf_search"
8209                         ;;
8210                 esac
8211         done
8212 fi
8213
8214 cf_search=
8215
8216 test "/usr" != "$prefix" && \
8217 test -d "/usr" && \
8218 (test $prefix = NONE || test "/usr" != "$prefix") && {
8219         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8220         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8221         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8222         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8223         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8224         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8225 }
8226
8227 test "$prefix" != "NONE" && \
8228 test -d "$prefix" && \
8229  {
8230         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8231         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8232         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8233         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8234         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8235         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8236 }
8237
8238 test "/usr/local" != "$prefix" && \
8239 test -d "/usr/local" && \
8240 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8241         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8242         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8243         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8244         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8245         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8246         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8247 }
8248
8249 test "/opt" != "$prefix" && \
8250 test -d "/opt" && \
8251 (test $prefix = NONE || test "/opt" != "$prefix") && {
8252         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8253         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8254         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8255         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8256         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8257         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8258 }
8259
8260 test "$HOME" != "$prefix" && \
8261 test -d "$HOME" && \
8262 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8263         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8264         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8265         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8266         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8267         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8268         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8269 }
8270
8271 cf_search="$cf_library_path_list $cf_search"
8272
8273                         for cf_libdir in $cf_search
8274                         do
8275                                 echo "$as_me:8275: checking for -l$cf_nculib_root in $cf_libdir" >&5
8276 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8277                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8278                                 cat >conftest.$ac_ext <<_ACEOF
8279 #line 8279 "configure"
8280 #include "confdefs.h"
8281 #include <${cf_cv_ncurses_header:-curses.h}>
8282 int
8283 main ()
8284 {
8285 initscr()
8286   ;
8287   return 0;
8288 }
8289 _ACEOF
8290 rm -f conftest.$ac_objext conftest$ac_exeext
8291 if { (eval echo "$as_me:8291: \"$ac_link\"") >&5
8292   (eval $ac_link) 2>&5
8293   ac_status=$?
8294   echo "$as_me:8294: \$? = $ac_status" >&5
8295   (exit $ac_status); } &&
8296          { ac_try='test -s conftest$ac_exeext'
8297   { (eval echo "$as_me:8297: \"$ac_try\"") >&5
8298   (eval $ac_try) 2>&5
8299   ac_status=$?
8300   echo "$as_me:8300: \$? = $ac_status" >&5
8301   (exit $ac_status); }; }; then
8302   echo "$as_me:8302: result: yes" >&5
8303 echo "${ECHO_T}yes" >&6
8304                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8305                                          break
8306 else
8307   echo "$as_me: failed program was:" >&5
8308 cat conftest.$ac_ext >&5
8309 echo "$as_me:8309: result: no" >&5
8310 echo "${ECHO_T}no" >&6
8311                                          LIBS="$cf_save_LIBS"
8312 fi
8313 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8314                         done
8315
8316 fi
8317 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8318
8319 fi
8320
8321 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8322
8323 if test $cf_found_library = no ; then
8324         { { echo "$as_me:8324: error: Cannot link $cf_nculib_root library" >&5
8325 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8326    { (exit 1); exit 1; }; }
8327 fi
8328
8329 fi
8330
8331 if test -n "$cf_ncurses_LIBS" ; then
8332         echo "$as_me:8332: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8333 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8334         cf_ncurses_SAVE="$LIBS"
8335         for p in $cf_ncurses_LIBS ; do
8336                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8337                 if test "$q" != "$LIBS" ; then
8338                         LIBS="$q"
8339                 fi
8340         done
8341         cat >conftest.$ac_ext <<_ACEOF
8342 #line 8342 "configure"
8343 #include "confdefs.h"
8344 #include <${cf_cv_ncurses_header:-curses.h}>
8345 int
8346 main ()
8347 {
8348 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8349   ;
8350   return 0;
8351 }
8352 _ACEOF
8353 rm -f conftest.$ac_objext conftest$ac_exeext
8354 if { (eval echo "$as_me:8354: \"$ac_link\"") >&5
8355   (eval $ac_link) 2>&5
8356   ac_status=$?
8357   echo "$as_me:8357: \$? = $ac_status" >&5
8358   (exit $ac_status); } &&
8359          { ac_try='test -s conftest$ac_exeext'
8360   { (eval echo "$as_me:8360: \"$ac_try\"") >&5
8361   (eval $ac_try) 2>&5
8362   ac_status=$?
8363   echo "$as_me:8363: \$? = $ac_status" >&5
8364   (exit $ac_status); }; }; then
8365   echo "$as_me:8365: result: yes" >&5
8366 echo "${ECHO_T}yes" >&6
8367 else
8368   echo "$as_me: failed program was:" >&5
8369 cat conftest.$ac_ext >&5
8370 echo "$as_me:8370: result: no" >&5
8371 echo "${ECHO_T}no" >&6
8372                  LIBS="$cf_ncurses_SAVE"
8373 fi
8374 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8375 fi
8376
8377 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8378
8379 cat >>confdefs.h <<EOF
8380 #define $cf_nculib_ROOT 1
8381 EOF
8382
8383 fi
8384
8385         ;;
8386 pdcurses) #(vi
8387
8388 echo "$as_me:8388: checking if you want to use pkg-config" >&5
8389 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
8390
8391 # Check whether --with-pkg-config or --without-pkg-config was given.
8392 if test "${with_pkg_config+set}" = set; then
8393   withval="$with_pkg_config"
8394   cf_pkg_config=$withval
8395 else
8396   cf_pkg_config=yes
8397 fi;
8398 echo "$as_me:8398: result: $cf_pkg_config" >&5
8399 echo "${ECHO_T}$cf_pkg_config" >&6
8400
8401 case $cf_pkg_config in #(vi
8402 no) #(vi
8403         PKG_CONFIG=none
8404         ;;
8405 yes) #(vi
8406         # Extract the first word of "pkg-config", so it can be a program name with args.
8407 set dummy pkg-config; ac_word=$2
8408 echo "$as_me:8408: checking for $ac_word" >&5
8409 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8410 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
8411   echo $ECHO_N "(cached) $ECHO_C" >&6
8412 else
8413   case $PKG_CONFIG in
8414   [\\/]* | ?:[\\/]*)
8415   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
8416   ;;
8417   *)
8418   ac_save_IFS=$IFS; IFS=$ac_path_separator
8419 ac_dummy="$PATH"
8420 for ac_dir in $ac_dummy; do
8421   IFS=$ac_save_IFS
8422   test -z "$ac_dir" && ac_dir=.
8423   if $as_executable_p "$ac_dir/$ac_word"; then
8424    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
8425    echo "$as_me:8425: found $ac_dir/$ac_word" >&5
8426    break
8427 fi
8428 done
8429
8430   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
8431   ;;
8432 esac
8433 fi
8434 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
8435
8436 if test -n "$PKG_CONFIG"; then
8437   echo "$as_me:8437: result: $PKG_CONFIG" >&5
8438 echo "${ECHO_T}$PKG_CONFIG" >&6
8439 else
8440   echo "$as_me:8440: result: no" >&5
8441 echo "${ECHO_T}no" >&6
8442 fi
8443
8444         ;;
8445 *)
8446         PKG_CONFIG=$withval
8447         ;;
8448 esac
8449
8450 test -z "$PKG_CONFIG" && PKG_CONFIG=none
8451 if test "$PKG_CONFIG" != none ; then
8452
8453 if test "x$prefix" != xNONE; then
8454   cf_path_syntax="$prefix"
8455 else
8456   cf_path_syntax="$ac_default_prefix"
8457 fi
8458
8459 case ".$PKG_CONFIG" in #(vi
8460 .\$\(*\)*|.\'*\'*) #(vi
8461   ;;
8462 ..|./*|.\\*) #(vi
8463   ;;
8464 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
8465   ;;
8466 .\${*prefix}*) #(vi
8467   eval PKG_CONFIG="$PKG_CONFIG"
8468   case ".$PKG_CONFIG" in #(vi
8469   .NONE/*)
8470     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
8471     ;;
8472   esac
8473   ;; #(vi
8474 .no|.NONE/*)
8475   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
8476   ;;
8477 *)
8478   { { echo "$as_me:8478: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
8479 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
8480    { (exit 1); exit 1; }; }
8481   ;;
8482 esac
8483
8484 fi
8485
8486 echo "$as_me:8486: checking for X" >&5
8487 echo $ECHO_N "checking for X... $ECHO_C" >&6
8488
8489 # Check whether --with-x or --without-x was given.
8490 if test "${with_x+set}" = set; then
8491   withval="$with_x"
8492
8493 fi;
8494 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8495 if test "x$with_x" = xno; then
8496   # The user explicitly disabled X.
8497   have_x=disabled
8498 else
8499   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8500     # Both variables are already set.
8501     have_x=yes
8502   else
8503     if test "${ac_cv_have_x+set}" = set; then
8504   echo $ECHO_N "(cached) $ECHO_C" >&6
8505 else
8506   # One or both of the vars are not set, and there is no cached value.
8507 ac_x_includes=no ac_x_libraries=no
8508 rm -fr conftest.dir
8509 if mkdir conftest.dir; then
8510   cd conftest.dir
8511   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8512   cat >Imakefile <<'EOF'
8513 acfindx:
8514         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8515 EOF
8516   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8517     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8518     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8519     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8520     for ac_extension in a so sl dylib dll; do
8521       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8522          test -f $ac_im_libdir/libX11.$ac_extension; then
8523         ac_im_usrlibdir=$ac_im_libdir; break
8524       fi
8525     done
8526     # Screen out bogus values from the imake configuration.  They are
8527     # bogus both because they are the default anyway, and because
8528     # using them would break gcc on systems where it needs fixed includes.
8529     case $ac_im_incroot in
8530         /usr/include) ;;
8531         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
8532     esac
8533     case $ac_im_usrlibdir in
8534         /usr/lib | /lib) ;;
8535         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
8536     esac
8537   fi
8538   cd ..
8539   rm -fr conftest.dir
8540 fi
8541
8542 # Standard set of common directories for X headers.
8543 # Check X11 before X11Rn because it is often a symlink to the current release.
8544 ac_x_header_dirs='
8545 /usr/X11/include
8546 /usr/X11R6/include
8547 /usr/X11R5/include
8548 /usr/X11R4/include
8549
8550 /usr/include/X11
8551 /usr/include/X11R6
8552 /usr/include/X11R5
8553 /usr/include/X11R4
8554
8555 /usr/local/X11/include
8556 /usr/local/X11R6/include
8557 /usr/local/X11R5/include
8558 /usr/local/X11R4/include
8559
8560 /usr/local/include/X11
8561 /usr/local/include/X11R6
8562 /usr/local/include/X11R5
8563 /usr/local/include/X11R4
8564
8565 /usr/X386/include
8566 /usr/x386/include
8567 /usr/XFree86/include/X11
8568
8569 /usr/include
8570 /usr/local/include
8571 /usr/unsupported/include
8572 /usr/athena/include
8573 /usr/local/x11r5/include
8574 /usr/lpp/Xamples/include
8575
8576 /usr/openwin/include
8577 /usr/openwin/share/include'
8578
8579 if test "$ac_x_includes" = no; then
8580   # Guess where to find include files, by looking for Intrinsic.h.
8581   # First, try using that file with no special directory specified.
8582   cat >conftest.$ac_ext <<_ACEOF
8583 #line 8583 "configure"
8584 #include "confdefs.h"
8585 #include <X11/Intrinsic.h>
8586 _ACEOF
8587 if { (eval echo "$as_me:8587: \"$ac_cpp conftest.$ac_ext\"") >&5
8588   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8589   ac_status=$?
8590   egrep -v '^ *\+' conftest.er1 >conftest.err
8591   rm -f conftest.er1
8592   cat conftest.err >&5
8593   echo "$as_me:8593: \$? = $ac_status" >&5
8594   (exit $ac_status); } >/dev/null; then
8595   if test -s conftest.err; then
8596     ac_cpp_err=$ac_c_preproc_warn_flag
8597   else
8598     ac_cpp_err=
8599   fi
8600 else
8601   ac_cpp_err=yes
8602 fi
8603 if test -z "$ac_cpp_err"; then
8604   # We can compile using X headers with no special include directory.
8605 ac_x_includes=
8606 else
8607   echo "$as_me: failed program was:" >&5
8608   cat conftest.$ac_ext >&5
8609   for ac_dir in $ac_x_header_dirs; do
8610   if test -r "$ac_dir/X11/Intrinsic.h"; then
8611     ac_x_includes=$ac_dir
8612     break
8613   fi
8614 done
8615 fi
8616 rm -f conftest.err conftest.$ac_ext
8617 fi # $ac_x_includes = no
8618
8619 if test "$ac_x_libraries" = no; then
8620   # Check for the libraries.
8621   # See if we find them without any special options.
8622   # Don't add to $LIBS permanently.
8623   ac_save_LIBS=$LIBS
8624   LIBS="-lXt $LIBS"
8625   cat >conftest.$ac_ext <<_ACEOF
8626 #line 8626 "configure"
8627 #include "confdefs.h"
8628 #include <X11/Intrinsic.h>
8629 int
8630 main ()
8631 {
8632 XtMalloc (0)
8633   ;
8634   return 0;
8635 }
8636 _ACEOF
8637 rm -f conftest.$ac_objext conftest$ac_exeext
8638 if { (eval echo "$as_me:8638: \"$ac_link\"") >&5
8639   (eval $ac_link) 2>&5
8640   ac_status=$?
8641   echo "$as_me:8641: \$? = $ac_status" >&5
8642   (exit $ac_status); } &&
8643          { ac_try='test -s conftest$ac_exeext'
8644   { (eval echo "$as_me:8644: \"$ac_try\"") >&5
8645   (eval $ac_try) 2>&5
8646   ac_status=$?
8647   echo "$as_me:8647: \$? = $ac_status" >&5
8648   (exit $ac_status); }; }; then
8649   LIBS=$ac_save_LIBS
8650 # We can link X programs with no special library path.
8651 ac_x_libraries=
8652 else
8653   echo "$as_me: failed program was:" >&5
8654 cat conftest.$ac_ext >&5
8655 LIBS=$ac_save_LIBS
8656 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
8657 do
8658   # Don't even attempt the hair of trying to link an X program!
8659   for ac_extension in a so sl dylib dll; do
8660     if test -r $ac_dir/libXt.$ac_extension; then
8661       ac_x_libraries=$ac_dir
8662       break 2
8663     fi
8664   done
8665 done
8666 fi
8667 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8668 fi # $ac_x_libraries = no
8669
8670 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
8671   # Didn't find X anywhere.  Cache the known absence of X.
8672   ac_cv_have_x="have_x=no"
8673 else
8674   # Record where we found X for the cache.
8675   ac_cv_have_x="have_x=yes \
8676                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
8677 fi
8678 fi
8679
8680   fi
8681   eval "$ac_cv_have_x"
8682 fi # $with_x != no
8683
8684 if test "$have_x" != yes; then
8685   echo "$as_me:8685: result: $have_x" >&5
8686 echo "${ECHO_T}$have_x" >&6
8687   no_x=yes
8688 else
8689   # If each of the values was on the command line, it overrides each guess.
8690   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
8691   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
8692   # Update the cache value to reflect the command line values.
8693   ac_cv_have_x="have_x=yes \
8694                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
8695   echo "$as_me:8695: result: libraries $x_libraries, headers $x_includes" >&5
8696 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
8697 fi
8698
8699 if test "$no_x" = yes; then
8700   # Not all programs may use this symbol, but it does not hurt to define it.
8701
8702 cat >>confdefs.h <<\EOF
8703 #define X_DISPLAY_MISSING 1
8704 EOF
8705
8706   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
8707 else
8708   if test -n "$x_includes"; then
8709     X_CFLAGS="$X_CFLAGS -I$x_includes"
8710   fi
8711
8712   # It would also be nice to do this for all -L options, not just this one.
8713   if test -n "$x_libraries"; then
8714     X_LIBS="$X_LIBS -L$x_libraries"
8715     # For Solaris; some versions of Sun CC require a space after -R and
8716     # others require no space.  Words are not sufficient . . . .
8717     case `(uname -sr) 2>/dev/null` in
8718     "SunOS 5"*)
8719       echo "$as_me:8719: checking whether -R must be followed by a space" >&5
8720 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
8721       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
8722       cat >conftest.$ac_ext <<_ACEOF
8723 #line 8723 "configure"
8724 #include "confdefs.h"
8725
8726 int
8727 main ()
8728 {
8729
8730   ;
8731   return 0;
8732 }
8733 _ACEOF
8734 rm -f conftest.$ac_objext conftest$ac_exeext
8735 if { (eval echo "$as_me:8735: \"$ac_link\"") >&5
8736   (eval $ac_link) 2>&5
8737   ac_status=$?
8738   echo "$as_me:8738: \$? = $ac_status" >&5
8739   (exit $ac_status); } &&
8740          { ac_try='test -s conftest$ac_exeext'
8741   { (eval echo "$as_me:8741: \"$ac_try\"") >&5
8742   (eval $ac_try) 2>&5
8743   ac_status=$?
8744   echo "$as_me:8744: \$? = $ac_status" >&5
8745   (exit $ac_status); }; }; then
8746   ac_R_nospace=yes
8747 else
8748   echo "$as_me: failed program was:" >&5
8749 cat conftest.$ac_ext >&5
8750 ac_R_nospace=no
8751 fi
8752 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8753       if test $ac_R_nospace = yes; then
8754         echo "$as_me:8754: result: no" >&5
8755 echo "${ECHO_T}no" >&6
8756         X_LIBS="$X_LIBS -R$x_libraries"
8757       else
8758         LIBS="$ac_xsave_LIBS -R $x_libraries"
8759         cat >conftest.$ac_ext <<_ACEOF
8760 #line 8760 "configure"
8761 #include "confdefs.h"
8762
8763 int
8764 main ()
8765 {
8766
8767   ;
8768   return 0;
8769 }
8770 _ACEOF
8771 rm -f conftest.$ac_objext conftest$ac_exeext
8772 if { (eval echo "$as_me:8772: \"$ac_link\"") >&5
8773   (eval $ac_link) 2>&5
8774   ac_status=$?
8775   echo "$as_me:8775: \$? = $ac_status" >&5
8776   (exit $ac_status); } &&
8777          { ac_try='test -s conftest$ac_exeext'
8778   { (eval echo "$as_me:8778: \"$ac_try\"") >&5
8779   (eval $ac_try) 2>&5
8780   ac_status=$?
8781   echo "$as_me:8781: \$? = $ac_status" >&5
8782   (exit $ac_status); }; }; then
8783   ac_R_space=yes
8784 else
8785   echo "$as_me: failed program was:" >&5
8786 cat conftest.$ac_ext >&5
8787 ac_R_space=no
8788 fi
8789 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8790         if test $ac_R_space = yes; then
8791           echo "$as_me:8791: result: yes" >&5
8792 echo "${ECHO_T}yes" >&6
8793           X_LIBS="$X_LIBS -R $x_libraries"
8794         else
8795           echo "$as_me:8795: result: neither works" >&5
8796 echo "${ECHO_T}neither works" >&6
8797         fi
8798       fi
8799       LIBS=$ac_xsave_LIBS
8800     esac
8801   fi
8802
8803   # Check for system-dependent libraries X programs must link with.
8804   # Do this before checking for the system-independent R6 libraries
8805   # (-lICE), since we may need -lsocket or whatever for X linking.
8806
8807   if test "$ISC" = yes; then
8808     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
8809   else
8810     # Martyn Johnson says this is needed for Ultrix, if the X
8811     # libraries were built with DECnet support.  And Karl Berry says
8812     # the Alpha needs dnet_stub (dnet does not exist).
8813     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
8814     cat >conftest.$ac_ext <<_ACEOF
8815 #line 8815 "configure"
8816 #include "confdefs.h"
8817
8818 /* Override any gcc2 internal prototype to avoid an error.  */
8819 #ifdef __cplusplus
8820 extern "C"
8821 #endif
8822 /* We use char because int might match the return type of a gcc2
8823    builtin and then its argument prototype would still apply.  */
8824 char XOpenDisplay ();
8825 int
8826 main ()
8827 {
8828 XOpenDisplay ();
8829   ;
8830   return 0;
8831 }
8832 _ACEOF
8833 rm -f conftest.$ac_objext conftest$ac_exeext
8834 if { (eval echo "$as_me:8834: \"$ac_link\"") >&5
8835   (eval $ac_link) 2>&5
8836   ac_status=$?
8837   echo "$as_me:8837: \$? = $ac_status" >&5
8838   (exit $ac_status); } &&
8839          { ac_try='test -s conftest$ac_exeext'
8840   { (eval echo "$as_me:8840: \"$ac_try\"") >&5
8841   (eval $ac_try) 2>&5
8842   ac_status=$?
8843   echo "$as_me:8843: \$? = $ac_status" >&5
8844   (exit $ac_status); }; }; then
8845   :
8846 else
8847   echo "$as_me: failed program was:" >&5
8848 cat conftest.$ac_ext >&5
8849 echo "$as_me:8849: checking for dnet_ntoa in -ldnet" >&5
8850 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
8851 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
8852   echo $ECHO_N "(cached) $ECHO_C" >&6
8853 else
8854   ac_check_lib_save_LIBS=$LIBS
8855 LIBS="-ldnet  $LIBS"
8856 cat >conftest.$ac_ext <<_ACEOF
8857 #line 8857 "configure"
8858 #include "confdefs.h"
8859
8860 /* Override any gcc2 internal prototype to avoid an error.  */
8861 #ifdef __cplusplus
8862 extern "C"
8863 #endif
8864 /* We use char because int might match the return type of a gcc2
8865    builtin and then its argument prototype would still apply.  */
8866 char dnet_ntoa ();
8867 int
8868 main ()
8869 {
8870 dnet_ntoa ();
8871   ;
8872   return 0;
8873 }
8874 _ACEOF
8875 rm -f conftest.$ac_objext conftest$ac_exeext
8876 if { (eval echo "$as_me:8876: \"$ac_link\"") >&5
8877   (eval $ac_link) 2>&5
8878   ac_status=$?
8879   echo "$as_me:8879: \$? = $ac_status" >&5
8880   (exit $ac_status); } &&
8881          { ac_try='test -s conftest$ac_exeext'
8882   { (eval echo "$as_me:8882: \"$ac_try\"") >&5
8883   (eval $ac_try) 2>&5
8884   ac_status=$?
8885   echo "$as_me:8885: \$? = $ac_status" >&5
8886   (exit $ac_status); }; }; then
8887   ac_cv_lib_dnet_dnet_ntoa=yes
8888 else
8889   echo "$as_me: failed program was:" >&5
8890 cat conftest.$ac_ext >&5
8891 ac_cv_lib_dnet_dnet_ntoa=no
8892 fi
8893 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8894 LIBS=$ac_check_lib_save_LIBS
8895 fi
8896 echo "$as_me:8896: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
8897 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
8898 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
8899   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
8900 fi
8901
8902     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
8903       echo "$as_me:8903: checking for dnet_ntoa in -ldnet_stub" >&5
8904 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
8905 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
8906   echo $ECHO_N "(cached) $ECHO_C" >&6
8907 else
8908   ac_check_lib_save_LIBS=$LIBS
8909 LIBS="-ldnet_stub  $LIBS"
8910 cat >conftest.$ac_ext <<_ACEOF
8911 #line 8911 "configure"
8912 #include "confdefs.h"
8913
8914 /* Override any gcc2 internal prototype to avoid an error.  */
8915 #ifdef __cplusplus
8916 extern "C"
8917 #endif
8918 /* We use char because int might match the return type of a gcc2
8919    builtin and then its argument prototype would still apply.  */
8920 char dnet_ntoa ();
8921 int
8922 main ()
8923 {
8924 dnet_ntoa ();
8925   ;
8926   return 0;
8927 }
8928 _ACEOF
8929 rm -f conftest.$ac_objext conftest$ac_exeext
8930 if { (eval echo "$as_me:8930: \"$ac_link\"") >&5
8931   (eval $ac_link) 2>&5
8932   ac_status=$?
8933   echo "$as_me:8933: \$? = $ac_status" >&5
8934   (exit $ac_status); } &&
8935          { ac_try='test -s conftest$ac_exeext'
8936   { (eval echo "$as_me:8936: \"$ac_try\"") >&5
8937   (eval $ac_try) 2>&5
8938   ac_status=$?
8939   echo "$as_me:8939: \$? = $ac_status" >&5
8940   (exit $ac_status); }; }; then
8941   ac_cv_lib_dnet_stub_dnet_ntoa=yes
8942 else
8943   echo "$as_me: failed program was:" >&5
8944 cat conftest.$ac_ext >&5
8945 ac_cv_lib_dnet_stub_dnet_ntoa=no
8946 fi
8947 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8948 LIBS=$ac_check_lib_save_LIBS
8949 fi
8950 echo "$as_me:8950: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
8951 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
8952 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
8953   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
8954 fi
8955
8956     fi
8957 fi
8958 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8959     LIBS="$ac_xsave_LIBS"
8960
8961     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
8962     # to get the SysV transport functions.
8963     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
8964     # needs -lnsl.
8965     # The nsl library prevents programs from opening the X display
8966     # on Irix 5.2, according to T.E. Dickey.
8967     # The functions gethostbyname, getservbyname, and inet_addr are
8968     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
8969     echo "$as_me:8969: checking for gethostbyname" >&5
8970 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
8971 if test "${ac_cv_func_gethostbyname+set}" = set; then
8972   echo $ECHO_N "(cached) $ECHO_C" >&6
8973 else
8974   cat >conftest.$ac_ext <<_ACEOF
8975 #line 8975 "configure"
8976 #include "confdefs.h"
8977 /* System header to define __stub macros and hopefully few prototypes,
8978     which can conflict with char gethostbyname (); below.  */
8979 #include <assert.h>
8980 /* Override any gcc2 internal prototype to avoid an error.  */
8981 #ifdef __cplusplus
8982 extern "C"
8983 #endif
8984 /* We use char because int might match the return type of a gcc2
8985    builtin and then its argument prototype would still apply.  */
8986 char gethostbyname ();
8987 char (*f) ();
8988
8989 int
8990 main ()
8991 {
8992 /* The GNU C library defines this for functions which it implements
8993     to always fail with ENOSYS.  Some functions are actually named
8994     something starting with __ and the normal name is an alias.  */
8995 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
8996 choke me
8997 #else
8998 f = gethostbyname;
8999 #endif
9000
9001   ;
9002   return 0;
9003 }
9004 _ACEOF
9005 rm -f conftest.$ac_objext conftest$ac_exeext
9006 if { (eval echo "$as_me:9006: \"$ac_link\"") >&5
9007   (eval $ac_link) 2>&5
9008   ac_status=$?
9009   echo "$as_me:9009: \$? = $ac_status" >&5
9010   (exit $ac_status); } &&
9011          { ac_try='test -s conftest$ac_exeext'
9012   { (eval echo "$as_me:9012: \"$ac_try\"") >&5
9013   (eval $ac_try) 2>&5
9014   ac_status=$?
9015   echo "$as_me:9015: \$? = $ac_status" >&5
9016   (exit $ac_status); }; }; then
9017   ac_cv_func_gethostbyname=yes
9018 else
9019   echo "$as_me: failed program was:" >&5
9020 cat conftest.$ac_ext >&5
9021 ac_cv_func_gethostbyname=no
9022 fi
9023 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9024 fi
9025 echo "$as_me:9025: result: $ac_cv_func_gethostbyname" >&5
9026 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9027
9028     if test $ac_cv_func_gethostbyname = no; then
9029       echo "$as_me:9029: checking for gethostbyname in -lnsl" >&5
9030 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9031 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9032   echo $ECHO_N "(cached) $ECHO_C" >&6
9033 else
9034   ac_check_lib_save_LIBS=$LIBS
9035 LIBS="-lnsl  $LIBS"
9036 cat >conftest.$ac_ext <<_ACEOF
9037 #line 9037 "configure"
9038 #include "confdefs.h"
9039
9040 /* Override any gcc2 internal prototype to avoid an error.  */
9041 #ifdef __cplusplus
9042 extern "C"
9043 #endif
9044 /* We use char because int might match the return type of a gcc2
9045    builtin and then its argument prototype would still apply.  */
9046 char gethostbyname ();
9047 int
9048 main ()
9049 {
9050 gethostbyname ();
9051   ;
9052   return 0;
9053 }
9054 _ACEOF
9055 rm -f conftest.$ac_objext conftest$ac_exeext
9056 if { (eval echo "$as_me:9056: \"$ac_link\"") >&5
9057   (eval $ac_link) 2>&5
9058   ac_status=$?
9059   echo "$as_me:9059: \$? = $ac_status" >&5
9060   (exit $ac_status); } &&
9061          { ac_try='test -s conftest$ac_exeext'
9062   { (eval echo "$as_me:9062: \"$ac_try\"") >&5
9063   (eval $ac_try) 2>&5
9064   ac_status=$?
9065   echo "$as_me:9065: \$? = $ac_status" >&5
9066   (exit $ac_status); }; }; then
9067   ac_cv_lib_nsl_gethostbyname=yes
9068 else
9069   echo "$as_me: failed program was:" >&5
9070 cat conftest.$ac_ext >&5
9071 ac_cv_lib_nsl_gethostbyname=no
9072 fi
9073 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9074 LIBS=$ac_check_lib_save_LIBS
9075 fi
9076 echo "$as_me:9076: result: $ac_cv_lib_nsl_gethostbyname" >&5
9077 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9078 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9079   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9080 fi
9081
9082       if test $ac_cv_lib_nsl_gethostbyname = no; then
9083         echo "$as_me:9083: checking for gethostbyname in -lbsd" >&5
9084 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9085 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9086   echo $ECHO_N "(cached) $ECHO_C" >&6
9087 else
9088   ac_check_lib_save_LIBS=$LIBS
9089 LIBS="-lbsd  $LIBS"
9090 cat >conftest.$ac_ext <<_ACEOF
9091 #line 9091 "configure"
9092 #include "confdefs.h"
9093
9094 /* Override any gcc2 internal prototype to avoid an error.  */
9095 #ifdef __cplusplus
9096 extern "C"
9097 #endif
9098 /* We use char because int might match the return type of a gcc2
9099    builtin and then its argument prototype would still apply.  */
9100 char gethostbyname ();
9101 int
9102 main ()
9103 {
9104 gethostbyname ();
9105   ;
9106   return 0;
9107 }
9108 _ACEOF
9109 rm -f conftest.$ac_objext conftest$ac_exeext
9110 if { (eval echo "$as_me:9110: \"$ac_link\"") >&5
9111   (eval $ac_link) 2>&5
9112   ac_status=$?
9113   echo "$as_me:9113: \$? = $ac_status" >&5
9114   (exit $ac_status); } &&
9115          { ac_try='test -s conftest$ac_exeext'
9116   { (eval echo "$as_me:9116: \"$ac_try\"") >&5
9117   (eval $ac_try) 2>&5
9118   ac_status=$?
9119   echo "$as_me:9119: \$? = $ac_status" >&5
9120   (exit $ac_status); }; }; then
9121   ac_cv_lib_bsd_gethostbyname=yes
9122 else
9123   echo "$as_me: failed program was:" >&5
9124 cat conftest.$ac_ext >&5
9125 ac_cv_lib_bsd_gethostbyname=no
9126 fi
9127 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9128 LIBS=$ac_check_lib_save_LIBS
9129 fi
9130 echo "$as_me:9130: result: $ac_cv_lib_bsd_gethostbyname" >&5
9131 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9132 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9133   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9134 fi
9135
9136       fi
9137     fi
9138
9139     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9140     # socket/setsockopt and other routines are undefined under SCO ODT
9141     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9142     # on later versions), says Simon Leinen: it contains gethostby*
9143     # variants that don't use the nameserver (or something).  -lsocket
9144     # must be given before -lnsl if both are needed.  We assume that
9145     # if connect needs -lnsl, so does gethostbyname.
9146     echo "$as_me:9146: checking for connect" >&5
9147 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9148 if test "${ac_cv_func_connect+set}" = set; then
9149   echo $ECHO_N "(cached) $ECHO_C" >&6
9150 else
9151   cat >conftest.$ac_ext <<_ACEOF
9152 #line 9152 "configure"
9153 #include "confdefs.h"
9154 /* System header to define __stub macros and hopefully few prototypes,
9155     which can conflict with char connect (); below.  */
9156 #include <assert.h>
9157 /* Override any gcc2 internal prototype to avoid an error.  */
9158 #ifdef __cplusplus
9159 extern "C"
9160 #endif
9161 /* We use char because int might match the return type of a gcc2
9162    builtin and then its argument prototype would still apply.  */
9163 char connect ();
9164 char (*f) ();
9165
9166 int
9167 main ()
9168 {
9169 /* The GNU C library defines this for functions which it implements
9170     to always fail with ENOSYS.  Some functions are actually named
9171     something starting with __ and the normal name is an alias.  */
9172 #if defined (__stub_connect) || defined (__stub___connect)
9173 choke me
9174 #else
9175 f = connect;
9176 #endif
9177
9178   ;
9179   return 0;
9180 }
9181 _ACEOF
9182 rm -f conftest.$ac_objext conftest$ac_exeext
9183 if { (eval echo "$as_me:9183: \"$ac_link\"") >&5
9184   (eval $ac_link) 2>&5
9185   ac_status=$?
9186   echo "$as_me:9186: \$? = $ac_status" >&5
9187   (exit $ac_status); } &&
9188          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_func_connect=yes
9195 else
9196   echo "$as_me: failed program was:" >&5
9197 cat conftest.$ac_ext >&5
9198 ac_cv_func_connect=no
9199 fi
9200 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9201 fi
9202 echo "$as_me:9202: result: $ac_cv_func_connect" >&5
9203 echo "${ECHO_T}$ac_cv_func_connect" >&6
9204
9205     if test $ac_cv_func_connect = no; then
9206       echo "$as_me:9206: checking for connect in -lsocket" >&5
9207 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9208 if test "${ac_cv_lib_socket_connect+set}" = set; then
9209   echo $ECHO_N "(cached) $ECHO_C" >&6
9210 else
9211   ac_check_lib_save_LIBS=$LIBS
9212 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9213 cat >conftest.$ac_ext <<_ACEOF
9214 #line 9214 "configure"
9215 #include "confdefs.h"
9216
9217 /* Override any gcc2 internal prototype to avoid an error.  */
9218 #ifdef __cplusplus
9219 extern "C"
9220 #endif
9221 /* We use char because int might match the return type of a gcc2
9222    builtin and then its argument prototype would still apply.  */
9223 char connect ();
9224 int
9225 main ()
9226 {
9227 connect ();
9228   ;
9229   return 0;
9230 }
9231 _ACEOF
9232 rm -f conftest.$ac_objext conftest$ac_exeext
9233 if { (eval echo "$as_me:9233: \"$ac_link\"") >&5
9234   (eval $ac_link) 2>&5
9235   ac_status=$?
9236   echo "$as_me:9236: \$? = $ac_status" >&5
9237   (exit $ac_status); } &&
9238          { ac_try='test -s conftest$ac_exeext'
9239   { (eval echo "$as_me:9239: \"$ac_try\"") >&5
9240   (eval $ac_try) 2>&5
9241   ac_status=$?
9242   echo "$as_me:9242: \$? = $ac_status" >&5
9243   (exit $ac_status); }; }; then
9244   ac_cv_lib_socket_connect=yes
9245 else
9246   echo "$as_me: failed program was:" >&5
9247 cat conftest.$ac_ext >&5
9248 ac_cv_lib_socket_connect=no
9249 fi
9250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9251 LIBS=$ac_check_lib_save_LIBS
9252 fi
9253 echo "$as_me:9253: result: $ac_cv_lib_socket_connect" >&5
9254 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9255 if test $ac_cv_lib_socket_connect = yes; then
9256   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9257 fi
9258
9259     fi
9260
9261     # Guillermo Gomez says -lposix is necessary on A/UX.
9262     echo "$as_me:9262: checking for remove" >&5
9263 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9264 if test "${ac_cv_func_remove+set}" = set; then
9265   echo $ECHO_N "(cached) $ECHO_C" >&6
9266 else
9267   cat >conftest.$ac_ext <<_ACEOF
9268 #line 9268 "configure"
9269 #include "confdefs.h"
9270 /* System header to define __stub macros and hopefully few prototypes,
9271     which can conflict with char remove (); below.  */
9272 #include <assert.h>
9273 /* Override any gcc2 internal prototype to avoid an error.  */
9274 #ifdef __cplusplus
9275 extern "C"
9276 #endif
9277 /* We use char because int might match the return type of a gcc2
9278    builtin and then its argument prototype would still apply.  */
9279 char remove ();
9280 char (*f) ();
9281
9282 int
9283 main ()
9284 {
9285 /* The GNU C library defines this for functions which it implements
9286     to always fail with ENOSYS.  Some functions are actually named
9287     something starting with __ and the normal name is an alias.  */
9288 #if defined (__stub_remove) || defined (__stub___remove)
9289 choke me
9290 #else
9291 f = remove;
9292 #endif
9293
9294   ;
9295   return 0;
9296 }
9297 _ACEOF
9298 rm -f conftest.$ac_objext conftest$ac_exeext
9299 if { (eval echo "$as_me:9299: \"$ac_link\"") >&5
9300   (eval $ac_link) 2>&5
9301   ac_status=$?
9302   echo "$as_me:9302: \$? = $ac_status" >&5
9303   (exit $ac_status); } &&
9304          { ac_try='test -s conftest$ac_exeext'
9305   { (eval echo "$as_me:9305: \"$ac_try\"") >&5
9306   (eval $ac_try) 2>&5
9307   ac_status=$?
9308   echo "$as_me:9308: \$? = $ac_status" >&5
9309   (exit $ac_status); }; }; then
9310   ac_cv_func_remove=yes
9311 else
9312   echo "$as_me: failed program was:" >&5
9313 cat conftest.$ac_ext >&5
9314 ac_cv_func_remove=no
9315 fi
9316 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9317 fi
9318 echo "$as_me:9318: result: $ac_cv_func_remove" >&5
9319 echo "${ECHO_T}$ac_cv_func_remove" >&6
9320
9321     if test $ac_cv_func_remove = no; then
9322       echo "$as_me:9322: checking for remove in -lposix" >&5
9323 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9324 if test "${ac_cv_lib_posix_remove+set}" = set; then
9325   echo $ECHO_N "(cached) $ECHO_C" >&6
9326 else
9327   ac_check_lib_save_LIBS=$LIBS
9328 LIBS="-lposix  $LIBS"
9329 cat >conftest.$ac_ext <<_ACEOF
9330 #line 9330 "configure"
9331 #include "confdefs.h"
9332
9333 /* Override any gcc2 internal prototype to avoid an error.  */
9334 #ifdef __cplusplus
9335 extern "C"
9336 #endif
9337 /* We use char because int might match the return type of a gcc2
9338    builtin and then its argument prototype would still apply.  */
9339 char remove ();
9340 int
9341 main ()
9342 {
9343 remove ();
9344   ;
9345   return 0;
9346 }
9347 _ACEOF
9348 rm -f conftest.$ac_objext conftest$ac_exeext
9349 if { (eval echo "$as_me:9349: \"$ac_link\"") >&5
9350   (eval $ac_link) 2>&5
9351   ac_status=$?
9352   echo "$as_me:9352: \$? = $ac_status" >&5
9353   (exit $ac_status); } &&
9354          { ac_try='test -s conftest$ac_exeext'
9355   { (eval echo "$as_me:9355: \"$ac_try\"") >&5
9356   (eval $ac_try) 2>&5
9357   ac_status=$?
9358   echo "$as_me:9358: \$? = $ac_status" >&5
9359   (exit $ac_status); }; }; then
9360   ac_cv_lib_posix_remove=yes
9361 else
9362   echo "$as_me: failed program was:" >&5
9363 cat conftest.$ac_ext >&5
9364 ac_cv_lib_posix_remove=no
9365 fi
9366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9367 LIBS=$ac_check_lib_save_LIBS
9368 fi
9369 echo "$as_me:9369: result: $ac_cv_lib_posix_remove" >&5
9370 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9371 if test $ac_cv_lib_posix_remove = yes; then
9372   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9373 fi
9374
9375     fi
9376
9377     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9378     echo "$as_me:9378: checking for shmat" >&5
9379 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9380 if test "${ac_cv_func_shmat+set}" = set; then
9381   echo $ECHO_N "(cached) $ECHO_C" >&6
9382 else
9383   cat >conftest.$ac_ext <<_ACEOF
9384 #line 9384 "configure"
9385 #include "confdefs.h"
9386 /* System header to define __stub macros and hopefully few prototypes,
9387     which can conflict with char shmat (); below.  */
9388 #include <assert.h>
9389 /* Override any gcc2 internal prototype to avoid an error.  */
9390 #ifdef __cplusplus
9391 extern "C"
9392 #endif
9393 /* We use char because int might match the return type of a gcc2
9394    builtin and then its argument prototype would still apply.  */
9395 char shmat ();
9396 char (*f) ();
9397
9398 int
9399 main ()
9400 {
9401 /* The GNU C library defines this for functions which it implements
9402     to always fail with ENOSYS.  Some functions are actually named
9403     something starting with __ and the normal name is an alias.  */
9404 #if defined (__stub_shmat) || defined (__stub___shmat)
9405 choke me
9406 #else
9407 f = shmat;
9408 #endif
9409
9410   ;
9411   return 0;
9412 }
9413 _ACEOF
9414 rm -f conftest.$ac_objext conftest$ac_exeext
9415 if { (eval echo "$as_me:9415: \"$ac_link\"") >&5
9416   (eval $ac_link) 2>&5
9417   ac_status=$?
9418   echo "$as_me:9418: \$? = $ac_status" >&5
9419   (exit $ac_status); } &&
9420          { ac_try='test -s conftest$ac_exeext'
9421   { (eval echo "$as_me:9421: \"$ac_try\"") >&5
9422   (eval $ac_try) 2>&5
9423   ac_status=$?
9424   echo "$as_me:9424: \$? = $ac_status" >&5
9425   (exit $ac_status); }; }; then
9426   ac_cv_func_shmat=yes
9427 else
9428   echo "$as_me: failed program was:" >&5
9429 cat conftest.$ac_ext >&5
9430 ac_cv_func_shmat=no
9431 fi
9432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9433 fi
9434 echo "$as_me:9434: result: $ac_cv_func_shmat" >&5
9435 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9436
9437     if test $ac_cv_func_shmat = no; then
9438       echo "$as_me:9438: checking for shmat in -lipc" >&5
9439 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9440 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9441   echo $ECHO_N "(cached) $ECHO_C" >&6
9442 else
9443   ac_check_lib_save_LIBS=$LIBS
9444 LIBS="-lipc  $LIBS"
9445 cat >conftest.$ac_ext <<_ACEOF
9446 #line 9446 "configure"
9447 #include "confdefs.h"
9448
9449 /* Override any gcc2 internal prototype to avoid an error.  */
9450 #ifdef __cplusplus
9451 extern "C"
9452 #endif
9453 /* We use char because int might match the return type of a gcc2
9454    builtin and then its argument prototype would still apply.  */
9455 char shmat ();
9456 int
9457 main ()
9458 {
9459 shmat ();
9460   ;
9461   return 0;
9462 }
9463 _ACEOF
9464 rm -f conftest.$ac_objext conftest$ac_exeext
9465 if { (eval echo "$as_me:9465: \"$ac_link\"") >&5
9466   (eval $ac_link) 2>&5
9467   ac_status=$?
9468   echo "$as_me:9468: \$? = $ac_status" >&5
9469   (exit $ac_status); } &&
9470          { ac_try='test -s conftest$ac_exeext'
9471   { (eval echo "$as_me:9471: \"$ac_try\"") >&5
9472   (eval $ac_try) 2>&5
9473   ac_status=$?
9474   echo "$as_me:9474: \$? = $ac_status" >&5
9475   (exit $ac_status); }; }; then
9476   ac_cv_lib_ipc_shmat=yes
9477 else
9478   echo "$as_me: failed program was:" >&5
9479 cat conftest.$ac_ext >&5
9480 ac_cv_lib_ipc_shmat=no
9481 fi
9482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9483 LIBS=$ac_check_lib_save_LIBS
9484 fi
9485 echo "$as_me:9485: result: $ac_cv_lib_ipc_shmat" >&5
9486 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
9487 if test $ac_cv_lib_ipc_shmat = yes; then
9488   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
9489 fi
9490
9491     fi
9492   fi
9493
9494   # Check for libraries that X11R6 Xt/Xaw programs need.
9495   ac_save_LDFLAGS=$LDFLAGS
9496   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
9497   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
9498   # check for ICE first), but we must link in the order -lSM -lICE or
9499   # we get undefined symbols.  So assume we have SM if we have ICE.
9500   # These have to be linked with before -lX11, unlike the other
9501   # libraries we check for below, so use a different variable.
9502   # John Interrante, Karl Berry
9503   echo "$as_me:9503: checking for IceConnectionNumber in -lICE" >&5
9504 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
9505 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
9506   echo $ECHO_N "(cached) $ECHO_C" >&6
9507 else
9508   ac_check_lib_save_LIBS=$LIBS
9509 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
9510 cat >conftest.$ac_ext <<_ACEOF
9511 #line 9511 "configure"
9512 #include "confdefs.h"
9513
9514 /* Override any gcc2 internal prototype to avoid an error.  */
9515 #ifdef __cplusplus
9516 extern "C"
9517 #endif
9518 /* We use char because int might match the return type of a gcc2
9519    builtin and then its argument prototype would still apply.  */
9520 char IceConnectionNumber ();
9521 int
9522 main ()
9523 {
9524 IceConnectionNumber ();
9525   ;
9526   return 0;
9527 }
9528 _ACEOF
9529 rm -f conftest.$ac_objext conftest$ac_exeext
9530 if { (eval echo "$as_me:9530: \"$ac_link\"") >&5
9531   (eval $ac_link) 2>&5
9532   ac_status=$?
9533   echo "$as_me:9533: \$? = $ac_status" >&5
9534   (exit $ac_status); } &&
9535          { ac_try='test -s conftest$ac_exeext'
9536   { (eval echo "$as_me:9536: \"$ac_try\"") >&5
9537   (eval $ac_try) 2>&5
9538   ac_status=$?
9539   echo "$as_me:9539: \$? = $ac_status" >&5
9540   (exit $ac_status); }; }; then
9541   ac_cv_lib_ICE_IceConnectionNumber=yes
9542 else
9543   echo "$as_me: failed program was:" >&5
9544 cat conftest.$ac_ext >&5
9545 ac_cv_lib_ICE_IceConnectionNumber=no
9546 fi
9547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9548 LIBS=$ac_check_lib_save_LIBS
9549 fi
9550 echo "$as_me:9550: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
9551 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
9552 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
9553   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
9554 fi
9555
9556   LDFLAGS=$ac_save_LDFLAGS
9557
9558 fi
9559
9560 cf_x_athena=${cf_x_athena:-Xaw}
9561
9562 echo "$as_me:9562: checking if you want to link with Xaw 3d library" >&5
9563 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
9564 withval=
9565
9566 # Check whether --with-Xaw3d or --without-Xaw3d was given.
9567 if test "${with_Xaw3d+set}" = set; then
9568   withval="$with_Xaw3d"
9569
9570 fi;
9571 if test "$withval" = yes ; then
9572         cf_x_athena=Xaw3d
9573         echo "$as_me:9573: result: yes" >&5
9574 echo "${ECHO_T}yes" >&6
9575 else
9576         echo "$as_me:9576: result: no" >&5
9577 echo "${ECHO_T}no" >&6
9578 fi
9579
9580 echo "$as_me:9580: checking if you want to link with neXT Athena library" >&5
9581 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
9582 withval=
9583
9584 # Check whether --with-neXtaw or --without-neXtaw was given.
9585 if test "${with_neXtaw+set}" = set; then
9586   withval="$with_neXtaw"
9587
9588 fi;
9589 if test "$withval" = yes ; then
9590         cf_x_athena=neXtaw
9591         echo "$as_me:9591: result: yes" >&5
9592 echo "${ECHO_T}yes" >&6
9593 else
9594         echo "$as_me:9594: result: no" >&5
9595 echo "${ECHO_T}no" >&6
9596 fi
9597
9598 echo "$as_me:9598: checking if you want to link with Athena-Plus library" >&5
9599 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
9600 withval=
9601
9602 # Check whether --with-XawPlus or --without-XawPlus was given.
9603 if test "${with_XawPlus+set}" = set; then
9604   withval="$with_XawPlus"
9605
9606 fi;
9607 if test "$withval" = yes ; then
9608         cf_x_athena=XawPlus
9609         echo "$as_me:9609: result: yes" >&5
9610 echo "${ECHO_T}yes" >&6
9611 else
9612         echo "$as_me:9612: result: no" >&5
9613 echo "${ECHO_T}no" >&6
9614 fi
9615
9616 cf_x_athena_lib=""
9617
9618 if test "$PKG_CONFIG" != none ; then
9619         cf_athena_list=
9620         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
9621         for cf_athena_pkg in \
9622                 $cf_athena_list \
9623                 ${cf_x_athena} \
9624                 ${cf_x_athena}-devel \
9625                 lib${cf_x_athena} \
9626                 lib${cf_x_athena}-devel
9627         do
9628
9629 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
9630         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
9631
9632 echo "${as_me:-configure}:9632: testing found package $cf_athena_pkg ..." 1>&5
9633
9634         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
9635         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
9636         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
9637
9638 echo "${as_me:-configure}:9638: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9639
9640         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
9641
9642 echo "${as_me:-configure}:9642: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
9643
9644 cf_fix_cppflags=no
9645 cf_new_cflags=
9646 cf_new_cppflags=
9647 cf_new_extra_cppflags=
9648
9649 for cf_add_cflags in $cf_pkgconfig_incs
9650 do
9651 case $cf_fix_cppflags in
9652 no)
9653         case $cf_add_cflags in #(vi
9654         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9655                 case $cf_add_cflags in
9656                 -D*)
9657                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9658
9659                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9660                                 && test -z "${cf_tst_cflags}" \
9661                                 && cf_fix_cppflags=yes
9662
9663                         if test $cf_fix_cppflags = yes ; then
9664                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9665                                 continue
9666                         elif test "${cf_tst_cflags}" = "\"'" ; then
9667                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9668                                 continue
9669                         fi
9670                         ;;
9671                 esac
9672                 case "$CPPFLAGS" in
9673                 *$cf_add_cflags) #(vi
9674                         ;;
9675                 *) #(vi
9676                         case $cf_add_cflags in #(vi
9677                         -D*)
9678                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9679
9680 CPPFLAGS=`echo "$CPPFLAGS" | \
9681         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9682                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9683
9684                                 ;;
9685                         esac
9686                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9687                         ;;
9688                 esac
9689                 ;;
9690         *)
9691                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9692                 ;;
9693         esac
9694         ;;
9695 yes)
9696         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9697
9698         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9699
9700         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9701                 && test -z "${cf_tst_cflags}" \
9702                 && cf_fix_cppflags=no
9703         ;;
9704 esac
9705 done
9706
9707 if test -n "$cf_new_cflags" ; then
9708
9709         CFLAGS="$CFLAGS $cf_new_cflags"
9710 fi
9711
9712 if test -n "$cf_new_cppflags" ; then
9713
9714         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9715 fi
9716
9717 if test -n "$cf_new_extra_cppflags" ; then
9718
9719         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9720 fi
9721
9722         LIBS="$cf_pkgconfig_libs $LIBS"
9723
9724                         cf_x_athena_lib="$cf_pkgconfig_libs"
9725
9726 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9727
9728                         cat >>confdefs.h <<EOF
9729 #define $cf_x_athena_LIBS 1
9730 EOF
9731
9732                         break
9733 else
9734         :
9735 fi
9736
9737         done
9738 fi
9739
9740 if test -z "$cf_x_athena_lib" ; then
9741
9742 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
9743         test -n "$verbose" && echo "    found package Xext" 1>&6
9744
9745 echo "${as_me:-configure}:9745: testing found package Xext ..." 1>&5
9746
9747         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
9748         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
9749         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
9750
9751 echo "${as_me:-configure}:9751: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9752
9753         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
9754
9755 echo "${as_me:-configure}:9755: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
9756
9757 cf_fix_cppflags=no
9758 cf_new_cflags=
9759 cf_new_cppflags=
9760 cf_new_extra_cppflags=
9761
9762 for cf_add_cflags in $cf_pkgconfig_incs
9763 do
9764 case $cf_fix_cppflags in
9765 no)
9766         case $cf_add_cflags in #(vi
9767         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9768                 case $cf_add_cflags in
9769                 -D*)
9770                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9771
9772                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9773                                 && test -z "${cf_tst_cflags}" \
9774                                 && cf_fix_cppflags=yes
9775
9776                         if test $cf_fix_cppflags = yes ; then
9777                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9778                                 continue
9779                         elif test "${cf_tst_cflags}" = "\"'" ; then
9780                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9781                                 continue
9782                         fi
9783                         ;;
9784                 esac
9785                 case "$CPPFLAGS" in
9786                 *$cf_add_cflags) #(vi
9787                         ;;
9788                 *) #(vi
9789                         case $cf_add_cflags in #(vi
9790                         -D*)
9791                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9792
9793 CPPFLAGS=`echo "$CPPFLAGS" | \
9794         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9795                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9796
9797                                 ;;
9798                         esac
9799                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9800                         ;;
9801                 esac
9802                 ;;
9803         *)
9804                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9805                 ;;
9806         esac
9807         ;;
9808 yes)
9809         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9810
9811         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9812
9813         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9814                 && test -z "${cf_tst_cflags}" \
9815                 && cf_fix_cppflags=no
9816         ;;
9817 esac
9818 done
9819
9820 if test -n "$cf_new_cflags" ; then
9821
9822         CFLAGS="$CFLAGS $cf_new_cflags"
9823 fi
9824
9825 if test -n "$cf_new_cppflags" ; then
9826
9827         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9828 fi
9829
9830 if test -n "$cf_new_extra_cppflags" ; then
9831
9832         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9833 fi
9834
9835         LIBS="$cf_pkgconfig_libs $LIBS"
9836         :
9837 else
9838
9839         echo "$as_me:9839: checking for XextCreateExtension in -lXext" >&5
9840 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
9841 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
9842   echo $ECHO_N "(cached) $ECHO_C" >&6
9843 else
9844   ac_check_lib_save_LIBS=$LIBS
9845 LIBS="-lXext  $LIBS"
9846 cat >conftest.$ac_ext <<_ACEOF
9847 #line 9847 "configure"
9848 #include "confdefs.h"
9849
9850 /* Override any gcc2 internal prototype to avoid an error.  */
9851 #ifdef __cplusplus
9852 extern "C"
9853 #endif
9854 /* We use char because int might match the return type of a gcc2
9855    builtin and then its argument prototype would still apply.  */
9856 char XextCreateExtension ();
9857 int
9858 main ()
9859 {
9860 XextCreateExtension ();
9861   ;
9862   return 0;
9863 }
9864 _ACEOF
9865 rm -f conftest.$ac_objext conftest$ac_exeext
9866 if { (eval echo "$as_me:9866: \"$ac_link\"") >&5
9867   (eval $ac_link) 2>&5
9868   ac_status=$?
9869   echo "$as_me:9869: \$? = $ac_status" >&5
9870   (exit $ac_status); } &&
9871          { ac_try='test -s conftest$ac_exeext'
9872   { (eval echo "$as_me:9872: \"$ac_try\"") >&5
9873   (eval $ac_try) 2>&5
9874   ac_status=$?
9875   echo "$as_me:9875: \$? = $ac_status" >&5
9876   (exit $ac_status); }; }; then
9877   ac_cv_lib_Xext_XextCreateExtension=yes
9878 else
9879   echo "$as_me: failed program was:" >&5
9880 cat conftest.$ac_ext >&5
9881 ac_cv_lib_Xext_XextCreateExtension=no
9882 fi
9883 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9884 LIBS=$ac_check_lib_save_LIBS
9885 fi
9886 echo "$as_me:9886: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
9887 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
9888 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
9889   LIBS="-lXext $LIBS"
9890 fi
9891
9892 fi
9893
9894 cf_have_X_LIBS=no
9895
9896 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
9897         test -n "$verbose" && echo "    found package xt" 1>&6
9898
9899 echo "${as_me:-configure}:9899: testing found package xt ..." 1>&5
9900
9901         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
9902         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
9903         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
9904
9905 echo "${as_me:-configure}:9905: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9906
9907         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
9908
9909 echo "${as_me:-configure}:9909: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
9910
9911 cf_fix_cppflags=no
9912 cf_new_cflags=
9913 cf_new_cppflags=
9914 cf_new_extra_cppflags=
9915
9916 for cf_add_cflags in $cf_pkgconfig_incs
9917 do
9918 case $cf_fix_cppflags in
9919 no)
9920         case $cf_add_cflags in #(vi
9921         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9922                 case $cf_add_cflags in
9923                 -D*)
9924                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9925
9926                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9927                                 && test -z "${cf_tst_cflags}" \
9928                                 && cf_fix_cppflags=yes
9929
9930                         if test $cf_fix_cppflags = yes ; then
9931                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9932                                 continue
9933                         elif test "${cf_tst_cflags}" = "\"'" ; then
9934                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9935                                 continue
9936                         fi
9937                         ;;
9938                 esac
9939                 case "$CPPFLAGS" in
9940                 *$cf_add_cflags) #(vi
9941                         ;;
9942                 *) #(vi
9943                         case $cf_add_cflags in #(vi
9944                         -D*)
9945                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9946
9947 CPPFLAGS=`echo "$CPPFLAGS" | \
9948         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9949                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9950
9951                                 ;;
9952                         esac
9953                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9954                         ;;
9955                 esac
9956                 ;;
9957         *)
9958                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9959                 ;;
9960         esac
9961         ;;
9962 yes)
9963         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9964
9965         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9966
9967         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9968                 && test -z "${cf_tst_cflags}" \
9969                 && cf_fix_cppflags=no
9970         ;;
9971 esac
9972 done
9973
9974 if test -n "$cf_new_cflags" ; then
9975
9976         CFLAGS="$CFLAGS $cf_new_cflags"
9977 fi
9978
9979 if test -n "$cf_new_cppflags" ; then
9980
9981         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9982 fi
9983
9984 if test -n "$cf_new_extra_cppflags" ; then
9985
9986         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9987 fi
9988
9989         LIBS="$cf_pkgconfig_libs $LIBS"
9990
9991         # workaround for broken ".pc" files used for X Toolkit.
9992         case "x$X_PRE_LIBS" in #(vi
9993         *-lICE*)
9994                 case "x$LIBS" in #(vi
9995                 *-lICE*) #(vi
9996                         ;;
9997                 *)
9998                         test -n "$verbose" && echo "    work around broken package" 1>&6
9999
10000 echo "${as_me:-configure}:10000: testing work around broken package ..." 1>&5
10001
10002                         test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10003
10004 echo "${as_me:-configure}:10004: testing ...before $LIBS ..." 1>&5
10005
10006                         LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
10007                         test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10008
10009 echo "${as_me:-configure}:10009: testing ...after  $LIBS ..." 1>&5
10010
10011                         ;;
10012                 esac
10013                 ;;
10014         esac
10015
10016         cf_have_X_LIBS=yes
10017
10018 else
10019
10020         LDFLAGS="$X_LIBS $LDFLAGS"
10021
10022 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
10023
10024 echo "${as_me:-configure}:10024: testing checking additions to CFLAGS ..." 1>&5
10025
10026 cf_check_cflags="$CFLAGS"
10027 cf_check_cppflags="$CPPFLAGS"
10028
10029 cf_fix_cppflags=no
10030 cf_new_cflags=
10031 cf_new_cppflags=
10032 cf_new_extra_cppflags=
10033
10034 for cf_add_cflags in $X_CFLAGS
10035 do
10036 case $cf_fix_cppflags in
10037 no)
10038         case $cf_add_cflags in #(vi
10039         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10040                 case $cf_add_cflags in
10041                 -D*)
10042                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10043
10044                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10045                                 && test -z "${cf_tst_cflags}" \
10046                                 && cf_fix_cppflags=yes
10047
10048                         if test $cf_fix_cppflags = yes ; then
10049                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10050                                 continue
10051                         elif test "${cf_tst_cflags}" = "\"'" ; then
10052                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10053                                 continue
10054                         fi
10055                         ;;
10056                 esac
10057                 case "$CPPFLAGS" in
10058                 *$cf_add_cflags) #(vi
10059                         ;;
10060                 *) #(vi
10061                         case $cf_add_cflags in #(vi
10062                         -D*)
10063                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10064
10065 CPPFLAGS=`echo "$CPPFLAGS" | \
10066         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10067                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10068
10069                                 ;;
10070                         esac
10071                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10072                         ;;
10073                 esac
10074                 ;;
10075         *)
10076                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10077                 ;;
10078         esac
10079         ;;
10080 yes)
10081         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10082
10083         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10084
10085         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10086                 && test -z "${cf_tst_cflags}" \
10087                 && cf_fix_cppflags=no
10088         ;;
10089 esac
10090 done
10091
10092 if test -n "$cf_new_cflags" ; then
10093         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10094
10095 echo "${as_me:-configure}:10095: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10096
10097         CFLAGS="$CFLAGS $cf_new_cflags"
10098 fi
10099
10100 if test -n "$cf_new_cppflags" ; then
10101         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10102
10103 echo "${as_me:-configure}:10103: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10104
10105         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10106 fi
10107
10108 if test -n "$cf_new_extra_cppflags" ; then
10109         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10110
10111 echo "${as_me:-configure}:10111: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10112
10113         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10114 fi
10115
10116 if test "$cf_check_cflags" != "$CFLAGS" ; then
10117 cat >conftest.$ac_ext <<_ACEOF
10118 #line 10118 "configure"
10119 #include "confdefs.h"
10120 #include <stdio.h>
10121 int
10122 main ()
10123 {
10124 printf("Hello world");
10125   ;
10126   return 0;
10127 }
10128 _ACEOF
10129 rm -f conftest.$ac_objext conftest$ac_exeext
10130 if { (eval echo "$as_me:10130: \"$ac_link\"") >&5
10131   (eval $ac_link) 2>&5
10132   ac_status=$?
10133   echo "$as_me:10133: \$? = $ac_status" >&5
10134   (exit $ac_status); } &&
10135          { ac_try='test -s conftest$ac_exeext'
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   :
10142 else
10143   echo "$as_me: failed program was:" >&5
10144 cat conftest.$ac_ext >&5
10145 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
10146
10147 echo "${as_me:-configure}:10147: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
10148
10149          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
10150                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
10151
10152 echo "${as_me:-configure}:10152: testing but keeping change to \$CPPFLAGS ..." 1>&5
10153
10154          fi
10155          CFLAGS="$cf_check_flags"
10156 fi
10157 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10158 fi
10159
10160         echo "$as_me:10160: checking for XOpenDisplay" >&5
10161 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
10162 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
10163   echo $ECHO_N "(cached) $ECHO_C" >&6
10164 else
10165   cat >conftest.$ac_ext <<_ACEOF
10166 #line 10166 "configure"
10167 #include "confdefs.h"
10168 /* System header to define __stub macros and hopefully few prototypes,
10169     which can conflict with char XOpenDisplay (); below.  */
10170 #include <assert.h>
10171 /* Override any gcc2 internal prototype to avoid an error.  */
10172 #ifdef __cplusplus
10173 extern "C"
10174 #endif
10175 /* We use char because int might match the return type of a gcc2
10176    builtin and then its argument prototype would still apply.  */
10177 char XOpenDisplay ();
10178 char (*f) ();
10179
10180 int
10181 main ()
10182 {
10183 /* The GNU C library defines this for functions which it implements
10184     to always fail with ENOSYS.  Some functions are actually named
10185     something starting with __ and the normal name is an alias.  */
10186 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
10187 choke me
10188 #else
10189 f = XOpenDisplay;
10190 #endif
10191
10192   ;
10193   return 0;
10194 }
10195 _ACEOF
10196 rm -f conftest.$ac_objext conftest$ac_exeext
10197 if { (eval echo "$as_me:10197: \"$ac_link\"") >&5
10198   (eval $ac_link) 2>&5
10199   ac_status=$?
10200   echo "$as_me:10200: \$? = $ac_status" >&5
10201   (exit $ac_status); } &&
10202          { ac_try='test -s conftest$ac_exeext'
10203   { (eval echo "$as_me:10203: \"$ac_try\"") >&5
10204   (eval $ac_try) 2>&5
10205   ac_status=$?
10206   echo "$as_me:10206: \$? = $ac_status" >&5
10207   (exit $ac_status); }; }; then
10208   ac_cv_func_XOpenDisplay=yes
10209 else
10210   echo "$as_me: failed program was:" >&5
10211 cat conftest.$ac_ext >&5
10212 ac_cv_func_XOpenDisplay=no
10213 fi
10214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10215 fi
10216 echo "$as_me:10216: result: $ac_cv_func_XOpenDisplay" >&5
10217 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
10218 if test $ac_cv_func_XOpenDisplay = yes; then
10219   :
10220 else
10221
10222         echo "$as_me:10222: checking for XOpenDisplay in -lX11" >&5
10223 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
10224 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
10225   echo $ECHO_N "(cached) $ECHO_C" >&6
10226 else
10227   ac_check_lib_save_LIBS=$LIBS
10228 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
10229 cat >conftest.$ac_ext <<_ACEOF
10230 #line 10230 "configure"
10231 #include "confdefs.h"
10232
10233 /* Override any gcc2 internal prototype to avoid an error.  */
10234 #ifdef __cplusplus
10235 extern "C"
10236 #endif
10237 /* We use char because int might match the return type of a gcc2
10238    builtin and then its argument prototype would still apply.  */
10239 char XOpenDisplay ();
10240 int
10241 main ()
10242 {
10243 XOpenDisplay ();
10244   ;
10245   return 0;
10246 }
10247 _ACEOF
10248 rm -f conftest.$ac_objext conftest$ac_exeext
10249 if { (eval echo "$as_me:10249: \"$ac_link\"") >&5
10250   (eval $ac_link) 2>&5
10251   ac_status=$?
10252   echo "$as_me:10252: \$? = $ac_status" >&5
10253   (exit $ac_status); } &&
10254          { ac_try='test -s conftest$ac_exeext'
10255   { (eval echo "$as_me:10255: \"$ac_try\"") >&5
10256   (eval $ac_try) 2>&5
10257   ac_status=$?
10258   echo "$as_me:10258: \$? = $ac_status" >&5
10259   (exit $ac_status); }; }; then
10260   ac_cv_lib_X11_XOpenDisplay=yes
10261 else
10262   echo "$as_me: failed program was:" >&5
10263 cat conftest.$ac_ext >&5
10264 ac_cv_lib_X11_XOpenDisplay=no
10265 fi
10266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10267 LIBS=$ac_check_lib_save_LIBS
10268 fi
10269 echo "$as_me:10269: result: $ac_cv_lib_X11_XOpenDisplay" >&5
10270 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
10271 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
10272   LIBS="-lX11 $LIBS"
10273 fi
10274
10275 fi
10276
10277         echo "$as_me:10277: checking for XtAppInitialize" >&5
10278 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
10279 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
10280   echo $ECHO_N "(cached) $ECHO_C" >&6
10281 else
10282   cat >conftest.$ac_ext <<_ACEOF
10283 #line 10283 "configure"
10284 #include "confdefs.h"
10285 /* System header to define __stub macros and hopefully few prototypes,
10286     which can conflict with char XtAppInitialize (); below.  */
10287 #include <assert.h>
10288 /* Override any gcc2 internal prototype to avoid an error.  */
10289 #ifdef __cplusplus
10290 extern "C"
10291 #endif
10292 /* We use char because int might match the return type of a gcc2
10293    builtin and then its argument prototype would still apply.  */
10294 char XtAppInitialize ();
10295 char (*f) ();
10296
10297 int
10298 main ()
10299 {
10300 /* The GNU C library defines this for functions which it implements
10301     to always fail with ENOSYS.  Some functions are actually named
10302     something starting with __ and the normal name is an alias.  */
10303 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
10304 choke me
10305 #else
10306 f = XtAppInitialize;
10307 #endif
10308
10309   ;
10310   return 0;
10311 }
10312 _ACEOF
10313 rm -f conftest.$ac_objext conftest$ac_exeext
10314 if { (eval echo "$as_me:10314: \"$ac_link\"") >&5
10315   (eval $ac_link) 2>&5
10316   ac_status=$?
10317   echo "$as_me:10317: \$? = $ac_status" >&5
10318   (exit $ac_status); } &&
10319          { ac_try='test -s conftest$ac_exeext'
10320   { (eval echo "$as_me:10320: \"$ac_try\"") >&5
10321   (eval $ac_try) 2>&5
10322   ac_status=$?
10323   echo "$as_me:10323: \$? = $ac_status" >&5
10324   (exit $ac_status); }; }; then
10325   ac_cv_func_XtAppInitialize=yes
10326 else
10327   echo "$as_me: failed program was:" >&5
10328 cat conftest.$ac_ext >&5
10329 ac_cv_func_XtAppInitialize=no
10330 fi
10331 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10332 fi
10333 echo "$as_me:10333: result: $ac_cv_func_XtAppInitialize" >&5
10334 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
10335 if test $ac_cv_func_XtAppInitialize = yes; then
10336   :
10337 else
10338
10339         echo "$as_me:10339: checking for XtAppInitialize in -lXt" >&5
10340 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
10341 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
10342   echo $ECHO_N "(cached) $ECHO_C" >&6
10343 else
10344   ac_check_lib_save_LIBS=$LIBS
10345 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
10346 cat >conftest.$ac_ext <<_ACEOF
10347 #line 10347 "configure"
10348 #include "confdefs.h"
10349
10350 /* Override any gcc2 internal prototype to avoid an error.  */
10351 #ifdef __cplusplus
10352 extern "C"
10353 #endif
10354 /* We use char because int might match the return type of a gcc2
10355    builtin and then its argument prototype would still apply.  */
10356 char XtAppInitialize ();
10357 int
10358 main ()
10359 {
10360 XtAppInitialize ();
10361   ;
10362   return 0;
10363 }
10364 _ACEOF
10365 rm -f conftest.$ac_objext conftest$ac_exeext
10366 if { (eval echo "$as_me:10366: \"$ac_link\"") >&5
10367   (eval $ac_link) 2>&5
10368   ac_status=$?
10369   echo "$as_me:10369: \$? = $ac_status" >&5
10370   (exit $ac_status); } &&
10371          { ac_try='test -s conftest$ac_exeext'
10372   { (eval echo "$as_me:10372: \"$ac_try\"") >&5
10373   (eval $ac_try) 2>&5
10374   ac_status=$?
10375   echo "$as_me:10375: \$? = $ac_status" >&5
10376   (exit $ac_status); }; }; then
10377   ac_cv_lib_Xt_XtAppInitialize=yes
10378 else
10379   echo "$as_me: failed program was:" >&5
10380 cat conftest.$ac_ext >&5
10381 ac_cv_lib_Xt_XtAppInitialize=no
10382 fi
10383 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10384 LIBS=$ac_check_lib_save_LIBS
10385 fi
10386 echo "$as_me:10386: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
10387 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
10388 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
10389   cat >>confdefs.h <<\EOF
10390 #define HAVE_LIBXT 1
10391 EOF
10392
10393                  cf_have_X_LIBS=Xt
10394                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
10395 fi
10396
10397 fi
10398
10399 fi
10400
10401 if test $cf_have_X_LIBS = no ; then
10402         { echo "$as_me:10402: WARNING: Unable to successfully link X Toolkit library (-lXt) with
10403 test program.  You will have to check and add the proper libraries by hand
10404 to makefile." >&5
10405 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
10406 test program.  You will have to check and add the proper libraries by hand
10407 to makefile." >&2;}
10408 fi
10409
10410 cf_x_athena_root=$cf_x_athena
10411 cf_x_athena_inc=""
10412
10413 for cf_path in default \
10414         /usr/contrib/X11R6 \
10415         /usr/contrib/X11R5 \
10416         /usr/lib/X11R5 \
10417         /usr/local
10418 do
10419         if test -z "$cf_x_athena_inc" ; then
10420                 cf_save="$CPPFLAGS"
10421                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
10422                 if test $cf_path != default ; then
10423                         CPPFLAGS="$cf_save -I$cf_path/include"
10424                         echo "$as_me:10424: checking for $cf_test in $cf_path" >&5
10425 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
10426                 else
10427                         echo "$as_me:10427: checking for $cf_test" >&5
10428 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
10429                 fi
10430                 cat >conftest.$ac_ext <<_ACEOF
10431 #line 10431 "configure"
10432 #include "confdefs.h"
10433
10434 #include <X11/Intrinsic.h>
10435 #include <$cf_test>
10436 int
10437 main ()
10438 {
10439
10440   ;
10441   return 0;
10442 }
10443 _ACEOF
10444 rm -f conftest.$ac_objext
10445 if { (eval echo "$as_me:10445: \"$ac_compile\"") >&5
10446   (eval $ac_compile) 2>&5
10447   ac_status=$?
10448   echo "$as_me:10448: \$? = $ac_status" >&5
10449   (exit $ac_status); } &&
10450          { ac_try='test -s conftest.$ac_objext'
10451   { (eval echo "$as_me:10451: \"$ac_try\"") >&5
10452   (eval $ac_try) 2>&5
10453   ac_status=$?
10454   echo "$as_me:10454: \$? = $ac_status" >&5
10455   (exit $ac_status); }; }; then
10456   cf_result=yes
10457 else
10458   echo "$as_me: failed program was:" >&5
10459 cat conftest.$ac_ext >&5
10460 cf_result=no
10461 fi
10462 rm -f conftest.$ac_objext conftest.$ac_ext
10463                 echo "$as_me:10463: result: $cf_result" >&5
10464 echo "${ECHO_T}$cf_result" >&6
10465                 if test "$cf_result" = yes ; then
10466                         cf_x_athena_inc=$cf_path
10467                         break
10468                 else
10469                         CPPFLAGS="$cf_save"
10470                 fi
10471         fi
10472 done
10473
10474 if test -z "$cf_x_athena_inc" ; then
10475         { echo "$as_me:10475: WARNING: Unable to successfully find Athena header files with test program" >&5
10476 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
10477 elif test "$cf_x_athena_inc" != default ; then
10478         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
10479 fi
10480
10481 cf_x_athena_root=$cf_x_athena
10482 cf_x_athena_lib=""
10483
10484 for cf_path in default \
10485         /usr/contrib/X11R6 \
10486         /usr/contrib/X11R5 \
10487         /usr/lib/X11R5 \
10488         /usr/local
10489 do
10490         for cf_lib in \
10491                 "-l$cf_x_athena_root -lXmu" \
10492                 "-l$cf_x_athena_root -lXpm -lXmu" \
10493                 "-l${cf_x_athena_root}_s -lXmu_s"
10494         do
10495                 if test -z "$cf_x_athena_lib" ; then
10496                         cf_save="$LIBS"
10497                         cf_test=XawSimpleMenuAddGlobalActions
10498                         if test $cf_path != default ; then
10499                                 LIBS="-L$cf_path/lib $cf_lib $LIBS"
10500                                 echo "$as_me:10500: checking for $cf_lib in $cf_path" >&5
10501 echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6
10502                         else
10503                                 LIBS="$cf_lib $LIBS"
10504                                 echo "$as_me:10504: checking for $cf_test in $cf_lib" >&5
10505 echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6
10506                         fi
10507                         cat >conftest.$ac_ext <<_ACEOF
10508 #line 10508 "configure"
10509 #include "confdefs.h"
10510
10511 int
10512 main ()
10513 {
10514 $cf_test()
10515   ;
10516   return 0;
10517 }
10518 _ACEOF
10519 rm -f conftest.$ac_objext conftest$ac_exeext
10520 if { (eval echo "$as_me:10520: \"$ac_link\"") >&5
10521   (eval $ac_link) 2>&5
10522   ac_status=$?
10523   echo "$as_me:10523: \$? = $ac_status" >&5
10524   (exit $ac_status); } &&
10525          { ac_try='test -s conftest$ac_exeext'
10526   { (eval echo "$as_me:10526: \"$ac_try\"") >&5
10527   (eval $ac_try) 2>&5
10528   ac_status=$?
10529   echo "$as_me:10529: \$? = $ac_status" >&5
10530   (exit $ac_status); }; }; then
10531   cf_result=yes
10532 else
10533   echo "$as_me: failed program was:" >&5
10534 cat conftest.$ac_ext >&5
10535 cf_result=no
10536 fi
10537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10538                         echo "$as_me:10538: result: $cf_result" >&5
10539 echo "${ECHO_T}$cf_result" >&6
10540                         if test "$cf_result" = yes ; then
10541                                 cf_x_athena_lib="$cf_lib"
10542                                 break
10543                         fi
10544                         LIBS="$cf_save"
10545                 fi
10546         done
10547 done
10548
10549 if test -z "$cf_x_athena_lib" ; then
10550         { { echo "$as_me:10550: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
10551 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
10552    { (exit 1); exit 1; }; }
10553 fi
10554
10555 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10556
10557 cat >>confdefs.h <<EOF
10558 #define $cf_x_athena_LIBS 1
10559 EOF
10560
10561 fi
10562
10563 for ac_prog in xcurses-config
10564 do
10565   # Extract the first word of "$ac_prog", so it can be a program name with args.
10566 set dummy $ac_prog; ac_word=$2
10567 echo "$as_me:10567: checking for $ac_word" >&5
10568 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10569 if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
10570   echo $ECHO_N "(cached) $ECHO_C" >&6
10571 else
10572   case $XCURSES_CONFIG in
10573   [\\/]* | ?:[\\/]*)
10574   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
10575   ;;
10576   *)
10577   ac_save_IFS=$IFS; IFS=$ac_path_separator
10578 ac_dummy="$PATH"
10579 for ac_dir in $ac_dummy; do
10580   IFS=$ac_save_IFS
10581   test -z "$ac_dir" && ac_dir=.
10582   if $as_executable_p "$ac_dir/$ac_word"; then
10583    ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
10584    echo "$as_me:10584: found $ac_dir/$ac_word" >&5
10585    break
10586 fi
10587 done
10588
10589   ;;
10590 esac
10591 fi
10592 XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
10593
10594 if test -n "$XCURSES_CONFIG"; then
10595   echo "$as_me:10595: result: $XCURSES_CONFIG" >&5
10596 echo "${ECHO_T}$XCURSES_CONFIG" >&6
10597 else
10598   echo "$as_me:10598: result: no" >&5
10599 echo "${ECHO_T}no" >&6
10600 fi
10601
10602   test -n "$XCURSES_CONFIG" && break
10603 done
10604 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
10605
10606 if test "$XCURSES_CONFIG" != none ; then
10607
10608 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
10609 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
10610
10611 cf_cv_lib_XCurses=yes
10612
10613 else
10614
10615 LDFLAGS="$LDFLAGS $X_LIBS"
10616
10617 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
10618
10619 echo "${as_me:-configure}:10619: testing checking additions to CFLAGS ..." 1>&5
10620
10621 cf_check_cflags="$CFLAGS"
10622 cf_check_cppflags="$CPPFLAGS"
10623
10624 cf_fix_cppflags=no
10625 cf_new_cflags=
10626 cf_new_cppflags=
10627 cf_new_extra_cppflags=
10628
10629 for cf_add_cflags in $X_CFLAGS
10630 do
10631 case $cf_fix_cppflags in
10632 no)
10633         case $cf_add_cflags in #(vi
10634         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10635                 case $cf_add_cflags in
10636                 -D*)
10637                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10638
10639                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10640                                 && test -z "${cf_tst_cflags}" \
10641                                 && cf_fix_cppflags=yes
10642
10643                         if test $cf_fix_cppflags = yes ; then
10644                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10645                                 continue
10646                         elif test "${cf_tst_cflags}" = "\"'" ; then
10647                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10648                                 continue
10649                         fi
10650                         ;;
10651                 esac
10652                 case "$CPPFLAGS" in
10653                 *$cf_add_cflags) #(vi
10654                         ;;
10655                 *) #(vi
10656                         case $cf_add_cflags in #(vi
10657                         -D*)
10658                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10659
10660 CPPFLAGS=`echo "$CPPFLAGS" | \
10661         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10662                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10663
10664                                 ;;
10665                         esac
10666                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10667                         ;;
10668                 esac
10669                 ;;
10670         *)
10671                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10672                 ;;
10673         esac
10674         ;;
10675 yes)
10676         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10677
10678         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10679
10680         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10681                 && test -z "${cf_tst_cflags}" \
10682                 && cf_fix_cppflags=no
10683         ;;
10684 esac
10685 done
10686
10687 if test -n "$cf_new_cflags" ; then
10688         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10689
10690 echo "${as_me:-configure}:10690: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10691
10692         CFLAGS="$CFLAGS $cf_new_cflags"
10693 fi
10694
10695 if test -n "$cf_new_cppflags" ; then
10696         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10697
10698 echo "${as_me:-configure}:10698: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10699
10700         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10701 fi
10702
10703 if test -n "$cf_new_extra_cppflags" ; then
10704         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10705
10706 echo "${as_me:-configure}:10706: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10707
10708         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10709 fi
10710
10711 if test "$cf_check_cflags" != "$CFLAGS" ; then
10712 cat >conftest.$ac_ext <<_ACEOF
10713 #line 10713 "configure"
10714 #include "confdefs.h"
10715 #include <stdio.h>
10716 int
10717 main ()
10718 {
10719 printf("Hello world");
10720   ;
10721   return 0;
10722 }
10723 _ACEOF
10724 rm -f conftest.$ac_objext conftest$ac_exeext
10725 if { (eval echo "$as_me:10725: \"$ac_link\"") >&5
10726   (eval $ac_link) 2>&5
10727   ac_status=$?
10728   echo "$as_me:10728: \$? = $ac_status" >&5
10729   (exit $ac_status); } &&
10730          { ac_try='test -s conftest$ac_exeext'
10731   { (eval echo "$as_me:10731: \"$ac_try\"") >&5
10732   (eval $ac_try) 2>&5
10733   ac_status=$?
10734   echo "$as_me:10734: \$? = $ac_status" >&5
10735   (exit $ac_status); }; }; then
10736   :
10737 else
10738   echo "$as_me: failed program was:" >&5
10739 cat conftest.$ac_ext >&5
10740 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
10741
10742 echo "${as_me:-configure}:10742: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
10743
10744          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
10745                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
10746
10747 echo "${as_me:-configure}:10747: testing but keeping change to \$CPPFLAGS ..." 1>&5
10748
10749          fi
10750          CFLAGS="$cf_check_flags"
10751 fi
10752 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10753 fi
10754
10755 echo "$as_me:10755: checking for XOpenDisplay in -lX11" >&5
10756 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
10757 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
10758   echo $ECHO_N "(cached) $ECHO_C" >&6
10759 else
10760   ac_check_lib_save_LIBS=$LIBS
10761 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
10762 cat >conftest.$ac_ext <<_ACEOF
10763 #line 10763 "configure"
10764 #include "confdefs.h"
10765
10766 /* Override any gcc2 internal prototype to avoid an error.  */
10767 #ifdef __cplusplus
10768 extern "C"
10769 #endif
10770 /* We use char because int might match the return type of a gcc2
10771    builtin and then its argument prototype would still apply.  */
10772 char XOpenDisplay ();
10773 int
10774 main ()
10775 {
10776 XOpenDisplay ();
10777   ;
10778   return 0;
10779 }
10780 _ACEOF
10781 rm -f conftest.$ac_objext conftest$ac_exeext
10782 if { (eval echo "$as_me:10782: \"$ac_link\"") >&5
10783   (eval $ac_link) 2>&5
10784   ac_status=$?
10785   echo "$as_me:10785: \$? = $ac_status" >&5
10786   (exit $ac_status); } &&
10787          { ac_try='test -s conftest$ac_exeext'
10788   { (eval echo "$as_me:10788: \"$ac_try\"") >&5
10789   (eval $ac_try) 2>&5
10790   ac_status=$?
10791   echo "$as_me:10791: \$? = $ac_status" >&5
10792   (exit $ac_status); }; }; then
10793   ac_cv_lib_X11_XOpenDisplay=yes
10794 else
10795   echo "$as_me: failed program was:" >&5
10796 cat conftest.$ac_ext >&5
10797 ac_cv_lib_X11_XOpenDisplay=no
10798 fi
10799 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10800 LIBS=$ac_check_lib_save_LIBS
10801 fi
10802 echo "$as_me:10802: result: $ac_cv_lib_X11_XOpenDisplay" >&5
10803 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
10804 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
10805   LIBS="-lX11 $LIBS"
10806 fi
10807
10808 echo "$as_me:10808: checking for XCurses library" >&5
10809 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
10810 if test "${cf_cv_lib_XCurses+set}" = set; then
10811   echo $ECHO_N "(cached) $ECHO_C" >&6
10812 else
10813
10814 LIBS="-lXCurses $LIBS"
10815 cat >conftest.$ac_ext <<_ACEOF
10816 #line 10816 "configure"
10817 #include "confdefs.h"
10818
10819 #include <xcurses.h>
10820 char *XCursesProgramName = "test";
10821
10822 int
10823 main ()
10824 {
10825 XCursesExit();
10826   ;
10827   return 0;
10828 }
10829 _ACEOF
10830 rm -f conftest.$ac_objext conftest$ac_exeext
10831 if { (eval echo "$as_me:10831: \"$ac_link\"") >&5
10832   (eval $ac_link) 2>&5
10833   ac_status=$?
10834   echo "$as_me:10834: \$? = $ac_status" >&5
10835   (exit $ac_status); } &&
10836          { ac_try='test -s conftest$ac_exeext'
10837   { (eval echo "$as_me:10837: \"$ac_try\"") >&5
10838   (eval $ac_try) 2>&5
10839   ac_status=$?
10840   echo "$as_me:10840: \$? = $ac_status" >&5
10841   (exit $ac_status); }; }; then
10842   cf_cv_lib_XCurses=yes
10843 else
10844   echo "$as_me: failed program was:" >&5
10845 cat conftest.$ac_ext >&5
10846 cf_cv_lib_XCurses=no
10847 fi
10848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10849
10850 fi
10851 echo "$as_me:10851: result: $cf_cv_lib_XCurses" >&5
10852 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
10853
10854 fi
10855
10856 if test $cf_cv_lib_XCurses = yes ; then
10857         cat >>confdefs.h <<\EOF
10858 #define UNIX 1
10859 EOF
10860
10861         cat >>confdefs.h <<\EOF
10862 #define XCURSES 1
10863 EOF
10864
10865         cat >>confdefs.h <<\EOF
10866 #define HAVE_XCURSES 1
10867 EOF
10868
10869 else
10870         { { echo "$as_me:10870: error: Cannot link with XCurses" >&5
10871 echo "$as_me: error: Cannot link with XCurses" >&2;}
10872    { (exit 1); exit 1; }; }
10873 fi
10874
10875         ;;
10876 esac
10877
10878 case $cf_cv_screen in #(vi
10879 pdcurses) #(vi
10880         ;;
10881 *)
10882         # look for curses-related libraries
10883
10884 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
10885 echo "$as_me:10885: checking for new_panel in -lpanel$cf_cv_libtype" >&5
10886 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
10887 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
10888   echo $ECHO_N "(cached) $ECHO_C" >&6
10889 else
10890   ac_check_lib_save_LIBS=$LIBS
10891 LIBS="-lpanel$cf_cv_libtype  $LIBS"
10892 cat >conftest.$ac_ext <<_ACEOF
10893 #line 10893 "configure"
10894 #include "confdefs.h"
10895
10896 /* Override any gcc2 internal prototype to avoid an error.  */
10897 #ifdef __cplusplus
10898 extern "C"
10899 #endif
10900 /* We use char because int might match the return type of a gcc2
10901    builtin and then its argument prototype would still apply.  */
10902 char new_panel ();
10903 int
10904 main ()
10905 {
10906 new_panel ();
10907   ;
10908   return 0;
10909 }
10910 _ACEOF
10911 rm -f conftest.$ac_objext conftest$ac_exeext
10912 if { (eval echo "$as_me:10912: \"$ac_link\"") >&5
10913   (eval $ac_link) 2>&5
10914   ac_status=$?
10915   echo "$as_me:10915: \$? = $ac_status" >&5
10916   (exit $ac_status); } &&
10917          { ac_try='test -s conftest$ac_exeext'
10918   { (eval echo "$as_me:10918: \"$ac_try\"") >&5
10919   (eval $ac_try) 2>&5
10920   ac_status=$?
10921   echo "$as_me:10921: \$? = $ac_status" >&5
10922   (exit $ac_status); }; }; then
10923   eval "$as_ac_Lib=yes"
10924 else
10925   echo "$as_me: failed program was:" >&5
10926 cat conftest.$ac_ext >&5
10927 eval "$as_ac_Lib=no"
10928 fi
10929 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10930 LIBS=$ac_check_lib_save_LIBS
10931 fi
10932 echo "$as_me:10932: result: `eval echo '${'$as_ac_Lib'}'`" >&5
10933 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
10934 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
10935   cat >>confdefs.h <<EOF
10936 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
10937 EOF
10938
10939   LIBS="-lpanel$cf_cv_libtype $LIBS"
10940
10941 fi
10942
10943 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
10944 echo "$as_me:10944: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
10945 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
10946 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
10947   echo $ECHO_N "(cached) $ECHO_C" >&6
10948 else
10949   ac_check_lib_save_LIBS=$LIBS
10950 LIBS="-lmenu$cf_cv_libtype  $LIBS"
10951 cat >conftest.$ac_ext <<_ACEOF
10952 #line 10952 "configure"
10953 #include "confdefs.h"
10954
10955 /* Override any gcc2 internal prototype to avoid an error.  */
10956 #ifdef __cplusplus
10957 extern "C"
10958 #endif
10959 /* We use char because int might match the return type of a gcc2
10960    builtin and then its argument prototype would still apply.  */
10961 char menu_driver ();
10962 int
10963 main ()
10964 {
10965 menu_driver ();
10966   ;
10967   return 0;
10968 }
10969 _ACEOF
10970 rm -f conftest.$ac_objext conftest$ac_exeext
10971 if { (eval echo "$as_me:10971: \"$ac_link\"") >&5
10972   (eval $ac_link) 2>&5
10973   ac_status=$?
10974   echo "$as_me:10974: \$? = $ac_status" >&5
10975   (exit $ac_status); } &&
10976          { ac_try='test -s conftest$ac_exeext'
10977   { (eval echo "$as_me:10977: \"$ac_try\"") >&5
10978   (eval $ac_try) 2>&5
10979   ac_status=$?
10980   echo "$as_me:10980: \$? = $ac_status" >&5
10981   (exit $ac_status); }; }; then
10982   eval "$as_ac_Lib=yes"
10983 else
10984   echo "$as_me: failed program was:" >&5
10985 cat conftest.$ac_ext >&5
10986 eval "$as_ac_Lib=no"
10987 fi
10988 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10989 LIBS=$ac_check_lib_save_LIBS
10990 fi
10991 echo "$as_me:10991: result: `eval echo '${'$as_ac_Lib'}'`" >&5
10992 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
10993 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
10994   cat >>confdefs.h <<EOF
10995 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
10996 EOF
10997
10998   LIBS="-lmenu$cf_cv_libtype $LIBS"
10999
11000 fi
11001
11002 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
11003 echo "$as_me:11003: checking for form_driver in -lform$cf_cv_libtype" >&5
11004 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
11005 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
11006   echo $ECHO_N "(cached) $ECHO_C" >&6
11007 else
11008   ac_check_lib_save_LIBS=$LIBS
11009 LIBS="-lform$cf_cv_libtype  $LIBS"
11010 cat >conftest.$ac_ext <<_ACEOF
11011 #line 11011 "configure"
11012 #include "confdefs.h"
11013
11014 /* Override any gcc2 internal prototype to avoid an error.  */
11015 #ifdef __cplusplus
11016 extern "C"
11017 #endif
11018 /* We use char because int might match the return type of a gcc2
11019    builtin and then its argument prototype would still apply.  */
11020 char form_driver ();
11021 int
11022 main ()
11023 {
11024 form_driver ();
11025   ;
11026   return 0;
11027 }
11028 _ACEOF
11029 rm -f conftest.$ac_objext conftest$ac_exeext
11030 if { (eval echo "$as_me:11030: \"$ac_link\"") >&5
11031   (eval $ac_link) 2>&5
11032   ac_status=$?
11033   echo "$as_me:11033: \$? = $ac_status" >&5
11034   (exit $ac_status); } &&
11035          { ac_try='test -s conftest$ac_exeext'
11036   { (eval echo "$as_me:11036: \"$ac_try\"") >&5
11037   (eval $ac_try) 2>&5
11038   ac_status=$?
11039   echo "$as_me:11039: \$? = $ac_status" >&5
11040   (exit $ac_status); }; }; then
11041   eval "$as_ac_Lib=yes"
11042 else
11043   echo "$as_me: failed program was:" >&5
11044 cat conftest.$ac_ext >&5
11045 eval "$as_ac_Lib=no"
11046 fi
11047 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11048 LIBS=$ac_check_lib_save_LIBS
11049 fi
11050 echo "$as_me:11050: result: `eval echo '${'$as_ac_Lib'}'`" >&5
11051 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
11052 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
11053   cat >>confdefs.h <<EOF
11054 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
11055 EOF
11056
11057   LIBS="-lform$cf_cv_libtype $LIBS"
11058
11059 fi
11060
11061         # look for curses-related headers
11062
11063 for ac_header in \
11064                 nc_alloc.h \
11065                 nomacros.h \
11066                 form.h \
11067                 menu.h \
11068                 panel.h \
11069
11070 do
11071 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11072 echo "$as_me:11072: checking for $ac_header" >&5
11073 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11074 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11075   echo $ECHO_N "(cached) $ECHO_C" >&6
11076 else
11077   cat >conftest.$ac_ext <<_ACEOF
11078 #line 11078 "configure"
11079 #include "confdefs.h"
11080 #include <$ac_header>
11081 _ACEOF
11082 if { (eval echo "$as_me:11082: \"$ac_cpp conftest.$ac_ext\"") >&5
11083   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11084   ac_status=$?
11085   egrep -v '^ *\+' conftest.er1 >conftest.err
11086   rm -f conftest.er1
11087   cat conftest.err >&5
11088   echo "$as_me:11088: \$? = $ac_status" >&5
11089   (exit $ac_status); } >/dev/null; then
11090   if test -s conftest.err; then
11091     ac_cpp_err=$ac_c_preproc_warn_flag
11092   else
11093     ac_cpp_err=
11094   fi
11095 else
11096   ac_cpp_err=yes
11097 fi
11098 if test -z "$ac_cpp_err"; then
11099   eval "$as_ac_Header=yes"
11100 else
11101   echo "$as_me: failed program was:" >&5
11102   cat conftest.$ac_ext >&5
11103   eval "$as_ac_Header=no"
11104 fi
11105 rm -f conftest.err conftest.$ac_ext
11106 fi
11107 echo "$as_me:11107: result: `eval echo '${'$as_ac_Header'}'`" >&5
11108 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
11109 if test `eval echo '${'$as_ac_Header'}'` = yes; then
11110   cat >>confdefs.h <<EOF
11111 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11112 EOF
11113
11114 fi
11115 done
11116
11117         ;;
11118 esac
11119
11120 echo "$as_me:11120: checking return type of signal handlers" >&5
11121 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
11122 if test "${ac_cv_type_signal+set}" = set; then
11123   echo $ECHO_N "(cached) $ECHO_C" >&6
11124 else
11125   cat >conftest.$ac_ext <<_ACEOF
11126 #line 11126 "configure"
11127 #include "confdefs.h"
11128 #include <sys/types.h>
11129 #include <signal.h>
11130 #ifdef signal
11131 # undef signal
11132 #endif
11133 #ifdef __cplusplus
11134 extern "C" void (*signal (int, void (*)(int)))(int);
11135 #else
11136 void (*signal ()) ();
11137 #endif
11138
11139 int
11140 main ()
11141 {
11142 int i;
11143   ;
11144   return 0;
11145 }
11146 _ACEOF
11147 rm -f conftest.$ac_objext
11148 if { (eval echo "$as_me:11148: \"$ac_compile\"") >&5
11149   (eval $ac_compile) 2>&5
11150   ac_status=$?
11151   echo "$as_me:11151: \$? = $ac_status" >&5
11152   (exit $ac_status); } &&
11153          { ac_try='test -s conftest.$ac_objext'
11154   { (eval echo "$as_me:11154: \"$ac_try\"") >&5
11155   (eval $ac_try) 2>&5
11156   ac_status=$?
11157   echo "$as_me:11157: \$? = $ac_status" >&5
11158   (exit $ac_status); }; }; then
11159   ac_cv_type_signal=void
11160 else
11161   echo "$as_me: failed program was:" >&5
11162 cat conftest.$ac_ext >&5
11163 ac_cv_type_signal=int
11164 fi
11165 rm -f conftest.$ac_objext conftest.$ac_ext
11166 fi
11167 echo "$as_me:11167: result: $ac_cv_type_signal" >&5
11168 echo "${ECHO_T}$ac_cv_type_signal" >&6
11169
11170 cat >>confdefs.h <<EOF
11171 #define RETSIGTYPE $ac_cv_type_signal
11172 EOF
11173
11174 echo "$as_me:11174: checking for ANSI C header files" >&5
11175 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
11176 if test "${ac_cv_header_stdc+set}" = set; then
11177   echo $ECHO_N "(cached) $ECHO_C" >&6
11178 else
11179   cat >conftest.$ac_ext <<_ACEOF
11180 #line 11180 "configure"
11181 #include "confdefs.h"
11182 #include <stdlib.h>
11183 #include <stdarg.h>
11184 #include <string.h>
11185 #include <float.h>
11186
11187 _ACEOF
11188 if { (eval echo "$as_me:11188: \"$ac_cpp conftest.$ac_ext\"") >&5
11189   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11190   ac_status=$?
11191   egrep -v '^ *\+' conftest.er1 >conftest.err
11192   rm -f conftest.er1
11193   cat conftest.err >&5
11194   echo "$as_me:11194: \$? = $ac_status" >&5
11195   (exit $ac_status); } >/dev/null; then
11196   if test -s conftest.err; then
11197     ac_cpp_err=$ac_c_preproc_warn_flag
11198   else
11199     ac_cpp_err=
11200   fi
11201 else
11202   ac_cpp_err=yes
11203 fi
11204 if test -z "$ac_cpp_err"; then
11205   ac_cv_header_stdc=yes
11206 else
11207   echo "$as_me: failed program was:" >&5
11208   cat conftest.$ac_ext >&5
11209   ac_cv_header_stdc=no
11210 fi
11211 rm -f conftest.err conftest.$ac_ext
11212
11213 if test $ac_cv_header_stdc = yes; then
11214   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
11215   cat >conftest.$ac_ext <<_ACEOF
11216 #line 11216 "configure"
11217 #include "confdefs.h"
11218 #include <string.h>
11219
11220 _ACEOF
11221 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11222   egrep "memchr" >/dev/null 2>&1; then
11223   :
11224 else
11225   ac_cv_header_stdc=no
11226 fi
11227 rm -rf conftest*
11228
11229 fi
11230
11231 if test $ac_cv_header_stdc = yes; then
11232   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
11233   cat >conftest.$ac_ext <<_ACEOF
11234 #line 11234 "configure"
11235 #include "confdefs.h"
11236 #include <stdlib.h>
11237
11238 _ACEOF
11239 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11240   egrep "free" >/dev/null 2>&1; then
11241   :
11242 else
11243   ac_cv_header_stdc=no
11244 fi
11245 rm -rf conftest*
11246
11247 fi
11248
11249 if test $ac_cv_header_stdc = yes; then
11250   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
11251   if test "$cross_compiling" = yes; then
11252   :
11253 else
11254   cat >conftest.$ac_ext <<_ACEOF
11255 #line 11255 "configure"
11256 #include "confdefs.h"
11257 #include <ctype.h>
11258 #if ((' ' & 0x0FF) == 0x020)
11259 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
11260 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
11261 #else
11262 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
11263                      || ('j' <= (c) && (c) <= 'r') \
11264                      || ('s' <= (c) && (c) <= 'z'))
11265 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
11266 #endif
11267
11268 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
11269 int
11270 main ()
11271 {
11272   int i;
11273   for (i = 0; i < 256; i++)
11274     if (XOR (islower (i), ISLOWER (i))
11275         || toupper (i) != TOUPPER (i))
11276       $ac_main_return(2);
11277   $ac_main_return (0);
11278 }
11279 _ACEOF
11280 rm -f conftest$ac_exeext
11281 if { (eval echo "$as_me:11281: \"$ac_link\"") >&5
11282   (eval $ac_link) 2>&5
11283   ac_status=$?
11284   echo "$as_me:11284: \$? = $ac_status" >&5
11285   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11286   { (eval echo "$as_me:11286: \"$ac_try\"") >&5
11287   (eval $ac_try) 2>&5
11288   ac_status=$?
11289   echo "$as_me:11289: \$? = $ac_status" >&5
11290   (exit $ac_status); }; }; then
11291   :
11292 else
11293   echo "$as_me: program exited with status $ac_status" >&5
11294 echo "$as_me: failed program was:" >&5
11295 cat conftest.$ac_ext >&5
11296 ac_cv_header_stdc=no
11297 fi
11298 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11299 fi
11300 fi
11301 fi
11302 echo "$as_me:11302: result: $ac_cv_header_stdc" >&5
11303 echo "${ECHO_T}$ac_cv_header_stdc" >&6
11304 if test $ac_cv_header_stdc = yes; then
11305
11306 cat >>confdefs.h <<\EOF
11307 #define STDC_HEADERS 1
11308 EOF
11309
11310 fi
11311
11312 echo "$as_me:11312: checking whether time.h and sys/time.h may both be included" >&5
11313 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
11314 if test "${ac_cv_header_time+set}" = set; then
11315   echo $ECHO_N "(cached) $ECHO_C" >&6
11316 else
11317   cat >conftest.$ac_ext <<_ACEOF
11318 #line 11318 "configure"
11319 #include "confdefs.h"
11320 #include <sys/types.h>
11321 #include <sys/time.h>
11322 #include <time.h>
11323
11324 int
11325 main ()
11326 {
11327 if ((struct tm *) 0)
11328 return 0;
11329   ;
11330   return 0;
11331 }
11332 _ACEOF
11333 rm -f conftest.$ac_objext
11334 if { (eval echo "$as_me:11334: \"$ac_compile\"") >&5
11335   (eval $ac_compile) 2>&5
11336   ac_status=$?
11337   echo "$as_me:11337: \$? = $ac_status" >&5
11338   (exit $ac_status); } &&
11339          { ac_try='test -s conftest.$ac_objext'
11340   { (eval echo "$as_me:11340: \"$ac_try\"") >&5
11341   (eval $ac_try) 2>&5
11342   ac_status=$?
11343   echo "$as_me:11343: \$? = $ac_status" >&5
11344   (exit $ac_status); }; }; then
11345   ac_cv_header_time=yes
11346 else
11347   echo "$as_me: failed program was:" >&5
11348 cat conftest.$ac_ext >&5
11349 ac_cv_header_time=no
11350 fi
11351 rm -f conftest.$ac_objext conftest.$ac_ext
11352 fi
11353 echo "$as_me:11353: result: $ac_cv_header_time" >&5
11354 echo "${ECHO_T}$ac_cv_header_time" >&6
11355 if test $ac_cv_header_time = yes; then
11356
11357 cat >>confdefs.h <<\EOF
11358 #define TIME_WITH_SYS_TIME 1
11359 EOF
11360
11361 fi
11362
11363 for ac_header in \
11364 getopt.h \
11365 locale.h \
11366 stdarg.h \
11367 sys/ioctl.h \
11368 sys/select.h \
11369 sys/time.h \
11370 termios.h \
11371 unistd.h \
11372
11373 do
11374 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11375 echo "$as_me:11375: checking for $ac_header" >&5
11376 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11377 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11378   echo $ECHO_N "(cached) $ECHO_C" >&6
11379 else
11380   cat >conftest.$ac_ext <<_ACEOF
11381 #line 11381 "configure"
11382 #include "confdefs.h"
11383 #include <$ac_header>
11384 _ACEOF
11385 if { (eval echo "$as_me:11385: \"$ac_cpp conftest.$ac_ext\"") >&5
11386   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11387   ac_status=$?
11388   egrep -v '^ *\+' conftest.er1 >conftest.err
11389   rm -f conftest.er1
11390   cat conftest.err >&5
11391   echo "$as_me:11391: \$? = $ac_status" >&5
11392   (exit $ac_status); } >/dev/null; then
11393   if test -s conftest.err; then
11394     ac_cpp_err=$ac_c_preproc_warn_flag
11395   else
11396     ac_cpp_err=
11397   fi
11398 else
11399   ac_cpp_err=yes
11400 fi
11401 if test -z "$ac_cpp_err"; then
11402   eval "$as_ac_Header=yes"
11403 else
11404   echo "$as_me: failed program was:" >&5
11405   cat conftest.$ac_ext >&5
11406   eval "$as_ac_Header=no"
11407 fi
11408 rm -f conftest.err conftest.$ac_ext
11409 fi
11410 echo "$as_me:11410: result: `eval echo '${'$as_ac_Header'}'`" >&5
11411 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
11412 if test `eval echo '${'$as_ac_Header'}'` = yes; then
11413   cat >>confdefs.h <<EOF
11414 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11415 EOF
11416
11417 fi
11418 done
11419
11420 for ac_func in \
11421 gettimeofday \
11422 mblen \
11423 mbrlen \
11424 mbrtowc \
11425 mbsrtowcs \
11426 mbstowcs \
11427 mbtowc \
11428 strdup \
11429 wcsrtombs \
11430 wcstombs \
11431
11432 do
11433 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
11434 echo "$as_me:11434: checking for $ac_func" >&5
11435 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
11436 if eval "test \"\${$as_ac_var+set}\" = set"; then
11437   echo $ECHO_N "(cached) $ECHO_C" >&6
11438 else
11439   cat >conftest.$ac_ext <<_ACEOF
11440 #line 11440 "configure"
11441 #include "confdefs.h"
11442 /* System header to define __stub macros and hopefully few prototypes,
11443     which can conflict with char $ac_func (); below.  */
11444 #include <assert.h>
11445 /* Override any gcc2 internal prototype to avoid an error.  */
11446 #ifdef __cplusplus
11447 extern "C"
11448 #endif
11449 /* We use char because int might match the return type of a gcc2
11450    builtin and then its argument prototype would still apply.  */
11451 char $ac_func ();
11452 char (*f) ();
11453
11454 int
11455 main ()
11456 {
11457 /* The GNU C library defines this for functions which it implements
11458     to always fail with ENOSYS.  Some functions are actually named
11459     something starting with __ and the normal name is an alias.  */
11460 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11461 choke me
11462 #else
11463 f = $ac_func;
11464 #endif
11465
11466   ;
11467   return 0;
11468 }
11469 _ACEOF
11470 rm -f conftest.$ac_objext conftest$ac_exeext
11471 if { (eval echo "$as_me:11471: \"$ac_link\"") >&5
11472   (eval $ac_link) 2>&5
11473   ac_status=$?
11474   echo "$as_me:11474: \$? = $ac_status" >&5
11475   (exit $ac_status); } &&
11476          { ac_try='test -s conftest$ac_exeext'
11477   { (eval echo "$as_me:11477: \"$ac_try\"") >&5
11478   (eval $ac_try) 2>&5
11479   ac_status=$?
11480   echo "$as_me:11480: \$? = $ac_status" >&5
11481   (exit $ac_status); }; }; then
11482   eval "$as_ac_var=yes"
11483 else
11484   echo "$as_me: failed program was:" >&5
11485 cat conftest.$ac_ext >&5
11486 eval "$as_ac_var=no"
11487 fi
11488 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11489 fi
11490 echo "$as_me:11490: result: `eval echo '${'$as_ac_var'}'`" >&5
11491 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
11492 if test `eval echo '${'$as_ac_var'}'` = yes; then
11493   cat >>confdefs.h <<EOF
11494 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
11495 EOF
11496
11497 fi
11498 done
11499
11500 echo "$as_me:11500: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
11501 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
11502 if test "${cf_cv_need_xopen_extension+set}" = set; then
11503   echo $ECHO_N "(cached) $ECHO_C" >&6
11504 else
11505
11506 cat >conftest.$ac_ext <<_ACEOF
11507 #line 11507 "configure"
11508 #include "confdefs.h"
11509
11510 #include <stdlib.h>
11511 #include <${cf_cv_ncurses_header:-curses.h}>
11512 int
11513 main ()
11514 {
11515
11516 #if defined(NCURSES_VERSION_PATCH)
11517 if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
11518         make an error
11519 #endif
11520 #endif
11521         long x = winnstr(stdscr, "", 0);
11522         int x1, y1;
11523         getbegyx(stdscr, y1, x1)
11524   ;
11525   return 0;
11526 }
11527 _ACEOF
11528 rm -f conftest.$ac_objext conftest$ac_exeext
11529 if { (eval echo "$as_me:11529: \"$ac_link\"") >&5
11530   (eval $ac_link) 2>&5
11531   ac_status=$?
11532   echo "$as_me:11532: \$? = $ac_status" >&5
11533   (exit $ac_status); } &&
11534          { ac_try='test -s conftest$ac_exeext'
11535   { (eval echo "$as_me:11535: \"$ac_try\"") >&5
11536   (eval $ac_try) 2>&5
11537   ac_status=$?
11538   echo "$as_me:11538: \$? = $ac_status" >&5
11539   (exit $ac_status); }; }; then
11540   cf_cv_need_xopen_extension=no
11541 else
11542   echo "$as_me: failed program was:" >&5
11543 cat conftest.$ac_ext >&5
11544 cat >conftest.$ac_ext <<_ACEOF
11545 #line 11545 "configure"
11546 #include "confdefs.h"
11547
11548 #define _XOPEN_SOURCE_EXTENDED
11549 #include <stdlib.h>
11550 #include <${cf_cv_ncurses_header:-curses.h}>
11551 int
11552 main ()
11553 {
11554
11555 #ifdef NCURSES_VERSION
11556         cchar_t check;
11557         int check2 = curs_set((int)sizeof(check));
11558 #endif
11559         long x = winnstr(stdscr, "", 0);
11560         int x1, y1;
11561         getbegyx(stdscr, y1, x1)
11562   ;
11563   return 0;
11564 }
11565 _ACEOF
11566 rm -f conftest.$ac_objext conftest$ac_exeext
11567 if { (eval echo "$as_me:11567: \"$ac_link\"") >&5
11568   (eval $ac_link) 2>&5
11569   ac_status=$?
11570   echo "$as_me:11570: \$? = $ac_status" >&5
11571   (exit $ac_status); } &&
11572          { ac_try='test -s conftest$ac_exeext'
11573   { (eval echo "$as_me:11573: \"$ac_try\"") >&5
11574   (eval $ac_try) 2>&5
11575   ac_status=$?
11576   echo "$as_me:11576: \$? = $ac_status" >&5
11577   (exit $ac_status); }; }; then
11578   cf_cv_need_xopen_extension=yes
11579 else
11580   echo "$as_me: failed program was:" >&5
11581 cat conftest.$ac_ext >&5
11582 cf_cv_need_xopen_extension=unknown
11583 fi
11584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11585 fi
11586 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11587 fi
11588 echo "$as_me:11588: result: $cf_cv_need_xopen_extension" >&5
11589 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
11590 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
11591
11592 echo "$as_me:11592: checking for term.h" >&5
11593 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
11594 if test "${cf_cv_term_header+set}" = set; then
11595   echo $ECHO_N "(cached) $ECHO_C" >&6
11596 else
11597
11598 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
11599 # for <term.h> if we do not find the variant.
11600 for cf_header in \
11601         `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
11602         term.h
11603 do
11604         cat >conftest.$ac_ext <<_ACEOF
11605 #line 11605 "configure"
11606 #include "confdefs.h"
11607
11608 #include <${cf_cv_ncurses_header:-curses.h}>
11609 #include <${cf_header}>
11610 int
11611 main ()
11612 {
11613 WINDOW *x
11614   ;
11615   return 0;
11616 }
11617 _ACEOF
11618 rm -f conftest.$ac_objext
11619 if { (eval echo "$as_me:11619: \"$ac_compile\"") >&5
11620   (eval $ac_compile) 2>&5
11621   ac_status=$?
11622   echo "$as_me:11622: \$? = $ac_status" >&5
11623   (exit $ac_status); } &&
11624          { ac_try='test -s conftest.$ac_objext'
11625   { (eval echo "$as_me:11625: \"$ac_try\"") >&5
11626   (eval $ac_try) 2>&5
11627   ac_status=$?
11628   echo "$as_me:11628: \$? = $ac_status" >&5
11629   (exit $ac_status); }; }; then
11630   cf_cv_term_header=$cf_header
11631          break
11632 else
11633   echo "$as_me: failed program was:" >&5
11634 cat conftest.$ac_ext >&5
11635 cf_cv_term_header=no
11636 fi
11637 rm -f conftest.$ac_objext conftest.$ac_ext
11638 done
11639
11640 case $cf_cv_term_header in #(vi
11641 no)
11642         # If curses is ncurses, some packagers still mess it up by trying to make
11643         # us use GNU termcap.  This handles the most common case.
11644         for cf_header in ncurses/term.h ncursesw/term.h
11645         do
11646                 cat >conftest.$ac_ext <<_ACEOF
11647 #line 11647 "configure"
11648 #include "confdefs.h"
11649
11650 #include <${cf_cv_ncurses_header:-curses.h}>
11651 #ifdef NCURSES_VERSION
11652 #include <${cf_header}>
11653 #else
11654 make an error
11655 #endif
11656 int
11657 main ()
11658 {
11659 WINDOW *x
11660   ;
11661   return 0;
11662 }
11663 _ACEOF
11664 rm -f conftest.$ac_objext
11665 if { (eval echo "$as_me:11665: \"$ac_compile\"") >&5
11666   (eval $ac_compile) 2>&5
11667   ac_status=$?
11668   echo "$as_me:11668: \$? = $ac_status" >&5
11669   (exit $ac_status); } &&
11670          { ac_try='test -s conftest.$ac_objext'
11671   { (eval echo "$as_me:11671: \"$ac_try\"") >&5
11672   (eval $ac_try) 2>&5
11673   ac_status=$?
11674   echo "$as_me:11674: \$? = $ac_status" >&5
11675   (exit $ac_status); }; }; then
11676   cf_cv_term_header=$cf_header
11677                          break
11678 else
11679   echo "$as_me: failed program was:" >&5
11680 cat conftest.$ac_ext >&5
11681 cf_cv_term_header=no
11682 fi
11683 rm -f conftest.$ac_objext conftest.$ac_ext
11684         done
11685         ;;
11686 esac
11687
11688 fi
11689 echo "$as_me:11689: result: $cf_cv_term_header" >&5
11690 echo "${ECHO_T}$cf_cv_term_header" >&6
11691
11692 case $cf_cv_term_header in #(vi
11693 term.h) #(vi
11694         cat >>confdefs.h <<\EOF
11695 #define HAVE_TERM_H 1
11696 EOF
11697
11698         ;;
11699 ncurses/term.h) #(vi
11700         cat >>confdefs.h <<\EOF
11701 #define HAVE_NCURSES_TERM_H 1
11702 EOF
11703
11704         ;;
11705 ncursesw/term.h)
11706         cat >>confdefs.h <<\EOF
11707 #define HAVE_NCURSESW_TERM_H 1
11708 EOF
11709
11710         ;;
11711 esac
11712
11713 for cf_func in \
11714 chgat \
11715 color_set \
11716 filter \
11717 getbegx \
11718 getcurx \
11719 getmaxx \
11720 getnstr \
11721 getparx \
11722 getwin \
11723 mvvline \
11724 mvwvline \
11725 napms \
11726 putwin \
11727 resize_term \
11728 resizeterm \
11729 ripoffline \
11730 setupterm \
11731 slk_color \
11732 slk_init \
11733 termattrs \
11734 tgetent \
11735 tigetnum \
11736 tigetstr \
11737 typeahead \
11738 use_default_colors \
11739 vw_printw \
11740 vsscanf \
11741 wchgat \
11742 winsstr \
11743 wresize \
11744
11745 do
11746
11747 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11748
11749         echo "$as_me:11749: checking for ${cf_func}" >&5
11750 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
11751
11752 echo "${as_me:-configure}:11752: testing ${cf_func} ..." 1>&5
11753
11754         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
11755   echo $ECHO_N "(cached) $ECHO_C" >&6
11756 else
11757
11758                 eval cf_result='$ac_cv_func_'$cf_func
11759                 if test ".$cf_result" != ".no"; then
11760                         cat >conftest.$ac_ext <<_ACEOF
11761 #line 11761 "configure"
11762 #include "confdefs.h"
11763
11764 #ifdef HAVE_XCURSES
11765 #include <xcurses.h>
11766 char * XCursesProgramName = "test";
11767 #else
11768 #include <${cf_cv_ncurses_header:-curses.h}>
11769 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
11770 #include <ncursesw/term.h>
11771 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
11772 #include <ncurses/term.h>
11773 #elif defined(HAVE_TERM_H)
11774 #include <term.h>
11775 #endif
11776 #endif
11777
11778 int
11779 main ()
11780 {
11781
11782 #ifndef ${cf_func}
11783 long foo = (long)(&${cf_func});
11784 ${cf_cv_main_return:-return}(foo == 0);
11785 #endif
11786
11787   ;
11788   return 0;
11789 }
11790 _ACEOF
11791 rm -f conftest.$ac_objext conftest$ac_exeext
11792 if { (eval echo "$as_me:11792: \"$ac_link\"") >&5
11793   (eval $ac_link) 2>&5
11794   ac_status=$?
11795   echo "$as_me:11795: \$? = $ac_status" >&5
11796   (exit $ac_status); } &&
11797          { ac_try='test -s conftest$ac_exeext'
11798   { (eval echo "$as_me:11798: \"$ac_try\"") >&5
11799   (eval $ac_try) 2>&5
11800   ac_status=$?
11801   echo "$as_me:11801: \$? = $ac_status" >&5
11802   (exit $ac_status); }; }; then
11803   cf_result=yes
11804 else
11805   echo "$as_me: failed program was:" >&5
11806 cat conftest.$ac_ext >&5
11807 cf_result=no
11808 fi
11809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11810                 fi
11811                 eval 'cf_cv_func_'$cf_func'=$cf_result'
11812
11813 fi
11814
11815         # use the computed/retrieved cache-value:
11816         eval 'cf_result=$cf_cv_func_'$cf_func
11817         echo "$as_me:11817: result: $cf_result" >&5
11818 echo "${ECHO_T}$cf_result" >&6
11819         if test $cf_result != no; then
11820                 cat >>confdefs.h <<EOF
11821 #define HAVE_${cf_tr_func} 1
11822 EOF
11823
11824         fi
11825 done
11826
11827 echo "$as_me:11827: checking for ncurses extended functions" >&5
11828 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
11829 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
11830   echo $ECHO_N "(cached) $ECHO_C" >&6
11831 else
11832
11833 cat >conftest.$ac_ext <<_ACEOF
11834 #line 11834 "configure"
11835 #include "confdefs.h"
11836
11837 #include <${cf_cv_ncurses_header:-curses.h}>
11838 int
11839 main ()
11840 {
11841
11842 int x = NCURSES_EXT_FUNCS
11843
11844   ;
11845   return 0;
11846 }
11847 _ACEOF
11848 rm -f conftest.$ac_objext
11849 if { (eval echo "$as_me:11849: \"$ac_compile\"") >&5
11850   (eval $ac_compile) 2>&5
11851   ac_status=$?
11852   echo "$as_me:11852: \$? = $ac_status" >&5
11853   (exit $ac_status); } &&
11854          { ac_try='test -s conftest.$ac_objext'
11855   { (eval echo "$as_me:11855: \"$ac_try\"") >&5
11856   (eval $ac_try) 2>&5
11857   ac_status=$?
11858   echo "$as_me:11858: \$? = $ac_status" >&5
11859   (exit $ac_status); }; }; then
11860   cf_cv_ncurses_ext_funcs=defined
11861 else
11862   echo "$as_me: failed program was:" >&5
11863 cat conftest.$ac_ext >&5
11864
11865 cat >conftest.$ac_ext <<_ACEOF
11866 #line 11866 "configure"
11867 #include "confdefs.h"
11868
11869 #include <${cf_cv_ncurses_header:-curses.h}>
11870 int
11871 main ()
11872 {
11873
11874         (void) assume_default_colors (0, 0);
11875         (void) curses_version ();
11876         (void) define_key (0, 0);
11877         (void) is_term_resized (0, 0);
11878         (void) key_defined (0);
11879         (void) keybound (0, 0);
11880         (void) keyok (0, 0);
11881         (void) resize_term (0, 0);
11882         (void) resizeterm (0, 0);
11883         (void) use_default_colors ();
11884         (void) use_extended_names (0);
11885         (void) wresize (0, 0, 0);
11886   ;
11887   return 0;
11888 }
11889 _ACEOF
11890 rm -f conftest.$ac_objext conftest$ac_exeext
11891 if { (eval echo "$as_me:11891: \"$ac_link\"") >&5
11892   (eval $ac_link) 2>&5
11893   ac_status=$?
11894   echo "$as_me:11894: \$? = $ac_status" >&5
11895   (exit $ac_status); } &&
11896          { ac_try='test -s conftest$ac_exeext'
11897   { (eval echo "$as_me:11897: \"$ac_try\"") >&5
11898   (eval $ac_try) 2>&5
11899   ac_status=$?
11900   echo "$as_me:11900: \$? = $ac_status" >&5
11901   (exit $ac_status); }; }; then
11902   cf_cv_ncurses_ext_funcs=yes
11903 else
11904   echo "$as_me: failed program was:" >&5
11905 cat conftest.$ac_ext >&5
11906 cf_cv_ncurses_ext_funcs=no
11907 fi
11908 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11909
11910 fi
11911 rm -f conftest.$ac_objext conftest.$ac_ext
11912
11913 fi
11914 echo "$as_me:11914: result: $cf_cv_ncurses_ext_funcs" >&5
11915 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
11916 test "$cf_cv_ncurses_ext_funcs" == yes && cat >>confdefs.h <<\EOF
11917 #define NCURSES_EXT_FUNCS 1
11918 EOF
11919
11920 echo "$as_me:11920: checking for wide-character functions" >&5
11921 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
11922 if test "${cf_cv_widechar_funcs+set}" = set; then
11923   echo $ECHO_N "(cached) $ECHO_C" >&6
11924 else
11925
11926 cat >conftest.$ac_ext <<_ACEOF
11927 #line 11927 "configure"
11928 #include "confdefs.h"
11929
11930 #include <${cf_cv_ncurses_header:-curses.h}>
11931 int
11932 main ()
11933 {
11934
11935         static wchar_t src_wchar[2];
11936         static cchar_t dst_cchar;
11937         setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
11938
11939   ;
11940   return 0;
11941 }
11942 _ACEOF
11943 rm -f conftest.$ac_objext conftest$ac_exeext
11944 if { (eval echo "$as_me:11944: \"$ac_link\"") >&5
11945   (eval $ac_link) 2>&5
11946   ac_status=$?
11947   echo "$as_me:11947: \$? = $ac_status" >&5
11948   (exit $ac_status); } &&
11949          { ac_try='test -s conftest$ac_exeext'
11950   { (eval echo "$as_me:11950: \"$ac_try\"") >&5
11951   (eval $ac_try) 2>&5
11952   ac_status=$?
11953   echo "$as_me:11953: \$? = $ac_status" >&5
11954   (exit $ac_status); }; }; then
11955   cf_cv_widechar_funcs=yes
11956 else
11957   echo "$as_me: failed program was:" >&5
11958 cat conftest.$ac_ext >&5
11959 cf_cv_widechar_funcs=no
11960 fi
11961 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11962
11963 fi
11964 echo "$as_me:11964: result: $cf_cv_widechar_funcs" >&5
11965 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
11966 if test "$cf_cv_widechar_funcs" != no ; then
11967         cat >>confdefs.h <<\EOF
11968 #define USE_WIDEC_SUPPORT 1
11969 EOF
11970
11971 else
11972         cat >>confdefs.h <<\EOF
11973 #define USE_WIDEC_SUPPORT 0
11974 EOF
11975
11976 fi
11977
11978 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
11979
11980 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
11981                   inttypes.h stdint.h unistd.h
11982 do
11983 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11984 echo "$as_me:11984: checking for $ac_header" >&5
11985 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11986 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11987   echo $ECHO_N "(cached) $ECHO_C" >&6
11988 else
11989   cat >conftest.$ac_ext <<_ACEOF
11990 #line 11990 "configure"
11991 #include "confdefs.h"
11992 $ac_includes_default
11993 #include <$ac_header>
11994 _ACEOF
11995 rm -f conftest.$ac_objext
11996 if { (eval echo "$as_me:11996: \"$ac_compile\"") >&5
11997   (eval $ac_compile) 2>&5
11998   ac_status=$?
11999   echo "$as_me:11999: \$? = $ac_status" >&5
12000   (exit $ac_status); } &&
12001          { ac_try='test -s conftest.$ac_objext'
12002   { (eval echo "$as_me:12002: \"$ac_try\"") >&5
12003   (eval $ac_try) 2>&5
12004   ac_status=$?
12005   echo "$as_me:12005: \$? = $ac_status" >&5
12006   (exit $ac_status); }; }; then
12007   eval "$as_ac_Header=yes"
12008 else
12009   echo "$as_me: failed program was:" >&5
12010 cat conftest.$ac_ext >&5
12011 eval "$as_ac_Header=no"
12012 fi
12013 rm -f conftest.$ac_objext conftest.$ac_ext
12014 fi
12015 echo "$as_me:12015: result: `eval echo '${'$as_ac_Header'}'`" >&5
12016 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12017 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12018   cat >>confdefs.h <<EOF
12019 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12020 EOF
12021
12022 fi
12023 done
12024
12025 echo "$as_me:12025: checking for pid_t" >&5
12026 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
12027 if test "${ac_cv_type_pid_t+set}" = set; then
12028   echo $ECHO_N "(cached) $ECHO_C" >&6
12029 else
12030   cat >conftest.$ac_ext <<_ACEOF
12031 #line 12031 "configure"
12032 #include "confdefs.h"
12033 $ac_includes_default
12034 int
12035 main ()
12036 {
12037 if ((pid_t *) 0)
12038   return 0;
12039 if (sizeof (pid_t))
12040   return 0;
12041   ;
12042   return 0;
12043 }
12044 _ACEOF
12045 rm -f conftest.$ac_objext
12046 if { (eval echo "$as_me:12046: \"$ac_compile\"") >&5
12047   (eval $ac_compile) 2>&5
12048   ac_status=$?
12049   echo "$as_me:12049: \$? = $ac_status" >&5
12050   (exit $ac_status); } &&
12051          { ac_try='test -s conftest.$ac_objext'
12052   { (eval echo "$as_me:12052: \"$ac_try\"") >&5
12053   (eval $ac_try) 2>&5
12054   ac_status=$?
12055   echo "$as_me:12055: \$? = $ac_status" >&5
12056   (exit $ac_status); }; }; then
12057   ac_cv_type_pid_t=yes
12058 else
12059   echo "$as_me: failed program was:" >&5
12060 cat conftest.$ac_ext >&5
12061 ac_cv_type_pid_t=no
12062 fi
12063 rm -f conftest.$ac_objext conftest.$ac_ext
12064 fi
12065 echo "$as_me:12065: result: $ac_cv_type_pid_t" >&5
12066 echo "${ECHO_T}$ac_cv_type_pid_t" >&6
12067 if test $ac_cv_type_pid_t = yes; then
12068   :
12069 else
12070
12071 cat >>confdefs.h <<EOF
12072 #define pid_t int
12073 EOF
12074
12075 fi
12076
12077 for ac_header in unistd.h vfork.h
12078 do
12079 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12080 echo "$as_me:12080: checking for $ac_header" >&5
12081 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12082 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12083   echo $ECHO_N "(cached) $ECHO_C" >&6
12084 else
12085   cat >conftest.$ac_ext <<_ACEOF
12086 #line 12086 "configure"
12087 #include "confdefs.h"
12088 #include <$ac_header>
12089 _ACEOF
12090 if { (eval echo "$as_me:12090: \"$ac_cpp conftest.$ac_ext\"") >&5
12091   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12092   ac_status=$?
12093   egrep -v '^ *\+' conftest.er1 >conftest.err
12094   rm -f conftest.er1
12095   cat conftest.err >&5
12096   echo "$as_me:12096: \$? = $ac_status" >&5
12097   (exit $ac_status); } >/dev/null; then
12098   if test -s conftest.err; then
12099     ac_cpp_err=$ac_c_preproc_warn_flag
12100   else
12101     ac_cpp_err=
12102   fi
12103 else
12104   ac_cpp_err=yes
12105 fi
12106 if test -z "$ac_cpp_err"; then
12107   eval "$as_ac_Header=yes"
12108 else
12109   echo "$as_me: failed program was:" >&5
12110   cat conftest.$ac_ext >&5
12111   eval "$as_ac_Header=no"
12112 fi
12113 rm -f conftest.err conftest.$ac_ext
12114 fi
12115 echo "$as_me:12115: result: `eval echo '${'$as_ac_Header'}'`" >&5
12116 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12117 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12118   cat >>confdefs.h <<EOF
12119 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12120 EOF
12121
12122 fi
12123 done
12124
12125 for ac_func in fork vfork
12126 do
12127 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12128 echo "$as_me:12128: checking for $ac_func" >&5
12129 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12130 if eval "test \"\${$as_ac_var+set}\" = set"; then
12131   echo $ECHO_N "(cached) $ECHO_C" >&6
12132 else
12133   cat >conftest.$ac_ext <<_ACEOF
12134 #line 12134 "configure"
12135 #include "confdefs.h"
12136 /* System header to define __stub macros and hopefully few prototypes,
12137     which can conflict with char $ac_func (); below.  */
12138 #include <assert.h>
12139 /* Override any gcc2 internal prototype to avoid an error.  */
12140 #ifdef __cplusplus
12141 extern "C"
12142 #endif
12143 /* We use char because int might match the return type of a gcc2
12144    builtin and then its argument prototype would still apply.  */
12145 char $ac_func ();
12146 char (*f) ();
12147
12148 int
12149 main ()
12150 {
12151 /* The GNU C library defines this for functions which it implements
12152     to always fail with ENOSYS.  Some functions are actually named
12153     something starting with __ and the normal name is an alias.  */
12154 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12155 choke me
12156 #else
12157 f = $ac_func;
12158 #endif
12159
12160   ;
12161   return 0;
12162 }
12163 _ACEOF
12164 rm -f conftest.$ac_objext conftest$ac_exeext
12165 if { (eval echo "$as_me:12165: \"$ac_link\"") >&5
12166   (eval $ac_link) 2>&5
12167   ac_status=$?
12168   echo "$as_me:12168: \$? = $ac_status" >&5
12169   (exit $ac_status); } &&
12170          { ac_try='test -s conftest$ac_exeext'
12171   { (eval echo "$as_me:12171: \"$ac_try\"") >&5
12172   (eval $ac_try) 2>&5
12173   ac_status=$?
12174   echo "$as_me:12174: \$? = $ac_status" >&5
12175   (exit $ac_status); }; }; then
12176   eval "$as_ac_var=yes"
12177 else
12178   echo "$as_me: failed program was:" >&5
12179 cat conftest.$ac_ext >&5
12180 eval "$as_ac_var=no"
12181 fi
12182 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12183 fi
12184 echo "$as_me:12184: result: `eval echo '${'$as_ac_var'}'`" >&5
12185 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12186 if test `eval echo '${'$as_ac_var'}'` = yes; then
12187   cat >>confdefs.h <<EOF
12188 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12189 EOF
12190
12191 fi
12192 done
12193
12194 ac_cv_func_fork_works=$ac_cv_func_fork
12195 if test "x$ac_cv_func_fork" = xyes; then
12196   echo "$as_me:12196: checking for working fork" >&5
12197 echo $ECHO_N "checking for working fork... $ECHO_C" >&6
12198 if test "${ac_cv_func_fork_works+set}" = set; then
12199   echo $ECHO_N "(cached) $ECHO_C" >&6
12200 else
12201   if test "$cross_compiling" = yes; then
12202   ac_cv_func_fork_works=cross
12203 else
12204   cat >conftest.$ac_ext <<_ACEOF
12205 /* By Rüdiger Kuhlmann. */
12206       #include <sys/types.h>
12207       #if HAVE_UNISTD_H
12208       # include <unistd.h>
12209       #endif
12210       /* Some systems only have a dummy stub for fork() */
12211       int main ()
12212       {
12213         if (fork() < 0)
12214           $ac_main_return (1);
12215         $ac_main_return (0);
12216       }
12217 _ACEOF
12218 rm -f conftest$ac_exeext
12219 if { (eval echo "$as_me:12219: \"$ac_link\"") >&5
12220   (eval $ac_link) 2>&5
12221   ac_status=$?
12222   echo "$as_me:12222: \$? = $ac_status" >&5
12223   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12224   { (eval echo "$as_me:12224: \"$ac_try\"") >&5
12225   (eval $ac_try) 2>&5
12226   ac_status=$?
12227   echo "$as_me:12227: \$? = $ac_status" >&5
12228   (exit $ac_status); }; }; then
12229   ac_cv_func_fork_works=yes
12230 else
12231   echo "$as_me: program exited with status $ac_status" >&5
12232 echo "$as_me: failed program was:" >&5
12233 cat conftest.$ac_ext >&5
12234 ac_cv_func_fork_works=no
12235 fi
12236 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12237 fi
12238 fi
12239 echo "$as_me:12239: result: $ac_cv_func_fork_works" >&5
12240 echo "${ECHO_T}$ac_cv_func_fork_works" >&6
12241
12242 fi
12243 if test "x$ac_cv_func_fork_works" = xcross; then
12244   case $host in
12245     *-*-amigaos* | *-*-msdosdjgpp*)
12246       # Override, as these systems have only a dummy fork() stub
12247       ac_cv_func_fork_works=no
12248       ;;
12249     *)
12250       ac_cv_func_fork_works=yes
12251       ;;
12252   esac
12253   { echo "$as_me:12253: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
12254 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
12255 fi
12256 ac_cv_func_vfork_works=$ac_cv_func_vfork
12257 if test "x$ac_cv_func_vfork" = xyes; then
12258   echo "$as_me:12258: checking for working vfork" >&5
12259 echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
12260 if test "${ac_cv_func_vfork_works+set}" = set; then
12261   echo $ECHO_N "(cached) $ECHO_C" >&6
12262 else
12263   if test "$cross_compiling" = yes; then
12264   ac_cv_func_vfork_works=cross
12265 else
12266   cat >conftest.$ac_ext <<_ACEOF
12267 #line 12267 "configure"
12268 #include "confdefs.h"
12269 /* Thanks to Paul Eggert for this test.  */
12270 #include <stdio.h>
12271 #include <sys/types.h>
12272 #include <sys/stat.h>
12273 #if HAVE_UNISTD_H
12274 # include <unistd.h>
12275 #endif
12276 #if HAVE_VFORK_H
12277 # include <vfork.h>
12278 #endif
12279 /* On some sparc systems, changes by the child to local and incoming
12280    argument registers are propagated back to the parent.  The compiler
12281    is told about this with #include <vfork.h>, but some compilers
12282    (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
12283    static variable whose address is put into a register that is
12284    clobbered by the vfork.  */
12285 static
12286 #ifdef __cplusplus
12287 sparc_address_test (int arg)
12288 # else
12289 sparc_address_test (arg) int arg;
12290 #endif
12291 {
12292   static pid_t child;
12293   if (!child) {
12294     child = vfork ();
12295     if (child < 0) {
12296       perror ("vfork");
12297       _exit(2);
12298     }
12299     if (!child) {
12300       arg = getpid();
12301       write(-1, "", 0);
12302       _exit (arg);
12303     }
12304   }
12305 }
12306
12307 int
12308 main ()
12309 {
12310   pid_t parent = getpid ();
12311   pid_t child;
12312
12313   sparc_address_test ();
12314
12315   child = vfork ();
12316
12317   if (child == 0) {
12318     /* Here is another test for sparc vfork register problems.  This
12319        test uses lots of local variables, at least as many local
12320        variables as main has allocated so far including compiler
12321        temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
12322        4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
12323        reuse the register of parent for one of the local variables,
12324        since it will think that parent can't possibly be used any more
12325        in this routine.  Assigning to the local variable will thus
12326        munge parent in the parent process.  */
12327     pid_t
12328       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
12329       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
12330     /* Convince the compiler that p..p7 are live; otherwise, it might
12331        use the same hardware register for all 8 local variables.  */
12332     if (p != p1 || p != p2 || p != p3 || p != p4
12333         || p != p5 || p != p6 || p != p7)
12334       _exit(1);
12335
12336     /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
12337        from child file descriptors.  If the child closes a descriptor
12338        before it execs or exits, this munges the parent's descriptor
12339        as well.  Test for this by closing stdout in the child.  */
12340     _exit(close(fileno(stdout)) != 0);
12341   } else {
12342     int status;
12343     struct stat st;
12344
12345     while (wait(&status) != child)
12346       ;
12347     $ac_main_return(
12348          /* Was there some problem with vforking?  */
12349          child < 0
12350
12351          /* Did the child fail?  (This shouldn't happen.)  */
12352          || status
12353
12354          /* Did the vfork/compiler bug occur?  */
12355          || parent != getpid()
12356
12357          /* Did the file descriptor bug occur?  */
12358          || fstat(fileno(stdout), &st) != 0
12359          );
12360   }
12361 }
12362 _ACEOF
12363 rm -f conftest$ac_exeext
12364 if { (eval echo "$as_me:12364: \"$ac_link\"") >&5
12365   (eval $ac_link) 2>&5
12366   ac_status=$?
12367   echo "$as_me:12367: \$? = $ac_status" >&5
12368   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12369   { (eval echo "$as_me:12369: \"$ac_try\"") >&5
12370   (eval $ac_try) 2>&5
12371   ac_status=$?
12372   echo "$as_me:12372: \$? = $ac_status" >&5
12373   (exit $ac_status); }; }; then
12374   ac_cv_func_vfork_works=yes
12375 else
12376   echo "$as_me: program exited with status $ac_status" >&5
12377 echo "$as_me: failed program was:" >&5
12378 cat conftest.$ac_ext >&5
12379 ac_cv_func_vfork_works=no
12380 fi
12381 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12382 fi
12383 fi
12384 echo "$as_me:12384: result: $ac_cv_func_vfork_works" >&5
12385 echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
12386
12387 fi;
12388 if test "x$ac_cv_func_fork_works" = xcross; then
12389   ac_cv_func_vfork_works=ac_cv_func_vfork
12390   { echo "$as_me:12390: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
12391 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
12392 fi
12393
12394 if test "x$ac_cv_func_vfork_works" = xyes; then
12395
12396 cat >>confdefs.h <<\EOF
12397 #define HAVE_WORKING_VFORK 1
12398 EOF
12399
12400 else
12401
12402 cat >>confdefs.h <<\EOF
12403 #define vfork fork
12404 EOF
12405
12406 fi
12407 if test "x$ac_cv_func_fork_works" = xyes; then
12408
12409 cat >>confdefs.h <<\EOF
12410 #define HAVE_WORKING_FORK 1
12411 EOF
12412
12413 fi
12414
12415 echo "$as_me:12415: checking if sys/time.h works with sys/select.h" >&5
12416 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
12417 if test "${cf_cv_sys_time_select+set}" = set; then
12418   echo $ECHO_N "(cached) $ECHO_C" >&6
12419 else
12420
12421 cat >conftest.$ac_ext <<_ACEOF
12422 #line 12422 "configure"
12423 #include "confdefs.h"
12424
12425 #include <sys/types.h>
12426 #ifdef HAVE_SYS_TIME_H
12427 #include <sys/time.h>
12428 #endif
12429 #ifdef HAVE_SYS_SELECT_H
12430 #include <sys/select.h>
12431 #endif
12432
12433 int
12434 main ()
12435 {
12436
12437   ;
12438   return 0;
12439 }
12440 _ACEOF
12441 rm -f conftest.$ac_objext
12442 if { (eval echo "$as_me:12442: \"$ac_compile\"") >&5
12443   (eval $ac_compile) 2>&5
12444   ac_status=$?
12445   echo "$as_me:12445: \$? = $ac_status" >&5
12446   (exit $ac_status); } &&
12447          { ac_try='test -s conftest.$ac_objext'
12448   { (eval echo "$as_me:12448: \"$ac_try\"") >&5
12449   (eval $ac_try) 2>&5
12450   ac_status=$?
12451   echo "$as_me:12451: \$? = $ac_status" >&5
12452   (exit $ac_status); }; }; then
12453   cf_cv_sys_time_select=yes
12454 else
12455   echo "$as_me: failed program was:" >&5
12456 cat conftest.$ac_ext >&5
12457 cf_cv_sys_time_select=no
12458 fi
12459 rm -f conftest.$ac_objext conftest.$ac_ext
12460
12461 fi
12462
12463 echo "$as_me:12463: result: $cf_cv_sys_time_select" >&5
12464 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
12465 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
12466 #define HAVE_SYS_TIME_SELECT 1
12467 EOF
12468
12469 echo "$as_me:12469: checking for function curses_version" >&5
12470 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
12471 if test "${cf_cv_func_curses_version+set}" = set; then
12472   echo $ECHO_N "(cached) $ECHO_C" >&6
12473 else
12474
12475 if test "$cross_compiling" = yes; then
12476   cf_cv_func_curses_version=unknown
12477 else
12478   cat >conftest.$ac_ext <<_ACEOF
12479 #line 12479 "configure"
12480 #include "confdefs.h"
12481
12482 #include <${cf_cv_ncurses_header:-curses.h}>
12483 int main()
12484 {
12485         char temp[1024];
12486         sprintf(temp, "%s\n", curses_version());
12487         ${cf_cv_main_return:-return}(0);
12488 }
12489
12490 _ACEOF
12491 rm -f conftest$ac_exeext
12492 if { (eval echo "$as_me:12492: \"$ac_link\"") >&5
12493   (eval $ac_link) 2>&5
12494   ac_status=$?
12495   echo "$as_me:12495: \$? = $ac_status" >&5
12496   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12497   { (eval echo "$as_me:12497: \"$ac_try\"") >&5
12498   (eval $ac_try) 2>&5
12499   ac_status=$?
12500   echo "$as_me:12500: \$? = $ac_status" >&5
12501   (exit $ac_status); }; }; then
12502   cf_cv_func_curses_version=yes
12503
12504 else
12505   echo "$as_me: program exited with status $ac_status" >&5
12506 echo "$as_me: failed program was:" >&5
12507 cat conftest.$ac_ext >&5
12508 cf_cv_func_curses_version=no
12509
12510 fi
12511 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12512 fi
12513 rm -f core
12514 fi
12515 echo "$as_me:12515: result: $cf_cv_func_curses_version" >&5
12516 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
12517 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
12518 #define HAVE_CURSES_VERSION 1
12519 EOF
12520
12521 echo "$as_me:12521: checking for ncurses wrap-prefix" >&5
12522 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
12523
12524 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
12525 if test "${with_ncurses_wrap_prefix+set}" = set; then
12526   withval="$with_ncurses_wrap_prefix"
12527   NCURSES_WRAP_PREFIX=$withval
12528 else
12529   NCURSES_WRAP_PREFIX=_nc_
12530 fi;
12531 echo "$as_me:12531: result: $NCURSES_WRAP_PREFIX" >&5
12532 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
12533
12534 echo "$as_me:12534: checking for alternate character set array" >&5
12535 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
12536 if test "${cf_cv_curses_acs_map+set}" = set; then
12537   echo $ECHO_N "(cached) $ECHO_C" >&6
12538 else
12539
12540 cf_cv_curses_acs_map=unknown
12541 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
12542 do
12543 cat >conftest.$ac_ext <<_ACEOF
12544 #line 12544 "configure"
12545 #include "confdefs.h"
12546
12547 #include <${cf_cv_ncurses_header:-curses.h}>
12548
12549 int
12550 main ()
12551 {
12552
12553 $name['k'] = ACS_PLUS
12554
12555   ;
12556   return 0;
12557 }
12558 _ACEOF
12559 rm -f conftest.$ac_objext conftest$ac_exeext
12560 if { (eval echo "$as_me:12560: \"$ac_link\"") >&5
12561   (eval $ac_link) 2>&5
12562   ac_status=$?
12563   echo "$as_me:12563: \$? = $ac_status" >&5
12564   (exit $ac_status); } &&
12565          { ac_try='test -s conftest$ac_exeext'
12566   { (eval echo "$as_me:12566: \"$ac_try\"") >&5
12567   (eval $ac_try) 2>&5
12568   ac_status=$?
12569   echo "$as_me:12569: \$? = $ac_status" >&5
12570   (exit $ac_status); }; }; then
12571   cf_cv_curses_acs_map=$name; break
12572 else
12573   echo "$as_me: failed program was:" >&5
12574 cat conftest.$ac_ext >&5
12575 fi
12576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12577 done
12578
12579 fi
12580 echo "$as_me:12580: result: $cf_cv_curses_acs_map" >&5
12581 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
12582
12583 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
12584 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
12585 EOF
12586
12587 echo "$as_me:12587: checking for wide alternate character set array" >&5
12588 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
12589 if test "${cf_cv_curses_wacs_map+set}" = set; then
12590   echo $ECHO_N "(cached) $ECHO_C" >&6
12591 else
12592
12593         cf_cv_curses_wacs_map=unknown
12594         for name in wacs_map _wacs_map __wacs_map _nc_wacs
12595         do
12596         cat >conftest.$ac_ext <<_ACEOF
12597 #line 12597 "configure"
12598 #include "confdefs.h"
12599
12600 #ifndef _XOPEN_SOURCE_EXTENDED
12601 #define _XOPEN_SOURCE_EXTENDED
12602 #endif
12603 #include <${cf_cv_ncurses_header:-curses.h}>
12604 int
12605 main ()
12606 {
12607 $name['k'] = *WACS_PLUS
12608   ;
12609   return 0;
12610 }
12611 _ACEOF
12612 rm -f conftest.$ac_objext conftest$ac_exeext
12613 if { (eval echo "$as_me:12613: \"$ac_link\"") >&5
12614   (eval $ac_link) 2>&5
12615   ac_status=$?
12616   echo "$as_me:12616: \$? = $ac_status" >&5
12617   (exit $ac_status); } &&
12618          { ac_try='test -s conftest$ac_exeext'
12619   { (eval echo "$as_me:12619: \"$ac_try\"") >&5
12620   (eval $ac_try) 2>&5
12621   ac_status=$?
12622   echo "$as_me:12622: \$? = $ac_status" >&5
12623   (exit $ac_status); }; }; then
12624   cf_cv_curses_wacs_map=$name
12625          break
12626 else
12627   echo "$as_me: failed program was:" >&5
12628 cat conftest.$ac_ext >&5
12629 fi
12630 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12631         done
12632 fi
12633 echo "$as_me:12633: result: $cf_cv_curses_wacs_map" >&5
12634 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
12635
12636 echo "$as_me:12636: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
12637 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
12638 cat >conftest.$ac_ext <<_ACEOF
12639 #line 12639 "configure"
12640 #include "confdefs.h"
12641
12642 #ifndef _XOPEN_SOURCE_EXTENDED
12643 #define _XOPEN_SOURCE_EXTENDED
12644 #endif
12645 #include <${cf_cv_ncurses_header:-curses.h}>
12646 int
12647 main ()
12648 {
12649
12650 attr_t foo
12651
12652   ;
12653   return 0;
12654 }
12655 _ACEOF
12656 rm -f conftest.$ac_objext
12657 if { (eval echo "$as_me:12657: \"$ac_compile\"") >&5
12658   (eval $ac_compile) 2>&5
12659   ac_status=$?
12660   echo "$as_me:12660: \$? = $ac_status" >&5
12661   (exit $ac_status); } &&
12662          { ac_try='test -s conftest.$ac_objext'
12663   { (eval echo "$as_me:12663: \"$ac_try\"") >&5
12664   (eval $ac_try) 2>&5
12665   ac_status=$?
12666   echo "$as_me:12666: \$? = $ac_status" >&5
12667   (exit $ac_status); }; }; then
12668   cf_result=yes
12669 else
12670   echo "$as_me: failed program was:" >&5
12671 cat conftest.$ac_ext >&5
12672 cf_result=no
12673 fi
12674 rm -f conftest.$ac_objext conftest.$ac_ext
12675 echo "$as_me:12675: result: $cf_result" >&5
12676 echo "${ECHO_T}$cf_result" >&6
12677 if test $cf_result = yes ; then
12678
12679 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12680
12681         cat >>confdefs.h <<EOF
12682 #define $cf_result 1
12683 EOF
12684
12685 else
12686         cat >>confdefs.h <<EOF
12687 #define attr_t long
12688 EOF
12689
12690 fi
12691
12692 # This is needed on Tru64 5.0 to declare mbstate_t
12693 echo "$as_me:12693: checking if we must include wchar.h to declare mbstate_t" >&5
12694 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
12695 if test "${cf_cv_mbstate_t+set}" = set; then
12696   echo $ECHO_N "(cached) $ECHO_C" >&6
12697 else
12698
12699 cat >conftest.$ac_ext <<_ACEOF
12700 #line 12700 "configure"
12701 #include "confdefs.h"
12702
12703 #include <stdlib.h>
12704 #include <stdarg.h>
12705 #include <stdio.h>
12706 #ifdef HAVE_LIBUTF8_H
12707 #include <libutf8.h>
12708 #endif
12709 int
12710 main ()
12711 {
12712 mbstate_t state
12713   ;
12714   return 0;
12715 }
12716 _ACEOF
12717 rm -f conftest.$ac_objext
12718 if { (eval echo "$as_me:12718: \"$ac_compile\"") >&5
12719   (eval $ac_compile) 2>&5
12720   ac_status=$?
12721   echo "$as_me:12721: \$? = $ac_status" >&5
12722   (exit $ac_status); } &&
12723          { ac_try='test -s conftest.$ac_objext'
12724   { (eval echo "$as_me:12724: \"$ac_try\"") >&5
12725   (eval $ac_try) 2>&5
12726   ac_status=$?
12727   echo "$as_me:12727: \$? = $ac_status" >&5
12728   (exit $ac_status); }; }; then
12729   cf_cv_mbstate_t=no
12730 else
12731   echo "$as_me: failed program was:" >&5
12732 cat conftest.$ac_ext >&5
12733 cat >conftest.$ac_ext <<_ACEOF
12734 #line 12734 "configure"
12735 #include "confdefs.h"
12736
12737 #include <stdlib.h>
12738 #include <stdarg.h>
12739 #include <stdio.h>
12740 #include <wchar.h>
12741 #ifdef HAVE_LIBUTF8_H
12742 #include <libutf8.h>
12743 #endif
12744 int
12745 main ()
12746 {
12747 mbstate_t value
12748   ;
12749   return 0;
12750 }
12751 _ACEOF
12752 rm -f conftest.$ac_objext
12753 if { (eval echo "$as_me:12753: \"$ac_compile\"") >&5
12754   (eval $ac_compile) 2>&5
12755   ac_status=$?
12756   echo "$as_me:12756: \$? = $ac_status" >&5
12757   (exit $ac_status); } &&
12758          { ac_try='test -s conftest.$ac_objext'
12759   { (eval echo "$as_me:12759: \"$ac_try\"") >&5
12760   (eval $ac_try) 2>&5
12761   ac_status=$?
12762   echo "$as_me:12762: \$? = $ac_status" >&5
12763   (exit $ac_status); }; }; then
12764   cf_cv_mbstate_t=yes
12765 else
12766   echo "$as_me: failed program was:" >&5
12767 cat conftest.$ac_ext >&5
12768 cf_cv_mbstate_t=unknown
12769 fi
12770 rm -f conftest.$ac_objext conftest.$ac_ext
12771 fi
12772 rm -f conftest.$ac_objext conftest.$ac_ext
12773 fi
12774 echo "$as_me:12774: result: $cf_cv_mbstate_t" >&5
12775 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
12776
12777 if test "$cf_cv_mbstate_t" = yes ; then
12778         cat >>confdefs.h <<\EOF
12779 #define NEED_WCHAR_H 1
12780 EOF
12781
12782         NEED_WCHAR_H=1
12783 fi
12784
12785 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
12786 if test "$cf_cv_mbstate_t" = unknown ; then
12787         NCURSES_MBSTATE_T=1
12788 fi
12789
12790 # if we find mbstate_t in either place, use substitution to provide a fallback.
12791 if test "$cf_cv_mbstate_t" != unknown ; then
12792         NCURSES_OK_MBSTATE_T=1
12793 fi
12794
12795 # This is needed on Tru64 5.0 to declare wchar_t
12796 echo "$as_me:12796: checking if we must include wchar.h to declare wchar_t" >&5
12797 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
12798 if test "${cf_cv_wchar_t+set}" = set; then
12799   echo $ECHO_N "(cached) $ECHO_C" >&6
12800 else
12801
12802 cat >conftest.$ac_ext <<_ACEOF
12803 #line 12803 "configure"
12804 #include "confdefs.h"
12805
12806 #include <stdlib.h>
12807 #include <stdarg.h>
12808 #include <stdio.h>
12809 #ifdef HAVE_LIBUTF8_H
12810 #include <libutf8.h>
12811 #endif
12812 int
12813 main ()
12814 {
12815 wchar_t state
12816   ;
12817   return 0;
12818 }
12819 _ACEOF
12820 rm -f conftest.$ac_objext
12821 if { (eval echo "$as_me:12821: \"$ac_compile\"") >&5
12822   (eval $ac_compile) 2>&5
12823   ac_status=$?
12824   echo "$as_me:12824: \$? = $ac_status" >&5
12825   (exit $ac_status); } &&
12826          { ac_try='test -s conftest.$ac_objext'
12827   { (eval echo "$as_me:12827: \"$ac_try\"") >&5
12828   (eval $ac_try) 2>&5
12829   ac_status=$?
12830   echo "$as_me:12830: \$? = $ac_status" >&5
12831   (exit $ac_status); }; }; then
12832   cf_cv_wchar_t=no
12833 else
12834   echo "$as_me: failed program was:" >&5
12835 cat conftest.$ac_ext >&5
12836 cat >conftest.$ac_ext <<_ACEOF
12837 #line 12837 "configure"
12838 #include "confdefs.h"
12839
12840 #include <stdlib.h>
12841 #include <stdarg.h>
12842 #include <stdio.h>
12843 #include <wchar.h>
12844 #ifdef HAVE_LIBUTF8_H
12845 #include <libutf8.h>
12846 #endif
12847 int
12848 main ()
12849 {
12850 wchar_t value
12851   ;
12852   return 0;
12853 }
12854 _ACEOF
12855 rm -f conftest.$ac_objext
12856 if { (eval echo "$as_me:12856: \"$ac_compile\"") >&5
12857   (eval $ac_compile) 2>&5
12858   ac_status=$?
12859   echo "$as_me:12859: \$? = $ac_status" >&5
12860   (exit $ac_status); } &&
12861          { ac_try='test -s conftest.$ac_objext'
12862   { (eval echo "$as_me:12862: \"$ac_try\"") >&5
12863   (eval $ac_try) 2>&5
12864   ac_status=$?
12865   echo "$as_me:12865: \$? = $ac_status" >&5
12866   (exit $ac_status); }; }; then
12867   cf_cv_wchar_t=yes
12868 else
12869   echo "$as_me: failed program was:" >&5
12870 cat conftest.$ac_ext >&5
12871 cf_cv_wchar_t=unknown
12872 fi
12873 rm -f conftest.$ac_objext conftest.$ac_ext
12874 fi
12875 rm -f conftest.$ac_objext conftest.$ac_ext
12876 fi
12877 echo "$as_me:12877: result: $cf_cv_wchar_t" >&5
12878 echo "${ECHO_T}$cf_cv_wchar_t" >&6
12879
12880 if test "$cf_cv_wchar_t" = yes ; then
12881         cat >>confdefs.h <<\EOF
12882 #define NEED_WCHAR_H 1
12883 EOF
12884
12885         NEED_WCHAR_H=1
12886 fi
12887
12888 # if we do not find wchar_t in either place, use substitution to provide a fallback.
12889 if test "$cf_cv_wchar_t" = unknown ; then
12890         NCURSES_WCHAR_T=1
12891 fi
12892
12893 # if we find wchar_t in either place, use substitution to provide a fallback.
12894 if test "$cf_cv_wchar_t" != unknown ; then
12895         NCURSES_OK_WCHAR_T=1
12896 fi
12897
12898 # This is needed on Tru64 5.0 to declare wint_t
12899 echo "$as_me:12899: checking if we must include wchar.h to declare wint_t" >&5
12900 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
12901 if test "${cf_cv_wint_t+set}" = set; then
12902   echo $ECHO_N "(cached) $ECHO_C" >&6
12903 else
12904
12905 cat >conftest.$ac_ext <<_ACEOF
12906 #line 12906 "configure"
12907 #include "confdefs.h"
12908
12909 #include <stdlib.h>
12910 #include <stdarg.h>
12911 #include <stdio.h>
12912 #ifdef HAVE_LIBUTF8_H
12913 #include <libutf8.h>
12914 #endif
12915 int
12916 main ()
12917 {
12918 wint_t state
12919   ;
12920   return 0;
12921 }
12922 _ACEOF
12923 rm -f conftest.$ac_objext
12924 if { (eval echo "$as_me:12924: \"$ac_compile\"") >&5
12925   (eval $ac_compile) 2>&5
12926   ac_status=$?
12927   echo "$as_me:12927: \$? = $ac_status" >&5
12928   (exit $ac_status); } &&
12929          { ac_try='test -s conftest.$ac_objext'
12930   { (eval echo "$as_me:12930: \"$ac_try\"") >&5
12931   (eval $ac_try) 2>&5
12932   ac_status=$?
12933   echo "$as_me:12933: \$? = $ac_status" >&5
12934   (exit $ac_status); }; }; then
12935   cf_cv_wint_t=no
12936 else
12937   echo "$as_me: failed program was:" >&5
12938 cat conftest.$ac_ext >&5
12939 cat >conftest.$ac_ext <<_ACEOF
12940 #line 12940 "configure"
12941 #include "confdefs.h"
12942
12943 #include <stdlib.h>
12944 #include <stdarg.h>
12945 #include <stdio.h>
12946 #include <wchar.h>
12947 #ifdef HAVE_LIBUTF8_H
12948 #include <libutf8.h>
12949 #endif
12950 int
12951 main ()
12952 {
12953 wint_t value
12954   ;
12955   return 0;
12956 }
12957 _ACEOF
12958 rm -f conftest.$ac_objext
12959 if { (eval echo "$as_me:12959: \"$ac_compile\"") >&5
12960   (eval $ac_compile) 2>&5
12961   ac_status=$?
12962   echo "$as_me:12962: \$? = $ac_status" >&5
12963   (exit $ac_status); } &&
12964          { ac_try='test -s conftest.$ac_objext'
12965   { (eval echo "$as_me:12965: \"$ac_try\"") >&5
12966   (eval $ac_try) 2>&5
12967   ac_status=$?
12968   echo "$as_me:12968: \$? = $ac_status" >&5
12969   (exit $ac_status); }; }; then
12970   cf_cv_wint_t=yes
12971 else
12972   echo "$as_me: failed program was:" >&5
12973 cat conftest.$ac_ext >&5
12974 cf_cv_wint_t=unknown
12975 fi
12976 rm -f conftest.$ac_objext conftest.$ac_ext
12977 fi
12978 rm -f conftest.$ac_objext conftest.$ac_ext
12979 fi
12980 echo "$as_me:12980: result: $cf_cv_wint_t" >&5
12981 echo "${ECHO_T}$cf_cv_wint_t" >&6
12982
12983 if test "$cf_cv_wint_t" = yes ; then
12984         cat >>confdefs.h <<\EOF
12985 #define NEED_WCHAR_H 1
12986 EOF
12987
12988         NEED_WCHAR_H=1
12989 fi
12990
12991 # if we do not find wint_t in either place, use substitution to provide a fallback.
12992 if test "$cf_cv_wint_t" = unknown ; then
12993         NCURSES_WINT_T=1
12994 fi
12995
12996 # if we find wint_t in either place, use substitution to provide a fallback.
12997 if test "$cf_cv_wint_t" != unknown ; then
12998         NCURSES_OK_WINT_T=1
12999 fi
13000
13001 if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
13002
13003 echo "$as_me:13003: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13004 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13005 cat >conftest.$ac_ext <<_ACEOF
13006 #line 13006 "configure"
13007 #include "confdefs.h"
13008
13009 #ifndef _XOPEN_SOURCE_EXTENDED
13010 #define _XOPEN_SOURCE_EXTENDED
13011 #endif
13012 #include <${cf_cv_ncurses_header:-curses.h}>
13013 int
13014 main ()
13015 {
13016
13017 mbstate_t foo
13018
13019   ;
13020   return 0;
13021 }
13022 _ACEOF
13023 rm -f conftest.$ac_objext
13024 if { (eval echo "$as_me:13024: \"$ac_compile\"") >&5
13025   (eval $ac_compile) 2>&5
13026   ac_status=$?
13027   echo "$as_me:13027: \$? = $ac_status" >&5
13028   (exit $ac_status); } &&
13029          { ac_try='test -s conftest.$ac_objext'
13030   { (eval echo "$as_me:13030: \"$ac_try\"") >&5
13031   (eval $ac_try) 2>&5
13032   ac_status=$?
13033   echo "$as_me:13033: \$? = $ac_status" >&5
13034   (exit $ac_status); }; }; then
13035   cf_result=yes
13036 else
13037   echo "$as_me: failed program was:" >&5
13038 cat conftest.$ac_ext >&5
13039 cf_result=no
13040 fi
13041 rm -f conftest.$ac_objext conftest.$ac_ext
13042 echo "$as_me:13042: result: $cf_result" >&5
13043 echo "${ECHO_T}$cf_result" >&6
13044 if test $cf_result = yes ; then
13045
13046 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13047
13048         cat >>confdefs.h <<EOF
13049 #define $cf_result 1
13050 EOF
13051
13052 else
13053         cat >>confdefs.h <<EOF
13054 #define mbstate_t long
13055 EOF
13056
13057 fi
13058
13059 fi
13060
13061 if test "$NCURSES_OK_WCHAR_T" = 0 ; then
13062
13063 echo "$as_me:13063: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13064 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13065 cat >conftest.$ac_ext <<_ACEOF
13066 #line 13066 "configure"
13067 #include "confdefs.h"
13068
13069 #ifndef _XOPEN_SOURCE_EXTENDED
13070 #define _XOPEN_SOURCE_EXTENDED
13071 #endif
13072 #include <${cf_cv_ncurses_header:-curses.h}>
13073 int
13074 main ()
13075 {
13076
13077 wchar_t foo
13078
13079   ;
13080   return 0;
13081 }
13082 _ACEOF
13083 rm -f conftest.$ac_objext
13084 if { (eval echo "$as_me:13084: \"$ac_compile\"") >&5
13085   (eval $ac_compile) 2>&5
13086   ac_status=$?
13087   echo "$as_me:13087: \$? = $ac_status" >&5
13088   (exit $ac_status); } &&
13089          { ac_try='test -s conftest.$ac_objext'
13090   { (eval echo "$as_me:13090: \"$ac_try\"") >&5
13091   (eval $ac_try) 2>&5
13092   ac_status=$?
13093   echo "$as_me:13093: \$? = $ac_status" >&5
13094   (exit $ac_status); }; }; then
13095   cf_result=yes
13096 else
13097   echo "$as_me: failed program was:" >&5
13098 cat conftest.$ac_ext >&5
13099 cf_result=no
13100 fi
13101 rm -f conftest.$ac_objext conftest.$ac_ext
13102 echo "$as_me:13102: result: $cf_result" >&5
13103 echo "${ECHO_T}$cf_result" >&6
13104 if test $cf_result = yes ; then
13105
13106 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13107
13108         cat >>confdefs.h <<EOF
13109 #define $cf_result 1
13110 EOF
13111
13112 else
13113         cat >>confdefs.h <<EOF
13114 #define wchar_t long
13115 EOF
13116
13117 fi
13118
13119 fi
13120
13121 if test "$NCURSES_OK_WINT_T" = 0 ; then
13122
13123 echo "$as_me:13123: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13124 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13125 cat >conftest.$ac_ext <<_ACEOF
13126 #line 13126 "configure"
13127 #include "confdefs.h"
13128
13129 #ifndef _XOPEN_SOURCE_EXTENDED
13130 #define _XOPEN_SOURCE_EXTENDED
13131 #endif
13132 #include <${cf_cv_ncurses_header:-curses.h}>
13133 int
13134 main ()
13135 {
13136
13137 wint_t foo
13138
13139   ;
13140   return 0;
13141 }
13142 _ACEOF
13143 rm -f conftest.$ac_objext
13144 if { (eval echo "$as_me:13144: \"$ac_compile\"") >&5
13145   (eval $ac_compile) 2>&5
13146   ac_status=$?
13147   echo "$as_me:13147: \$? = $ac_status" >&5
13148   (exit $ac_status); } &&
13149          { ac_try='test -s conftest.$ac_objext'
13150   { (eval echo "$as_me:13150: \"$ac_try\"") >&5
13151   (eval $ac_try) 2>&5
13152   ac_status=$?
13153   echo "$as_me:13153: \$? = $ac_status" >&5
13154   (exit $ac_status); }; }; then
13155   cf_result=yes
13156 else
13157   echo "$as_me: failed program was:" >&5
13158 cat conftest.$ac_ext >&5
13159 cf_result=no
13160 fi
13161 rm -f conftest.$ac_objext conftest.$ac_ext
13162 echo "$as_me:13162: result: $cf_result" >&5
13163 echo "${ECHO_T}$cf_result" >&6
13164 if test $cf_result = yes ; then
13165
13166 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13167
13168         cat >>confdefs.h <<EOF
13169 #define $cf_result 1
13170 EOF
13171
13172 else
13173         cat >>confdefs.h <<EOF
13174 #define wint_t long
13175 EOF
13176
13177 fi
13178
13179 fi
13180
13181 echo "$as_me:13181: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
13182 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13183 cat >conftest.$ac_ext <<_ACEOF
13184 #line 13184 "configure"
13185 #include "confdefs.h"
13186
13187 #ifdef HAVE_XCURSES
13188 #include <xcurses.h>
13189 char * XCursesProgramName = "test";
13190 #else
13191 #include <${cf_cv_ncurses_header:-curses.h}>
13192 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13193 #include <ncursesw/term.h>
13194 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13195 #include <ncurses/term.h>
13196 #elif defined(HAVE_TERM_H)
13197 #include <term.h>
13198 #endif
13199 #endif
13200
13201 int
13202 main ()
13203 {
13204
13205 void *foo = &(boolnames)
13206
13207   ;
13208   return 0;
13209 }
13210 _ACEOF
13211 rm -f conftest.$ac_objext
13212 if { (eval echo "$as_me:13212: \"$ac_compile\"") >&5
13213   (eval $ac_compile) 2>&5
13214   ac_status=$?
13215   echo "$as_me:13215: \$? = $ac_status" >&5
13216   (exit $ac_status); } &&
13217          { ac_try='test -s conftest.$ac_objext'
13218   { (eval echo "$as_me:13218: \"$ac_try\"") >&5
13219   (eval $ac_try) 2>&5
13220   ac_status=$?
13221   echo "$as_me:13221: \$? = $ac_status" >&5
13222   (exit $ac_status); }; }; then
13223   cf_result=yes
13224 else
13225   echo "$as_me: failed program was:" >&5
13226 cat conftest.$ac_ext >&5
13227 cf_result=no
13228 fi
13229 rm -f conftest.$ac_objext conftest.$ac_ext
13230 echo "$as_me:13230: result: $cf_result" >&5
13231 echo "${ECHO_T}$cf_result" >&6
13232 if test $cf_result = yes ; then
13233
13234 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13235
13236         cat >>confdefs.h <<EOF
13237 #define $cf_result 1
13238 EOF
13239
13240 else
13241         echo "$as_me:13241: checking for data boolnames in library" >&5
13242 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
13243         cat >conftest.$ac_ext <<_ACEOF
13244 #line 13244 "configure"
13245 #include "confdefs.h"
13246
13247 #ifdef HAVE_XCURSES
13248 #include <xcurses.h>
13249 char * XCursesProgramName = "test";
13250 #else
13251 #include <${cf_cv_ncurses_header:-curses.h}>
13252 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13253 #include <ncursesw/term.h>
13254 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13255 #include <ncurses/term.h>
13256 #elif defined(HAVE_TERM_H)
13257 #include <term.h>
13258 #endif
13259 #endif
13260
13261 extern char boolnames;
13262 int
13263 main ()
13264 {
13265
13266         do {
13267                 void *foo = &(boolnames);
13268                 ${cf_cv_main_return:-return}(foo == 0);
13269         } while (0)
13270
13271   ;
13272   return 0;
13273 }
13274 _ACEOF
13275 rm -f conftest.$ac_objext conftest$ac_exeext
13276 if { (eval echo "$as_me:13276: \"$ac_link\"") >&5
13277   (eval $ac_link) 2>&5
13278   ac_status=$?
13279   echo "$as_me:13279: \$? = $ac_status" >&5
13280   (exit $ac_status); } &&
13281          { ac_try='test -s conftest$ac_exeext'
13282   { (eval echo "$as_me:13282: \"$ac_try\"") >&5
13283   (eval $ac_try) 2>&5
13284   ac_status=$?
13285   echo "$as_me:13285: \$? = $ac_status" >&5
13286   (exit $ac_status); }; }; then
13287   cf_result=yes
13288 else
13289   echo "$as_me: failed program was:" >&5
13290 cat conftest.$ac_ext >&5
13291 cf_result=no
13292 fi
13293 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13294         echo "$as_me:13294: result: $cf_result" >&5
13295 echo "${ECHO_T}$cf_result" >&6
13296         if test $cf_result = yes ; then
13297
13298 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13299
13300                 cat >>confdefs.h <<EOF
13301 #define $cf_result 1
13302 EOF
13303
13304         fi
13305 fi
13306
13307 echo "$as_me:13307: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
13308 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13309 cat >conftest.$ac_ext <<_ACEOF
13310 #line 13310 "configure"
13311 #include "confdefs.h"
13312
13313 #ifdef HAVE_XCURSES
13314 #include <xcurses.h>
13315 char * XCursesProgramName = "test";
13316 #else
13317 #include <${cf_cv_ncurses_header:-curses.h}>
13318 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13319 #include <ncursesw/term.h>
13320 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13321 #include <ncurses/term.h>
13322 #elif defined(HAVE_TERM_H)
13323 #include <term.h>
13324 #endif
13325 #endif
13326
13327 int
13328 main ()
13329 {
13330
13331 void *foo = &(boolfnames)
13332
13333   ;
13334   return 0;
13335 }
13336 _ACEOF
13337 rm -f conftest.$ac_objext
13338 if { (eval echo "$as_me:13338: \"$ac_compile\"") >&5
13339   (eval $ac_compile) 2>&5
13340   ac_status=$?
13341   echo "$as_me:13341: \$? = $ac_status" >&5
13342   (exit $ac_status); } &&
13343          { ac_try='test -s conftest.$ac_objext'
13344   { (eval echo "$as_me:13344: \"$ac_try\"") >&5
13345   (eval $ac_try) 2>&5
13346   ac_status=$?
13347   echo "$as_me:13347: \$? = $ac_status" >&5
13348   (exit $ac_status); }; }; then
13349   cf_result=yes
13350 else
13351   echo "$as_me: failed program was:" >&5
13352 cat conftest.$ac_ext >&5
13353 cf_result=no
13354 fi
13355 rm -f conftest.$ac_objext conftest.$ac_ext
13356 echo "$as_me:13356: result: $cf_result" >&5
13357 echo "${ECHO_T}$cf_result" >&6
13358 if test $cf_result = yes ; then
13359
13360 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13361
13362         cat >>confdefs.h <<EOF
13363 #define $cf_result 1
13364 EOF
13365
13366 else
13367         echo "$as_me:13367: checking for data boolfnames in library" >&5
13368 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
13369         cat >conftest.$ac_ext <<_ACEOF
13370 #line 13370 "configure"
13371 #include "confdefs.h"
13372
13373 #ifdef HAVE_XCURSES
13374 #include <xcurses.h>
13375 char * XCursesProgramName = "test";
13376 #else
13377 #include <${cf_cv_ncurses_header:-curses.h}>
13378 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13379 #include <ncursesw/term.h>
13380 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13381 #include <ncurses/term.h>
13382 #elif defined(HAVE_TERM_H)
13383 #include <term.h>
13384 #endif
13385 #endif
13386
13387 extern char boolfnames;
13388 int
13389 main ()
13390 {
13391
13392         do {
13393                 void *foo = &(boolfnames);
13394                 ${cf_cv_main_return:-return}(foo == 0);
13395         } while (0)
13396
13397   ;
13398   return 0;
13399 }
13400 _ACEOF
13401 rm -f conftest.$ac_objext conftest$ac_exeext
13402 if { (eval echo "$as_me:13402: \"$ac_link\"") >&5
13403   (eval $ac_link) 2>&5
13404   ac_status=$?
13405   echo "$as_me:13405: \$? = $ac_status" >&5
13406   (exit $ac_status); } &&
13407          { ac_try='test -s conftest$ac_exeext'
13408   { (eval echo "$as_me:13408: \"$ac_try\"") >&5
13409   (eval $ac_try) 2>&5
13410   ac_status=$?
13411   echo "$as_me:13411: \$? = $ac_status" >&5
13412   (exit $ac_status); }; }; then
13413   cf_result=yes
13414 else
13415   echo "$as_me: failed program was:" >&5
13416 cat conftest.$ac_ext >&5
13417 cf_result=no
13418 fi
13419 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13420         echo "$as_me:13420: result: $cf_result" >&5
13421 echo "${ECHO_T}$cf_result" >&6
13422         if test $cf_result = yes ; then
13423
13424 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13425
13426                 cat >>confdefs.h <<EOF
13427 #define $cf_result 1
13428 EOF
13429
13430         fi
13431 fi
13432
13433 TEST_ARGS="$LIBS"
13434 LIBS=
13435
13436 ac_config_files="$ac_config_files Makefile"
13437 ac_config_commands="$ac_config_commands default"
13438 cat >confcache <<\_ACEOF
13439 # This file is a shell script that caches the results of configure
13440 # tests run on this system so they can be shared between configure
13441 # scripts and configure runs, see configure's option --config-cache.
13442 # It is not useful on other systems.  If it contains results you don't
13443 # want to keep, you may remove or edit it.
13444 #
13445 # config.status only pays attention to the cache file if you give it
13446 # the --recheck option to rerun configure.
13447 #
13448 # `ac_cv_env_foo' variables (set or unset) will be overriden when
13449 # loading this file, other *unset* `ac_cv_foo' will be assigned the
13450 # following values.
13451
13452 _ACEOF
13453
13454 # The following way of writing the cache mishandles newlines in values,
13455 # but we know of no workaround that is simple, portable, and efficient.
13456 # So, don't put newlines in cache variables' values.
13457 # Ultrix sh set writes to stderr and can't be redirected directly,
13458 # and sets the high bit in the cache file unless we assign to the vars.
13459 {
13460   (set) 2>&1 |
13461     case `(ac_space=' '; set | grep ac_space) 2>&1` in
13462     *ac_space=\ *)
13463       # `set' does not quote correctly, so add quotes (double-quote
13464       # substitution turns \\\\ into \\, and sed turns \\ into \).
13465       sed -n \
13466         "s/'/'\\\\''/g;
13467           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
13468       ;;
13469     *)
13470       # `set' quotes correctly as required by POSIX, so do not add quotes.
13471       sed -n \
13472         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
13473       ;;
13474     esac;
13475 } |
13476   sed '
13477      t clear
13478      : clear
13479      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
13480      t end
13481      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
13482      : end' >>confcache
13483 if cmp -s $cache_file confcache; then :; else
13484   if test -w $cache_file; then
13485     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
13486     cat confcache >$cache_file
13487   else
13488     echo "not updating unwritable cache $cache_file"
13489   fi
13490 fi
13491 rm -f confcache
13492
13493 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13494 # Let make expand exec_prefix.
13495 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13496
13497 # VPATH may cause trouble with some makes, so we remove $(srcdir),
13498 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
13499 # trailing colons and then remove the whole line if VPATH becomes empty
13500 # (actually we leave an empty line to preserve line numbers).
13501 if test "x$srcdir" = x.; then
13502   ac_vpsub='/^[         ]*VPATH[        ]*=/{
13503 s/:*\$(srcdir):*/:/;
13504 s/:*\${srcdir}:*/:/;
13505 s/:*@srcdir@:*/:/;
13506 s/^\([^=]*=[    ]*\):*/\1/;
13507 s/:*$//;
13508 s/^[^=]*=[      ]*$//;
13509 }'
13510 fi
13511
13512 DEFS=-DHAVE_CONFIG_H
13513
13514 : ${CONFIG_STATUS=./config.status}
13515 ac_clean_files_save=$ac_clean_files
13516 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
13517 { echo "$as_me:13517: creating $CONFIG_STATUS" >&5
13518 echo "$as_me: creating $CONFIG_STATUS" >&6;}
13519 cat >$CONFIG_STATUS <<_ACEOF
13520 #! $SHELL
13521 # Generated automatically by configure.
13522 # Run this file to recreate the current configuration.
13523 # Compiler output produced by configure, useful for debugging
13524 # configure, is in config.log if it exists.
13525
13526 debug=false
13527 SHELL=\${CONFIG_SHELL-$SHELL}
13528 ac_cs_invocation="\$0 \$@"
13529
13530 _ACEOF
13531
13532 cat >>$CONFIG_STATUS <<\_ACEOF
13533 # Be Bourne compatible
13534 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
13535   emulate sh
13536   NULLCMD=:
13537 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
13538   set -o posix
13539 fi
13540
13541 # Name of the executable.
13542 as_me=`echo "$0" |sed 's,.*[\\/],,'`
13543
13544 if expr a : '\(a\)' >/dev/null 2>&1; then
13545   as_expr=expr
13546 else
13547   as_expr=false
13548 fi
13549
13550 rm -f conf$$ conf$$.exe conf$$.file
13551 echo >conf$$.file
13552 if ln -s conf$$.file conf$$ 2>/dev/null; then
13553   # We could just check for DJGPP; but this test a) works b) is more generic
13554   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
13555   if test -f conf$$.exe; then
13556     # Don't use ln at all; we don't have any links
13557     as_ln_s='cp -p'
13558   else
13559     as_ln_s='ln -s'
13560   fi
13561 elif ln conf$$.file conf$$ 2>/dev/null; then
13562   as_ln_s=ln
13563 else
13564   as_ln_s='cp -p'
13565 fi
13566 rm -f conf$$ conf$$.exe conf$$.file
13567
13568 as_executable_p="test -f"
13569
13570 # Support unset when possible.
13571 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
13572   as_unset=unset
13573 else
13574   as_unset=false
13575 fi
13576
13577 # NLS nuisances.
13578 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
13579 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
13580 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
13581 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
13582 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
13583 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
13584 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
13585 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
13586
13587 # IFS
13588 # We need space, tab and new line, in precisely that order.
13589 as_nl='
13590 '
13591 IFS="   $as_nl"
13592
13593 # CDPATH.
13594 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
13595
13596 exec 6>&1
13597
13598 _ACEOF
13599
13600 # Files that config.status was made for.
13601 if test -n "$ac_config_files"; then
13602   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
13603 fi
13604
13605 if test -n "$ac_config_headers"; then
13606   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
13607 fi
13608
13609 if test -n "$ac_config_links"; then
13610   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
13611 fi
13612
13613 if test -n "$ac_config_commands"; then
13614   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
13615 fi
13616
13617 cat >>$CONFIG_STATUS <<\EOF
13618
13619 ac_cs_usage="\
13620 \`$as_me' instantiates files from templates according to the
13621 current configuration.
13622
13623 Usage: $0 [OPTIONS] [FILE]...
13624
13625   -h, --help       print this help, then exit
13626   -V, --version    print version number, then exit
13627   -d, --debug      don't remove temporary files
13628       --recheck    update $as_me by reconfiguring in the same conditions
13629   --file=FILE[:TEMPLATE]
13630                    instantiate the configuration file FILE
13631   --header=FILE[:TEMPLATE]
13632                    instantiate the configuration header FILE
13633
13634 Configuration files:
13635 $config_files
13636
13637 Configuration headers:
13638 $config_headers
13639
13640 Configuration commands:
13641 $config_commands
13642
13643 Report bugs to <dickey@invisible-island.net>."
13644 EOF
13645
13646 cat >>$CONFIG_STATUS <<EOF
13647 ac_cs_version="\\
13648 config.status
13649 configured by $0, generated by GNU Autoconf 2.52.20101001,
13650   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
13651
13652 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
13653 Free Software Foundation, Inc.
13654 This config.status script is free software; the Free Software Foundation
13655 gives unlimited permission to copy, distribute and modify it."
13656 srcdir=$srcdir
13657 INSTALL="$INSTALL"
13658 EOF
13659
13660 cat >>$CONFIG_STATUS <<\EOF
13661 # If no file are specified by the user, then we need to provide default
13662 # value.  By we need to know if files were specified by the user.
13663 ac_need_defaults=:
13664 while test $# != 0
13665 do
13666   case $1 in
13667   --*=*)
13668     ac_option=`expr "x$1" : 'x\([^=]*\)='`
13669     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
13670     shift
13671     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
13672     shift
13673     ;;
13674   -*);;
13675   *) # This is not an option, so the user has probably given explicit
13676      # arguments.
13677      ac_need_defaults=false;;
13678   esac
13679
13680   case $1 in
13681   # Handling of the options.
13682 EOF
13683 cat >>$CONFIG_STATUS <<EOF
13684   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13685     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
13686     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
13687 EOF
13688 cat >>$CONFIG_STATUS <<\EOF
13689   --version | --vers* | -V )
13690     echo "$ac_cs_version"; exit 0 ;;
13691   --he | --h)
13692     # Conflict between --help and --header
13693     { { echo "$as_me:13693: error: ambiguous option: $1
13694 Try \`$0 --help' for more information." >&5
13695 echo "$as_me: error: ambiguous option: $1
13696 Try \`$0 --help' for more information." >&2;}
13697    { (exit 1); exit 1; }; };;
13698   --help | --hel | -h )
13699     echo "$ac_cs_usage"; exit 0 ;;
13700   --debug | --d* | -d )
13701     debug=: ;;
13702   --file | --fil | --fi | --f )
13703     shift
13704     CONFIG_FILES="$CONFIG_FILES $1"
13705     ac_need_defaults=false;;
13706   --header | --heade | --head | --hea )
13707     shift
13708     CONFIG_HEADERS="$CONFIG_HEADERS $1"
13709     ac_need_defaults=false;;
13710
13711   # This is an error.
13712   -*) { { echo "$as_me:13712: error: unrecognized option: $1
13713 Try \`$0 --help' for more information." >&5
13714 echo "$as_me: error: unrecognized option: $1
13715 Try \`$0 --help' for more information." >&2;}
13716    { (exit 1); exit 1; }; } ;;
13717
13718   *) ac_config_targets="$ac_config_targets $1" ;;
13719
13720   esac
13721   shift
13722 done
13723
13724 exec 5>>config.log
13725 cat >&5 << _ACEOF
13726
13727 ## ----------------------- ##
13728 ## Running config.status.  ##
13729 ## ----------------------- ##
13730
13731 This file was extended by $as_me 2.52.20101001, executed with
13732   CONFIG_FILES    = $CONFIG_FILES
13733   CONFIG_HEADERS  = $CONFIG_HEADERS
13734   CONFIG_LINKS    = $CONFIG_LINKS
13735   CONFIG_COMMANDS = $CONFIG_COMMANDS
13736   > $ac_cs_invocation
13737 on `(hostname || uname -n) 2>/dev/null | sed 1q`
13738
13739 _ACEOF
13740 EOF
13741
13742 cat >>$CONFIG_STATUS <<EOF
13743 #
13744 # INIT-COMMANDS section.
13745 #
13746
13747 AWK="$AWK"
13748 ECHO_LD="$ECHO_LD"
13749
13750 EOF
13751
13752 cat >>$CONFIG_STATUS <<\EOF
13753 for ac_config_target in $ac_config_targets
13754 do
13755   case "$ac_config_target" in
13756   # Handling of arguments.
13757   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
13758   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
13759   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
13760   *) { { echo "$as_me:13760: error: invalid argument: $ac_config_target" >&5
13761 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
13762    { (exit 1); exit 1; }; };;
13763   esac
13764 done
13765
13766 # If the user did not use the arguments to specify the items to instantiate,
13767 # then the envvar interface is used.  Set only those that are not.
13768 # We use the long form for the default assignment because of an extremely
13769 # bizarre bug on SunOS 4.1.3.
13770 if $ac_need_defaults; then
13771   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
13772   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
13773   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
13774 fi
13775
13776 # Create a temporary directory, and hook for its removal unless debugging.
13777 $debug ||
13778 {
13779   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
13780   trap '{ (exit 1); exit 1; }' 1 2 13 15
13781 }
13782
13783 # Create a (secure) tmp directory for tmp files.
13784 : ${TMPDIR=/tmp}
13785 {
13786   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
13787   test -n "$tmp" && test -d "$tmp"
13788 }  ||
13789 {
13790   tmp=$TMPDIR/cs$$-$RANDOM
13791   (umask 077 && mkdir $tmp)
13792 } ||
13793 {
13794    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
13795    { (exit 1); exit 1; }
13796 }
13797
13798 EOF
13799
13800 cat >>$CONFIG_STATUS <<EOF
13801
13802 #
13803 # CONFIG_FILES section.
13804 #
13805
13806 # No need to generate the scripts if there are no CONFIG_FILES.
13807 # This happens for instance when ./config.status config.h
13808 if test -n "\$CONFIG_FILES"; then
13809   # Protect against being on the right side of a sed subst in config.status.
13810   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
13811    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
13812 s,@SHELL@,$SHELL,;t t
13813 s,@exec_prefix@,$exec_prefix,;t t
13814 s,@prefix@,$prefix,;t t
13815 s,@program_transform_name@,$program_transform_name,;t t
13816 s,@bindir@,$bindir,;t t
13817 s,@sbindir@,$sbindir,;t t
13818 s,@libexecdir@,$libexecdir,;t t
13819 s,@datadir@,$datadir,;t t
13820 s,@sysconfdir@,$sysconfdir,;t t
13821 s,@sharedstatedir@,$sharedstatedir,;t t
13822 s,@localstatedir@,$localstatedir,;t t
13823 s,@libdir@,$libdir,;t t
13824 s,@includedir@,$includedir,;t t
13825 s,@oldincludedir@,$oldincludedir,;t t
13826 s,@infodir@,$infodir,;t t
13827 s,@mandir@,$mandir,;t t
13828 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
13829 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
13830 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
13831 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
13832 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
13833 s,@build_alias@,$build_alias,;t t
13834 s,@host_alias@,$host_alias,;t t
13835 s,@target_alias@,$target_alias,;t t
13836 s,@ECHO_C@,$ECHO_C,;t t
13837 s,@ECHO_N@,$ECHO_N,;t t
13838 s,@ECHO_T@,$ECHO_T,;t t
13839 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
13840 s,@DEFS@,$DEFS,;t t
13841 s,@LIBS@,$LIBS,;t t
13842 s,@build@,$build,;t t
13843 s,@build_cpu@,$build_cpu,;t t
13844 s,@build_vendor@,$build_vendor,;t t
13845 s,@build_os@,$build_os,;t t
13846 s,@host@,$host,;t t
13847 s,@host_cpu@,$host_cpu,;t t
13848 s,@host_vendor@,$host_vendor,;t t
13849 s,@host_os@,$host_os,;t t
13850 s,@SET_MAKE@,$SET_MAKE,;t t
13851 s,@CC@,$CC,;t t
13852 s,@CFLAGS@,$CFLAGS,;t t
13853 s,@LDFLAGS@,$LDFLAGS,;t t
13854 s,@CPPFLAGS@,$CPPFLAGS,;t t
13855 s,@ac_ct_CC@,$ac_ct_CC,;t t
13856 s,@EXEEXT@,$EXEEXT,;t t
13857 s,@OBJEXT@,$OBJEXT,;t t
13858 s,@CPP@,$CPP,;t t
13859 s,@AWK@,$AWK,;t t
13860 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
13861 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
13862 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
13863 s,@LINT@,$LINT,;t t
13864 s,@LINT_OPTS@,$LINT_OPTS,;t t
13865 s,@CTAGS@,$CTAGS,;t t
13866 s,@ETAGS@,$ETAGS,;t t
13867 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
13868 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
13869 s,@MATH_LIB@,$MATH_LIB,;t t
13870 s,@CC_G_OPT@,$CC_G_OPT,;t t
13871 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
13872 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
13873 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
13874 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
13875 s,@LD@,$LD,;t t
13876 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
13877 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
13878 s,@LD_MODEL@,$LD_MODEL,;t t
13879 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
13880 s,@LIBTOOL@,$LIBTOOL,;t t
13881 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
13882 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
13883 s,@LIB_LINK@,$LIB_LINK,;t t
13884 s,@LINK_TESTS@,$LINK_TESTS,;t t
13885 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
13886 s,@PTHREAD@,$PTHREAD,;t t
13887 s,@TEST_ARGS@,$TEST_ARGS,;t t
13888 s,@TEST_DEPS@,$TEST_DEPS,;t t
13889 s,@TEST_LIBS@,$TEST_LIBS,;t t
13890 s,@TINFO_ARGS@,$TINFO_ARGS,;t t
13891 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
13892 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
13893 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
13894 s,@ECHO_LT@,$ECHO_LT,;t t
13895 s,@ECHO_LD@,$ECHO_LD,;t t
13896 s,@RULE_CC@,$RULE_CC,;t t
13897 s,@SHOW_CC@,$SHOW_CC,;t t
13898 s,@ECHO_CC@,$ECHO_CC,;t t
13899 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
13900 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
13901 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
13902 s,@X_CFLAGS@,$X_CFLAGS,;t t
13903 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
13904 s,@X_LIBS@,$X_LIBS,;t t
13905 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
13906 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
13907 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
13908 CEOF
13909
13910 EOF
13911
13912   cat >>$CONFIG_STATUS <<\EOF
13913   # Split the substitutions into bite-sized pieces for seds with
13914   # small command number limits, like on Digital OSF/1 and HP-UX.
13915   ac_max_sed_lines=48
13916   ac_sed_frag=1 # Number of current file.
13917   ac_beg=1 # First line for current file.
13918   ac_end=$ac_max_sed_lines # Line after last line for current file.
13919   ac_more_lines=:
13920   ac_sed_cmds=
13921   while $ac_more_lines; do
13922     if test $ac_beg -gt 1; then
13923       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
13924     else
13925       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
13926     fi
13927     if test ! -s $tmp/subs.frag; then
13928       ac_more_lines=false
13929     else
13930       # The purpose of the label and of the branching condition is to
13931       # speed up the sed processing (if there are no `@' at all, there
13932       # is no need to browse any of the substitutions).
13933       # These are the two extra sed commands mentioned above.
13934       (echo ':t
13935   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
13936       if test -z "$ac_sed_cmds"; then
13937         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
13938       else
13939         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
13940       fi
13941       ac_sed_frag=`expr $ac_sed_frag + 1`
13942       ac_beg=$ac_end
13943       ac_end=`expr $ac_end + $ac_max_sed_lines`
13944     fi
13945   done
13946   if test -z "$ac_sed_cmds"; then
13947     ac_sed_cmds=cat
13948   fi
13949 fi # test -n "$CONFIG_FILES"
13950
13951 EOF
13952 cat >>$CONFIG_STATUS <<\EOF
13953 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
13954   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13955   case $ac_file in
13956   - | *:- | *:-:* ) # input from stdin
13957         cat >$tmp/stdin
13958         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
13959         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
13960   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
13961         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
13962   * )   ac_file_in=$ac_file.in ;;
13963   esac
13964
13965   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
13966   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13967          X"$ac_file" : 'X\(//\)[^/]' \| \
13968          X"$ac_file" : 'X\(//\)$' \| \
13969          X"$ac_file" : 'X\(/\)' \| \
13970          .     : '\(.\)' 2>/dev/null ||
13971 echo X"$ac_file" |
13972     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13973           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13974           /^X\(\/\/\)$/{ s//\1/; q; }
13975           /^X\(\/\).*/{ s//\1/; q; }
13976           s/.*/./; q'`
13977   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13978     { case "$ac_dir" in
13979   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
13980   *)                      as_incr_dir=.;;
13981 esac
13982 as_dummy="$ac_dir"
13983 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
13984   case $as_mkdir_dir in
13985     # Skip DOS drivespec
13986     ?:) as_incr_dir=$as_mkdir_dir ;;
13987     *)
13988       as_incr_dir=$as_incr_dir/$as_mkdir_dir
13989       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
13990     ;;
13991   esac
13992 done; }
13993
13994     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
13995     # A "../" for each directory in $ac_dir_suffix.
13996     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
13997   else
13998     ac_dir_suffix= ac_dots=
13999   fi
14000
14001   case $srcdir in
14002   .)  ac_srcdir=.
14003       if test -z "$ac_dots"; then
14004          ac_top_srcdir=.
14005       else
14006          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
14007       fi ;;
14008   [\\/]* | ?:[\\/]* )
14009       ac_srcdir=$srcdir$ac_dir_suffix;
14010       ac_top_srcdir=$srcdir ;;
14011   *) # Relative path.
14012     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
14013     ac_top_srcdir=$ac_dots$srcdir ;;
14014   esac
14015
14016   case $INSTALL in
14017   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
14018   *) ac_INSTALL=$ac_dots$INSTALL ;;
14019   esac
14020
14021   if test x"$ac_file" != x-; then
14022     { echo "$as_me:14022: creating $ac_file" >&5
14023 echo "$as_me: creating $ac_file" >&6;}
14024     rm -f "$ac_file"
14025   fi
14026   # Let's still pretend it is `configure' which instantiates (i.e., don't
14027   # use $as_me), people would be surprised to read:
14028   #    /* config.h.  Generated automatically by config.status.  */
14029   configure_input="Generated automatically from `echo $ac_file_in |
14030                                                  sed 's,.*/,,'` by configure."
14031
14032   # First look for the input files in the build tree, otherwise in the
14033   # src tree.
14034   ac_file_inputs=`IFS=:
14035     for f in $ac_file_in; do
14036       case $f in
14037       -) echo $tmp/stdin ;;
14038       [\\/$]*)
14039          # Absolute (can't be DOS-style, as IFS=:)
14040          test -f "$f" || { { echo "$as_me:14040: error: cannot find input file: $f" >&5
14041 echo "$as_me: error: cannot find input file: $f" >&2;}
14042    { (exit 1); exit 1; }; }
14043          echo $f;;
14044       *) # Relative
14045          if test -f "$f"; then
14046            # Build tree
14047            echo $f
14048          elif test -f "$srcdir/$f"; then
14049            # Source tree
14050            echo $srcdir/$f
14051          else
14052            # /dev/null tree
14053            { { echo "$as_me:14053: error: cannot find input file: $f" >&5
14054 echo "$as_me: error: cannot find input file: $f" >&2;}
14055    { (exit 1); exit 1; }; }
14056          fi;;
14057       esac
14058     done` || { (exit 1); exit 1; }
14059 EOF
14060 cat >>$CONFIG_STATUS <<EOF
14061   sed "$ac_vpsub
14062 $extrasub
14063 EOF
14064 cat >>$CONFIG_STATUS <<\EOF
14065 :t
14066 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
14067 s,@configure_input@,$configure_input,;t t
14068 s,@srcdir@,$ac_srcdir,;t t
14069 s,@top_srcdir@,$ac_top_srcdir,;t t
14070 s,@INSTALL@,$ac_INSTALL,;t t
14071 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
14072   rm -f $tmp/stdin
14073   if test x"$ac_file" != x-; then
14074     mv $tmp/out $ac_file
14075   else
14076     cat $tmp/out
14077     rm -f $tmp/out
14078   fi
14079
14080 done
14081 EOF
14082 cat >>$CONFIG_STATUS <<\EOF
14083
14084 #
14085 # CONFIG_HEADER section.
14086 #
14087
14088 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
14089 # NAME is the cpp macro being defined and VALUE is the value it is being given.
14090 #
14091 # ac_d sets the value in "#define NAME VALUE" lines.
14092 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
14093 ac_dB='[        ].*$,\1#\2'
14094 ac_dC=' '
14095 ac_dD=',;t'
14096 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
14097 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14098 ac_iB='\([      ]\),\1#\2define\3'
14099 ac_iC=' '
14100 ac_iD='\4,;t'
14101 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
14102 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
14103 ac_uB='$,\1#\2define\3'
14104 ac_uC=' '
14105 ac_uD=',;t'
14106
14107 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
14108   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
14109   case $ac_file in
14110   - | *:- | *:-:* ) # input from stdin
14111         cat >$tmp/stdin
14112         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14113         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14114   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
14115         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
14116   * )   ac_file_in=$ac_file.in ;;
14117   esac
14118
14119   test x"$ac_file" != x- && { echo "$as_me:14119: creating $ac_file" >&5
14120 echo "$as_me: creating $ac_file" >&6;}
14121
14122   # First look for the input files in the build tree, otherwise in the
14123   # src tree.
14124   ac_file_inputs=`IFS=:
14125     for f in $ac_file_in; do
14126       case $f in
14127       -) echo $tmp/stdin ;;
14128       [\\/$]*)
14129          # Absolute (can't be DOS-style, as IFS=:)
14130          test -f "$f" || { { echo "$as_me:14130: error: cannot find input file: $f" >&5
14131 echo "$as_me: error: cannot find input file: $f" >&2;}
14132    { (exit 1); exit 1; }; }
14133          echo $f;;
14134       *) # Relative
14135          if test -f "$f"; then
14136            # Build tree
14137            echo $f
14138          elif test -f "$srcdir/$f"; then
14139            # Source tree
14140            echo $srcdir/$f
14141          else
14142            # /dev/null tree
14143            { { echo "$as_me:14143: error: cannot find input file: $f" >&5
14144 echo "$as_me: error: cannot find input file: $f" >&2;}
14145    { (exit 1); exit 1; }; }
14146          fi;;
14147       esac
14148     done` || { (exit 1); exit 1; }
14149   # Remove the trailing spaces.
14150   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
14151
14152 EOF
14153
14154 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
14155 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
14156 # be either 'cat' or 'sort'.
14157 cat confdefs.h | uniq >conftest.vals
14158
14159 # Break up conftest.vals because some shells have a limit on
14160 # the size of here documents, and old seds have small limits too.
14161
14162 rm -f conftest.tail
14163 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
14164 while grep . conftest.vals >/dev/null
14165 do
14166   # Write chunks of a limited-size here document to conftest.frag.
14167   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
14168   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
14169   echo 'CEOF' >> $CONFIG_STATUS
14170   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
14171   rm -f conftest.vals
14172   mv conftest.tail conftest.vals
14173 done
14174 rm -f conftest.vals
14175
14176 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
14177 # marker @DEFS@.
14178 echo '  cat >> conftest.edit <<CEOF
14179 /@DEFS@/r conftest.frag
14180 /@DEFS@/d
14181 CEOF
14182 sed -f conftest.edit $tmp/in > $tmp/out
14183 rm -f $tmp/in
14184 mv $tmp/out $tmp/in
14185 rm -f conftest.edit conftest.frag
14186 ' >> $CONFIG_STATUS
14187
14188 cat >>$CONFIG_STATUS <<\EOF
14189   # Let's still pretend it is `configure' which instantiates (i.e., don't
14190   # use $as_me), people would be surprised to read:
14191   #    /* config.h.  Generated automatically by config.status.  */
14192   if test x"$ac_file" = x-; then
14193     echo "/* Generated automatically by configure.  */" >$tmp/config.h
14194   else
14195     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
14196   fi
14197   cat $tmp/in >>$tmp/config.h
14198   rm -f $tmp/in
14199   if test x"$ac_file" != x-; then
14200     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
14201       { echo "$as_me:14201: $ac_file is unchanged" >&5
14202 echo "$as_me: $ac_file is unchanged" >&6;}
14203     else
14204       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14205          X"$ac_file" : 'X\(//\)[^/]' \| \
14206          X"$ac_file" : 'X\(//\)$' \| \
14207          X"$ac_file" : 'X\(/\)' \| \
14208          .     : '\(.\)' 2>/dev/null ||
14209 echo X"$ac_file" |
14210     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14211           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14212           /^X\(\/\/\)$/{ s//\1/; q; }
14213           /^X\(\/\).*/{ s//\1/; q; }
14214           s/.*/./; q'`
14215       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14216         { case "$ac_dir" in
14217   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14218   *)                      as_incr_dir=.;;
14219 esac
14220 as_dummy="$ac_dir"
14221 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14222   case $as_mkdir_dir in
14223     # Skip DOS drivespec
14224     ?:) as_incr_dir=$as_mkdir_dir ;;
14225     *)
14226       as_incr_dir=$as_incr_dir/$as_mkdir_dir
14227       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
14228     ;;
14229   esac
14230 done; }
14231
14232       fi
14233       rm -f $ac_file
14234       mv $tmp/config.h $ac_file
14235     fi
14236   else
14237     cat $tmp/config.h
14238     rm -f $tmp/config.h
14239   fi
14240 done
14241 EOF
14242 cat >>$CONFIG_STATUS <<\EOF
14243 #
14244 # CONFIG_COMMANDS section.
14245 #
14246 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
14247   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
14248   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
14249
14250   case $ac_dest in
14251     default )
14252
14253 for cf_dir in .
14254 do
14255         if test ! -d $srcdir/$cf_dir; then
14256                 continue
14257         elif test -f $srcdir/$cf_dir/programs; then
14258                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
14259         fi
14260 done
14261
14262         cat >>Makefile <<TEST_EOF
14263
14264 # These rules are generated so we do not rely on suffix rules, which do not
14265 # work consistently for different make-programs (the '\$(MODEL)/' confuses
14266 # some, and the '\$x' confuses others).
14267 TEST_EOF
14268
14269 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
14270 for N in $LIST
14271 do
14272         cat >>Makefile <<TEST_EOF
14273
14274 \$(MODEL)/$N.o : $N.c \\
14275         test.priv.h \\
14276         ncurses_cfg.h
14277         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
14278 TEST_EOF
14279 done
14280
14281 if test -f ../config.guess && test -f ../config.sub
14282 then
14283         cat >>Makefile <<TEST_EOF
14284
14285 # if we used CF_INHERIT for getting these files, we can remove them
14286 distclean::
14287         rm -f config.guess config.sub
14288 TEST_EOF
14289 fi
14290  ;;
14291   esac
14292 done
14293 EOF
14294
14295 cat >>$CONFIG_STATUS <<\EOF
14296
14297 { (exit 0); exit 0; }
14298 EOF
14299 chmod +x $CONFIG_STATUS
14300 ac_clean_files=$ac_clean_files_save
14301
14302 # configure is writing to config.log, and then calls config.status.
14303 # config.status does its own redirection, appending to config.log.
14304 # Unfortunately, on DOS this fails, as config.log is still kept open
14305 # by configure, so config.status won't be able to write to it; its
14306 # output is simply discarded.  So we exec the FD to /dev/null,
14307 # effectively closing config.log, so it can be properly (re)opened and
14308 # appended to by config.status.  When coming back to configure, we
14309 # need to make the FD available again.
14310 if test "$no_create" != yes; then
14311   ac_cs_success=:
14312   exec 5>/dev/null
14313   $SHELL $CONFIG_STATUS || ac_cs_success=false
14314   exec 5>>config.log
14315   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
14316   # would make configure fail if this is the last instruction.
14317   $ac_cs_success || { (exit 1); exit 1; }
14318 fi
14319