]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.7 - patch 20101023
[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 X features:
658   --x-includes=DIR    X include files are in DIR
659   --x-libraries=DIR   X library files are in DIR
660
661 System types:
662   --build=BUILD           configure for building on BUILD [guessed]
663   --host=HOST       build programs to run on HOST [BUILD]
664 EOF
665 fi
666
667 if test -n "$ac_init_help"; then
668
669   cat <<\EOF
670
671 Optional Features:
672   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
673   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
674
675 Optional Packages:
676   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
677   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
678
679   --disable-echo          display "compiling" commands
680   --enable-warnings       test: turn on gcc compiler warnings
681   --with-curses-dir=DIR   directory in which (n)curses is installed
682   --with-5lib             use SunOS sysv-libraries
683   --with-ncursesw         use wide ncurses-libraries (installed)
684   --with-ncurses          use ncurses-libraries (installed)
685   --with-pdcurses         compile/link with pdcurses X11 library
686   --with-Xaw3d            link with Xaw 3d library
687   --with-neXtaw           link with neXT Athena library
688   --with-XawPlus          link with Athena-Plus library
689   --with-pkg-config{=path} enable/disable use of pkg-config
690   --with-x                use the X Window System
691   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
692
693 Some influential environment variables:
694   CC          C compiler command
695   CFLAGS      C compiler flags
696   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
697               nonstandard directory <lib dir>
698   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
699               headers in a nonstandard directory <include dir>
700   CPP         C preprocessor
701
702 Use these variables to override the choices made by `configure' or to help
703 it to find libraries and programs with nonstandard names/locations.
704
705 EOF
706 fi
707
708 if test "$ac_init_help" = "recursive"; then
709   # If there are subdirs, report their specific --help.
710   ac_popdir=`pwd`
711   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
712     cd $ac_subdir
713     # A "../" for each directory in /$ac_subdir.
714     ac_dots=`echo $ac_subdir |
715              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
716
717     case $srcdir in
718     .) # No --srcdir option.  We are building in place.
719       ac_sub_srcdir=$srcdir ;;
720     [\\/]* | ?:[\\/]* ) # Absolute path.
721       ac_sub_srcdir=$srcdir/$ac_subdir ;;
722     *) # Relative path.
723       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
724     esac
725
726     # Check for guested configure; otherwise get Cygnus style configure.
727     if test -f $ac_sub_srcdir/configure.gnu; then
728       echo
729       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
730     elif test -f $ac_sub_srcdir/configure; then
731       echo
732       $SHELL $ac_sub_srcdir/configure  --help=recursive
733     elif test -f $ac_sub_srcdir/configure.ac ||
734            test -f $ac_sub_srcdir/configure.in; then
735       echo
736       $ac_configure --help
737     else
738       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
739     fi
740     cd $ac_popdir
741   done
742 fi
743
744 test -n "$ac_init_help" && exit 0
745 if $ac_init_version; then
746   cat <<\EOF
747
748 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
749 Free Software Foundation, Inc.
750 This configure script is free software; the Free Software Foundation
751 gives unlimited permission to copy, distribute and modify it.
752 EOF
753   exit 0
754 fi
755 exec 5>config.log
756 cat >&5 <<EOF
757 This file contains any messages produced by compilers while
758 running configure, to aid debugging if configure makes a mistake.
759
760 It was created by $as_me, which was
761 generated by GNU Autoconf 2.52.20101001.  Invocation command line was
762
763   $ $0 $@
764
765 EOF
766 {
767 cat <<_ASUNAME
768 ## ---------- ##
769 ## Platform.  ##
770 ## ---------- ##
771
772 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
773 uname -m = `(uname -m) 2>/dev/null || echo unknown`
774 uname -r = `(uname -r) 2>/dev/null || echo unknown`
775 uname -s = `(uname -s) 2>/dev/null || echo unknown`
776 uname -v = `(uname -v) 2>/dev/null || echo unknown`
777
778 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
779 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
780
781 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
782 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
783 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
784 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
785 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
786 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
787 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
788
789 PATH = $PATH
790
791 _ASUNAME
792 } >&5
793
794 cat >&5 <<EOF
795 ## ------------ ##
796 ## Core tests.  ##
797 ## ------------ ##
798
799 EOF
800
801 # Keep a trace of the command line.
802 # Strip out --no-create and --no-recursion so they do not pile up.
803 # Also quote any args containing shell meta-characters.
804 ac_configure_args=
805 ac_sep=
806 for ac_arg
807 do
808   case $ac_arg in
809   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
810   | --no-cr | --no-c) ;;
811   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
812   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
813   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
814     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
815     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
816     ac_sep=" " ;;
817   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
818      ac_sep=" " ;;
819   esac
820   # Get rid of the leading space.
821 done
822
823 # When interrupted or exit'd, cleanup temporary files, and complete
824 # config.log.  We remove comments because anyway the quotes in there
825 # would cause problems or look ugly.
826 trap 'exit_status=$?
827   # Save into config.log some information that might help in debugging.
828   echo >&5
829   echo "## ----------------- ##" >&5
830   echo "## Cache variables.  ##" >&5
831   echo "## ----------------- ##" >&5
832   echo >&5
833   # The following way of writing the cache mishandles newlines in values,
834 {
835   (set) 2>&1 |
836     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
837     *ac_space=\ *)
838       sed -n \
839         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
840           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
841       ;;
842     *)
843       sed -n \
844         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
845       ;;
846     esac;
847 } >&5
848   sed "/^$/d" confdefs.h >conftest.log
849   if test -s conftest.log; then
850     echo >&5
851     echo "## ------------ ##" >&5
852     echo "## confdefs.h.  ##" >&5
853     echo "## ------------ ##" >&5
854     echo >&5
855     cat conftest.log >&5
856   fi
857   (echo; echo) >&5
858   test "$ac_signal" != 0 &&
859     echo "$as_me: caught signal $ac_signal" >&5
860   echo "$as_me: exit $exit_status" >&5
861   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
862     exit $exit_status
863      ' 0
864 for ac_signal in 1 2 13 15; do
865   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
866 done
867 ac_signal=0
868
869 # confdefs.h avoids OS command line length limits that DEFS can exceed.
870 rm -rf conftest* confdefs.h
871 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
872 echo >confdefs.h
873
874 # Let the site file select an alternate cache file if it wants to.
875 # Prefer explicitly selected file to automatically selected ones.
876 if test -z "$CONFIG_SITE"; then
877   if test "x$prefix" != xNONE; then
878     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
879   else
880     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
881   fi
882 fi
883 for ac_site_file in $CONFIG_SITE; do
884   if test -r "$ac_site_file"; then
885     { echo "$as_me:885: loading site script $ac_site_file" >&5
886 echo "$as_me: loading site script $ac_site_file" >&6;}
887     cat "$ac_site_file" >&5
888     . "$ac_site_file"
889   fi
890 done
891
892 if test -r "$cache_file"; then
893   # Some versions of bash will fail to source /dev/null (special
894   # files actually), so we avoid doing that.
895   if test -f "$cache_file"; then
896     { echo "$as_me:896: loading cache $cache_file" >&5
897 echo "$as_me: loading cache $cache_file" >&6;}
898     case $cache_file in
899       [\\/]* | ?:[\\/]* ) . $cache_file;;
900       *)                      . ./$cache_file;;
901     esac
902   fi
903 else
904   { echo "$as_me:904: creating cache $cache_file" >&5
905 echo "$as_me: creating cache $cache_file" >&6;}
906   >$cache_file
907 fi
908
909 # Check that the precious variables saved in the cache have kept the same
910 # value.
911 ac_cache_corrupted=false
912 for ac_var in `(set) 2>&1 |
913                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
914   eval ac_old_set=\$ac_cv_env_${ac_var}_set
915   eval ac_new_set=\$ac_env_${ac_var}_set
916   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
917   eval ac_new_val="\$ac_env_${ac_var}_value"
918   case $ac_old_set,$ac_new_set in
919     set,)
920       { echo "$as_me:920: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
921 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
922       ac_cache_corrupted=: ;;
923     ,set)
924       { echo "$as_me:924: error: \`$ac_var' was not set in the previous run" >&5
925 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
926       ac_cache_corrupted=: ;;
927     ,);;
928     *)
929       if test "x$ac_old_val" != "x$ac_new_val"; then
930         { echo "$as_me:930: error: \`$ac_var' has changed since the previous run:" >&5
931 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
932         { echo "$as_me:932:   former value:  $ac_old_val" >&5
933 echo "$as_me:   former value:  $ac_old_val" >&2;}
934         { echo "$as_me:934:   current value: $ac_new_val" >&5
935 echo "$as_me:   current value: $ac_new_val" >&2;}
936         ac_cache_corrupted=:
937       fi;;
938   esac
939   # Pass precious variables to config.status.  It doesn't matter if
940   # we pass some twice (in addition to the command line arguments).
941   if test "$ac_new_set" = set; then
942     case $ac_new_val in
943     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
944       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
945       ac_configure_args="$ac_configure_args '$ac_arg'"
946       ;;
947     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
948        ;;
949     esac
950   fi
951 done
952 if $ac_cache_corrupted; then
953   { echo "$as_me:953: error: changes in the environment can compromise the build" >&5
954 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
955   { { echo "$as_me:955: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
956 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
957    { (exit 1); exit 1; }; }
958 fi
959
960 ac_ext=c
961 ac_cpp='$CPP $CPPFLAGS'
962 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
963 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
964 ac_compiler_gnu=$ac_cv_c_compiler_gnu
965 ac_main_return=return
966
967 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
968   *c*,-n*) ECHO_N= ECHO_C='
969 ' ECHO_T='      ' ;;
970   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
971   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
972 esac
973 echo "#! $SHELL" >conftest.sh
974 echo  "exit 0"   >>conftest.sh
975 chmod +x conftest.sh
976 if { (echo "$as_me:976: PATH=\".;.\"; conftest.sh") >&5
977   (PATH=".;."; conftest.sh) 2>&5
978   ac_status=$?
979   echo "$as_me:979: \$? = $ac_status" >&5
980   (exit $ac_status); }; then
981   ac_path_separator=';'
982 else
983   ac_path_separator=:
984 fi
985 PATH_SEPARATOR="$ac_path_separator"
986 rm -f conftest.sh
987
988 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
989
990 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
991
992 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
993
994 ac_aux_dir=
995 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
996   if test -f $ac_dir/install-sh; then
997     ac_aux_dir=$ac_dir
998     ac_install_sh="$ac_aux_dir/install-sh -c"
999     break
1000   elif test -f $ac_dir/install.sh; then
1001     ac_aux_dir=$ac_dir
1002     ac_install_sh="$ac_aux_dir/install.sh -c"
1003     break
1004   elif test -f $ac_dir/shtool; then
1005     ac_aux_dir=$ac_dir
1006     ac_install_sh="$ac_aux_dir/shtool install -c"
1007     break
1008   fi
1009 done
1010 if test -z "$ac_aux_dir"; then
1011   { { echo "$as_me:1011: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1012 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1013    { (exit 1); exit 1; }; }
1014 fi
1015 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1016 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1017 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1018
1019 # Make sure we can run config.sub.
1020 $ac_config_sub sun4 >/dev/null 2>&1 ||
1021   { { echo "$as_me:1021: error: cannot run $ac_config_sub" >&5
1022 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1023    { (exit 1); exit 1; }; }
1024
1025 echo "$as_me:1025: checking build system type" >&5
1026 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1027 if test "${ac_cv_build+set}" = set; then
1028   echo $ECHO_N "(cached) $ECHO_C" >&6
1029 else
1030   ac_cv_build_alias=$build_alias
1031 test -z "$ac_cv_build_alias" &&
1032   ac_cv_build_alias=`$ac_config_guess`
1033 test -z "$ac_cv_build_alias" &&
1034   { { echo "$as_me:1034: error: cannot guess build type; you must specify one" >&5
1035 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1036    { (exit 1); exit 1; }; }
1037 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1038   { { echo "$as_me:1038: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1039 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1040    { (exit 1); exit 1; }; }
1041
1042 fi
1043 echo "$as_me:1043: result: $ac_cv_build" >&5
1044 echo "${ECHO_T}$ac_cv_build" >&6
1045 build=$ac_cv_build
1046 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1047 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1048 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1049
1050 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1051         echo "$as_me:1051: checking host system type" >&5
1052 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1053 if test "${ac_cv_host+set}" = set; then
1054   echo $ECHO_N "(cached) $ECHO_C" >&6
1055 else
1056   ac_cv_host_alias=$host_alias
1057 test -z "$ac_cv_host_alias" &&
1058   ac_cv_host_alias=$ac_cv_build_alias
1059 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1060   { { echo "$as_me:1060: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1061 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1062    { (exit 1); exit 1; }; }
1063
1064 fi
1065 echo "$as_me:1065: result: $ac_cv_host" >&5
1066 echo "${ECHO_T}$ac_cv_host" >&6
1067 host=$ac_cv_host
1068 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1069 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1070 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1071
1072         system_name="$host_os"
1073 else
1074         system_name="`(uname -s -r) 2>/dev/null`"
1075         if test -z "$system_name" ; then
1076                 system_name="`(hostname) 2>/dev/null`"
1077         fi
1078 fi
1079 test -n "$system_name" && cat >>confdefs.h <<EOF
1080 #define SYSTEM_NAME "$system_name"
1081 EOF
1082
1083 if test "${cf_cv_system_name+set}" = set; then
1084   echo $ECHO_N "(cached) $ECHO_C" >&6
1085 else
1086   cf_cv_system_name="$system_name"
1087 fi
1088
1089 test -z "$system_name" && system_name="$cf_cv_system_name"
1090 test -n "$cf_cv_system_name" && echo "$as_me:1090: result: Configuring for $cf_cv_system_name" >&5
1091 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1092
1093 if test ".$system_name" != ".$cf_cv_system_name" ; then
1094         echo "$as_me:1094: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1095 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1096         { { echo "$as_me:1096: error: \"Please remove config.cache and try again.\"" >&5
1097 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1098    { (exit 1); exit 1; }; }
1099 fi
1100
1101 echo "$as_me:1101: checking whether ${MAKE-make} sets \${MAKE}" >&5
1102 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1103 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1104 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1105   echo $ECHO_N "(cached) $ECHO_C" >&6
1106 else
1107   cat >conftest.make <<\EOF
1108 all:
1109         @echo 'ac_maketemp="${MAKE}"'
1110 EOF
1111 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1112 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1113 if test -n "$ac_maketemp"; then
1114   eval ac_cv_prog_make_${ac_make}_set=yes
1115 else
1116   eval ac_cv_prog_make_${ac_make}_set=no
1117 fi
1118 rm -f conftest.make
1119 fi
1120 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1121   echo "$as_me:1121: result: yes" >&5
1122 echo "${ECHO_T}yes" >&6
1123   SET_MAKE=
1124 else
1125   echo "$as_me:1125: result: no" >&5
1126 echo "${ECHO_T}no" >&6
1127   SET_MAKE="MAKE=${MAKE-make}"
1128 fi
1129
1130 ac_ext=c
1131 ac_cpp='$CPP $CPPFLAGS'
1132 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1133 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1134 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1135 ac_main_return=return
1136 if test -n "$ac_tool_prefix"; then
1137   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1138 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1139 echo "$as_me:1139: checking for $ac_word" >&5
1140 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1141 if test "${ac_cv_prog_CC+set}" = set; then
1142   echo $ECHO_N "(cached) $ECHO_C" >&6
1143 else
1144   if test -n "$CC"; then
1145   ac_cv_prog_CC="$CC" # Let the user override the test.
1146 else
1147   ac_save_IFS=$IFS; IFS=$ac_path_separator
1148 ac_dummy="$PATH"
1149 for ac_dir in $ac_dummy; do
1150   IFS=$ac_save_IFS
1151   test -z "$ac_dir" && ac_dir=.
1152   $as_executable_p "$ac_dir/$ac_word" || continue
1153 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1154 echo "$as_me:1154: found $ac_dir/$ac_word" >&5
1155 break
1156 done
1157
1158 fi
1159 fi
1160 CC=$ac_cv_prog_CC
1161 if test -n "$CC"; then
1162   echo "$as_me:1162: result: $CC" >&5
1163 echo "${ECHO_T}$CC" >&6
1164 else
1165   echo "$as_me:1165: result: no" >&5
1166 echo "${ECHO_T}no" >&6
1167 fi
1168
1169 fi
1170 if test -z "$ac_cv_prog_CC"; then
1171   ac_ct_CC=$CC
1172   # Extract the first word of "gcc", so it can be a program name with args.
1173 set dummy gcc; ac_word=$2
1174 echo "$as_me:1174: checking for $ac_word" >&5
1175 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1176 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1177   echo $ECHO_N "(cached) $ECHO_C" >&6
1178 else
1179   if test -n "$ac_ct_CC"; then
1180   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1181 else
1182   ac_save_IFS=$IFS; IFS=$ac_path_separator
1183 ac_dummy="$PATH"
1184 for ac_dir in $ac_dummy; do
1185   IFS=$ac_save_IFS
1186   test -z "$ac_dir" && ac_dir=.
1187   $as_executable_p "$ac_dir/$ac_word" || continue
1188 ac_cv_prog_ac_ct_CC="gcc"
1189 echo "$as_me:1189: found $ac_dir/$ac_word" >&5
1190 break
1191 done
1192
1193 fi
1194 fi
1195 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1196 if test -n "$ac_ct_CC"; then
1197   echo "$as_me:1197: result: $ac_ct_CC" >&5
1198 echo "${ECHO_T}$ac_ct_CC" >&6
1199 else
1200   echo "$as_me:1200: result: no" >&5
1201 echo "${ECHO_T}no" >&6
1202 fi
1203
1204   CC=$ac_ct_CC
1205 else
1206   CC="$ac_cv_prog_CC"
1207 fi
1208
1209 if test -z "$CC"; then
1210   if test -n "$ac_tool_prefix"; then
1211   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1212 set dummy ${ac_tool_prefix}cc; ac_word=$2
1213 echo "$as_me:1213: checking for $ac_word" >&5
1214 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1215 if test "${ac_cv_prog_CC+set}" = set; then
1216   echo $ECHO_N "(cached) $ECHO_C" >&6
1217 else
1218   if test -n "$CC"; then
1219   ac_cv_prog_CC="$CC" # Let the user override the test.
1220 else
1221   ac_save_IFS=$IFS; IFS=$ac_path_separator
1222 ac_dummy="$PATH"
1223 for ac_dir in $ac_dummy; do
1224   IFS=$ac_save_IFS
1225   test -z "$ac_dir" && ac_dir=.
1226   $as_executable_p "$ac_dir/$ac_word" || continue
1227 ac_cv_prog_CC="${ac_tool_prefix}cc"
1228 echo "$as_me:1228: found $ac_dir/$ac_word" >&5
1229 break
1230 done
1231
1232 fi
1233 fi
1234 CC=$ac_cv_prog_CC
1235 if test -n "$CC"; then
1236   echo "$as_me:1236: result: $CC" >&5
1237 echo "${ECHO_T}$CC" >&6
1238 else
1239   echo "$as_me:1239: result: no" >&5
1240 echo "${ECHO_T}no" >&6
1241 fi
1242
1243 fi
1244 if test -z "$ac_cv_prog_CC"; then
1245   ac_ct_CC=$CC
1246   # Extract the first word of "cc", so it can be a program name with args.
1247 set dummy cc; ac_word=$2
1248 echo "$as_me:1248: checking for $ac_word" >&5
1249 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1250 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1251   echo $ECHO_N "(cached) $ECHO_C" >&6
1252 else
1253   if test -n "$ac_ct_CC"; then
1254   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1255 else
1256   ac_save_IFS=$IFS; IFS=$ac_path_separator
1257 ac_dummy="$PATH"
1258 for ac_dir in $ac_dummy; do
1259   IFS=$ac_save_IFS
1260   test -z "$ac_dir" && ac_dir=.
1261   $as_executable_p "$ac_dir/$ac_word" || continue
1262 ac_cv_prog_ac_ct_CC="cc"
1263 echo "$as_me:1263: found $ac_dir/$ac_word" >&5
1264 break
1265 done
1266
1267 fi
1268 fi
1269 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1270 if test -n "$ac_ct_CC"; then
1271   echo "$as_me:1271: result: $ac_ct_CC" >&5
1272 echo "${ECHO_T}$ac_ct_CC" >&6
1273 else
1274   echo "$as_me:1274: result: no" >&5
1275 echo "${ECHO_T}no" >&6
1276 fi
1277
1278   CC=$ac_ct_CC
1279 else
1280   CC="$ac_cv_prog_CC"
1281 fi
1282
1283 fi
1284 if test -z "$CC"; then
1285   # Extract the first word of "cc", so it can be a program name with args.
1286 set dummy cc; ac_word=$2
1287 echo "$as_me:1287: checking for $ac_word" >&5
1288 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1289 if test "${ac_cv_prog_CC+set}" = set; then
1290   echo $ECHO_N "(cached) $ECHO_C" >&6
1291 else
1292   if test -n "$CC"; then
1293   ac_cv_prog_CC="$CC" # Let the user override the test.
1294 else
1295   ac_prog_rejected=no
1296   ac_save_IFS=$IFS; IFS=$ac_path_separator
1297 ac_dummy="$PATH"
1298 for ac_dir in $ac_dummy; do
1299   IFS=$ac_save_IFS
1300   test -z "$ac_dir" && ac_dir=.
1301   $as_executable_p "$ac_dir/$ac_word" || continue
1302 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1303   ac_prog_rejected=yes
1304   continue
1305 fi
1306 ac_cv_prog_CC="cc"
1307 echo "$as_me:1307: found $ac_dir/$ac_word" >&5
1308 break
1309 done
1310
1311 if test $ac_prog_rejected = yes; then
1312   # We found a bogon in the path, so make sure we never use it.
1313   set dummy $ac_cv_prog_CC
1314   shift
1315   if test $# != 0; then
1316     # We chose a different compiler from the bogus one.
1317     # However, it has the same basename, so the bogon will be chosen
1318     # first if we set CC to just the basename; use the full file name.
1319     shift
1320     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1321     shift
1322     ac_cv_prog_CC="$@"
1323   fi
1324 fi
1325 fi
1326 fi
1327 CC=$ac_cv_prog_CC
1328 if test -n "$CC"; then
1329   echo "$as_me:1329: result: $CC" >&5
1330 echo "${ECHO_T}$CC" >&6
1331 else
1332   echo "$as_me:1332: result: no" >&5
1333 echo "${ECHO_T}no" >&6
1334 fi
1335
1336 fi
1337 if test -z "$CC"; then
1338   if test -n "$ac_tool_prefix"; then
1339   for ac_prog in cl
1340   do
1341     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1342 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1343 echo "$as_me:1343: checking for $ac_word" >&5
1344 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1345 if test "${ac_cv_prog_CC+set}" = set; then
1346   echo $ECHO_N "(cached) $ECHO_C" >&6
1347 else
1348   if test -n "$CC"; then
1349   ac_cv_prog_CC="$CC" # Let the user override the test.
1350 else
1351   ac_save_IFS=$IFS; IFS=$ac_path_separator
1352 ac_dummy="$PATH"
1353 for ac_dir in $ac_dummy; do
1354   IFS=$ac_save_IFS
1355   test -z "$ac_dir" && ac_dir=.
1356   $as_executable_p "$ac_dir/$ac_word" || continue
1357 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1358 echo "$as_me:1358: found $ac_dir/$ac_word" >&5
1359 break
1360 done
1361
1362 fi
1363 fi
1364 CC=$ac_cv_prog_CC
1365 if test -n "$CC"; then
1366   echo "$as_me:1366: result: $CC" >&5
1367 echo "${ECHO_T}$CC" >&6
1368 else
1369   echo "$as_me:1369: result: no" >&5
1370 echo "${ECHO_T}no" >&6
1371 fi
1372
1373     test -n "$CC" && break
1374   done
1375 fi
1376 if test -z "$CC"; then
1377   ac_ct_CC=$CC
1378   for ac_prog in cl
1379 do
1380   # Extract the first word of "$ac_prog", so it can be a program name with args.
1381 set dummy $ac_prog; ac_word=$2
1382 echo "$as_me:1382: checking for $ac_word" >&5
1383 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1384 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1385   echo $ECHO_N "(cached) $ECHO_C" >&6
1386 else
1387   if test -n "$ac_ct_CC"; then
1388   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1389 else
1390   ac_save_IFS=$IFS; IFS=$ac_path_separator
1391 ac_dummy="$PATH"
1392 for ac_dir in $ac_dummy; do
1393   IFS=$ac_save_IFS
1394   test -z "$ac_dir" && ac_dir=.
1395   $as_executable_p "$ac_dir/$ac_word" || continue
1396 ac_cv_prog_ac_ct_CC="$ac_prog"
1397 echo "$as_me:1397: found $ac_dir/$ac_word" >&5
1398 break
1399 done
1400
1401 fi
1402 fi
1403 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1404 if test -n "$ac_ct_CC"; then
1405   echo "$as_me:1405: result: $ac_ct_CC" >&5
1406 echo "${ECHO_T}$ac_ct_CC" >&6
1407 else
1408   echo "$as_me:1408: result: no" >&5
1409 echo "${ECHO_T}no" >&6
1410 fi
1411
1412   test -n "$ac_ct_CC" && break
1413 done
1414
1415   CC=$ac_ct_CC
1416 fi
1417
1418 fi
1419
1420 test -z "$CC" && { { echo "$as_me:1420: error: no acceptable cc found in \$PATH" >&5
1421 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1422    { (exit 1); exit 1; }; }
1423
1424 # Provide some information about the compiler.
1425 echo "$as_me:1425:" \
1426      "checking for C compiler version" >&5
1427 ac_compiler=`set X $ac_compile; echo $2`
1428 { (eval echo "$as_me:1428: \"$ac_compiler --version </dev/null >&5\"") >&5
1429   (eval $ac_compiler --version </dev/null >&5) 2>&5
1430   ac_status=$?
1431   echo "$as_me:1431: \$? = $ac_status" >&5
1432   (exit $ac_status); }
1433 { (eval echo "$as_me:1433: \"$ac_compiler -v </dev/null >&5\"") >&5
1434   (eval $ac_compiler -v </dev/null >&5) 2>&5
1435   ac_status=$?
1436   echo "$as_me:1436: \$? = $ac_status" >&5
1437   (exit $ac_status); }
1438 { (eval echo "$as_me:1438: \"$ac_compiler -V </dev/null >&5\"") >&5
1439   (eval $ac_compiler -V </dev/null >&5) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }
1443
1444 cat >conftest.$ac_ext <<_ACEOF
1445 #line 1445 "configure"
1446 #include "confdefs.h"
1447
1448 int
1449 main ()
1450 {
1451
1452   ;
1453   return 0;
1454 }
1455 _ACEOF
1456 ac_clean_files_save=$ac_clean_files
1457 ac_clean_files="$ac_clean_files a.out a.exe"
1458 # Try to create an executable without -o first, disregard a.out.
1459 # It will help us diagnose broken compilers, and finding out an intuition
1460 # of exeext.
1461 echo "$as_me:1461: checking for C compiler default output" >&5
1462 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1463 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1464 if { (eval echo "$as_me:1464: \"$ac_link_default\"") >&5
1465   (eval $ac_link_default) 2>&5
1466   ac_status=$?
1467   echo "$as_me:1467: \$? = $ac_status" >&5
1468   (exit $ac_status); }; then
1469   # Find the output, starting from the most likely.  This scheme is
1470 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1471 # resort.
1472 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1473                 ls a.out conftest 2>/dev/null;
1474                 ls a.* conftest.* 2>/dev/null`; do
1475   case $ac_file in
1476     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1477     a.out ) # We found the default executable, but exeext='' is most
1478             # certainly right.
1479             break;;
1480     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1481           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1482           export ac_cv_exeext
1483           break;;
1484     * ) break;;
1485   esac
1486 done
1487 else
1488   echo "$as_me: failed program was:" >&5
1489 cat conftest.$ac_ext >&5
1490 { { echo "$as_me:1490: error: C compiler cannot create executables" >&5
1491 echo "$as_me: error: C compiler cannot create executables" >&2;}
1492    { (exit 77); exit 77; }; }
1493 fi
1494
1495 ac_exeext=$ac_cv_exeext
1496 echo "$as_me:1496: result: $ac_file" >&5
1497 echo "${ECHO_T}$ac_file" >&6
1498
1499 # Check the compiler produces executables we can run.  If not, either
1500 # the compiler is broken, or we cross compile.
1501 echo "$as_me:1501: checking whether the C compiler works" >&5
1502 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1503 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1504 # If not cross compiling, check that we can run a simple program.
1505 if test "$cross_compiling" != yes; then
1506   if { ac_try='./$ac_file'
1507   { (eval echo "$as_me:1507: \"$ac_try\"") >&5
1508   (eval $ac_try) 2>&5
1509   ac_status=$?
1510   echo "$as_me:1510: \$? = $ac_status" >&5
1511   (exit $ac_status); }; }; then
1512     cross_compiling=no
1513   else
1514     if test "$cross_compiling" = maybe; then
1515         cross_compiling=yes
1516     else
1517         { { echo "$as_me:1517: error: cannot run C compiled programs.
1518 If you meant to cross compile, use \`--host'." >&5
1519 echo "$as_me: error: cannot run C compiled programs.
1520 If you meant to cross compile, use \`--host'." >&2;}
1521    { (exit 1); exit 1; }; }
1522     fi
1523   fi
1524 fi
1525 echo "$as_me:1525: result: yes" >&5
1526 echo "${ECHO_T}yes" >&6
1527
1528 rm -f a.out a.exe conftest$ac_cv_exeext
1529 ac_clean_files=$ac_clean_files_save
1530 # Check the compiler produces executables we can run.  If not, either
1531 # the compiler is broken, or we cross compile.
1532 echo "$as_me:1532: checking whether we are cross compiling" >&5
1533 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1534 echo "$as_me:1534: result: $cross_compiling" >&5
1535 echo "${ECHO_T}$cross_compiling" >&6
1536
1537 echo "$as_me:1537: checking for executable suffix" >&5
1538 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1539 if { (eval echo "$as_me:1539: \"$ac_link\"") >&5
1540   (eval $ac_link) 2>&5
1541   ac_status=$?
1542   echo "$as_me:1542: \$? = $ac_status" >&5
1543   (exit $ac_status); }; then
1544   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1545 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1546 # work properly (i.e., refer to `conftest.exe'), while it won't with
1547 # `rm'.
1548 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1549   case $ac_file in
1550     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1551     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1552           export ac_cv_exeext
1553           break;;
1554     * ) break;;
1555   esac
1556 done
1557 else
1558   { { echo "$as_me:1558: error: cannot compute EXEEXT: cannot compile and link" >&5
1559 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1560    { (exit 1); exit 1; }; }
1561 fi
1562
1563 rm -f conftest$ac_cv_exeext
1564 echo "$as_me:1564: result: $ac_cv_exeext" >&5
1565 echo "${ECHO_T}$ac_cv_exeext" >&6
1566
1567 rm -f conftest.$ac_ext
1568 EXEEXT=$ac_cv_exeext
1569 ac_exeext=$EXEEXT
1570 echo "$as_me:1570: checking for object suffix" >&5
1571 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1572 if test "${ac_cv_objext+set}" = set; then
1573   echo $ECHO_N "(cached) $ECHO_C" >&6
1574 else
1575   cat >conftest.$ac_ext <<_ACEOF
1576 #line 1576 "configure"
1577 #include "confdefs.h"
1578
1579 int
1580 main ()
1581 {
1582
1583   ;
1584   return 0;
1585 }
1586 _ACEOF
1587 rm -f conftest.o conftest.obj
1588 if { (eval echo "$as_me:1588: \"$ac_compile\"") >&5
1589   (eval $ac_compile) 2>&5
1590   ac_status=$?
1591   echo "$as_me:1591: \$? = $ac_status" >&5
1592   (exit $ac_status); }; then
1593   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1594   case $ac_file in
1595     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1596     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1597        break;;
1598   esac
1599 done
1600 else
1601   echo "$as_me: failed program was:" >&5
1602 cat conftest.$ac_ext >&5
1603 { { echo "$as_me:1603: error: cannot compute OBJEXT: cannot compile" >&5
1604 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1605    { (exit 1); exit 1; }; }
1606 fi
1607
1608 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1609 fi
1610 echo "$as_me:1610: result: $ac_cv_objext" >&5
1611 echo "${ECHO_T}$ac_cv_objext" >&6
1612 OBJEXT=$ac_cv_objext
1613 ac_objext=$OBJEXT
1614 echo "$as_me:1614: checking whether we are using the GNU C compiler" >&5
1615 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1616 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1617   echo $ECHO_N "(cached) $ECHO_C" >&6
1618 else
1619   cat >conftest.$ac_ext <<_ACEOF
1620 #line 1620 "configure"
1621 #include "confdefs.h"
1622
1623 int
1624 main ()
1625 {
1626 #ifndef __GNUC__
1627        choke me
1628 #endif
1629
1630   ;
1631   return 0;
1632 }
1633 _ACEOF
1634 rm -f conftest.$ac_objext
1635 if { (eval echo "$as_me:1635: \"$ac_compile\"") >&5
1636   (eval $ac_compile) 2>&5
1637   ac_status=$?
1638   echo "$as_me:1638: \$? = $ac_status" >&5
1639   (exit $ac_status); } &&
1640          { ac_try='test -s conftest.$ac_objext'
1641   { (eval echo "$as_me:1641: \"$ac_try\"") >&5
1642   (eval $ac_try) 2>&5
1643   ac_status=$?
1644   echo "$as_me:1644: \$? = $ac_status" >&5
1645   (exit $ac_status); }; }; then
1646   ac_compiler_gnu=yes
1647 else
1648   echo "$as_me: failed program was:" >&5
1649 cat conftest.$ac_ext >&5
1650 ac_compiler_gnu=no
1651 fi
1652 rm -f conftest.$ac_objext conftest.$ac_ext
1653 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1654
1655 fi
1656 echo "$as_me:1656: result: $ac_cv_c_compiler_gnu" >&5
1657 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1658 GCC=`test $ac_compiler_gnu = yes && echo yes`
1659 ac_test_CFLAGS=${CFLAGS+set}
1660 ac_save_CFLAGS=$CFLAGS
1661 CFLAGS="-g"
1662 echo "$as_me:1662: checking whether $CC accepts -g" >&5
1663 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1664 if test "${ac_cv_prog_cc_g+set}" = set; then
1665   echo $ECHO_N "(cached) $ECHO_C" >&6
1666 else
1667   cat >conftest.$ac_ext <<_ACEOF
1668 #line 1668 "configure"
1669 #include "confdefs.h"
1670
1671 int
1672 main ()
1673 {
1674
1675   ;
1676   return 0;
1677 }
1678 _ACEOF
1679 rm -f conftest.$ac_objext
1680 if { (eval echo "$as_me:1680: \"$ac_compile\"") >&5
1681   (eval $ac_compile) 2>&5
1682   ac_status=$?
1683   echo "$as_me:1683: \$? = $ac_status" >&5
1684   (exit $ac_status); } &&
1685          { ac_try='test -s conftest.$ac_objext'
1686   { (eval echo "$as_me:1686: \"$ac_try\"") >&5
1687   (eval $ac_try) 2>&5
1688   ac_status=$?
1689   echo "$as_me:1689: \$? = $ac_status" >&5
1690   (exit $ac_status); }; }; then
1691   ac_cv_prog_cc_g=yes
1692 else
1693   echo "$as_me: failed program was:" >&5
1694 cat conftest.$ac_ext >&5
1695 ac_cv_prog_cc_g=no
1696 fi
1697 rm -f conftest.$ac_objext conftest.$ac_ext
1698 fi
1699 echo "$as_me:1699: result: $ac_cv_prog_cc_g" >&5
1700 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1701 if test "$ac_test_CFLAGS" = set; then
1702   CFLAGS=$ac_save_CFLAGS
1703 elif test $ac_cv_prog_cc_g = yes; then
1704   if test "$GCC" = yes; then
1705     CFLAGS="-g -O2"
1706   else
1707     CFLAGS="-g"
1708   fi
1709 else
1710   if test "$GCC" = yes; then
1711     CFLAGS="-O2"
1712   else
1713     CFLAGS=
1714   fi
1715 fi
1716 # Some people use a C++ compiler to compile C.  Since we use `exit',
1717 # in C++ we need to declare it.  In case someone uses the same compiler
1718 # for both compiling C and C++ we need to have the C++ compiler decide
1719 # the declaration of exit, since it's the most demanding environment.
1720 cat >conftest.$ac_ext <<_ACEOF
1721 #ifndef __cplusplus
1722   choke me
1723 #endif
1724 _ACEOF
1725 rm -f conftest.$ac_objext
1726 if { (eval echo "$as_me:1726: \"$ac_compile\"") >&5
1727   (eval $ac_compile) 2>&5
1728   ac_status=$?
1729   echo "$as_me:1729: \$? = $ac_status" >&5
1730   (exit $ac_status); } &&
1731          { ac_try='test -s conftest.$ac_objext'
1732   { (eval echo "$as_me:1732: \"$ac_try\"") >&5
1733   (eval $ac_try) 2>&5
1734   ac_status=$?
1735   echo "$as_me:1735: \$? = $ac_status" >&5
1736   (exit $ac_status); }; }; then
1737   for ac_declaration in \
1738    ''\
1739    '#include <stdlib.h>' \
1740    'extern "C" void std::exit (int) throw (); using std::exit;' \
1741    'extern "C" void std::exit (int); using std::exit;' \
1742    'extern "C" void exit (int) throw ();' \
1743    'extern "C" void exit (int);' \
1744    'void exit (int);'
1745 do
1746   cat >conftest.$ac_ext <<_ACEOF
1747 #line 1747 "configure"
1748 #include "confdefs.h"
1749 #include <stdlib.h>
1750 $ac_declaration
1751 int
1752 main ()
1753 {
1754 exit (42);
1755   ;
1756   return 0;
1757 }
1758 _ACEOF
1759 rm -f conftest.$ac_objext
1760 if { (eval echo "$as_me:1760: \"$ac_compile\"") >&5
1761   (eval $ac_compile) 2>&5
1762   ac_status=$?
1763   echo "$as_me:1763: \$? = $ac_status" >&5
1764   (exit $ac_status); } &&
1765          { ac_try='test -s conftest.$ac_objext'
1766   { (eval echo "$as_me:1766: \"$ac_try\"") >&5
1767   (eval $ac_try) 2>&5
1768   ac_status=$?
1769   echo "$as_me:1769: \$? = $ac_status" >&5
1770   (exit $ac_status); }; }; then
1771   :
1772 else
1773   echo "$as_me: failed program was:" >&5
1774 cat conftest.$ac_ext >&5
1775 continue
1776 fi
1777 rm -f conftest.$ac_objext conftest.$ac_ext
1778   cat >conftest.$ac_ext <<_ACEOF
1779 #line 1779 "configure"
1780 #include "confdefs.h"
1781 $ac_declaration
1782 int
1783 main ()
1784 {
1785 exit (42);
1786   ;
1787   return 0;
1788 }
1789 _ACEOF
1790 rm -f conftest.$ac_objext
1791 if { (eval echo "$as_me:1791: \"$ac_compile\"") >&5
1792   (eval $ac_compile) 2>&5
1793   ac_status=$?
1794   echo "$as_me:1794: \$? = $ac_status" >&5
1795   (exit $ac_status); } &&
1796          { ac_try='test -s conftest.$ac_objext'
1797   { (eval echo "$as_me:1797: \"$ac_try\"") >&5
1798   (eval $ac_try) 2>&5
1799   ac_status=$?
1800   echo "$as_me:1800: \$? = $ac_status" >&5
1801   (exit $ac_status); }; }; then
1802   break
1803 else
1804   echo "$as_me: failed program was:" >&5
1805 cat conftest.$ac_ext >&5
1806 fi
1807 rm -f conftest.$ac_objext conftest.$ac_ext
1808 done
1809 rm -rf conftest*
1810 if test -n "$ac_declaration"; then
1811   echo '#ifdef __cplusplus' >>confdefs.h
1812   echo $ac_declaration      >>confdefs.h
1813   echo '#endif'             >>confdefs.h
1814 fi
1815
1816 else
1817   echo "$as_me: failed program was:" >&5
1818 cat conftest.$ac_ext >&5
1819 fi
1820 rm -f conftest.$ac_objext conftest.$ac_ext
1821 ac_ext=c
1822 ac_cpp='$CPP $CPPFLAGS'
1823 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1824 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1825 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1826 ac_main_return=return
1827
1828 ac_ext=c
1829 ac_cpp='$CPP $CPPFLAGS'
1830 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1831 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1832 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1833 ac_main_return=return
1834 echo "$as_me:1834: checking how to run the C preprocessor" >&5
1835 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1836 # On Suns, sometimes $CPP names a directory.
1837 if test -n "$CPP" && test -d "$CPP"; then
1838   CPP=
1839 fi
1840 if test -z "$CPP"; then
1841   if test "${ac_cv_prog_CPP+set}" = set; then
1842   echo $ECHO_N "(cached) $ECHO_C" >&6
1843 else
1844       # Double quotes because CPP needs to be expanded
1845     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1846     do
1847       ac_preproc_ok=false
1848 for ac_c_preproc_warn_flag in '' yes
1849 do
1850   # Use a header file that comes with gcc, so configuring glibc
1851   # with a fresh cross-compiler works.
1852   # On the NeXT, cc -E runs the code through the compiler's parser,
1853   # not just through cpp. "Syntax error" is here to catch this case.
1854   cat >conftest.$ac_ext <<_ACEOF
1855 #line 1855 "configure"
1856 #include "confdefs.h"
1857 #include <assert.h>
1858                      Syntax error
1859 _ACEOF
1860 if { (eval echo "$as_me:1860: \"$ac_cpp conftest.$ac_ext\"") >&5
1861   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1862   ac_status=$?
1863   egrep -v '^ *\+' conftest.er1 >conftest.err
1864   rm -f conftest.er1
1865   cat conftest.err >&5
1866   echo "$as_me:1866: \$? = $ac_status" >&5
1867   (exit $ac_status); } >/dev/null; then
1868   if test -s conftest.err; then
1869     ac_cpp_err=$ac_c_preproc_warn_flag
1870   else
1871     ac_cpp_err=
1872   fi
1873 else
1874   ac_cpp_err=yes
1875 fi
1876 if test -z "$ac_cpp_err"; then
1877   :
1878 else
1879   echo "$as_me: failed program was:" >&5
1880   cat conftest.$ac_ext >&5
1881   # Broken: fails on valid input.
1882 continue
1883 fi
1884 rm -f conftest.err conftest.$ac_ext
1885
1886   # OK, works on sane cases.  Now check whether non-existent headers
1887   # can be detected and how.
1888   cat >conftest.$ac_ext <<_ACEOF
1889 #line 1889 "configure"
1890 #include "confdefs.h"
1891 #include <ac_nonexistent.h>
1892 _ACEOF
1893 if { (eval echo "$as_me:1893: \"$ac_cpp conftest.$ac_ext\"") >&5
1894   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1895   ac_status=$?
1896   egrep -v '^ *\+' conftest.er1 >conftest.err
1897   rm -f conftest.er1
1898   cat conftest.err >&5
1899   echo "$as_me:1899: \$? = $ac_status" >&5
1900   (exit $ac_status); } >/dev/null; then
1901   if test -s conftest.err; then
1902     ac_cpp_err=$ac_c_preproc_warn_flag
1903   else
1904     ac_cpp_err=
1905   fi
1906 else
1907   ac_cpp_err=yes
1908 fi
1909 if test -z "$ac_cpp_err"; then
1910   # Broken: success on invalid input.
1911 continue
1912 else
1913   echo "$as_me: failed program was:" >&5
1914   cat conftest.$ac_ext >&5
1915   # Passes both tests.
1916 ac_preproc_ok=:
1917 break
1918 fi
1919 rm -f conftest.err conftest.$ac_ext
1920
1921 done
1922 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1923 rm -f conftest.err conftest.$ac_ext
1924 if $ac_preproc_ok; then
1925   break
1926 fi
1927
1928     done
1929     ac_cv_prog_CPP=$CPP
1930
1931 fi
1932   CPP=$ac_cv_prog_CPP
1933 else
1934   ac_cv_prog_CPP=$CPP
1935 fi
1936 echo "$as_me:1936: result: $CPP" >&5
1937 echo "${ECHO_T}$CPP" >&6
1938 ac_preproc_ok=false
1939 for ac_c_preproc_warn_flag in '' yes
1940 do
1941   # Use a header file that comes with gcc, so configuring glibc
1942   # with a fresh cross-compiler works.
1943   # On the NeXT, cc -E runs the code through the compiler's parser,
1944   # not just through cpp. "Syntax error" is here to catch this case.
1945   cat >conftest.$ac_ext <<_ACEOF
1946 #line 1946 "configure"
1947 #include "confdefs.h"
1948 #include <assert.h>
1949                      Syntax error
1950 _ACEOF
1951 if { (eval echo "$as_me:1951: \"$ac_cpp conftest.$ac_ext\"") >&5
1952   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1953   ac_status=$?
1954   egrep -v '^ *\+' conftest.er1 >conftest.err
1955   rm -f conftest.er1
1956   cat conftest.err >&5
1957   echo "$as_me:1957: \$? = $ac_status" >&5
1958   (exit $ac_status); } >/dev/null; then
1959   if test -s conftest.err; then
1960     ac_cpp_err=$ac_c_preproc_warn_flag
1961   else
1962     ac_cpp_err=
1963   fi
1964 else
1965   ac_cpp_err=yes
1966 fi
1967 if test -z "$ac_cpp_err"; then
1968   :
1969 else
1970   echo "$as_me: failed program was:" >&5
1971   cat conftest.$ac_ext >&5
1972   # Broken: fails on valid input.
1973 continue
1974 fi
1975 rm -f conftest.err conftest.$ac_ext
1976
1977   # OK, works on sane cases.  Now check whether non-existent headers
1978   # can be detected and how.
1979   cat >conftest.$ac_ext <<_ACEOF
1980 #line 1980 "configure"
1981 #include "confdefs.h"
1982 #include <ac_nonexistent.h>
1983 _ACEOF
1984 if { (eval echo "$as_me:1984: \"$ac_cpp conftest.$ac_ext\"") >&5
1985   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1986   ac_status=$?
1987   egrep -v '^ *\+' conftest.er1 >conftest.err
1988   rm -f conftest.er1
1989   cat conftest.err >&5
1990   echo "$as_me:1990: \$? = $ac_status" >&5
1991   (exit $ac_status); } >/dev/null; then
1992   if test -s conftest.err; then
1993     ac_cpp_err=$ac_c_preproc_warn_flag
1994   else
1995     ac_cpp_err=
1996   fi
1997 else
1998   ac_cpp_err=yes
1999 fi
2000 if test -z "$ac_cpp_err"; then
2001   # Broken: success on invalid input.
2002 continue
2003 else
2004   echo "$as_me: failed program was:" >&5
2005   cat conftest.$ac_ext >&5
2006   # Passes both tests.
2007 ac_preproc_ok=:
2008 break
2009 fi
2010 rm -f conftest.err conftest.$ac_ext
2011
2012 done
2013 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2014 rm -f conftest.err conftest.$ac_ext
2015 if $ac_preproc_ok; then
2016   :
2017 else
2018   { { echo "$as_me:2018: error: C preprocessor \"$CPP\" fails sanity check" >&5
2019 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2020    { (exit 1); exit 1; }; }
2021 fi
2022
2023 ac_ext=c
2024 ac_cpp='$CPP $CPPFLAGS'
2025 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2026 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2027 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2028 ac_main_return=return
2029
2030 for ac_prog in mawk gawk nawk awk
2031 do
2032   # Extract the first word of "$ac_prog", so it can be a program name with args.
2033 set dummy $ac_prog; ac_word=$2
2034 echo "$as_me:2034: checking for $ac_word" >&5
2035 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2036 if test "${ac_cv_prog_AWK+set}" = set; then
2037   echo $ECHO_N "(cached) $ECHO_C" >&6
2038 else
2039   if test -n "$AWK"; then
2040   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2041 else
2042   ac_save_IFS=$IFS; IFS=$ac_path_separator
2043 ac_dummy="$PATH"
2044 for ac_dir in $ac_dummy; do
2045   IFS=$ac_save_IFS
2046   test -z "$ac_dir" && ac_dir=.
2047   $as_executable_p "$ac_dir/$ac_word" || continue
2048 ac_cv_prog_AWK="$ac_prog"
2049 echo "$as_me:2049: found $ac_dir/$ac_word" >&5
2050 break
2051 done
2052
2053 fi
2054 fi
2055 AWK=$ac_cv_prog_AWK
2056 if test -n "$AWK"; then
2057   echo "$as_me:2057: result: $AWK" >&5
2058 echo "${ECHO_T}$AWK" >&6
2059 else
2060   echo "$as_me:2060: result: no" >&5
2061 echo "${ECHO_T}no" >&6
2062 fi
2063
2064   test -n "$AWK" && break
2065 done
2066
2067 echo "$as_me:2067: checking if filesystem supports mixed-case filenames" >&5
2068 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2069 if test "${cf_cv_mixedcase+set}" = set; then
2070   echo $ECHO_N "(cached) $ECHO_C" >&6
2071 else
2072
2073 if test "$cross_compiling" = yes ; then
2074         case $target_alias in #(vi
2075         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2076                 cf_cv_mixedcase=no
2077                 ;;
2078         *)
2079                 cf_cv_mixedcase=yes
2080                 ;;
2081         esac
2082 else
2083         rm -f conftest CONFTEST
2084         echo test >conftest
2085         if test -f CONFTEST ; then
2086                 cf_cv_mixedcase=no
2087         else
2088                 cf_cv_mixedcase=yes
2089         fi
2090         rm -f conftest CONFTEST
2091 fi
2092
2093 fi
2094 echo "$as_me:2094: result: $cf_cv_mixedcase" >&5
2095 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2096 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2097 #define MIXEDCASE_FILENAMES 1
2098 EOF
2099
2100 for ac_prog in exctags ctags
2101 do
2102   # Extract the first word of "$ac_prog", so it can be a program name with args.
2103 set dummy $ac_prog; ac_word=$2
2104 echo "$as_me:2104: checking for $ac_word" >&5
2105 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2106 if test "${ac_cv_prog_CTAGS+set}" = set; then
2107   echo $ECHO_N "(cached) $ECHO_C" >&6
2108 else
2109   if test -n "$CTAGS"; then
2110   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2111 else
2112   ac_save_IFS=$IFS; IFS=$ac_path_separator
2113 ac_dummy="$PATH"
2114 for ac_dir in $ac_dummy; do
2115   IFS=$ac_save_IFS
2116   test -z "$ac_dir" && ac_dir=.
2117   $as_executable_p "$ac_dir/$ac_word" || continue
2118 ac_cv_prog_CTAGS="$ac_prog"
2119 echo "$as_me:2119: found $ac_dir/$ac_word" >&5
2120 break
2121 done
2122
2123 fi
2124 fi
2125 CTAGS=$ac_cv_prog_CTAGS
2126 if test -n "$CTAGS"; then
2127   echo "$as_me:2127: result: $CTAGS" >&5
2128 echo "${ECHO_T}$CTAGS" >&6
2129 else
2130   echo "$as_me:2130: result: no" >&5
2131 echo "${ECHO_T}no" >&6
2132 fi
2133
2134   test -n "$CTAGS" && break
2135 done
2136
2137 for ac_prog in exetags etags
2138 do
2139   # Extract the first word of "$ac_prog", so it can be a program name with args.
2140 set dummy $ac_prog; ac_word=$2
2141 echo "$as_me:2141: checking for $ac_word" >&5
2142 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2143 if test "${ac_cv_prog_ETAGS+set}" = set; then
2144   echo $ECHO_N "(cached) $ECHO_C" >&6
2145 else
2146   if test -n "$ETAGS"; then
2147   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2148 else
2149   ac_save_IFS=$IFS; IFS=$ac_path_separator
2150 ac_dummy="$PATH"
2151 for ac_dir in $ac_dummy; do
2152   IFS=$ac_save_IFS
2153   test -z "$ac_dir" && ac_dir=.
2154   $as_executable_p "$ac_dir/$ac_word" || continue
2155 ac_cv_prog_ETAGS="$ac_prog"
2156 echo "$as_me:2156: found $ac_dir/$ac_word" >&5
2157 break
2158 done
2159
2160 fi
2161 fi
2162 ETAGS=$ac_cv_prog_ETAGS
2163 if test -n "$ETAGS"; then
2164   echo "$as_me:2164: result: $ETAGS" >&5
2165 echo "${ECHO_T}$ETAGS" >&6
2166 else
2167   echo "$as_me:2167: result: no" >&5
2168 echo "${ECHO_T}no" >&6
2169 fi
2170
2171   test -n "$ETAGS" && break
2172 done
2173
2174 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2175 set dummy ${CTAGS:-ctags}; ac_word=$2
2176 echo "$as_me:2176: checking for $ac_word" >&5
2177 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2178 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2179   echo $ECHO_N "(cached) $ECHO_C" >&6
2180 else
2181   if test -n "$MAKE_LOWER_TAGS"; then
2182   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2183 else
2184   ac_save_IFS=$IFS; IFS=$ac_path_separator
2185 ac_dummy="$PATH"
2186 for ac_dir in $ac_dummy; do
2187   IFS=$ac_save_IFS
2188   test -z "$ac_dir" && ac_dir=.
2189   $as_executable_p "$ac_dir/$ac_word" || continue
2190 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2191 echo "$as_me:2191: found $ac_dir/$ac_word" >&5
2192 break
2193 done
2194
2195   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2196 fi
2197 fi
2198 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2199 if test -n "$MAKE_LOWER_TAGS"; then
2200   echo "$as_me:2200: result: $MAKE_LOWER_TAGS" >&5
2201 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2202 else
2203   echo "$as_me:2203: result: no" >&5
2204 echo "${ECHO_T}no" >&6
2205 fi
2206
2207 if test "$cf_cv_mixedcase" = yes ; then
2208         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2209 set dummy ${ETAGS:-etags}; ac_word=$2
2210 echo "$as_me:2210: checking for $ac_word" >&5
2211 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2212 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2213   echo $ECHO_N "(cached) $ECHO_C" >&6
2214 else
2215   if test -n "$MAKE_UPPER_TAGS"; then
2216   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2217 else
2218   ac_save_IFS=$IFS; IFS=$ac_path_separator
2219 ac_dummy="$PATH"
2220 for ac_dir in $ac_dummy; do
2221   IFS=$ac_save_IFS
2222   test -z "$ac_dir" && ac_dir=.
2223   $as_executable_p "$ac_dir/$ac_word" || continue
2224 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2225 echo "$as_me:2225: found $ac_dir/$ac_word" >&5
2226 break
2227 done
2228
2229   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2230 fi
2231 fi
2232 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2233 if test -n "$MAKE_UPPER_TAGS"; then
2234   echo "$as_me:2234: result: $MAKE_UPPER_TAGS" >&5
2235 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2236 else
2237   echo "$as_me:2237: result: no" >&5
2238 echo "${ECHO_T}no" >&6
2239 fi
2240
2241 else
2242         MAKE_UPPER_TAGS=no
2243 fi
2244
2245 if test "$MAKE_UPPER_TAGS" = yes ; then
2246         MAKE_UPPER_TAGS=
2247 else
2248         MAKE_UPPER_TAGS="#"
2249 fi
2250
2251 if test "$MAKE_LOWER_TAGS" = yes ; then
2252         MAKE_LOWER_TAGS=
2253 else
2254         MAKE_LOWER_TAGS="#"
2255 fi
2256
2257 CC_G_OPT="-g"
2258 CC_SHARED_OPTS=unknown
2259 CPPFLAGS="$CPPFLAGS"
2260 DFT_DEP_SUFFIX=""
2261 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2262 DFT_UPR_MODEL="NORMAL"
2263 LD="ld"
2264 LDFLAGS_SHARED=""
2265 LDFLAGS_STATIC=""
2266 LD_MODEL=""
2267 LD_SHARED_OPTS=""
2268 LIBTOOL=""
2269 LIB_CLEAN=""
2270 LIB_COMPILE=""
2271 LIB_LINK='${CC}'
2272 LINK_TESTS=""
2273 LINT=lint
2274 LINT_OPTS=""
2275 LOCAL_LDFLAGS=""
2276 MATH_LIB="-lm"
2277 PTHREAD="-lm"
2278 TEST_ARGS=""
2279 TEST_DEPS=""
2280 TEST_LIBS=""
2281 TINFO_ARGS='$(LIBS_CURSES)'
2282 cf_cv_abi_version=""
2283 cf_cv_rel_version=""
2284
2285 cf_cv_screen=curses
2286 cf_cv_libtype=
2287
2288 echo "$as_me:2288: checking for ${CC:-cc} option to accept ANSI C" >&5
2289 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
2290 if test "${cf_cv_ansi_cc+set}" = set; then
2291   echo $ECHO_N "(cached) $ECHO_C" >&6
2292 else
2293
2294 cf_cv_ansi_cc=no
2295 cf_save_CFLAGS="$CFLAGS"
2296 cf_save_CPPFLAGS="$CPPFLAGS"
2297 # Don't try gcc -ansi; that turns off useful extensions and
2298 # breaks some systems' header files.
2299 # AIX                   -qlanglvl=ansi
2300 # Ultrix and OSF/1      -std1
2301 # HP-UX                 -Aa -D_HPUX_SOURCE
2302 # SVR4                  -Xc
2303 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2304 for cf_arg in "-DCC_HAS_PROTOS" \
2305         "" \
2306         -qlanglvl=ansi \
2307         -std1 \
2308         -Ae \
2309         "-Aa -D_HPUX_SOURCE" \
2310         -Xc
2311 do
2312
2313 cf_fix_cppflags=no
2314 cf_new_cflags=
2315 cf_new_cppflags=
2316 cf_new_extra_cppflags=
2317
2318 for cf_add_cflags in $cf_arg
2319 do
2320 case $cf_fix_cppflags in
2321 no)
2322         case $cf_add_cflags in #(vi
2323         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2324                 case $cf_add_cflags in
2325                 -D*)
2326                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2327
2328                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2329                                 && test -z "${cf_tst_cflags}" \
2330                                 && cf_fix_cppflags=yes
2331
2332                         if test $cf_fix_cppflags = yes ; then
2333                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2334                                 continue
2335                         elif test "${cf_tst_cflags}" = "\"'" ; then
2336                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2337                                 continue
2338                         fi
2339                         ;;
2340                 esac
2341                 case "$CPPFLAGS" in
2342                 *$cf_add_cflags) #(vi
2343                         ;;
2344                 *) #(vi
2345                         case $cf_add_cflags in #(vi
2346                         -D*)
2347                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2348
2349 CPPFLAGS=`echo "$CPPFLAGS" | \
2350         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2351                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2352
2353                                 ;;
2354                         esac
2355                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2356                         ;;
2357                 esac
2358                 ;;
2359         *)
2360                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2361                 ;;
2362         esac
2363         ;;
2364 yes)
2365         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2366
2367         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2368
2369         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2370                 && test -z "${cf_tst_cflags}" \
2371                 && cf_fix_cppflags=no
2372         ;;
2373 esac
2374 done
2375
2376 if test -n "$cf_new_cflags" ; then
2377
2378         CFLAGS="$CFLAGS $cf_new_cflags"
2379 fi
2380
2381 if test -n "$cf_new_cppflags" ; then
2382
2383         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2384 fi
2385
2386 if test -n "$cf_new_extra_cppflags" ; then
2387
2388         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2389 fi
2390
2391         cat >conftest.$ac_ext <<_ACEOF
2392 #line 2392 "configure"
2393 #include "confdefs.h"
2394
2395 #ifndef CC_HAS_PROTOS
2396 #if !defined(__STDC__) || (__STDC__ != 1)
2397 choke me
2398 #endif
2399 #endif
2400
2401 int
2402 main ()
2403 {
2404
2405         int test (int i, double x);
2406         struct s1 {int (*f) (int a);};
2407         struct s2 {int (*f) (double a);};
2408   ;
2409   return 0;
2410 }
2411 _ACEOF
2412 rm -f conftest.$ac_objext
2413 if { (eval echo "$as_me:2413: \"$ac_compile\"") >&5
2414   (eval $ac_compile) 2>&5
2415   ac_status=$?
2416   echo "$as_me:2416: \$? = $ac_status" >&5
2417   (exit $ac_status); } &&
2418          { ac_try='test -s conftest.$ac_objext'
2419   { (eval echo "$as_me:2419: \"$ac_try\"") >&5
2420   (eval $ac_try) 2>&5
2421   ac_status=$?
2422   echo "$as_me:2422: \$? = $ac_status" >&5
2423   (exit $ac_status); }; }; then
2424   cf_cv_ansi_cc="$cf_arg"; break
2425 else
2426   echo "$as_me: failed program was:" >&5
2427 cat conftest.$ac_ext >&5
2428 fi
2429 rm -f conftest.$ac_objext conftest.$ac_ext
2430 done
2431 CFLAGS="$cf_save_CFLAGS"
2432 CPPFLAGS="$cf_save_CPPFLAGS"
2433
2434 fi
2435 echo "$as_me:2435: result: $cf_cv_ansi_cc" >&5
2436 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2437
2438 if test "$cf_cv_ansi_cc" != "no"; then
2439 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2440
2441 cf_fix_cppflags=no
2442 cf_new_cflags=
2443 cf_new_cppflags=
2444 cf_new_extra_cppflags=
2445
2446 for cf_add_cflags in $cf_cv_ansi_cc
2447 do
2448 case $cf_fix_cppflags in
2449 no)
2450         case $cf_add_cflags in #(vi
2451         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2452                 case $cf_add_cflags in
2453                 -D*)
2454                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2455
2456                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2457                                 && test -z "${cf_tst_cflags}" \
2458                                 && cf_fix_cppflags=yes
2459
2460                         if test $cf_fix_cppflags = yes ; then
2461                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2462                                 continue
2463                         elif test "${cf_tst_cflags}" = "\"'" ; then
2464                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2465                                 continue
2466                         fi
2467                         ;;
2468                 esac
2469                 case "$CPPFLAGS" in
2470                 *$cf_add_cflags) #(vi
2471                         ;;
2472                 *) #(vi
2473                         case $cf_add_cflags in #(vi
2474                         -D*)
2475                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2476
2477 CPPFLAGS=`echo "$CPPFLAGS" | \
2478         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2479                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2480
2481                                 ;;
2482                         esac
2483                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2484                         ;;
2485                 esac
2486                 ;;
2487         *)
2488                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2489                 ;;
2490         esac
2491         ;;
2492 yes)
2493         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2494
2495         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2496
2497         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2498                 && test -z "${cf_tst_cflags}" \
2499                 && cf_fix_cppflags=no
2500         ;;
2501 esac
2502 done
2503
2504 if test -n "$cf_new_cflags" ; then
2505
2506         CFLAGS="$CFLAGS $cf_new_cflags"
2507 fi
2508
2509 if test -n "$cf_new_cppflags" ; then
2510
2511         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2512 fi
2513
2514 if test -n "$cf_new_extra_cppflags" ; then
2515
2516         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2517 fi
2518
2519 else
2520         cat >>confdefs.h <<\EOF
2521 #define CC_HAS_PROTOS 1
2522 EOF
2523
2524 fi
2525 fi
2526
2527 if test "$cf_cv_ansi_cc" = "no"; then
2528         { { echo "$as_me:2528: error: Your compiler does not appear to recognize prototypes.
2529 You have the following choices:
2530         a. adjust your compiler options
2531         b. get an up-to-date compiler
2532         c. use a wrapper such as unproto" >&5
2533 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2534 You have the following choices:
2535         a. adjust your compiler options
2536         b. get an up-to-date compiler
2537         c. use a wrapper such as unproto" >&2;}
2538    { (exit 1); exit 1; }; }
2539 fi
2540
2541 if test "$GCC" = yes
2542 then
2543 cat > conftest.i <<EOF
2544 #ifndef GCC_PRINTF
2545 #define GCC_PRINTF 0
2546 #endif
2547 #ifndef GCC_SCANF
2548 #define GCC_SCANF 0
2549 #endif
2550 #ifndef GCC_NORETURN
2551 #define GCC_NORETURN /* nothing */
2552 #endif
2553 #ifndef GCC_UNUSED
2554 #define GCC_UNUSED /* nothing */
2555 #endif
2556 EOF
2557 if test "$GCC" = yes
2558 then
2559         { echo "$as_me:2559: checking for $CC __attribute__ directives..." >&5
2560 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2561 cat > conftest.$ac_ext <<EOF
2562 #line 2562 "${as_me:-configure}"
2563 #include "confdefs.h"
2564 #include "conftest.h"
2565 #include "conftest.i"
2566 #if     GCC_PRINTF
2567 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2568 #else
2569 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2570 #endif
2571 #if     GCC_SCANF
2572 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2573 #else
2574 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2575 #endif
2576 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2577 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2578 extern void foo(void) GCC_NORETURN;
2579 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2580 EOF
2581         cf_printf_attribute=no
2582         cf_scanf_attribute=no
2583         for cf_attribute in scanf printf unused noreturn
2584         do
2585
2586 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2587
2588                 cf_directive="__attribute__(($cf_attribute))"
2589                 echo "checking for $CC $cf_directive" 1>&5
2590
2591                 case $cf_attribute in #(vi
2592                 printf) #(vi
2593                         cf_printf_attribute=yes
2594                         cat >conftest.h <<EOF
2595 #define GCC_$cf_ATTRIBUTE 1
2596 EOF
2597                         ;;
2598                 scanf) #(vi
2599                         cf_scanf_attribute=yes
2600                         cat >conftest.h <<EOF
2601 #define GCC_$cf_ATTRIBUTE 1
2602 EOF
2603                         ;;
2604                 *) #(vi
2605                         cat >conftest.h <<EOF
2606 #define GCC_$cf_ATTRIBUTE $cf_directive
2607 EOF
2608                         ;;
2609                 esac
2610
2611                 if { (eval echo "$as_me:2611: \"$ac_compile\"") >&5
2612   (eval $ac_compile) 2>&5
2613   ac_status=$?
2614   echo "$as_me:2614: \$? = $ac_status" >&5
2615   (exit $ac_status); }; then
2616                         test -n "$verbose" && echo "$as_me:2616: result: ... $cf_attribute" >&5
2617 echo "${ECHO_T}... $cf_attribute" >&6
2618                         cat conftest.h >>confdefs.h
2619                         case $cf_attribute in #(vi
2620                         printf) #(vi
2621                                 if test "$cf_printf_attribute" = no ; then
2622                                         cat >>confdefs.h <<EOF
2623 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
2624 EOF
2625                                 else
2626                                         cat >>confdefs.h <<EOF
2627 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2628 EOF
2629                                 fi
2630                                 ;;
2631                         scanf) #(vi
2632                                 if test "$cf_scanf_attribute" = no ; then
2633                                         cat >>confdefs.h <<EOF
2634 #define GCC_SCANFLIKE(fmt,var) /* nothing */
2635 EOF
2636                                 else
2637                                         cat >>confdefs.h <<EOF
2638 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2639 EOF
2640                                 fi
2641                                 ;;
2642                         esac
2643                 fi
2644         done
2645 else
2646         fgrep define conftest.i >>confdefs.h
2647 fi
2648 rm -rf conftest*
2649 fi
2650
2651 cf_XOPEN_SOURCE=500
2652 cf_POSIX_C_SOURCE=199506L
2653 cf_xopen_source=
2654
2655 case $host_os in #(vi
2656 aix[456]*) #(vi
2657         cf_xopen_source="-D_ALL_SOURCE"
2658         ;;
2659 darwin[0-8].*) #(vi
2660         cf_xopen_source="-D_APPLE_C_SOURCE"
2661         ;;
2662 darwin*) #(vi
2663         cf_xopen_source="-D_DARWIN_C_SOURCE"
2664         ;;
2665 freebsd*|dragonfly*) #(vi
2666         # 5.x headers associate
2667         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2668         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2669         cf_POSIX_C_SOURCE=200112L
2670         cf_XOPEN_SOURCE=600
2671         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2672         ;;
2673 hpux11*) #(vi
2674         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2675         ;;
2676 hpux*) #(vi
2677         cf_xopen_source="-D_HPUX_SOURCE"
2678         ;;
2679 irix[56].*) #(vi
2680         cf_xopen_source="-D_SGI_SOURCE"
2681         ;;
2682 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2683
2684 echo "$as_me:2684: checking if we must define _GNU_SOURCE" >&5
2685 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2686 if test "${cf_cv_gnu_source+set}" = set; then
2687   echo $ECHO_N "(cached) $ECHO_C" >&6
2688 else
2689
2690 cat >conftest.$ac_ext <<_ACEOF
2691 #line 2691 "configure"
2692 #include "confdefs.h"
2693 #include <sys/types.h>
2694 int
2695 main ()
2696 {
2697
2698 #ifndef _XOPEN_SOURCE
2699 make an error
2700 #endif
2701   ;
2702   return 0;
2703 }
2704 _ACEOF
2705 rm -f conftest.$ac_objext
2706 if { (eval echo "$as_me:2706: \"$ac_compile\"") >&5
2707   (eval $ac_compile) 2>&5
2708   ac_status=$?
2709   echo "$as_me:2709: \$? = $ac_status" >&5
2710   (exit $ac_status); } &&
2711          { ac_try='test -s conftest.$ac_objext'
2712   { (eval echo "$as_me:2712: \"$ac_try\"") >&5
2713   (eval $ac_try) 2>&5
2714   ac_status=$?
2715   echo "$as_me:2715: \$? = $ac_status" >&5
2716   (exit $ac_status); }; }; then
2717   cf_cv_gnu_source=no
2718 else
2719   echo "$as_me: failed program was:" >&5
2720 cat conftest.$ac_ext >&5
2721 cf_save="$CPPFLAGS"
2722          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2723          cat >conftest.$ac_ext <<_ACEOF
2724 #line 2724 "configure"
2725 #include "confdefs.h"
2726 #include <sys/types.h>
2727 int
2728 main ()
2729 {
2730
2731 #ifdef _XOPEN_SOURCE
2732 make an error
2733 #endif
2734   ;
2735   return 0;
2736 }
2737 _ACEOF
2738 rm -f conftest.$ac_objext
2739 if { (eval echo "$as_me:2739: \"$ac_compile\"") >&5
2740   (eval $ac_compile) 2>&5
2741   ac_status=$?
2742   echo "$as_me:2742: \$? = $ac_status" >&5
2743   (exit $ac_status); } &&
2744          { ac_try='test -s conftest.$ac_objext'
2745   { (eval echo "$as_me:2745: \"$ac_try\"") >&5
2746   (eval $ac_try) 2>&5
2747   ac_status=$?
2748   echo "$as_me:2748: \$? = $ac_status" >&5
2749   (exit $ac_status); }; }; then
2750   cf_cv_gnu_source=no
2751 else
2752   echo "$as_me: failed program was:" >&5
2753 cat conftest.$ac_ext >&5
2754 cf_cv_gnu_source=yes
2755 fi
2756 rm -f conftest.$ac_objext conftest.$ac_ext
2757         CPPFLAGS="$cf_save"
2758
2759 fi
2760 rm -f conftest.$ac_objext conftest.$ac_ext
2761
2762 fi
2763 echo "$as_me:2763: result: $cf_cv_gnu_source" >&5
2764 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2765 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2766
2767         ;;
2768 mirbsd*) #(vi
2769         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
2770         ;;
2771 netbsd*) #(vi
2772         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
2773         ;;
2774 openbsd*) #(vi
2775         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
2776         ;;
2777 osf[45]*) #(vi
2778         cf_xopen_source="-D_OSF_SOURCE"
2779         ;;
2780 nto-qnx*) #(vi
2781         cf_xopen_source="-D_QNX_SOURCE"
2782         ;;
2783 sco*) #(vi
2784         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
2785         ;;
2786 solaris2.1[0-9]) #(vi
2787         cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2788         ;;
2789 solaris2.[1-9]) #(vi
2790         cf_xopen_source="-D__EXTENSIONS__"
2791         ;;
2792 *)
2793         echo "$as_me:2793: checking if we should define _XOPEN_SOURCE" >&5
2794 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
2795 if test "${cf_cv_xopen_source+set}" = set; then
2796   echo $ECHO_N "(cached) $ECHO_C" >&6
2797 else
2798
2799         cat >conftest.$ac_ext <<_ACEOF
2800 #line 2800 "configure"
2801 #include "confdefs.h"
2802 #include <sys/types.h>
2803 int
2804 main ()
2805 {
2806
2807 #ifndef _XOPEN_SOURCE
2808 make an error
2809 #endif
2810   ;
2811   return 0;
2812 }
2813 _ACEOF
2814 rm -f conftest.$ac_objext
2815 if { (eval echo "$as_me:2815: \"$ac_compile\"") >&5
2816   (eval $ac_compile) 2>&5
2817   ac_status=$?
2818   echo "$as_me:2818: \$? = $ac_status" >&5
2819   (exit $ac_status); } &&
2820          { ac_try='test -s conftest.$ac_objext'
2821   { (eval echo "$as_me:2821: \"$ac_try\"") >&5
2822   (eval $ac_try) 2>&5
2823   ac_status=$?
2824   echo "$as_me:2824: \$? = $ac_status" >&5
2825   (exit $ac_status); }; }; then
2826   cf_cv_xopen_source=no
2827 else
2828   echo "$as_me: failed program was:" >&5
2829 cat conftest.$ac_ext >&5
2830 cf_save="$CPPFLAGS"
2831          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2832          cat >conftest.$ac_ext <<_ACEOF
2833 #line 2833 "configure"
2834 #include "confdefs.h"
2835 #include <sys/types.h>
2836 int
2837 main ()
2838 {
2839
2840 #ifdef _XOPEN_SOURCE
2841 make an error
2842 #endif
2843   ;
2844   return 0;
2845 }
2846 _ACEOF
2847 rm -f conftest.$ac_objext
2848 if { (eval echo "$as_me:2848: \"$ac_compile\"") >&5
2849   (eval $ac_compile) 2>&5
2850   ac_status=$?
2851   echo "$as_me:2851: \$? = $ac_status" >&5
2852   (exit $ac_status); } &&
2853          { ac_try='test -s conftest.$ac_objext'
2854   { (eval echo "$as_me:2854: \"$ac_try\"") >&5
2855   (eval $ac_try) 2>&5
2856   ac_status=$?
2857   echo "$as_me:2857: \$? = $ac_status" >&5
2858   (exit $ac_status); }; }; then
2859   cf_cv_xopen_source=no
2860 else
2861   echo "$as_me: failed program was:" >&5
2862 cat conftest.$ac_ext >&5
2863 cf_cv_xopen_source=$cf_XOPEN_SOURCE
2864 fi
2865 rm -f conftest.$ac_objext conftest.$ac_ext
2866         CPPFLAGS="$cf_save"
2867
2868 fi
2869 rm -f conftest.$ac_objext conftest.$ac_ext
2870
2871 fi
2872 echo "$as_me:2872: result: $cf_cv_xopen_source" >&5
2873 echo "${ECHO_T}$cf_cv_xopen_source" >&6
2874         if test "$cf_cv_xopen_source" != no ; then
2875
2876 CFLAGS=`echo "$CFLAGS" | \
2877         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
2878                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
2879
2880 CPPFLAGS=`echo "$CPPFLAGS" | \
2881         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
2882                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
2883
2884                 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
2885
2886 cf_fix_cppflags=no
2887 cf_new_cflags=
2888 cf_new_cppflags=
2889 cf_new_extra_cppflags=
2890
2891 for cf_add_cflags in $cf_temp_xopen_source
2892 do
2893 case $cf_fix_cppflags in
2894 no)
2895         case $cf_add_cflags in #(vi
2896         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2897                 case $cf_add_cflags in
2898                 -D*)
2899                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2900
2901                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2902                                 && test -z "${cf_tst_cflags}" \
2903                                 && cf_fix_cppflags=yes
2904
2905                         if test $cf_fix_cppflags = yes ; then
2906                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2907                                 continue
2908                         elif test "${cf_tst_cflags}" = "\"'" ; then
2909                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2910                                 continue
2911                         fi
2912                         ;;
2913                 esac
2914                 case "$CPPFLAGS" in
2915                 *$cf_add_cflags) #(vi
2916                         ;;
2917                 *) #(vi
2918                         case $cf_add_cflags in #(vi
2919                         -D*)
2920                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2921
2922 CPPFLAGS=`echo "$CPPFLAGS" | \
2923         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2924                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2925
2926                                 ;;
2927                         esac
2928                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2929                         ;;
2930                 esac
2931                 ;;
2932         *)
2933                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2934                 ;;
2935         esac
2936         ;;
2937 yes)
2938         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2939
2940         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2941
2942         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2943                 && test -z "${cf_tst_cflags}" \
2944                 && cf_fix_cppflags=no
2945         ;;
2946 esac
2947 done
2948
2949 if test -n "$cf_new_cflags" ; then
2950
2951         CFLAGS="$CFLAGS $cf_new_cflags"
2952 fi
2953
2954 if test -n "$cf_new_cppflags" ; then
2955
2956         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2957 fi
2958
2959 if test -n "$cf_new_extra_cppflags" ; then
2960
2961         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2962 fi
2963
2964         fi
2965
2966 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2967
2968 cf_save_CFLAGS="$CFLAGS"
2969 cf_save_CPPFLAGS="$CPPFLAGS"
2970
2971 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2972         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2973                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2974
2975 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2976         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2977                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2978
2979 echo "$as_me:2979: checking if we should define _POSIX_C_SOURCE" >&5
2980 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2981 if test "${cf_cv_posix_c_source+set}" = set; then
2982   echo $ECHO_N "(cached) $ECHO_C" >&6
2983 else
2984
2985 echo "${as_me:-configure}:2985: testing if the symbol is already defined go no further ..." 1>&5
2986
2987         cat >conftest.$ac_ext <<_ACEOF
2988 #line 2988 "configure"
2989 #include "confdefs.h"
2990 #include <sys/types.h>
2991 int
2992 main ()
2993 {
2994
2995 #ifndef _POSIX_C_SOURCE
2996 make an error
2997 #endif
2998   ;
2999   return 0;
3000 }
3001 _ACEOF
3002 rm -f conftest.$ac_objext
3003 if { (eval echo "$as_me:3003: \"$ac_compile\"") >&5
3004   (eval $ac_compile) 2>&5
3005   ac_status=$?
3006   echo "$as_me:3006: \$? = $ac_status" >&5
3007   (exit $ac_status); } &&
3008          { ac_try='test -s conftest.$ac_objext'
3009   { (eval echo "$as_me:3009: \"$ac_try\"") >&5
3010   (eval $ac_try) 2>&5
3011   ac_status=$?
3012   echo "$as_me:3012: \$? = $ac_status" >&5
3013   (exit $ac_status); }; }; then
3014   cf_cv_posix_c_source=no
3015 else
3016   echo "$as_me: failed program was:" >&5
3017 cat conftest.$ac_ext >&5
3018 cf_want_posix_source=no
3019          case .$cf_POSIX_C_SOURCE in #(vi
3020          .[12]??*) #(vi
3021                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3022                 ;;
3023          .2) #(vi
3024                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3025                 cf_want_posix_source=yes
3026                 ;;
3027          .*)
3028                 cf_want_posix_source=yes
3029                 ;;
3030          esac
3031          if test "$cf_want_posix_source" = yes ; then
3032                 cat >conftest.$ac_ext <<_ACEOF
3033 #line 3033 "configure"
3034 #include "confdefs.h"
3035 #include <sys/types.h>
3036 int
3037 main ()
3038 {
3039
3040 #ifdef _POSIX_SOURCE
3041 make an error
3042 #endif
3043   ;
3044   return 0;
3045 }
3046 _ACEOF
3047 rm -f conftest.$ac_objext
3048 if { (eval echo "$as_me:3048: \"$ac_compile\"") >&5
3049   (eval $ac_compile) 2>&5
3050   ac_status=$?
3051   echo "$as_me:3051: \$? = $ac_status" >&5
3052   (exit $ac_status); } &&
3053          { ac_try='test -s conftest.$ac_objext'
3054   { (eval echo "$as_me:3054: \"$ac_try\"") >&5
3055   (eval $ac_try) 2>&5
3056   ac_status=$?
3057   echo "$as_me:3057: \$? = $ac_status" >&5
3058   (exit $ac_status); }; }; then
3059   :
3060 else
3061   echo "$as_me: failed program was:" >&5
3062 cat conftest.$ac_ext >&5
3063 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3064 fi
3065 rm -f conftest.$ac_objext conftest.$ac_ext
3066          fi
3067
3068 echo "${as_me:-configure}:3068: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3069
3070          CFLAGS="$cf_trim_CFLAGS"
3071          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3072
3073 echo "${as_me:-configure}:3073: testing if the second compile does not leave our definition intact error ..." 1>&5
3074
3075          cat >conftest.$ac_ext <<_ACEOF
3076 #line 3076 "configure"
3077 #include "confdefs.h"
3078 #include <sys/types.h>
3079 int
3080 main ()
3081 {
3082
3083 #ifndef _POSIX_C_SOURCE
3084 make an error
3085 #endif
3086   ;
3087   return 0;
3088 }
3089 _ACEOF
3090 rm -f conftest.$ac_objext
3091 if { (eval echo "$as_me:3091: \"$ac_compile\"") >&5
3092   (eval $ac_compile) 2>&5
3093   ac_status=$?
3094   echo "$as_me:3094: \$? = $ac_status" >&5
3095   (exit $ac_status); } &&
3096          { ac_try='test -s conftest.$ac_objext'
3097   { (eval echo "$as_me:3097: \"$ac_try\"") >&5
3098   (eval $ac_try) 2>&5
3099   ac_status=$?
3100   echo "$as_me:3100: \$? = $ac_status" >&5
3101   (exit $ac_status); }; }; then
3102   :
3103 else
3104   echo "$as_me: failed program was:" >&5
3105 cat conftest.$ac_ext >&5
3106 cf_cv_posix_c_source=no
3107 fi
3108 rm -f conftest.$ac_objext conftest.$ac_ext
3109          CFLAGS="$cf_save_CFLAGS"
3110          CPPFLAGS="$cf_save_CPPFLAGS"
3111
3112 fi
3113 rm -f conftest.$ac_objext conftest.$ac_ext
3114
3115 fi
3116 echo "$as_me:3116: result: $cf_cv_posix_c_source" >&5
3117 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3118
3119 if test "$cf_cv_posix_c_source" != no ; then
3120         CFLAGS="$cf_trim_CFLAGS"
3121         CPPFLAGS="$cf_trim_CPPFLAGS"
3122
3123 cf_fix_cppflags=no
3124 cf_new_cflags=
3125 cf_new_cppflags=
3126 cf_new_extra_cppflags=
3127
3128 for cf_add_cflags in $cf_cv_posix_c_source
3129 do
3130 case $cf_fix_cppflags in
3131 no)
3132         case $cf_add_cflags in #(vi
3133         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3134                 case $cf_add_cflags in
3135                 -D*)
3136                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3137
3138                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3139                                 && test -z "${cf_tst_cflags}" \
3140                                 && cf_fix_cppflags=yes
3141
3142                         if test $cf_fix_cppflags = yes ; then
3143                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3144                                 continue
3145                         elif test "${cf_tst_cflags}" = "\"'" ; then
3146                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3147                                 continue
3148                         fi
3149                         ;;
3150                 esac
3151                 case "$CPPFLAGS" in
3152                 *$cf_add_cflags) #(vi
3153                         ;;
3154                 *) #(vi
3155                         case $cf_add_cflags in #(vi
3156                         -D*)
3157                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3158
3159 CPPFLAGS=`echo "$CPPFLAGS" | \
3160         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3161                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3162
3163                                 ;;
3164                         esac
3165                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3166                         ;;
3167                 esac
3168                 ;;
3169         *)
3170                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3171                 ;;
3172         esac
3173         ;;
3174 yes)
3175         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3176
3177         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3178
3179         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3180                 && test -z "${cf_tst_cflags}" \
3181                 && cf_fix_cppflags=no
3182         ;;
3183 esac
3184 done
3185
3186 if test -n "$cf_new_cflags" ; then
3187
3188         CFLAGS="$CFLAGS $cf_new_cflags"
3189 fi
3190
3191 if test -n "$cf_new_cppflags" ; then
3192
3193         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3194 fi
3195
3196 if test -n "$cf_new_extra_cppflags" ; then
3197
3198         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3199 fi
3200
3201 fi
3202
3203         ;;
3204 esac
3205
3206 if test -n "$cf_xopen_source" ; then
3207
3208 cf_fix_cppflags=no
3209 cf_new_cflags=
3210 cf_new_cppflags=
3211 cf_new_extra_cppflags=
3212
3213 for cf_add_cflags in $cf_xopen_source
3214 do
3215 case $cf_fix_cppflags in
3216 no)
3217         case $cf_add_cflags in #(vi
3218         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3219                 case $cf_add_cflags in
3220                 -D*)
3221                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3222
3223                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3224                                 && test -z "${cf_tst_cflags}" \
3225                                 && cf_fix_cppflags=yes
3226
3227                         if test $cf_fix_cppflags = yes ; then
3228                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3229                                 continue
3230                         elif test "${cf_tst_cflags}" = "\"'" ; then
3231                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3232                                 continue
3233                         fi
3234                         ;;
3235                 esac
3236                 case "$CPPFLAGS" in
3237                 *$cf_add_cflags) #(vi
3238                         ;;
3239                 *) #(vi
3240                         case $cf_add_cflags in #(vi
3241                         -D*)
3242                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3243
3244 CPPFLAGS=`echo "$CPPFLAGS" | \
3245         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3246                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3247
3248                                 ;;
3249                         esac
3250                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3251                         ;;
3252                 esac
3253                 ;;
3254         *)
3255                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3256                 ;;
3257         esac
3258         ;;
3259 yes)
3260         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3261
3262         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3263
3264         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3265                 && test -z "${cf_tst_cflags}" \
3266                 && cf_fix_cppflags=no
3267         ;;
3268 esac
3269 done
3270
3271 if test -n "$cf_new_cflags" ; then
3272
3273         CFLAGS="$CFLAGS $cf_new_cflags"
3274 fi
3275
3276 if test -n "$cf_new_cppflags" ; then
3277
3278         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3279 fi
3280
3281 if test -n "$cf_new_extra_cppflags" ; then
3282
3283         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3284 fi
3285
3286 fi
3287
3288 echo "$as_me:3288: checking for $CC option to accept ANSI C" >&5
3289 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
3290 if test "${ac_cv_prog_cc_stdc+set}" = set; then
3291   echo $ECHO_N "(cached) $ECHO_C" >&6
3292 else
3293   ac_cv_prog_cc_stdc=no
3294 ac_save_CC=$CC
3295 cat >conftest.$ac_ext <<_ACEOF
3296 #line 3296 "configure"
3297 #include "confdefs.h"
3298 #include <stdarg.h>
3299 #include <stdio.h>
3300 #include <sys/types.h>
3301 #include <sys/stat.h>
3302 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3303 struct buf { int x; };
3304 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3305 static char *e (p, i)
3306      char **p;
3307      int i;
3308 {
3309   return p[i];
3310 }
3311 static char *f (char * (*g) (char **, int), char **p, ...)
3312 {
3313   char *s;
3314   va_list v;
3315   va_start (v,p);
3316   s = g (p, va_arg (v,int));
3317   va_end (v);
3318   return s;
3319 }
3320 int test (int i, double x);
3321 struct s1 {int (*f) (int a);};
3322 struct s2 {int (*f) (double a);};
3323 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3324 int argc;
3325 char **argv;
3326 int
3327 main ()
3328 {
3329 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3330   ;
3331   return 0;
3332 }
3333 _ACEOF
3334 # Don't try gcc -ansi; that turns off useful extensions and
3335 # breaks some systems' header files.
3336 # AIX                   -qlanglvl=ansi
3337 # Ultrix and OSF/1      -std1
3338 # HP-UX 10.20 and later -Ae
3339 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3340 # SVR4                  -Xc -D__EXTENSIONS__
3341 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3342 do
3343   CC="$ac_save_CC $ac_arg"
3344   rm -f conftest.$ac_objext
3345 if { (eval echo "$as_me:3345: \"$ac_compile\"") >&5
3346   (eval $ac_compile) 2>&5
3347   ac_status=$?
3348   echo "$as_me:3348: \$? = $ac_status" >&5
3349   (exit $ac_status); } &&
3350          { ac_try='test -s conftest.$ac_objext'
3351   { (eval echo "$as_me:3351: \"$ac_try\"") >&5
3352   (eval $ac_try) 2>&5
3353   ac_status=$?
3354   echo "$as_me:3354: \$? = $ac_status" >&5
3355   (exit $ac_status); }; }; then
3356   ac_cv_prog_cc_stdc=$ac_arg
3357 break
3358 else
3359   echo "$as_me: failed program was:" >&5
3360 cat conftest.$ac_ext >&5
3361 fi
3362 rm -f conftest.$ac_objext
3363 done
3364 rm -f conftest.$ac_ext conftest.$ac_objext
3365 CC=$ac_save_CC
3366
3367 fi
3368
3369 case "x$ac_cv_prog_cc_stdc" in
3370   x|xno)
3371     echo "$as_me:3371: result: none needed" >&5
3372 echo "${ECHO_T}none needed" >&6 ;;
3373   *)
3374     echo "$as_me:3374: result: $ac_cv_prog_cc_stdc" >&5
3375 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
3376     CC="$CC $ac_cv_prog_cc_stdc" ;;
3377 esac
3378
3379 echo "$as_me:3379: checking for an ANSI C-conforming const" >&5
3380 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
3381 if test "${ac_cv_c_const+set}" = set; then
3382   echo $ECHO_N "(cached) $ECHO_C" >&6
3383 else
3384   cat >conftest.$ac_ext <<_ACEOF
3385 #line 3385 "configure"
3386 #include "confdefs.h"
3387
3388 int
3389 main ()
3390 {
3391 /* FIXME: Include the comments suggested by Paul. */
3392 #ifndef __cplusplus
3393   /* Ultrix mips cc rejects this.  */
3394   typedef int charset[2];
3395   const charset x;
3396   /* SunOS 4.1.1 cc rejects this.  */
3397   char const *const *ccp;
3398   char **p;
3399   /* NEC SVR4.0.2 mips cc rejects this.  */
3400   struct point {int x, y;};
3401   static struct point const zero = {0,0};
3402   /* AIX XL C 1.02.0.0 rejects this.
3403      It does not let you subtract one const X* pointer from another in
3404      an arm of an if-expression whose if-part is not a constant
3405      expression */
3406   const char *g = "string";
3407   ccp = &g + (g ? g-g : 0);
3408   /* HPUX 7.0 cc rejects these. */
3409   ++ccp;
3410   p = (char**) ccp;
3411   ccp = (char const *const *) p;
3412   { /* SCO 3.2v4 cc rejects this.  */
3413     char *t;
3414     char const *s = 0 ? (char *) 0 : (char const *) 0;
3415
3416     *t++ = 0;
3417   }
3418   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3419     int x[] = {25, 17};
3420     const int *foo = &x[0];
3421     ++foo;
3422   }
3423   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3424     typedef const int *iptr;
3425     iptr p = 0;
3426     ++p;
3427   }
3428   { /* AIX XL C 1.02.0.0 rejects this saying
3429        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3430     struct s { int j; const int *ap[3]; };
3431     struct s *b; b->j = 5;
3432   }
3433   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3434     const int foo = 10;
3435   }
3436 #endif
3437
3438   ;
3439   return 0;
3440 }
3441 _ACEOF
3442 rm -f conftest.$ac_objext
3443 if { (eval echo "$as_me:3443: \"$ac_compile\"") >&5
3444   (eval $ac_compile) 2>&5
3445   ac_status=$?
3446   echo "$as_me:3446: \$? = $ac_status" >&5
3447   (exit $ac_status); } &&
3448          { ac_try='test -s conftest.$ac_objext'
3449   { (eval echo "$as_me:3449: \"$ac_try\"") >&5
3450   (eval $ac_try) 2>&5
3451   ac_status=$?
3452   echo "$as_me:3452: \$? = $ac_status" >&5
3453   (exit $ac_status); }; }; then
3454   ac_cv_c_const=yes
3455 else
3456   echo "$as_me: failed program was:" >&5
3457 cat conftest.$ac_ext >&5
3458 ac_cv_c_const=no
3459 fi
3460 rm -f conftest.$ac_objext conftest.$ac_ext
3461 fi
3462 echo "$as_me:3462: result: $ac_cv_c_const" >&5
3463 echo "${ECHO_T}$ac_cv_c_const" >&6
3464 if test $ac_cv_c_const = no; then
3465
3466 cat >>confdefs.h <<\EOF
3467 #define const
3468 EOF
3469
3470 fi
3471
3472 echo "$as_me:3472: checking for signal global datatype" >&5
3473 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3474 if test "${cf_cv_sig_atomic_t+set}" = set; then
3475   echo $ECHO_N "(cached) $ECHO_C" >&6
3476 else
3477
3478         for cf_type in \
3479                 "volatile sig_atomic_t" \
3480                 "sig_atomic_t" \
3481                 "int"
3482         do
3483         cat >conftest.$ac_ext <<_ACEOF
3484 #line 3484 "configure"
3485 #include "confdefs.h"
3486
3487 #include <sys/types.h>
3488 #include <signal.h>
3489 #include <stdio.h>
3490
3491 extern $cf_type x;
3492 $cf_type x;
3493 static void handler(int sig)
3494 {
3495         x = 5;
3496 }
3497 int
3498 main ()
3499 {
3500 signal(SIGINT, handler);
3501                  x = 1
3502   ;
3503   return 0;
3504 }
3505 _ACEOF
3506 rm -f conftest.$ac_objext
3507 if { (eval echo "$as_me:3507: \"$ac_compile\"") >&5
3508   (eval $ac_compile) 2>&5
3509   ac_status=$?
3510   echo "$as_me:3510: \$? = $ac_status" >&5
3511   (exit $ac_status); } &&
3512          { ac_try='test -s conftest.$ac_objext'
3513   { (eval echo "$as_me:3513: \"$ac_try\"") >&5
3514   (eval $ac_try) 2>&5
3515   ac_status=$?
3516   echo "$as_me:3516: \$? = $ac_status" >&5
3517   (exit $ac_status); }; }; then
3518   cf_cv_sig_atomic_t=$cf_type
3519 else
3520   echo "$as_me: failed program was:" >&5
3521 cat conftest.$ac_ext >&5
3522 cf_cv_sig_atomic_t=no
3523 fi
3524 rm -f conftest.$ac_objext conftest.$ac_ext
3525                 test "$cf_cv_sig_atomic_t" != no && break
3526         done
3527
3528 fi
3529
3530 echo "$as_me:3530: result: $cf_cv_sig_atomic_t" >&5
3531 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
3532 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
3533 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
3534 EOF
3535
3536 echo "$as_me:3536: checking if you want to see long compiling messages" >&5
3537 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
3538
3539 # Check whether --enable-echo or --disable-echo was given.
3540 if test "${enable_echo+set}" = set; then
3541   enableval="$enable_echo"
3542   test "$enableval" != no && enableval=yes
3543   if test "$enableval" != "yes" ; then
3544
3545     ECHO_LT='--silent'
3546     ECHO_LD='@echo linking $@;'
3547     RULE_CC='@echo compiling $<'
3548     SHOW_CC='@echo compiling $@'
3549     ECHO_CC='@'
3550
3551   else
3552
3553     ECHO_LT=''
3554     ECHO_LD=''
3555     RULE_CC=''
3556     SHOW_CC=''
3557     ECHO_CC=''
3558
3559   fi
3560 else
3561   enableval=yes
3562
3563     ECHO_LT=''
3564     ECHO_LD=''
3565     RULE_CC=''
3566     SHOW_CC=''
3567     ECHO_CC=''
3568
3569 fi;
3570 echo "$as_me:3570: result: $enableval" >&5
3571 echo "${ECHO_T}$enableval" >&6
3572
3573 GCC_VERSION=none
3574 if test "$GCC" = yes ; then
3575         echo "$as_me:3575: checking version of $CC" >&5
3576 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
3577         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
3578         test -z "$GCC_VERSION" && GCC_VERSION=unknown
3579         echo "$as_me:3579: result: $GCC_VERSION" >&5
3580 echo "${ECHO_T}$GCC_VERSION" >&6
3581 fi
3582
3583 if ( test "$GCC" = yes || test "$GXX" = yes )
3584 then
3585 echo "$as_me:3585: checking if you want to turn on gcc warnings" >&5
3586 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
3587
3588 # Check whether --enable-warnings or --disable-warnings was given.
3589 if test "${enable_warnings+set}" = set; then
3590   enableval="$enable_warnings"
3591   test "$enableval" != yes && enableval=no
3592   if test "$enableval" != "no" ; then
3593     with_warnings=yes
3594   else
3595     with_warnings=no
3596   fi
3597 else
3598   enableval=no
3599   with_warnings=no
3600
3601 fi;
3602 echo "$as_me:3602: result: $with_warnings" >&5
3603 echo "${ECHO_T}$with_warnings" >&6
3604 if test "$with_warnings" = "yes"
3605 then
3606
3607 if test "$GCC" = yes
3608 then
3609 cat > conftest.i <<EOF
3610 #ifndef GCC_PRINTF
3611 #define GCC_PRINTF 0
3612 #endif
3613 #ifndef GCC_SCANF
3614 #define GCC_SCANF 0
3615 #endif
3616 #ifndef GCC_NORETURN
3617 #define GCC_NORETURN /* nothing */
3618 #endif
3619 #ifndef GCC_UNUSED
3620 #define GCC_UNUSED /* nothing */
3621 #endif
3622 EOF
3623 if test "$GCC" = yes
3624 then
3625         { echo "$as_me:3625: checking for $CC __attribute__ directives..." >&5
3626 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3627 cat > conftest.$ac_ext <<EOF
3628 #line 3628 "${as_me:-configure}"
3629 #include "confdefs.h"
3630 #include "conftest.h"
3631 #include "conftest.i"
3632 #if     GCC_PRINTF
3633 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3634 #else
3635 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3636 #endif
3637 #if     GCC_SCANF
3638 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3639 #else
3640 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3641 #endif
3642 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3643 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3644 extern void foo(void) GCC_NORETURN;
3645 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3646 EOF
3647         cf_printf_attribute=no
3648         cf_scanf_attribute=no
3649         for cf_attribute in scanf printf unused noreturn
3650         do
3651
3652 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3653
3654                 cf_directive="__attribute__(($cf_attribute))"
3655                 echo "checking for $CC $cf_directive" 1>&5
3656
3657                 case $cf_attribute in #(vi
3658                 printf) #(vi
3659                         cf_printf_attribute=yes
3660                         cat >conftest.h <<EOF
3661 #define GCC_$cf_ATTRIBUTE 1
3662 EOF
3663                         ;;
3664                 scanf) #(vi
3665                         cf_scanf_attribute=yes
3666                         cat >conftest.h <<EOF
3667 #define GCC_$cf_ATTRIBUTE 1
3668 EOF
3669                         ;;
3670                 *) #(vi
3671                         cat >conftest.h <<EOF
3672 #define GCC_$cf_ATTRIBUTE $cf_directive
3673 EOF
3674                         ;;
3675                 esac
3676
3677                 if { (eval echo "$as_me:3677: \"$ac_compile\"") >&5
3678   (eval $ac_compile) 2>&5
3679   ac_status=$?
3680   echo "$as_me:3680: \$? = $ac_status" >&5
3681   (exit $ac_status); }; then
3682                         test -n "$verbose" && echo "$as_me:3682: result: ... $cf_attribute" >&5
3683 echo "${ECHO_T}... $cf_attribute" >&6
3684                         cat conftest.h >>confdefs.h
3685                         case $cf_attribute in #(vi
3686                         printf) #(vi
3687                                 if test "$cf_printf_attribute" = no ; then
3688                                         cat >>confdefs.h <<EOF
3689 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
3690 EOF
3691                                 else
3692                                         cat >>confdefs.h <<EOF
3693 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3694 EOF
3695                                 fi
3696                                 ;;
3697                         scanf) #(vi
3698                                 if test "$cf_scanf_attribute" = no ; then
3699                                         cat >>confdefs.h <<EOF
3700 #define GCC_SCANFLIKE(fmt,var) /* nothing */
3701 EOF
3702                                 else
3703                                         cat >>confdefs.h <<EOF
3704 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3705 EOF
3706                                 fi
3707                                 ;;
3708                         esac
3709                 fi
3710         done
3711 else
3712         fgrep define conftest.i >>confdefs.h
3713 fi
3714 rm -rf conftest*
3715 fi
3716
3717 INTEL_COMPILER=no
3718
3719 if test "$GCC" = yes ; then
3720         case $host_os in
3721         linux*|gnu*)
3722                 echo "$as_me:3722: checking if this is really Intel C compiler" >&5
3723 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
3724                 cf_save_CFLAGS="$CFLAGS"
3725                 CFLAGS="$CFLAGS -no-gcc"
3726                 cat >conftest.$ac_ext <<_ACEOF
3727 #line 3727 "configure"
3728 #include "confdefs.h"
3729
3730 int
3731 main ()
3732 {
3733
3734 #ifdef __INTEL_COMPILER
3735 #else
3736 make an error
3737 #endif
3738
3739   ;
3740   return 0;
3741 }
3742 _ACEOF
3743 rm -f conftest.$ac_objext
3744 if { (eval echo "$as_me:3744: \"$ac_compile\"") >&5
3745   (eval $ac_compile) 2>&5
3746   ac_status=$?
3747   echo "$as_me:3747: \$? = $ac_status" >&5
3748   (exit $ac_status); } &&
3749          { ac_try='test -s conftest.$ac_objext'
3750   { (eval echo "$as_me:3750: \"$ac_try\"") >&5
3751   (eval $ac_try) 2>&5
3752   ac_status=$?
3753   echo "$as_me:3753: \$? = $ac_status" >&5
3754   (exit $ac_status); }; }; then
3755   INTEL_COMPILER=yes
3756 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
3757
3758 else
3759   echo "$as_me: failed program was:" >&5
3760 cat conftest.$ac_ext >&5
3761 fi
3762 rm -f conftest.$ac_objext conftest.$ac_ext
3763                 CFLAGS="$cf_save_CFLAGS"
3764                 echo "$as_me:3764: result: $INTEL_COMPILER" >&5
3765 echo "${ECHO_T}$INTEL_COMPILER" >&6
3766                 ;;
3767         esac
3768 fi
3769
3770 cat > conftest.$ac_ext <<EOF
3771 #line 3771 "${as_me:-configure}"
3772 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
3773 EOF
3774
3775 if test "$INTEL_COMPILER" = yes
3776 then
3777 # The "-wdXXX" options suppress warnings:
3778 # remark #1419: external declaration in primary source file
3779 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
3780 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
3781 # remark #193: zero used for undefined preprocessing identifier
3782 # remark #593: variable "curs_sb_left_arrow" was set but never used
3783 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
3784 # remark #869: parameter "tw" was never referenced
3785 # remark #981: operands are evaluated in unspecified order
3786 # warning #279: controlling expression is constant
3787
3788         { echo "$as_me:3788: checking for $CC warning options..." >&5
3789 echo "$as_me: checking for $CC warning options..." >&6;}
3790         cf_save_CFLAGS="$CFLAGS"
3791         EXTRA_CFLAGS="-Wall"
3792         for cf_opt in \
3793                 wd1419 \
3794                 wd1683 \
3795                 wd1684 \
3796                 wd193 \
3797                 wd593 \
3798                 wd279 \
3799                 wd810 \
3800                 wd869 \
3801                 wd981
3802         do
3803                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
3804                 if { (eval echo "$as_me:3804: \"$ac_compile\"") >&5
3805   (eval $ac_compile) 2>&5
3806   ac_status=$?
3807   echo "$as_me:3807: \$? = $ac_status" >&5
3808   (exit $ac_status); }; then
3809                         test -n "$verbose" && echo "$as_me:3809: result: ... -$cf_opt" >&5
3810 echo "${ECHO_T}... -$cf_opt" >&6
3811                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
3812                 fi
3813         done
3814         CFLAGS="$cf_save_CFLAGS"
3815
3816 elif test "$GCC" = yes
3817 then
3818         { echo "$as_me:3818: checking for $CC warning options..." >&5
3819 echo "$as_me: checking for $CC warning options..." >&6;}
3820         cf_save_CFLAGS="$CFLAGS"
3821         EXTRA_CFLAGS=
3822         cf_warn_CONST=""
3823         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
3824         for cf_opt in W Wall \
3825                 Wbad-function-cast \
3826                 Wcast-align \
3827                 Wcast-qual \
3828                 Winline \
3829                 Wmissing-declarations \
3830                 Wmissing-prototypes \
3831                 Wnested-externs \
3832                 Wpointer-arith \
3833                 Wshadow \
3834                 Wstrict-prototypes \
3835                 Wundef $cf_warn_CONST
3836         do
3837                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
3838                 if { (eval echo "$as_me:3838: \"$ac_compile\"") >&5
3839   (eval $ac_compile) 2>&5
3840   ac_status=$?
3841   echo "$as_me:3841: \$? = $ac_status" >&5
3842   (exit $ac_status); }; then
3843                         test -n "$verbose" && echo "$as_me:3843: result: ... -$cf_opt" >&5
3844 echo "${ECHO_T}... -$cf_opt" >&6
3845                         case $cf_opt in #(vi
3846                         Wcast-qual) #(vi
3847                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
3848                                 ;;
3849                         Winline) #(vi
3850                                 case $GCC_VERSION in
3851                                 [34].*)
3852                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
3853
3854 echo "${as_me:-configure}:3854: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
3855
3856                                         continue;;
3857                                 esac
3858                                 ;;
3859                         esac
3860                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
3861                 fi
3862         done
3863         CFLAGS="$cf_save_CFLAGS"
3864 fi
3865 rm -rf conftest*
3866
3867 fi
3868 fi
3869
3870 # Check whether --with-curses-dir or --without-curses-dir was given.
3871 if test "${with_curses_dir+set}" = set; then
3872   withval="$with_curses_dir"
3873
3874 if test "x$prefix" != xNONE; then
3875   cf_path_syntax="$prefix"
3876 else
3877   cf_path_syntax="$ac_default_prefix"
3878 fi
3879
3880 case ".$withval" in #(vi
3881 .\$\(*\)*|.\'*\'*) #(vi
3882   ;;
3883 ..|./*|.\\*) #(vi
3884   ;;
3885 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
3886   ;;
3887 .\${*prefix}*) #(vi
3888   eval withval="$withval"
3889   case ".$withval" in #(vi
3890   .NONE/*)
3891     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3892     ;;
3893   esac
3894   ;; #(vi
3895 .no|.NONE/*)
3896   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3897   ;;
3898 *)
3899   { { echo "$as_me:3899: error: expected a pathname, not \"$withval\"" >&5
3900 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3901    { (exit 1); exit 1; }; }
3902   ;;
3903 esac
3904
3905          cf_cv_curses_dir=$withval
3906 else
3907   cf_cv_curses_dir=no
3908 fi;
3909
3910 # Check whether --with-5lib or --without-5lib was given.
3911 if test "${with_5lib+set}" = set; then
3912   withval="$with_5lib"
3913   LIBS="-L/usr/5lib $LIBS"
3914          CPPFLAGS="$CPPFLAGS -I/usr/5include"
3915 fi;
3916
3917 # Check whether --with-ncursesw or --without-ncursesw was given.
3918 if test "${with_ncursesw+set}" = set; then
3919   withval="$with_ncursesw"
3920   cf_cv_screen=ncursesw
3921 else
3922
3923 # Check whether --with-ncurses or --without-ncurses was given.
3924 if test "${with_ncurses+set}" = set; then
3925   withval="$with_ncurses"
3926   cf_cv_screen=ncurses
3927 else
3928
3929 # Check whether --with-pdcurses or --without-pdcurses was given.
3930 if test "${with_pdcurses+set}" = set; then
3931   withval="$with_pdcurses"
3932   cf_cv_screen=pdcurses
3933 fi;
3934 fi;
3935 fi;
3936
3937 case $cf_cv_screen in
3938 curses)
3939
3940 echo "$as_me:3940: checking for extra include directories" >&5
3941 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
3942 if test "${cf_cv_curses_incdir+set}" = set; then
3943   echo $ECHO_N "(cached) $ECHO_C" >&6
3944 else
3945
3946 cf_cv_curses_incdir=no
3947 case $host_os in #(vi
3948 hpux10.*) #(vi
3949         test -d /usr/include/curses_colr && \
3950         cf_cv_curses_incdir="-I/usr/include/curses_colr"
3951         ;;
3952 sunos3*|sunos4*)
3953         test -d /usr/5lib && \
3954         test -d /usr/5include && \
3955         cf_cv_curses_incdir="-I/usr/5include"
3956         ;;
3957 esac
3958
3959 fi
3960 echo "$as_me:3960: result: $cf_cv_curses_incdir" >&5
3961 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
3962 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
3963
3964 echo "$as_me:3964: checking if we have identified curses headers" >&5
3965 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
3966 if test "${cf_cv_ncurses_header+set}" = set; then
3967   echo $ECHO_N "(cached) $ECHO_C" >&6
3968 else
3969
3970 cf_cv_ncurses_header=none
3971 for cf_header in  \
3972         curses.h \
3973         ncurses.h ncurses/curses.h ncurses/ncurses.h
3974 do
3975 cat >conftest.$ac_ext <<_ACEOF
3976 #line 3976 "configure"
3977 #include "confdefs.h"
3978 #include <${cf_header}>
3979 int
3980 main ()
3981 {
3982 initscr(); tgoto("?", 0,0)
3983   ;
3984   return 0;
3985 }
3986 _ACEOF
3987 rm -f conftest.$ac_objext
3988 if { (eval echo "$as_me:3988: \"$ac_compile\"") >&5
3989   (eval $ac_compile) 2>&5
3990   ac_status=$?
3991   echo "$as_me:3991: \$? = $ac_status" >&5
3992   (exit $ac_status); } &&
3993          { ac_try='test -s conftest.$ac_objext'
3994   { (eval echo "$as_me:3994: \"$ac_try\"") >&5
3995   (eval $ac_try) 2>&5
3996   ac_status=$?
3997   echo "$as_me:3997: \$? = $ac_status" >&5
3998   (exit $ac_status); }; }; then
3999   cf_cv_ncurses_header=$cf_header; break
4000 else
4001   echo "$as_me: failed program was:" >&5
4002 cat conftest.$ac_ext >&5
4003 fi
4004 rm -f conftest.$ac_objext conftest.$ac_ext
4005 done
4006
4007 fi
4008 echo "$as_me:4008: result: $cf_cv_ncurses_header" >&5
4009 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4010
4011 if test "$cf_cv_ncurses_header" = none ; then
4012         { { echo "$as_me:4012: error: No curses header-files found" >&5
4013 echo "$as_me: error: No curses header-files found" >&2;}
4014    { (exit 1); exit 1; }; }
4015 fi
4016
4017 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4018
4019 for ac_header in $cf_cv_ncurses_header
4020 do
4021 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4022 echo "$as_me:4022: checking for $ac_header" >&5
4023 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4024 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4025   echo $ECHO_N "(cached) $ECHO_C" >&6
4026 else
4027   cat >conftest.$ac_ext <<_ACEOF
4028 #line 4028 "configure"
4029 #include "confdefs.h"
4030 #include <$ac_header>
4031 _ACEOF
4032 if { (eval echo "$as_me:4032: \"$ac_cpp conftest.$ac_ext\"") >&5
4033   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4034   ac_status=$?
4035   egrep -v '^ *\+' conftest.er1 >conftest.err
4036   rm -f conftest.er1
4037   cat conftest.err >&5
4038   echo "$as_me:4038: \$? = $ac_status" >&5
4039   (exit $ac_status); } >/dev/null; then
4040   if test -s conftest.err; then
4041     ac_cpp_err=$ac_c_preproc_warn_flag
4042   else
4043     ac_cpp_err=
4044   fi
4045 else
4046   ac_cpp_err=yes
4047 fi
4048 if test -z "$ac_cpp_err"; then
4049   eval "$as_ac_Header=yes"
4050 else
4051   echo "$as_me: failed program was:" >&5
4052   cat conftest.$ac_ext >&5
4053   eval "$as_ac_Header=no"
4054 fi
4055 rm -f conftest.err conftest.$ac_ext
4056 fi
4057 echo "$as_me:4057: result: `eval echo '${'$as_ac_Header'}'`" >&5
4058 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4059 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4060   cat >>confdefs.h <<EOF
4061 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4062 EOF
4063
4064 fi
4065 done
4066
4067 echo "$as_me:4067: checking for terminfo header" >&5
4068 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4069 if test "${cf_cv_term_header+set}" = set; then
4070   echo $ECHO_N "(cached) $ECHO_C" >&6
4071 else
4072
4073 case ${cf_cv_ncurses_header} in #(vi
4074 */ncurses.h|*/ncursesw.h) #(vi
4075         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4076         ;;
4077 *)
4078         cf_term_header=term.h
4079         ;;
4080 esac
4081
4082 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4083 do
4084 cat >conftest.$ac_ext <<_ACEOF
4085 #line 4085 "configure"
4086 #include "confdefs.h"
4087 #include <stdio.h>
4088 #include <${cf_cv_ncurses_header:-curses.h}>
4089 #include <$cf_test>
4090
4091 int
4092 main ()
4093 {
4094 int x = auto_left_margin
4095   ;
4096   return 0;
4097 }
4098 _ACEOF
4099 rm -f conftest.$ac_objext
4100 if { (eval echo "$as_me:4100: \"$ac_compile\"") >&5
4101   (eval $ac_compile) 2>&5
4102   ac_status=$?
4103   echo "$as_me:4103: \$? = $ac_status" >&5
4104   (exit $ac_status); } &&
4105          { ac_try='test -s conftest.$ac_objext'
4106   { (eval echo "$as_me:4106: \"$ac_try\"") >&5
4107   (eval $ac_try) 2>&5
4108   ac_status=$?
4109   echo "$as_me:4109: \$? = $ac_status" >&5
4110   (exit $ac_status); }; }; then
4111
4112         cf_cv_term_header="$cf_test"
4113 else
4114   echo "$as_me: failed program was:" >&5
4115 cat conftest.$ac_ext >&5
4116
4117         cf_cv_term_header=unknown
4118
4119 fi
4120 rm -f conftest.$ac_objext conftest.$ac_ext
4121         test "$cf_cv_term_header" != unknown && break
4122 done
4123
4124 fi
4125 echo "$as_me:4125: result: $cf_cv_term_header" >&5
4126 echo "${ECHO_T}$cf_cv_term_header" >&6
4127
4128 # Set definitions to allow ifdef'ing to accommodate subdirectories
4129
4130 case $cf_cv_term_header in # (vi
4131 *term.h)
4132         cat >>confdefs.h <<\EOF
4133 #define HAVE_TERM_H 1
4134 EOF
4135
4136         ;;
4137 esac
4138
4139 case $cf_cv_term_header in # (vi
4140 ncurses/term.h) #(vi
4141         cat >>confdefs.h <<\EOF
4142 #define HAVE_NCURSES_TERM_H 1
4143 EOF
4144
4145         ;;
4146 ncursesw/term.h)
4147         cat >>confdefs.h <<\EOF
4148 #define HAVE_NCURSESW_TERM_H 1
4149 EOF
4150
4151         ;;
4152 esac
4153
4154 echo "$as_me:4154: checking for ncurses version" >&5
4155 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4156 if test "${cf_cv_ncurses_version+set}" = set; then
4157   echo $ECHO_N "(cached) $ECHO_C" >&6
4158 else
4159
4160         cf_cv_ncurses_version=no
4161         cf_tempfile=out$$
4162         rm -f $cf_tempfile
4163         if test "$cross_compiling" = yes; then
4164
4165         # This will not work if the preprocessor splits the line after the
4166         # Autoconf token.  The 'unproto' program does that.
4167         cat > conftest.$ac_ext <<EOF
4168 #include <${cf_cv_ncurses_header:-curses.h}>
4169 #undef Autoconf
4170 #ifdef NCURSES_VERSION
4171 Autoconf NCURSES_VERSION
4172 #else
4173 #ifdef __NCURSES_H
4174 Autoconf "old"
4175 #endif
4176 ;
4177 #endif
4178 EOF
4179         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4180         { (eval echo "$as_me:4180: \"$cf_try\"") >&5
4181   (eval $cf_try) 2>&5
4182   ac_status=$?
4183   echo "$as_me:4183: \$? = $ac_status" >&5
4184   (exit $ac_status); }
4185         if test -f conftest.out ; then
4186                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4187                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4188                 rm -f conftest.out
4189         fi
4190
4191 else
4192   cat >conftest.$ac_ext <<_ACEOF
4193 #line 4193 "configure"
4194 #include "confdefs.h"
4195
4196 #include <${cf_cv_ncurses_header:-curses.h}>
4197 #include <stdio.h>
4198 int main()
4199 {
4200         FILE *fp = fopen("$cf_tempfile", "w");
4201 #ifdef NCURSES_VERSION
4202 # ifdef NCURSES_VERSION_PATCH
4203         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4204 # else
4205         fprintf(fp, "%s\n", NCURSES_VERSION);
4206 # endif
4207 #else
4208 # ifdef __NCURSES_H
4209         fprintf(fp, "old\n");
4210 # else
4211         make an error
4212 # endif
4213 #endif
4214         ${cf_cv_main_return:-return}(0);
4215 }
4216 _ACEOF
4217 rm -f conftest$ac_exeext
4218 if { (eval echo "$as_me:4218: \"$ac_link\"") >&5
4219   (eval $ac_link) 2>&5
4220   ac_status=$?
4221   echo "$as_me:4221: \$? = $ac_status" >&5
4222   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4223   { (eval echo "$as_me:4223: \"$ac_try\"") >&5
4224   (eval $ac_try) 2>&5
4225   ac_status=$?
4226   echo "$as_me:4226: \$? = $ac_status" >&5
4227   (exit $ac_status); }; }; then
4228
4229         cf_cv_ncurses_version=`cat $cf_tempfile`
4230 else
4231   echo "$as_me: program exited with status $ac_status" >&5
4232 echo "$as_me: failed program was:" >&5
4233 cat conftest.$ac_ext >&5
4234 fi
4235 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4236 fi
4237         rm -f $cf_tempfile
4238
4239 fi
4240 echo "$as_me:4240: result: $cf_cv_ncurses_version" >&5
4241 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4242 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
4243 #define NCURSES 1
4244 EOF
4245
4246 echo "$as_me:4246: checking if we have identified curses libraries" >&5
4247 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4248 cat >conftest.$ac_ext <<_ACEOF
4249 #line 4249 "configure"
4250 #include "confdefs.h"
4251 #include <${cf_cv_ncurses_header:-curses.h}>
4252 int
4253 main ()
4254 {
4255 initscr(); tgoto("?", 0,0)
4256   ;
4257   return 0;
4258 }
4259 _ACEOF
4260 rm -f conftest.$ac_objext conftest$ac_exeext
4261 if { (eval echo "$as_me:4261: \"$ac_link\"") >&5
4262   (eval $ac_link) 2>&5
4263   ac_status=$?
4264   echo "$as_me:4264: \$? = $ac_status" >&5
4265   (exit $ac_status); } &&
4266          { ac_try='test -s conftest$ac_exeext'
4267   { (eval echo "$as_me:4267: \"$ac_try\"") >&5
4268   (eval $ac_try) 2>&5
4269   ac_status=$?
4270   echo "$as_me:4270: \$? = $ac_status" >&5
4271   (exit $ac_status); }; }; then
4272   cf_result=yes
4273 else
4274   echo "$as_me: failed program was:" >&5
4275 cat conftest.$ac_ext >&5
4276 cf_result=no
4277 fi
4278 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4279 echo "$as_me:4279: result: $cf_result" >&5
4280 echo "${ECHO_T}$cf_result" >&6
4281
4282 if test "$cf_result" = no ; then
4283 case $host_os in #(vi
4284 freebsd*) #(vi
4285     echo "$as_me:4285: checking for tgoto in -lmytinfo" >&5
4286 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4287 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4288   echo $ECHO_N "(cached) $ECHO_C" >&6
4289 else
4290   ac_check_lib_save_LIBS=$LIBS
4291 LIBS="-lmytinfo  $LIBS"
4292 cat >conftest.$ac_ext <<_ACEOF
4293 #line 4293 "configure"
4294 #include "confdefs.h"
4295
4296 /* Override any gcc2 internal prototype to avoid an error.  */
4297 #ifdef __cplusplus
4298 extern "C"
4299 #endif
4300 /* We use char because int might match the return type of a gcc2
4301    builtin and then its argument prototype would still apply.  */
4302 char tgoto ();
4303 int
4304 main ()
4305 {
4306 tgoto ();
4307   ;
4308   return 0;
4309 }
4310 _ACEOF
4311 rm -f conftest.$ac_objext conftest$ac_exeext
4312 if { (eval echo "$as_me:4312: \"$ac_link\"") >&5
4313   (eval $ac_link) 2>&5
4314   ac_status=$?
4315   echo "$as_me:4315: \$? = $ac_status" >&5
4316   (exit $ac_status); } &&
4317          { ac_try='test -s conftest$ac_exeext'
4318   { (eval echo "$as_me:4318: \"$ac_try\"") >&5
4319   (eval $ac_try) 2>&5
4320   ac_status=$?
4321   echo "$as_me:4321: \$? = $ac_status" >&5
4322   (exit $ac_status); }; }; then
4323   ac_cv_lib_mytinfo_tgoto=yes
4324 else
4325   echo "$as_me: failed program was:" >&5
4326 cat conftest.$ac_ext >&5
4327 ac_cv_lib_mytinfo_tgoto=no
4328 fi
4329 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4330 LIBS=$ac_check_lib_save_LIBS
4331 fi
4332 echo "$as_me:4332: result: $ac_cv_lib_mytinfo_tgoto" >&5
4333 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4334 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4335   LIBS="-lmytinfo $LIBS"
4336 fi
4337
4338     ;;
4339 hpux10.*) #(vi
4340     echo "$as_me:4340: checking for initscr in -lcur_colr" >&5
4341 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4342 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4343   echo $ECHO_N "(cached) $ECHO_C" >&6
4344 else
4345   ac_check_lib_save_LIBS=$LIBS
4346 LIBS="-lcur_colr  $LIBS"
4347 cat >conftest.$ac_ext <<_ACEOF
4348 #line 4348 "configure"
4349 #include "confdefs.h"
4350
4351 /* Override any gcc2 internal prototype to avoid an error.  */
4352 #ifdef __cplusplus
4353 extern "C"
4354 #endif
4355 /* We use char because int might match the return type of a gcc2
4356    builtin and then its argument prototype would still apply.  */
4357 char initscr ();
4358 int
4359 main ()
4360 {
4361 initscr ();
4362   ;
4363   return 0;
4364 }
4365 _ACEOF
4366 rm -f conftest.$ac_objext conftest$ac_exeext
4367 if { (eval echo "$as_me:4367: \"$ac_link\"") >&5
4368   (eval $ac_link) 2>&5
4369   ac_status=$?
4370   echo "$as_me:4370: \$? = $ac_status" >&5
4371   (exit $ac_status); } &&
4372          { ac_try='test -s conftest$ac_exeext'
4373   { (eval echo "$as_me:4373: \"$ac_try\"") >&5
4374   (eval $ac_try) 2>&5
4375   ac_status=$?
4376   echo "$as_me:4376: \$? = $ac_status" >&5
4377   (exit $ac_status); }; }; then
4378   ac_cv_lib_cur_colr_initscr=yes
4379 else
4380   echo "$as_me: failed program was:" >&5
4381 cat conftest.$ac_ext >&5
4382 ac_cv_lib_cur_colr_initscr=no
4383 fi
4384 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4385 LIBS=$ac_check_lib_save_LIBS
4386 fi
4387 echo "$as_me:4387: result: $ac_cv_lib_cur_colr_initscr" >&5
4388 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4389 if test $ac_cv_lib_cur_colr_initscr = yes; then
4390
4391         LIBS="-lcur_colr $LIBS"
4392         ac_cv_func_initscr=yes
4393
4394 else
4395
4396     echo "$as_me:4396: checking for initscr in -lHcurses" >&5
4397 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4398 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4399   echo $ECHO_N "(cached) $ECHO_C" >&6
4400 else
4401   ac_check_lib_save_LIBS=$LIBS
4402 LIBS="-lHcurses  $LIBS"
4403 cat >conftest.$ac_ext <<_ACEOF
4404 #line 4404 "configure"
4405 #include "confdefs.h"
4406
4407 /* Override any gcc2 internal prototype to avoid an error.  */
4408 #ifdef __cplusplus
4409 extern "C"
4410 #endif
4411 /* We use char because int might match the return type of a gcc2
4412    builtin and then its argument prototype would still apply.  */
4413 char initscr ();
4414 int
4415 main ()
4416 {
4417 initscr ();
4418   ;
4419   return 0;
4420 }
4421 _ACEOF
4422 rm -f conftest.$ac_objext conftest$ac_exeext
4423 if { (eval echo "$as_me:4423: \"$ac_link\"") >&5
4424   (eval $ac_link) 2>&5
4425   ac_status=$?
4426   echo "$as_me:4426: \$? = $ac_status" >&5
4427   (exit $ac_status); } &&
4428          { ac_try='test -s conftest$ac_exeext'
4429   { (eval echo "$as_me:4429: \"$ac_try\"") >&5
4430   (eval $ac_try) 2>&5
4431   ac_status=$?
4432   echo "$as_me:4432: \$? = $ac_status" >&5
4433   (exit $ac_status); }; }; then
4434   ac_cv_lib_Hcurses_initscr=yes
4435 else
4436   echo "$as_me: failed program was:" >&5
4437 cat conftest.$ac_ext >&5
4438 ac_cv_lib_Hcurses_initscr=no
4439 fi
4440 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4441 LIBS=$ac_check_lib_save_LIBS
4442 fi
4443 echo "$as_me:4443: result: $ac_cv_lib_Hcurses_initscr" >&5
4444 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
4445 if test $ac_cv_lib_Hcurses_initscr = yes; then
4446
4447         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
4448         LIBS="-lHcurses $LIBS"
4449         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
4450         ac_cv_func_initscr=yes
4451
4452 fi
4453
4454 fi
4455
4456     ;;
4457 linux*) # Suse Linux does not follow /usr/lib convention
4458
4459 if test -n "/lib" ; then
4460   for cf_add_libdir in /lib
4461   do
4462     if test $cf_add_libdir = /usr/lib ; then
4463       :
4464     elif test -d $cf_add_libdir
4465     then
4466       cf_have_libdir=no
4467       if test -n "$LDFLAGS$LIBS" ; then
4468         # a loop is needed to ensure we can add subdirs of existing dirs
4469         for cf_test_libdir in $LDFLAGS $LIBS ; do
4470           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4471             cf_have_libdir=yes; break
4472           fi
4473         done
4474       fi
4475       if test "$cf_have_libdir" = no ; then
4476         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4477
4478 echo "${as_me:-configure}:4478: testing adding $cf_add_libdir to library-path ..." 1>&5
4479
4480         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4481       fi
4482     fi
4483   done
4484 fi
4485
4486     ;;
4487 sunos3*|sunos4*)
4488     if test -d /usr/5lib ; then
4489
4490 if test -n "/usr/5lib" ; then
4491   for cf_add_libdir in /usr/5lib
4492   do
4493     if test $cf_add_libdir = /usr/lib ; then
4494       :
4495     elif test -d $cf_add_libdir
4496     then
4497       cf_have_libdir=no
4498       if test -n "$LDFLAGS$LIBS" ; then
4499         # a loop is needed to ensure we can add subdirs of existing dirs
4500         for cf_test_libdir in $LDFLAGS $LIBS ; do
4501           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4502             cf_have_libdir=yes; break
4503           fi
4504         done
4505       fi
4506       if test "$cf_have_libdir" = no ; then
4507         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4508
4509 echo "${as_me:-configure}:4509: testing adding $cf_add_libdir to library-path ..." 1>&5
4510
4511         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4512       fi
4513     fi
4514   done
4515 fi
4516
4517       LIBS="-lcurses -ltermcap $LIBS"
4518     fi
4519     ac_cv_func_initscr=yes
4520     ;;
4521 esac
4522
4523 if test ".$ac_cv_func_initscr" != .yes ; then
4524     cf_save_LIBS="$LIBS"
4525     cf_term_lib=""
4526     cf_curs_lib=""
4527
4528     if test ".${cf_cv_ncurses_version:-no}" != .no
4529     then
4530         cf_check_list="ncurses curses cursesX"
4531     else
4532         cf_check_list="cursesX curses ncurses"
4533     fi
4534
4535     # Check for library containing tgoto.  Do this before curses library
4536     # because it may be needed to link the test-case for initscr.
4537     echo "$as_me:4537: checking for tgoto" >&5
4538 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
4539 if test "${ac_cv_func_tgoto+set}" = set; then
4540   echo $ECHO_N "(cached) $ECHO_C" >&6
4541 else
4542   cat >conftest.$ac_ext <<_ACEOF
4543 #line 4543 "configure"
4544 #include "confdefs.h"
4545 /* System header to define __stub macros and hopefully few prototypes,
4546     which can conflict with char tgoto (); below.  */
4547 #include <assert.h>
4548 /* Override any gcc2 internal prototype to avoid an error.  */
4549 #ifdef __cplusplus
4550 extern "C"
4551 #endif
4552 /* We use char because int might match the return type of a gcc2
4553    builtin and then its argument prototype would still apply.  */
4554 char tgoto ();
4555 char (*f) ();
4556
4557 int
4558 main ()
4559 {
4560 /* The GNU C library defines this for functions which it implements
4561     to always fail with ENOSYS.  Some functions are actually named
4562     something starting with __ and the normal name is an alias.  */
4563 #if defined (__stub_tgoto) || defined (__stub___tgoto)
4564 choke me
4565 #else
4566 f = tgoto;
4567 #endif
4568
4569   ;
4570   return 0;
4571 }
4572 _ACEOF
4573 rm -f conftest.$ac_objext conftest$ac_exeext
4574 if { (eval echo "$as_me:4574: \"$ac_link\"") >&5
4575   (eval $ac_link) 2>&5
4576   ac_status=$?
4577   echo "$as_me:4577: \$? = $ac_status" >&5
4578   (exit $ac_status); } &&
4579          { ac_try='test -s conftest$ac_exeext'
4580   { (eval echo "$as_me:4580: \"$ac_try\"") >&5
4581   (eval $ac_try) 2>&5
4582   ac_status=$?
4583   echo "$as_me:4583: \$? = $ac_status" >&5
4584   (exit $ac_status); }; }; then
4585   ac_cv_func_tgoto=yes
4586 else
4587   echo "$as_me: failed program was:" >&5
4588 cat conftest.$ac_ext >&5
4589 ac_cv_func_tgoto=no
4590 fi
4591 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4592 fi
4593 echo "$as_me:4593: result: $ac_cv_func_tgoto" >&5
4594 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
4595 if test $ac_cv_func_tgoto = yes; then
4596   cf_term_lib=predefined
4597 else
4598
4599         for cf_term_lib in $cf_check_list termcap termlib unknown
4600         do
4601             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
4602 echo "$as_me:4602: checking for tgoto in -l$cf_term_lib" >&5
4603 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
4604 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
4605   echo $ECHO_N "(cached) $ECHO_C" >&6
4606 else
4607   ac_check_lib_save_LIBS=$LIBS
4608 LIBS="-l$cf_term_lib  $LIBS"
4609 cat >conftest.$ac_ext <<_ACEOF
4610 #line 4610 "configure"
4611 #include "confdefs.h"
4612
4613 /* Override any gcc2 internal prototype to avoid an error.  */
4614 #ifdef __cplusplus
4615 extern "C"
4616 #endif
4617 /* We use char because int might match the return type of a gcc2
4618    builtin and then its argument prototype would still apply.  */
4619 char tgoto ();
4620 int
4621 main ()
4622 {
4623 tgoto ();
4624   ;
4625   return 0;
4626 }
4627 _ACEOF
4628 rm -f conftest.$ac_objext conftest$ac_exeext
4629 if { (eval echo "$as_me:4629: \"$ac_link\"") >&5
4630   (eval $ac_link) 2>&5
4631   ac_status=$?
4632   echo "$as_me:4632: \$? = $ac_status" >&5
4633   (exit $ac_status); } &&
4634          { ac_try='test -s conftest$ac_exeext'
4635   { (eval echo "$as_me:4635: \"$ac_try\"") >&5
4636   (eval $ac_try) 2>&5
4637   ac_status=$?
4638   echo "$as_me:4638: \$? = $ac_status" >&5
4639   (exit $ac_status); }; }; then
4640   eval "$as_ac_Lib=yes"
4641 else
4642   echo "$as_me: failed program was:" >&5
4643 cat conftest.$ac_ext >&5
4644 eval "$as_ac_Lib=no"
4645 fi
4646 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4647 LIBS=$ac_check_lib_save_LIBS
4648 fi
4649 echo "$as_me:4649: result: `eval echo '${'$as_ac_Lib'}'`" >&5
4650 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
4651 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
4652   break
4653 fi
4654
4655         done
4656
4657 fi
4658
4659     # Check for library containing initscr
4660     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
4661         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
4662     do
4663         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
4664 echo "$as_me:4664: checking for initscr in -l$cf_curs_lib" >&5
4665 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
4666 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
4667   echo $ECHO_N "(cached) $ECHO_C" >&6
4668 else
4669   ac_check_lib_save_LIBS=$LIBS
4670 LIBS="-l$cf_curs_lib  $LIBS"
4671 cat >conftest.$ac_ext <<_ACEOF
4672 #line 4672 "configure"
4673 #include "confdefs.h"
4674
4675 /* Override any gcc2 internal prototype to avoid an error.  */
4676 #ifdef __cplusplus
4677 extern "C"
4678 #endif
4679 /* We use char because int might match the return type of a gcc2
4680    builtin and then its argument prototype would still apply.  */
4681 char initscr ();
4682 int
4683 main ()
4684 {
4685 initscr ();
4686   ;
4687   return 0;
4688 }
4689 _ACEOF
4690 rm -f conftest.$ac_objext conftest$ac_exeext
4691 if { (eval echo "$as_me:4691: \"$ac_link\"") >&5
4692   (eval $ac_link) 2>&5
4693   ac_status=$?
4694   echo "$as_me:4694: \$? = $ac_status" >&5
4695   (exit $ac_status); } &&
4696          { ac_try='test -s conftest$ac_exeext'
4697   { (eval echo "$as_me:4697: \"$ac_try\"") >&5
4698   (eval $ac_try) 2>&5
4699   ac_status=$?
4700   echo "$as_me:4700: \$? = $ac_status" >&5
4701   (exit $ac_status); }; }; then
4702   eval "$as_ac_Lib=yes"
4703 else
4704   echo "$as_me: failed program was:" >&5
4705 cat conftest.$ac_ext >&5
4706 eval "$as_ac_Lib=no"
4707 fi
4708 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4709 LIBS=$ac_check_lib_save_LIBS
4710 fi
4711 echo "$as_me:4711: result: `eval echo '${'$as_ac_Lib'}'`" >&5
4712 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
4713 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
4714   break
4715 fi
4716
4717     done
4718     test $cf_curs_lib = unknown && { { echo "$as_me:4718: error: no curses library found" >&5
4719 echo "$as_me: error: no curses library found" >&2;}
4720    { (exit 1); exit 1; }; }
4721
4722     LIBS="-l$cf_curs_lib $cf_save_LIBS"
4723     if test "$cf_term_lib" = unknown ; then
4724         echo "$as_me:4724: checking if we can link with $cf_curs_lib library" >&5
4725 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
4726         cat >conftest.$ac_ext <<_ACEOF
4727 #line 4727 "configure"
4728 #include "confdefs.h"
4729 #include <${cf_cv_ncurses_header:-curses.h}>
4730 int
4731 main ()
4732 {
4733 initscr()
4734   ;
4735   return 0;
4736 }
4737 _ACEOF
4738 rm -f conftest.$ac_objext conftest$ac_exeext
4739 if { (eval echo "$as_me:4739: \"$ac_link\"") >&5
4740   (eval $ac_link) 2>&5
4741   ac_status=$?
4742   echo "$as_me:4742: \$? = $ac_status" >&5
4743   (exit $ac_status); } &&
4744          { ac_try='test -s conftest$ac_exeext'
4745   { (eval echo "$as_me:4745: \"$ac_try\"") >&5
4746   (eval $ac_try) 2>&5
4747   ac_status=$?
4748   echo "$as_me:4748: \$? = $ac_status" >&5
4749   (exit $ac_status); }; }; then
4750   cf_result=yes
4751 else
4752   echo "$as_me: failed program was:" >&5
4753 cat conftest.$ac_ext >&5
4754 cf_result=no
4755 fi
4756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4757         echo "$as_me:4757: result: $cf_result" >&5
4758 echo "${ECHO_T}$cf_result" >&6
4759         test $cf_result = no && { { echo "$as_me:4759: error: Cannot link curses library" >&5
4760 echo "$as_me: error: Cannot link curses library" >&2;}
4761    { (exit 1); exit 1; }; }
4762     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
4763         :
4764     elif test "$cf_term_lib" != predefined ; then
4765         echo "$as_me:4765: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
4766 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
4767         cat >conftest.$ac_ext <<_ACEOF
4768 #line 4768 "configure"
4769 #include "confdefs.h"
4770 #include <${cf_cv_ncurses_header:-curses.h}>
4771 int
4772 main ()
4773 {
4774 initscr(); tgoto((char *)0, 0, 0);
4775   ;
4776   return 0;
4777 }
4778 _ACEOF
4779 rm -f conftest.$ac_objext conftest$ac_exeext
4780 if { (eval echo "$as_me:4780: \"$ac_link\"") >&5
4781   (eval $ac_link) 2>&5
4782   ac_status=$?
4783   echo "$as_me:4783: \$? = $ac_status" >&5
4784   (exit $ac_status); } &&
4785          { ac_try='test -s conftest$ac_exeext'
4786   { (eval echo "$as_me:4786: \"$ac_try\"") >&5
4787   (eval $ac_try) 2>&5
4788   ac_status=$?
4789   echo "$as_me:4789: \$? = $ac_status" >&5
4790   (exit $ac_status); }; }; then
4791   cf_result=no
4792 else
4793   echo "$as_me: failed program was:" >&5
4794 cat conftest.$ac_ext >&5
4795
4796             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
4797             cat >conftest.$ac_ext <<_ACEOF
4798 #line 4798 "configure"
4799 #include "confdefs.h"
4800 #include <${cf_cv_ncurses_header:-curses.h}>
4801 int
4802 main ()
4803 {
4804 initscr()
4805   ;
4806   return 0;
4807 }
4808 _ACEOF
4809 rm -f conftest.$ac_objext conftest$ac_exeext
4810 if { (eval echo "$as_me:4810: \"$ac_link\"") >&5
4811   (eval $ac_link) 2>&5
4812   ac_status=$?
4813   echo "$as_me:4813: \$? = $ac_status" >&5
4814   (exit $ac_status); } &&
4815          { ac_try='test -s conftest$ac_exeext'
4816   { (eval echo "$as_me:4816: \"$ac_try\"") >&5
4817   (eval $ac_try) 2>&5
4818   ac_status=$?
4819   echo "$as_me:4819: \$? = $ac_status" >&5
4820   (exit $ac_status); }; }; then
4821   cf_result=yes
4822 else
4823   echo "$as_me: failed program was:" >&5
4824 cat conftest.$ac_ext >&5
4825 cf_result=error
4826 fi
4827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4828
4829 fi
4830 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4831         echo "$as_me:4831: result: $cf_result" >&5
4832 echo "${ECHO_T}$cf_result" >&6
4833     fi
4834 fi
4835 fi
4836
4837         ;;
4838 ncurses)
4839
4840 cf_ncuconfig_root=ncurses
4841
4842 echo "Looking for ${cf_ncuconfig_root}-config"
4843 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4844 do
4845   # Extract the first word of "$ac_prog", so it can be a program name with args.
4846 set dummy $ac_prog; ac_word=$2
4847 echo "$as_me:4847: checking for $ac_word" >&5
4848 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4849 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
4850   echo $ECHO_N "(cached) $ECHO_C" >&6
4851 else
4852   case $NCURSES_CONFIG in
4853   [\\/]* | ?:[\\/]*)
4854   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
4855   ;;
4856   *)
4857   ac_save_IFS=$IFS; IFS=$ac_path_separator
4858 ac_dummy="$PATH"
4859 for ac_dir in $ac_dummy; do
4860   IFS=$ac_save_IFS
4861   test -z "$ac_dir" && ac_dir=.
4862   if $as_executable_p "$ac_dir/$ac_word"; then
4863    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
4864    echo "$as_me:4864: found $ac_dir/$ac_word" >&5
4865    break
4866 fi
4867 done
4868
4869   ;;
4870 esac
4871 fi
4872 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
4873
4874 if test -n "$NCURSES_CONFIG"; then
4875   echo "$as_me:4875: result: $NCURSES_CONFIG" >&5
4876 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4877 else
4878   echo "$as_me:4878: result: no" >&5
4879 echo "${ECHO_T}no" >&6
4880 fi
4881
4882   test -n "$NCURSES_CONFIG" && break
4883 done
4884 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
4885
4886 if test "$NCURSES_CONFIG" != none ; then
4887
4888 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4889 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
4890
4891 # even with config script, some packages use no-override for curses.h
4892
4893 echo "$as_me:4893: checking if we have identified curses headers" >&5
4894 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4895 if test "${cf_cv_ncurses_header+set}" = set; then
4896   echo $ECHO_N "(cached) $ECHO_C" >&6
4897 else
4898
4899 cf_cv_ncurses_header=none
4900 for cf_header in  \
4901     ncurses/curses.h \
4902         ncurses/ncurses.h \
4903         curses.h \
4904         ncurses.h
4905 do
4906 cat >conftest.$ac_ext <<_ACEOF
4907 #line 4907 "configure"
4908 #include "confdefs.h"
4909 #include <${cf_header}>
4910 int
4911 main ()
4912 {
4913 initscr(); tgoto("?", 0,0)
4914   ;
4915   return 0;
4916 }
4917 _ACEOF
4918 rm -f conftest.$ac_objext
4919 if { (eval echo "$as_me:4919: \"$ac_compile\"") >&5
4920   (eval $ac_compile) 2>&5
4921   ac_status=$?
4922   echo "$as_me:4922: \$? = $ac_status" >&5
4923   (exit $ac_status); } &&
4924          { ac_try='test -s conftest.$ac_objext'
4925   { (eval echo "$as_me:4925: \"$ac_try\"") >&5
4926   (eval $ac_try) 2>&5
4927   ac_status=$?
4928   echo "$as_me:4928: \$? = $ac_status" >&5
4929   (exit $ac_status); }; }; then
4930   cf_cv_ncurses_header=$cf_header; break
4931 else
4932   echo "$as_me: failed program was:" >&5
4933 cat conftest.$ac_ext >&5
4934 fi
4935 rm -f conftest.$ac_objext conftest.$ac_ext
4936 done
4937
4938 fi
4939 echo "$as_me:4939: result: $cf_cv_ncurses_header" >&5
4940 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4941
4942 if test "$cf_cv_ncurses_header" = none ; then
4943         { { echo "$as_me:4943: error: No curses header-files found" >&5
4944 echo "$as_me: error: No curses header-files found" >&2;}
4945    { (exit 1); exit 1; }; }
4946 fi
4947
4948 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4949
4950 for ac_header in $cf_cv_ncurses_header
4951 do
4952 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4953 echo "$as_me:4953: checking for $ac_header" >&5
4954 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4955 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4956   echo $ECHO_N "(cached) $ECHO_C" >&6
4957 else
4958   cat >conftest.$ac_ext <<_ACEOF
4959 #line 4959 "configure"
4960 #include "confdefs.h"
4961 #include <$ac_header>
4962 _ACEOF
4963 if { (eval echo "$as_me:4963: \"$ac_cpp conftest.$ac_ext\"") >&5
4964   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4965   ac_status=$?
4966   egrep -v '^ *\+' conftest.er1 >conftest.err
4967   rm -f conftest.er1
4968   cat conftest.err >&5
4969   echo "$as_me:4969: \$? = $ac_status" >&5
4970   (exit $ac_status); } >/dev/null; then
4971   if test -s conftest.err; then
4972     ac_cpp_err=$ac_c_preproc_warn_flag
4973   else
4974     ac_cpp_err=
4975   fi
4976 else
4977   ac_cpp_err=yes
4978 fi
4979 if test -z "$ac_cpp_err"; then
4980   eval "$as_ac_Header=yes"
4981 else
4982   echo "$as_me: failed program was:" >&5
4983   cat conftest.$ac_ext >&5
4984   eval "$as_ac_Header=no"
4985 fi
4986 rm -f conftest.err conftest.$ac_ext
4987 fi
4988 echo "$as_me:4988: result: `eval echo '${'$as_ac_Header'}'`" >&5
4989 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4990 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4991   cat >>confdefs.h <<EOF
4992 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4993 EOF
4994
4995 fi
4996 done
4997
4998 cat >>confdefs.h <<\EOF
4999 #define NCURSES 1
5000 EOF
5001
5002 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5003
5004 cat >>confdefs.h <<EOF
5005 #define $cf_nculib_ROOT 1
5006 EOF
5007
5008 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5009
5010 else
5011
5012 cf_ncuhdr_root=ncurses
5013
5014 test -n "$cf_cv_curses_dir" && \
5015 test "$cf_cv_curses_dir" != "no" && { \
5016
5017 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5018   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
5019   do
5020         while test $cf_add_incdir != /usr/include
5021         do
5022           if test -d $cf_add_incdir
5023           then
5024                 cf_have_incdir=no
5025                 if test -n "$CFLAGS$CPPFLAGS" ; then
5026                   # a loop is needed to ensure we can add subdirs of existing dirs
5027                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5028                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5029                           cf_have_incdir=yes; break
5030                         fi
5031                   done
5032                 fi
5033
5034                 if test "$cf_have_incdir" = no ; then
5035                   if test "$cf_add_incdir" = /usr/local/include ; then
5036                         if test "$GCC" = yes
5037                         then
5038                           cf_save_CPPFLAGS=$CPPFLAGS
5039                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5040                           cat >conftest.$ac_ext <<_ACEOF
5041 #line 5041 "configure"
5042 #include "confdefs.h"
5043 #include <stdio.h>
5044 int
5045 main ()
5046 {
5047 printf("Hello")
5048   ;
5049   return 0;
5050 }
5051 _ACEOF
5052 rm -f conftest.$ac_objext
5053 if { (eval echo "$as_me:5053: \"$ac_compile\"") >&5
5054   (eval $ac_compile) 2>&5
5055   ac_status=$?
5056   echo "$as_me:5056: \$? = $ac_status" >&5
5057   (exit $ac_status); } &&
5058          { ac_try='test -s conftest.$ac_objext'
5059   { (eval echo "$as_me:5059: \"$ac_try\"") >&5
5060   (eval $ac_try) 2>&5
5061   ac_status=$?
5062   echo "$as_me:5062: \$? = $ac_status" >&5
5063   (exit $ac_status); }; }; then
5064   :
5065 else
5066   echo "$as_me: failed program was:" >&5
5067 cat conftest.$ac_ext >&5
5068 cf_have_incdir=yes
5069 fi
5070 rm -f conftest.$ac_objext conftest.$ac_ext
5071                           CPPFLAGS=$cf_save_CPPFLAGS
5072                         fi
5073                   fi
5074                 fi
5075
5076                 if test "$cf_have_incdir" = no ; then
5077                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5078
5079 echo "${as_me:-configure}:5079: testing adding $cf_add_incdir to include-path ..." 1>&5
5080
5081                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5082
5083                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5084                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5085                   cf_add_incdir="$cf_top_incdir"
5086                 else
5087                   break
5088                 fi
5089           fi
5090         done
5091   done
5092 fi
5093
5094 }
5095
5096 echo "$as_me:5096: checking for $cf_ncuhdr_root header in include-path" >&5
5097 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5098 if test "${cf_cv_ncurses_h+set}" = set; then
5099   echo $ECHO_N "(cached) $ECHO_C" >&6
5100 else
5101
5102         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5103         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5104         for cf_header in $cf_header_list
5105         do
5106
5107         cat >conftest.$ac_ext <<_ACEOF
5108 #line 5108 "configure"
5109 #include "confdefs.h"
5110
5111 #include <$cf_header>
5112 int
5113 main ()
5114 {
5115
5116 #ifdef NCURSES_VERSION
5117
5118 printf("%s\n", NCURSES_VERSION);
5119 #else
5120 #ifdef __NCURSES_H
5121 printf("old\n");
5122 #else
5123         make an error
5124 #endif
5125 #endif
5126
5127   ;
5128   return 0;
5129 }
5130 _ACEOF
5131 rm -f conftest.$ac_objext
5132 if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5
5133   (eval $ac_compile) 2>&5
5134   ac_status=$?
5135   echo "$as_me:5135: \$? = $ac_status" >&5
5136   (exit $ac_status); } &&
5137          { ac_try='test -s conftest.$ac_objext'
5138   { (eval echo "$as_me:5138: \"$ac_try\"") >&5
5139   (eval $ac_try) 2>&5
5140   ac_status=$?
5141   echo "$as_me:5141: \$? = $ac_status" >&5
5142   (exit $ac_status); }; }; then
5143   cf_cv_ncurses_h=$cf_header
5144
5145 else
5146   echo "$as_me: failed program was:" >&5
5147 cat conftest.$ac_ext >&5
5148 cf_cv_ncurses_h=no
5149 fi
5150 rm -f conftest.$ac_objext conftest.$ac_ext
5151
5152                 test "$cf_cv_ncurses_h" != no && break
5153         done
5154
5155 fi
5156 echo "$as_me:5156: result: $cf_cv_ncurses_h" >&5
5157 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5158
5159 if test "$cf_cv_ncurses_h" != no ; then
5160         cf_cv_ncurses_header=$cf_cv_ncurses_h
5161 else
5162
5163 echo "$as_me:5163: checking for $cf_ncuhdr_root include-path" >&5
5164 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5165 if test "${cf_cv_ncurses_h2+set}" = set; then
5166   echo $ECHO_N "(cached) $ECHO_C" >&6
5167 else
5168
5169         test -n "$verbose" && echo
5170
5171 cf_search=
5172
5173 # collect the current set of include-directories from compiler flags
5174 cf_header_path_list=""
5175 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5176         for cf_header_path in $CPPFLAGS $CFLAGS
5177         do
5178                 case $cf_header_path in #(vi
5179                 -I*)
5180                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5181
5182 test "$cf_header_path" != "NONE" && \
5183 test -d "$cf_header_path" && \
5184  {
5185         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5186         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5187         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5188         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5189         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5190         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"
5191 }
5192
5193                         cf_header_path_list="$cf_header_path_list $cf_search"
5194                         ;;
5195                 esac
5196         done
5197 fi
5198
5199 # add the variations for the package we are looking for
5200
5201 cf_search=
5202
5203 test "/usr" != "$prefix" && \
5204 test -d "/usr" && \
5205 (test $prefix = NONE || test "/usr" != "$prefix") && {
5206         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5207         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5208         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5209         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5210         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5211         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5212 }
5213
5214 test "$prefix" != "NONE" && \
5215 test -d "$prefix" && \
5216  {
5217         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5218         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5219         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5220         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5221         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5222         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5223 }
5224
5225 test "/usr/local" != "$prefix" && \
5226 test -d "/usr/local" && \
5227 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
5228         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5229         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5230         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5231         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5232         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5233         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5234 }
5235
5236 test "/opt" != "$prefix" && \
5237 test -d "/opt" && \
5238 (test $prefix = NONE || test "/opt" != "$prefix") && {
5239         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5240         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5241         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5242         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5243         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5244         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5245 }
5246
5247 test "$HOME" != "$prefix" && \
5248 test -d "$HOME" && \
5249 (test $prefix = NONE || test "$HOME" != "$prefix") && {
5250         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5251         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5252         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5253         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5254         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5255         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5256 }
5257
5258 test "$includedir" != NONE && \
5259 test "$includedir" != "/usr/include" && \
5260 test -d "$includedir" && {
5261         test -d $includedir &&    cf_search="$cf_search $includedir"
5262         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5263 }
5264
5265 test "$oldincludedir" != NONE && \
5266 test "$oldincludedir" != "/usr/include" && \
5267 test -d "$oldincludedir" && {
5268         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5269         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5270 }
5271
5272 cf_search="$cf_search $cf_header_path_list"
5273
5274         test -n "$verbose" && echo search path $cf_search
5275         cf_save2_CPPFLAGS="$CPPFLAGS"
5276         for cf_incdir in $cf_search
5277         do
5278
5279 if test -n "$cf_incdir" ; then
5280   for cf_add_incdir in $cf_incdir
5281   do
5282         while test $cf_add_incdir != /usr/include
5283         do
5284           if test -d $cf_add_incdir
5285           then
5286                 cf_have_incdir=no
5287                 if test -n "$CFLAGS$CPPFLAGS" ; then
5288                   # a loop is needed to ensure we can add subdirs of existing dirs
5289                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5290                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5291                           cf_have_incdir=yes; break
5292                         fi
5293                   done
5294                 fi
5295
5296                 if test "$cf_have_incdir" = no ; then
5297                   if test "$cf_add_incdir" = /usr/local/include ; then
5298                         if test "$GCC" = yes
5299                         then
5300                           cf_save_CPPFLAGS=$CPPFLAGS
5301                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5302                           cat >conftest.$ac_ext <<_ACEOF
5303 #line 5303 "configure"
5304 #include "confdefs.h"
5305 #include <stdio.h>
5306 int
5307 main ()
5308 {
5309 printf("Hello")
5310   ;
5311   return 0;
5312 }
5313 _ACEOF
5314 rm -f conftest.$ac_objext
5315 if { (eval echo "$as_me:5315: \"$ac_compile\"") >&5
5316   (eval $ac_compile) 2>&5
5317   ac_status=$?
5318   echo "$as_me:5318: \$? = $ac_status" >&5
5319   (exit $ac_status); } &&
5320          { ac_try='test -s conftest.$ac_objext'
5321   { (eval echo "$as_me:5321: \"$ac_try\"") >&5
5322   (eval $ac_try) 2>&5
5323   ac_status=$?
5324   echo "$as_me:5324: \$? = $ac_status" >&5
5325   (exit $ac_status); }; }; then
5326   :
5327 else
5328   echo "$as_me: failed program was:" >&5
5329 cat conftest.$ac_ext >&5
5330 cf_have_incdir=yes
5331 fi
5332 rm -f conftest.$ac_objext conftest.$ac_ext
5333                           CPPFLAGS=$cf_save_CPPFLAGS
5334                         fi
5335                   fi
5336                 fi
5337
5338                 if test "$cf_have_incdir" = no ; then
5339                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5340
5341 echo "${as_me:-configure}:5341: testing adding $cf_add_incdir to include-path ..." 1>&5
5342
5343                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5344
5345                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5346                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5347                   cf_add_incdir="$cf_top_incdir"
5348                 else
5349                   break
5350                 fi
5351           fi
5352         done
5353   done
5354 fi
5355
5356                 for cf_header in \
5357                         ncurses.h \
5358                         curses.h
5359                 do
5360
5361         cat >conftest.$ac_ext <<_ACEOF
5362 #line 5362 "configure"
5363 #include "confdefs.h"
5364
5365 #include <$cf_header>
5366 int
5367 main ()
5368 {
5369
5370 #ifdef NCURSES_VERSION
5371
5372 printf("%s\n", NCURSES_VERSION);
5373 #else
5374 #ifdef __NCURSES_H
5375 printf("old\n");
5376 #else
5377         make an error
5378 #endif
5379 #endif
5380
5381   ;
5382   return 0;
5383 }
5384 _ACEOF
5385 rm -f conftest.$ac_objext
5386 if { (eval echo "$as_me:5386: \"$ac_compile\"") >&5
5387   (eval $ac_compile) 2>&5
5388   ac_status=$?
5389   echo "$as_me:5389: \$? = $ac_status" >&5
5390   (exit $ac_status); } &&
5391          { ac_try='test -s conftest.$ac_objext'
5392   { (eval echo "$as_me:5392: \"$ac_try\"") >&5
5393   (eval $ac_try) 2>&5
5394   ac_status=$?
5395   echo "$as_me:5395: \$? = $ac_status" >&5
5396   (exit $ac_status); }; }; then
5397   cf_cv_ncurses_h2=$cf_header
5398
5399 else
5400   echo "$as_me: failed program was:" >&5
5401 cat conftest.$ac_ext >&5
5402 cf_cv_ncurses_h2=no
5403 fi
5404 rm -f conftest.$ac_objext conftest.$ac_ext
5405
5406                         if test "$cf_cv_ncurses_h2" != no ; then
5407                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5408                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5409                                 break
5410                         fi
5411                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5412                 done
5413                 CPPFLAGS="$cf_save2_CPPFLAGS"
5414                 test "$cf_cv_ncurses_h2" != no && break
5415         done
5416         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5416: error: not found" >&5
5417 echo "$as_me: error: not found" >&2;}
5418    { (exit 1); exit 1; }; }
5419
5420 fi
5421 echo "$as_me:5421: result: $cf_cv_ncurses_h2" >&5
5422 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5423
5424         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5425         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5426         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5427                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5428         fi
5429
5430 if test -n "$cf_1st_incdir" ; then
5431   for cf_add_incdir in $cf_1st_incdir
5432   do
5433         while test $cf_add_incdir != /usr/include
5434         do
5435           if test -d $cf_add_incdir
5436           then
5437                 cf_have_incdir=no
5438                 if test -n "$CFLAGS$CPPFLAGS" ; then
5439                   # a loop is needed to ensure we can add subdirs of existing dirs
5440                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5441                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5442                           cf_have_incdir=yes; break
5443                         fi
5444                   done
5445                 fi
5446
5447                 if test "$cf_have_incdir" = no ; then
5448                   if test "$cf_add_incdir" = /usr/local/include ; then
5449                         if test "$GCC" = yes
5450                         then
5451                           cf_save_CPPFLAGS=$CPPFLAGS
5452                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5453                           cat >conftest.$ac_ext <<_ACEOF
5454 #line 5454 "configure"
5455 #include "confdefs.h"
5456 #include <stdio.h>
5457 int
5458 main ()
5459 {
5460 printf("Hello")
5461   ;
5462   return 0;
5463 }
5464 _ACEOF
5465 rm -f conftest.$ac_objext
5466 if { (eval echo "$as_me:5466: \"$ac_compile\"") >&5
5467   (eval $ac_compile) 2>&5
5468   ac_status=$?
5469   echo "$as_me:5469: \$? = $ac_status" >&5
5470   (exit $ac_status); } &&
5471          { ac_try='test -s conftest.$ac_objext'
5472   { (eval echo "$as_me:5472: \"$ac_try\"") >&5
5473   (eval $ac_try) 2>&5
5474   ac_status=$?
5475   echo "$as_me:5475: \$? = $ac_status" >&5
5476   (exit $ac_status); }; }; then
5477   :
5478 else
5479   echo "$as_me: failed program was:" >&5
5480 cat conftest.$ac_ext >&5
5481 cf_have_incdir=yes
5482 fi
5483 rm -f conftest.$ac_objext conftest.$ac_ext
5484                           CPPFLAGS=$cf_save_CPPFLAGS
5485                         fi
5486                   fi
5487                 fi
5488
5489                 if test "$cf_have_incdir" = no ; then
5490                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5491
5492 echo "${as_me:-configure}:5492: testing adding $cf_add_incdir to include-path ..." 1>&5
5493
5494                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5495
5496                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5497                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5498                   cf_add_incdir="$cf_top_incdir"
5499                 else
5500                   break
5501                 fi
5502           fi
5503         done
5504   done
5505 fi
5506
5507 fi
5508
5509 # Set definitions to allow ifdef'ing for ncurses.h
5510
5511 case $cf_cv_ncurses_header in # (vi
5512 *ncurses.h)
5513         cat >>confdefs.h <<\EOF
5514 #define HAVE_NCURSES_H 1
5515 EOF
5516
5517         ;;
5518 esac
5519
5520 case $cf_cv_ncurses_header in # (vi
5521 ncurses/curses.h|ncurses/ncurses.h)
5522         cat >>confdefs.h <<\EOF
5523 #define HAVE_NCURSES_NCURSES_H 1
5524 EOF
5525
5526         ;;
5527 ncursesw/curses.h|ncursesw/ncurses.h)
5528         cat >>confdefs.h <<\EOF
5529 #define HAVE_NCURSESW_NCURSES_H 1
5530 EOF
5531
5532         ;;
5533 esac
5534
5535 echo "$as_me:5535: checking for terminfo header" >&5
5536 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5537 if test "${cf_cv_term_header+set}" = set; then
5538   echo $ECHO_N "(cached) $ECHO_C" >&6
5539 else
5540
5541 case ${cf_cv_ncurses_header} in #(vi
5542 */ncurses.h|*/ncursesw.h) #(vi
5543         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5544         ;;
5545 *)
5546         cf_term_header=term.h
5547         ;;
5548 esac
5549
5550 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5551 do
5552 cat >conftest.$ac_ext <<_ACEOF
5553 #line 5553 "configure"
5554 #include "confdefs.h"
5555 #include <stdio.h>
5556 #include <${cf_cv_ncurses_header:-curses.h}>
5557 #include <$cf_test>
5558
5559 int
5560 main ()
5561 {
5562 int x = auto_left_margin
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
5580         cf_cv_term_header="$cf_test"
5581 else
5582   echo "$as_me: failed program was:" >&5
5583 cat conftest.$ac_ext >&5
5584
5585         cf_cv_term_header=unknown
5586
5587 fi
5588 rm -f conftest.$ac_objext conftest.$ac_ext
5589         test "$cf_cv_term_header" != unknown && break
5590 done
5591
5592 fi
5593 echo "$as_me:5593: result: $cf_cv_term_header" >&5
5594 echo "${ECHO_T}$cf_cv_term_header" >&6
5595
5596 # Set definitions to allow ifdef'ing to accommodate subdirectories
5597
5598 case $cf_cv_term_header in # (vi
5599 *term.h)
5600         cat >>confdefs.h <<\EOF
5601 #define HAVE_TERM_H 1
5602 EOF
5603
5604         ;;
5605 esac
5606
5607 case $cf_cv_term_header in # (vi
5608 ncurses/term.h) #(vi
5609         cat >>confdefs.h <<\EOF
5610 #define HAVE_NCURSES_TERM_H 1
5611 EOF
5612
5613         ;;
5614 ncursesw/term.h)
5615         cat >>confdefs.h <<\EOF
5616 #define HAVE_NCURSESW_TERM_H 1
5617 EOF
5618
5619         ;;
5620 esac
5621
5622 # some applications need this, but should check for NCURSES_VERSION
5623 cat >>confdefs.h <<\EOF
5624 #define NCURSES 1
5625 EOF
5626
5627 echo "$as_me:5627: checking for ncurses version" >&5
5628 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5629 if test "${cf_cv_ncurses_version+set}" = set; then
5630   echo $ECHO_N "(cached) $ECHO_C" >&6
5631 else
5632
5633         cf_cv_ncurses_version=no
5634         cf_tempfile=out$$
5635         rm -f $cf_tempfile
5636         if test "$cross_compiling" = yes; then
5637
5638         # This will not work if the preprocessor splits the line after the
5639         # Autoconf token.  The 'unproto' program does that.
5640         cat > conftest.$ac_ext <<EOF
5641 #include <${cf_cv_ncurses_header:-curses.h}>
5642 #undef Autoconf
5643 #ifdef NCURSES_VERSION
5644 Autoconf NCURSES_VERSION
5645 #else
5646 #ifdef __NCURSES_H
5647 Autoconf "old"
5648 #endif
5649 ;
5650 #endif
5651 EOF
5652         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5653         { (eval echo "$as_me:5653: \"$cf_try\"") >&5
5654   (eval $cf_try) 2>&5
5655   ac_status=$?
5656   echo "$as_me:5656: \$? = $ac_status" >&5
5657   (exit $ac_status); }
5658         if test -f conftest.out ; then
5659                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5660                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5661                 rm -f conftest.out
5662         fi
5663
5664 else
5665   cat >conftest.$ac_ext <<_ACEOF
5666 #line 5666 "configure"
5667 #include "confdefs.h"
5668
5669 #include <${cf_cv_ncurses_header:-curses.h}>
5670 #include <stdio.h>
5671 int main()
5672 {
5673         FILE *fp = fopen("$cf_tempfile", "w");
5674 #ifdef NCURSES_VERSION
5675 # ifdef NCURSES_VERSION_PATCH
5676         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5677 # else
5678         fprintf(fp, "%s\n", NCURSES_VERSION);
5679 # endif
5680 #else
5681 # ifdef __NCURSES_H
5682         fprintf(fp, "old\n");
5683 # else
5684         make an error
5685 # endif
5686 #endif
5687         ${cf_cv_main_return:-return}(0);
5688 }
5689 _ACEOF
5690 rm -f conftest$ac_exeext
5691 if { (eval echo "$as_me:5691: \"$ac_link\"") >&5
5692   (eval $ac_link) 2>&5
5693   ac_status=$?
5694   echo "$as_me:5694: \$? = $ac_status" >&5
5695   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5696   { (eval echo "$as_me:5696: \"$ac_try\"") >&5
5697   (eval $ac_try) 2>&5
5698   ac_status=$?
5699   echo "$as_me:5699: \$? = $ac_status" >&5
5700   (exit $ac_status); }; }; then
5701
5702         cf_cv_ncurses_version=`cat $cf_tempfile`
5703 else
5704   echo "$as_me: program exited with status $ac_status" >&5
5705 echo "$as_me: failed program was:" >&5
5706 cat conftest.$ac_ext >&5
5707 fi
5708 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5709 fi
5710         rm -f $cf_tempfile
5711
5712 fi
5713 echo "$as_me:5713: result: $cf_cv_ncurses_version" >&5
5714 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5715 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5716 #define NCURSES 1
5717 EOF
5718
5719 cf_nculib_root=ncurses
5720         # This works, except for the special case where we find gpm, but
5721         # ncurses is in a nonstandard location via $LIBS, and we really want
5722         # to link gpm.
5723 cf_ncurses_LIBS=""
5724 cf_ncurses_SAVE="$LIBS"
5725 echo "$as_me:5725: checking for Gpm_Open in -lgpm" >&5
5726 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5727 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5728   echo $ECHO_N "(cached) $ECHO_C" >&6
5729 else
5730   ac_check_lib_save_LIBS=$LIBS
5731 LIBS="-lgpm  $LIBS"
5732 cat >conftest.$ac_ext <<_ACEOF
5733 #line 5733 "configure"
5734 #include "confdefs.h"
5735
5736 /* Override any gcc2 internal prototype to avoid an error.  */
5737 #ifdef __cplusplus
5738 extern "C"
5739 #endif
5740 /* We use char because int might match the return type of a gcc2
5741    builtin and then its argument prototype would still apply.  */
5742 char Gpm_Open ();
5743 int
5744 main ()
5745 {
5746 Gpm_Open ();
5747   ;
5748   return 0;
5749 }
5750 _ACEOF
5751 rm -f conftest.$ac_objext conftest$ac_exeext
5752 if { (eval echo "$as_me:5752: \"$ac_link\"") >&5
5753   (eval $ac_link) 2>&5
5754   ac_status=$?
5755   echo "$as_me:5755: \$? = $ac_status" >&5
5756   (exit $ac_status); } &&
5757          { ac_try='test -s conftest$ac_exeext'
5758   { (eval echo "$as_me:5758: \"$ac_try\"") >&5
5759   (eval $ac_try) 2>&5
5760   ac_status=$?
5761   echo "$as_me:5761: \$? = $ac_status" >&5
5762   (exit $ac_status); }; }; then
5763   ac_cv_lib_gpm_Gpm_Open=yes
5764 else
5765   echo "$as_me: failed program was:" >&5
5766 cat conftest.$ac_ext >&5
5767 ac_cv_lib_gpm_Gpm_Open=no
5768 fi
5769 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5770 LIBS=$ac_check_lib_save_LIBS
5771 fi
5772 echo "$as_me:5772: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5773 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5774 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5775   echo "$as_me:5775: checking for initscr in -lgpm" >&5
5776 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5777 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5778   echo $ECHO_N "(cached) $ECHO_C" >&6
5779 else
5780   ac_check_lib_save_LIBS=$LIBS
5781 LIBS="-lgpm  $LIBS"
5782 cat >conftest.$ac_ext <<_ACEOF
5783 #line 5783 "configure"
5784 #include "confdefs.h"
5785
5786 /* Override any gcc2 internal prototype to avoid an error.  */
5787 #ifdef __cplusplus
5788 extern "C"
5789 #endif
5790 /* We use char because int might match the return type of a gcc2
5791    builtin and then its argument prototype would still apply.  */
5792 char initscr ();
5793 int
5794 main ()
5795 {
5796 initscr ();
5797   ;
5798   return 0;
5799 }
5800 _ACEOF
5801 rm -f conftest.$ac_objext conftest$ac_exeext
5802 if { (eval echo "$as_me:5802: \"$ac_link\"") >&5
5803   (eval $ac_link) 2>&5
5804   ac_status=$?
5805   echo "$as_me:5805: \$? = $ac_status" >&5
5806   (exit $ac_status); } &&
5807          { ac_try='test -s conftest$ac_exeext'
5808   { (eval echo "$as_me:5808: \"$ac_try\"") >&5
5809   (eval $ac_try) 2>&5
5810   ac_status=$?
5811   echo "$as_me:5811: \$? = $ac_status" >&5
5812   (exit $ac_status); }; }; then
5813   ac_cv_lib_gpm_initscr=yes
5814 else
5815   echo "$as_me: failed program was:" >&5
5816 cat conftest.$ac_ext >&5
5817 ac_cv_lib_gpm_initscr=no
5818 fi
5819 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5820 LIBS=$ac_check_lib_save_LIBS
5821 fi
5822 echo "$as_me:5822: result: $ac_cv_lib_gpm_initscr" >&5
5823 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5824 if test $ac_cv_lib_gpm_initscr = yes; then
5825   LIBS="$cf_ncurses_SAVE"
5826 else
5827   cf_ncurses_LIBS="-lgpm"
5828 fi
5829
5830 fi
5831
5832 case $host_os in #(vi
5833 freebsd*)
5834         # This is only necessary if you are linking against an obsolete
5835         # version of ncurses (but it should do no harm, since it's static).
5836         if test "$cf_nculib_root" = ncurses ; then
5837                 echo "$as_me:5837: checking for tgoto in -lmytinfo" >&5
5838 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5839 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5840   echo $ECHO_N "(cached) $ECHO_C" >&6
5841 else
5842   ac_check_lib_save_LIBS=$LIBS
5843 LIBS="-lmytinfo  $LIBS"
5844 cat >conftest.$ac_ext <<_ACEOF
5845 #line 5845 "configure"
5846 #include "confdefs.h"
5847
5848 /* Override any gcc2 internal prototype to avoid an error.  */
5849 #ifdef __cplusplus
5850 extern "C"
5851 #endif
5852 /* We use char because int might match the return type of a gcc2
5853    builtin and then its argument prototype would still apply.  */
5854 char tgoto ();
5855 int
5856 main ()
5857 {
5858 tgoto ();
5859   ;
5860   return 0;
5861 }
5862 _ACEOF
5863 rm -f conftest.$ac_objext conftest$ac_exeext
5864 if { (eval echo "$as_me:5864: \"$ac_link\"") >&5
5865   (eval $ac_link) 2>&5
5866   ac_status=$?
5867   echo "$as_me:5867: \$? = $ac_status" >&5
5868   (exit $ac_status); } &&
5869          { ac_try='test -s conftest$ac_exeext'
5870   { (eval echo "$as_me:5870: \"$ac_try\"") >&5
5871   (eval $ac_try) 2>&5
5872   ac_status=$?
5873   echo "$as_me:5873: \$? = $ac_status" >&5
5874   (exit $ac_status); }; }; then
5875   ac_cv_lib_mytinfo_tgoto=yes
5876 else
5877   echo "$as_me: failed program was:" >&5
5878 cat conftest.$ac_ext >&5
5879 ac_cv_lib_mytinfo_tgoto=no
5880 fi
5881 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5882 LIBS=$ac_check_lib_save_LIBS
5883 fi
5884 echo "$as_me:5884: result: $ac_cv_lib_mytinfo_tgoto" >&5
5885 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5886 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5887   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5888 fi
5889
5890         fi
5891         ;;
5892 esac
5893
5894 LIBS="$cf_ncurses_LIBS $LIBS"
5895
5896 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5897 then
5898
5899 if test -n "$cf_cv_curses_dir/lib" ; then
5900   for cf_add_libdir in $cf_cv_curses_dir/lib
5901   do
5902     if test $cf_add_libdir = /usr/lib ; then
5903       :
5904     elif test -d $cf_add_libdir
5905     then
5906       cf_have_libdir=no
5907       if test -n "$LDFLAGS$LIBS" ; then
5908         # a loop is needed to ensure we can add subdirs of existing dirs
5909         for cf_test_libdir in $LDFLAGS $LIBS ; do
5910           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5911             cf_have_libdir=yes; break
5912           fi
5913         done
5914       fi
5915       if test "$cf_have_libdir" = no ; then
5916         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5917
5918 echo "${as_me:-configure}:5918: testing adding $cf_add_libdir to library-path ..." 1>&5
5919
5920         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5921       fi
5922     fi
5923   done
5924 fi
5925
5926         LIBS="-l$cf_nculib_root $LIBS"
5927 else
5928
5929         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5930         cf_libdir=""
5931         echo "$as_me:5931: checking for initscr" >&5
5932 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5933 if test "${ac_cv_func_initscr+set}" = set; then
5934   echo $ECHO_N "(cached) $ECHO_C" >&6
5935 else
5936   cat >conftest.$ac_ext <<_ACEOF
5937 #line 5937 "configure"
5938 #include "confdefs.h"
5939 /* System header to define __stub macros and hopefully few prototypes,
5940     which can conflict with char initscr (); below.  */
5941 #include <assert.h>
5942 /* Override any gcc2 internal prototype to avoid an error.  */
5943 #ifdef __cplusplus
5944 extern "C"
5945 #endif
5946 /* We use char because int might match the return type of a gcc2
5947    builtin and then its argument prototype would still apply.  */
5948 char initscr ();
5949 char (*f) ();
5950
5951 int
5952 main ()
5953 {
5954 /* The GNU C library defines this for functions which it implements
5955     to always fail with ENOSYS.  Some functions are actually named
5956     something starting with __ and the normal name is an alias.  */
5957 #if defined (__stub_initscr) || defined (__stub___initscr)
5958 choke me
5959 #else
5960 f = initscr;
5961 #endif
5962
5963   ;
5964   return 0;
5965 }
5966 _ACEOF
5967 rm -f conftest.$ac_objext conftest$ac_exeext
5968 if { (eval echo "$as_me:5968: \"$ac_link\"") >&5
5969   (eval $ac_link) 2>&5
5970   ac_status=$?
5971   echo "$as_me:5971: \$? = $ac_status" >&5
5972   (exit $ac_status); } &&
5973          { ac_try='test -s conftest$ac_exeext'
5974   { (eval echo "$as_me:5974: \"$ac_try\"") >&5
5975   (eval $ac_try) 2>&5
5976   ac_status=$?
5977   echo "$as_me:5977: \$? = $ac_status" >&5
5978   (exit $ac_status); }; }; then
5979   ac_cv_func_initscr=yes
5980 else
5981   echo "$as_me: failed program was:" >&5
5982 cat conftest.$ac_ext >&5
5983 ac_cv_func_initscr=no
5984 fi
5985 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5986 fi
5987 echo "$as_me:5987: result: $ac_cv_func_initscr" >&5
5988 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5989 if test $ac_cv_func_initscr = yes; then
5990   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5991 else
5992
5993                 cf_save_LIBS="$LIBS"
5994                 echo "$as_me:5994: checking for initscr in -l$cf_nculib_root" >&5
5995 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5996                 LIBS="-l$cf_nculib_root $LIBS"
5997                 cat >conftest.$ac_ext <<_ACEOF
5998 #line 5998 "configure"
5999 #include "confdefs.h"
6000 #include <${cf_cv_ncurses_header:-curses.h}>
6001 int
6002 main ()
6003 {
6004 initscr()
6005   ;
6006   return 0;
6007 }
6008 _ACEOF
6009 rm -f conftest.$ac_objext conftest$ac_exeext
6010 if { (eval echo "$as_me:6010: \"$ac_link\"") >&5
6011   (eval $ac_link) 2>&5
6012   ac_status=$?
6013   echo "$as_me:6013: \$? = $ac_status" >&5
6014   (exit $ac_status); } &&
6015          { ac_try='test -s conftest$ac_exeext'
6016   { (eval echo "$as_me:6016: \"$ac_try\"") >&5
6017   (eval $ac_try) 2>&5
6018   ac_status=$?
6019   echo "$as_me:6019: \$? = $ac_status" >&5
6020   (exit $ac_status); }; }; then
6021   echo "$as_me:6021: result: yes" >&5
6022 echo "${ECHO_T}yes" >&6
6023                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6024
6025 else
6026   echo "$as_me: failed program was:" >&5
6027 cat conftest.$ac_ext >&5
6028 echo "$as_me:6028: result: no" >&5
6029 echo "${ECHO_T}no" >&6
6030
6031 cf_search=
6032 cf_library_path_list=""
6033 if test -n "${LDFLAGS}${LIBS}" ; then
6034         for cf_library_path in $LDFLAGS $LIBS
6035         do
6036                 case $cf_library_path in #(vi
6037                 -L*)
6038                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6039
6040 test "$cf_library_path" != "NONE" && \
6041 test -d "$cf_library_path" && \
6042  {
6043         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6044         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6045         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6046         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6047         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6048         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"
6049 }
6050
6051                         cf_library_path_list="$cf_library_path_list $cf_search"
6052                         ;;
6053                 esac
6054         done
6055 fi
6056
6057 cf_search=
6058
6059 test "/usr" != "$prefix" && \
6060 test -d "/usr" && \
6061 (test $prefix = NONE || test "/usr" != "$prefix") && {
6062         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6063         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6064         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6065         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6066         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6067         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6068 }
6069
6070 test "$prefix" != "NONE" && \
6071 test -d "$prefix" && \
6072  {
6073         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6074         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6075         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6076         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6077         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6078         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6079 }
6080
6081 test "/usr/local" != "$prefix" && \
6082 test -d "/usr/local" && \
6083 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6084         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6085         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6086         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6087         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6088         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6089         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6090 }
6091
6092 test "/opt" != "$prefix" && \
6093 test -d "/opt" && \
6094 (test $prefix = NONE || test "/opt" != "$prefix") && {
6095         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6096         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6097         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6098         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6099         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6100         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6101 }
6102
6103 test "$HOME" != "$prefix" && \
6104 test -d "$HOME" && \
6105 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6106         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6107         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6108         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6109         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6110         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6111         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6112 }
6113
6114 cf_search="$cf_library_path_list $cf_search"
6115
6116                         for cf_libdir in $cf_search
6117                         do
6118                                 echo "$as_me:6118: checking for -l$cf_nculib_root in $cf_libdir" >&5
6119 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6120                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6121                                 cat >conftest.$ac_ext <<_ACEOF
6122 #line 6122 "configure"
6123 #include "confdefs.h"
6124 #include <${cf_cv_ncurses_header:-curses.h}>
6125 int
6126 main ()
6127 {
6128 initscr()
6129   ;
6130   return 0;
6131 }
6132 _ACEOF
6133 rm -f conftest.$ac_objext conftest$ac_exeext
6134 if { (eval echo "$as_me:6134: \"$ac_link\"") >&5
6135   (eval $ac_link) 2>&5
6136   ac_status=$?
6137   echo "$as_me:6137: \$? = $ac_status" >&5
6138   (exit $ac_status); } &&
6139          { ac_try='test -s conftest$ac_exeext'
6140   { (eval echo "$as_me:6140: \"$ac_try\"") >&5
6141   (eval $ac_try) 2>&5
6142   ac_status=$?
6143   echo "$as_me:6143: \$? = $ac_status" >&5
6144   (exit $ac_status); }; }; then
6145   echo "$as_me:6145: result: yes" >&5
6146 echo "${ECHO_T}yes" >&6
6147                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6148                                          break
6149 else
6150   echo "$as_me: failed program was:" >&5
6151 cat conftest.$ac_ext >&5
6152 echo "$as_me:6152: result: no" >&5
6153 echo "${ECHO_T}no" >&6
6154                                          LIBS="$cf_save_LIBS"
6155 fi
6156 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6157                         done
6158
6159 fi
6160 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6161
6162 fi
6163
6164 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6165
6166 if test $cf_found_library = no ; then
6167         { { echo "$as_me:6167: error: Cannot link $cf_nculib_root library" >&5
6168 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6169    { (exit 1); exit 1; }; }
6170 fi
6171
6172 fi
6173
6174 if test -n "$cf_ncurses_LIBS" ; then
6175         echo "$as_me:6175: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6176 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6177         cf_ncurses_SAVE="$LIBS"
6178         for p in $cf_ncurses_LIBS ; do
6179                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6180                 if test "$q" != "$LIBS" ; then
6181                         LIBS="$q"
6182                 fi
6183         done
6184         cat >conftest.$ac_ext <<_ACEOF
6185 #line 6185 "configure"
6186 #include "confdefs.h"
6187 #include <${cf_cv_ncurses_header:-curses.h}>
6188 int
6189 main ()
6190 {
6191 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6192   ;
6193   return 0;
6194 }
6195 _ACEOF
6196 rm -f conftest.$ac_objext conftest$ac_exeext
6197 if { (eval echo "$as_me:6197: \"$ac_link\"") >&5
6198   (eval $ac_link) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit $ac_status); } &&
6202          { ac_try='test -s conftest$ac_exeext'
6203   { (eval echo "$as_me:6203: \"$ac_try\"") >&5
6204   (eval $ac_try) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit $ac_status); }; }; then
6208   echo "$as_me:6208: result: yes" >&5
6209 echo "${ECHO_T}yes" >&6
6210 else
6211   echo "$as_me: failed program was:" >&5
6212 cat conftest.$ac_ext >&5
6213 echo "$as_me:6213: result: no" >&5
6214 echo "${ECHO_T}no" >&6
6215                  LIBS="$cf_ncurses_SAVE"
6216 fi
6217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6218 fi
6219
6220 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6221
6222 cat >>confdefs.h <<EOF
6223 #define $cf_nculib_ROOT 1
6224 EOF
6225
6226 fi
6227
6228         ;;
6229 ncursesw)
6230         cf_cv_libtype=w
6231
6232 echo "$as_me:6232: checking for multibyte character support" >&5
6233 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6234 if test "${cf_cv_utf8_lib+set}" = set; then
6235   echo $ECHO_N "(cached) $ECHO_C" >&6
6236 else
6237
6238         cf_save_LIBS="$LIBS"
6239         cat >conftest.$ac_ext <<_ACEOF
6240 #line 6240 "configure"
6241 #include "confdefs.h"
6242
6243 #include <stdlib.h>
6244 int
6245 main ()
6246 {
6247 putwc(0,0);
6248   ;
6249   return 0;
6250 }
6251 _ACEOF
6252 rm -f conftest.$ac_objext conftest$ac_exeext
6253 if { (eval echo "$as_me:6253: \"$ac_link\"") >&5
6254   (eval $ac_link) 2>&5
6255   ac_status=$?
6256   echo "$as_me:6256: \$? = $ac_status" >&5
6257   (exit $ac_status); } &&
6258          { ac_try='test -s conftest$ac_exeext'
6259   { (eval echo "$as_me:6259: \"$ac_try\"") >&5
6260   (eval $ac_try) 2>&5
6261   ac_status=$?
6262   echo "$as_me:6262: \$? = $ac_status" >&5
6263   (exit $ac_status); }; }; then
6264   cf_cv_utf8_lib=yes
6265 else
6266   echo "$as_me: failed program was:" >&5
6267 cat conftest.$ac_ext >&5
6268
6269 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6270 # will be set on completion of the AC_TRY_LINK below.
6271 cf_cv_header_path_utf8=
6272 cf_cv_library_path_utf8=
6273
6274 echo "${as_me:-configure}:6274: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6275
6276 cf_save_LIBS="$LIBS"
6277
6278 cat >conftest.$ac_ext <<_ACEOF
6279 #line 6279 "configure"
6280 #include "confdefs.h"
6281
6282 #include <libutf8.h>
6283 int
6284 main ()
6285 {
6286 putwc(0,0);
6287   ;
6288   return 0;
6289 }
6290 _ACEOF
6291 rm -f conftest.$ac_objext conftest$ac_exeext
6292 if { (eval echo "$as_me:6292: \"$ac_link\"") >&5
6293   (eval $ac_link) 2>&5
6294   ac_status=$?
6295   echo "$as_me:6295: \$? = $ac_status" >&5
6296   (exit $ac_status); } &&
6297          { ac_try='test -s conftest$ac_exeext'
6298   { (eval echo "$as_me:6298: \"$ac_try\"") >&5
6299   (eval $ac_try) 2>&5
6300   ac_status=$?
6301   echo "$as_me:6301: \$? = $ac_status" >&5
6302   (exit $ac_status); }; }; then
6303
6304         cf_cv_find_linkage_utf8=yes
6305         cf_cv_header_path_utf8=/usr/include
6306         cf_cv_library_path_utf8=/usr/lib
6307
6308 else
6309   echo "$as_me: failed program was:" >&5
6310 cat conftest.$ac_ext >&5
6311
6312 LIBS="-lutf8  $cf_save_LIBS"
6313
6314 cat >conftest.$ac_ext <<_ACEOF
6315 #line 6315 "configure"
6316 #include "confdefs.h"
6317
6318 #include <libutf8.h>
6319 int
6320 main ()
6321 {
6322 putwc(0,0);
6323   ;
6324   return 0;
6325 }
6326 _ACEOF
6327 rm -f conftest.$ac_objext conftest$ac_exeext
6328 if { (eval echo "$as_me:6328: \"$ac_link\"") >&5
6329   (eval $ac_link) 2>&5
6330   ac_status=$?
6331   echo "$as_me:6331: \$? = $ac_status" >&5
6332   (exit $ac_status); } &&
6333          { ac_try='test -s conftest$ac_exeext'
6334   { (eval echo "$as_me:6334: \"$ac_try\"") >&5
6335   (eval $ac_try) 2>&5
6336   ac_status=$?
6337   echo "$as_me:6337: \$? = $ac_status" >&5
6338   (exit $ac_status); }; }; then
6339
6340         cf_cv_find_linkage_utf8=yes
6341         cf_cv_header_path_utf8=/usr/include
6342         cf_cv_library_path_utf8=/usr/lib
6343         cf_cv_library_file_utf8="-lutf8"
6344
6345 else
6346   echo "$as_me: failed program was:" >&5
6347 cat conftest.$ac_ext >&5
6348
6349         cf_cv_find_linkage_utf8=no
6350         LIBS="$cf_save_LIBS"
6351
6352     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
6353
6354 echo "${as_me:-configure}:6354: testing find linkage for utf8 library ..." 1>&5
6355
6356 echo "${as_me:-configure}:6356: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6357
6358     cf_save_CPPFLAGS="$CPPFLAGS"
6359     cf_test_CPPFLAGS="$CPPFLAGS"
6360
6361 cf_search=
6362
6363 # collect the current set of include-directories from compiler flags
6364 cf_header_path_list=""
6365 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6366         for cf_header_path in $CPPFLAGS $CFLAGS
6367         do
6368                 case $cf_header_path in #(vi
6369                 -I*)
6370                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6371
6372 test "$cf_header_path" != "NONE" && \
6373 test -d "$cf_header_path" && \
6374  {
6375         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6376         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6377         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6378         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6379         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6380         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6381 }
6382
6383                         cf_header_path_list="$cf_header_path_list $cf_search"
6384                         ;;
6385                 esac
6386         done
6387 fi
6388
6389 # add the variations for the package we are looking for
6390
6391 cf_search=
6392
6393 test "/usr" != "$prefix" && \
6394 test -d "/usr" && \
6395 (test $prefix = NONE || test "/usr" != "$prefix") && {
6396         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6397         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6398         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
6399         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
6400         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
6401         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
6402 }
6403
6404 test "$prefix" != "NONE" && \
6405 test -d "$prefix" && \
6406  {
6407         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6408         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6409         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6410         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6411         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6412         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6413 }
6414
6415 test "/usr/local" != "$prefix" && \
6416 test -d "/usr/local" && \
6417 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6418         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6419         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6420         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
6421         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
6422         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
6423         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
6424 }
6425
6426 test "/opt" != "$prefix" && \
6427 test -d "/opt" && \
6428 (test $prefix = NONE || test "/opt" != "$prefix") && {
6429         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6430         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6431         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
6432         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
6433         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
6434         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
6435 }
6436
6437 test "$HOME" != "$prefix" && \
6438 test -d "$HOME" && \
6439 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6440         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6441         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6442         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
6443         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
6444         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
6445         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
6446 }
6447
6448 test "$includedir" != NONE && \
6449 test "$includedir" != "/usr/include" && \
6450 test -d "$includedir" && {
6451         test -d $includedir &&    cf_search="$cf_search $includedir"
6452         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6453 }
6454
6455 test "$oldincludedir" != NONE && \
6456 test "$oldincludedir" != "/usr/include" && \
6457 test -d "$oldincludedir" && {
6458         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6459         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6460 }
6461
6462 cf_search="$cf_search $cf_header_path_list"
6463
6464     for cf_cv_header_path_utf8 in $cf_search
6465     do
6466       if test -d $cf_cv_header_path_utf8 ; then
6467         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6468
6469 echo "${as_me:-configure}:6469: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6470
6471         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6472         cat >conftest.$ac_ext <<_ACEOF
6473 #line 6473 "configure"
6474 #include "confdefs.h"
6475
6476 #include <libutf8.h>
6477 int
6478 main ()
6479 {
6480 putwc(0,0);
6481   ;
6482   return 0;
6483 }
6484 _ACEOF
6485 rm -f conftest.$ac_objext
6486 if { (eval echo "$as_me:6486: \"$ac_compile\"") >&5
6487   (eval $ac_compile) 2>&5
6488   ac_status=$?
6489   echo "$as_me:6489: \$? = $ac_status" >&5
6490   (exit $ac_status); } &&
6491          { ac_try='test -s conftest.$ac_objext'
6492   { (eval echo "$as_me:6492: \"$ac_try\"") >&5
6493   (eval $ac_try) 2>&5
6494   ac_status=$?
6495   echo "$as_me:6495: \$? = $ac_status" >&5
6496   (exit $ac_status); }; }; then
6497
6498             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6499
6500 echo "${as_me:-configure}:6500: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6501
6502             cf_cv_find_linkage_utf8=maybe
6503             cf_test_CPPFLAGS="$CPPFLAGS"
6504             break
6505 else
6506   echo "$as_me: failed program was:" >&5
6507 cat conftest.$ac_ext >&5
6508
6509             CPPFLAGS="$cf_save_CPPFLAGS"
6510
6511 fi
6512 rm -f conftest.$ac_objext conftest.$ac_ext
6513       fi
6514     done
6515
6516     if test "$cf_cv_find_linkage_utf8" = maybe ; then
6517
6518 echo "${as_me:-configure}:6518: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6519
6520       cf_save_LIBS="$LIBS"
6521       cf_save_LDFLAGS="$LDFLAGS"
6522
6523       if test "$cf_cv_find_linkage_utf8" != yes ; then
6524
6525 cf_search=
6526 cf_library_path_list=""
6527 if test -n "${LDFLAGS}${LIBS}" ; then
6528         for cf_library_path in $LDFLAGS $LIBS
6529         do
6530                 case $cf_library_path in #(vi
6531                 -L*)
6532                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6533
6534 test "$cf_library_path" != "NONE" && \
6535 test -d "$cf_library_path" && \
6536  {
6537         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6538         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6539         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6540         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6541         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6542         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6543 }
6544
6545                         cf_library_path_list="$cf_library_path_list $cf_search"
6546                         ;;
6547                 esac
6548         done
6549 fi
6550
6551 cf_search=
6552
6553 test "/usr" != "$prefix" && \
6554 test -d "/usr" && \
6555 (test $prefix = NONE || test "/usr" != "$prefix") && {
6556         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6557         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6558         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
6559         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
6560         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
6561         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
6562 }
6563
6564 test "$prefix" != "NONE" && \
6565 test -d "$prefix" && \
6566  {
6567         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6568         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6569         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6570         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6571         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6572         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6573 }
6574
6575 test "/usr/local" != "$prefix" && \
6576 test -d "/usr/local" && \
6577 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6578         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6579         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6580         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
6581         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
6582         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
6583         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
6584 }
6585
6586 test "/opt" != "$prefix" && \
6587 test -d "/opt" && \
6588 (test $prefix = NONE || test "/opt" != "$prefix") && {
6589         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6590         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6591         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
6592         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
6593         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
6594         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
6595 }
6596
6597 test "$HOME" != "$prefix" && \
6598 test -d "$HOME" && \
6599 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6600         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6601         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6602         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
6603         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
6604         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
6605         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
6606 }
6607
6608 cf_search="$cf_library_path_list $cf_search"
6609
6610         for cf_cv_library_path_utf8 in $cf_search
6611         do
6612           if test -d $cf_cv_library_path_utf8 ; then
6613             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
6614
6615 echo "${as_me:-configure}:6615: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6616
6617             CPPFLAGS="$cf_test_CPPFLAGS"
6618             LIBS="-lutf8  $cf_save_LIBS"
6619             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6620             cat >conftest.$ac_ext <<_ACEOF
6621 #line 6621 "configure"
6622 #include "confdefs.h"
6623
6624 #include <libutf8.h>
6625 int
6626 main ()
6627 {
6628 putwc(0,0);
6629   ;
6630   return 0;
6631 }
6632 _ACEOF
6633 rm -f conftest.$ac_objext conftest$ac_exeext
6634 if { (eval echo "$as_me:6634: \"$ac_link\"") >&5
6635   (eval $ac_link) 2>&5
6636   ac_status=$?
6637   echo "$as_me:6637: \$? = $ac_status" >&5
6638   (exit $ac_status); } &&
6639          { ac_try='test -s conftest$ac_exeext'
6640   { (eval echo "$as_me:6640: \"$ac_try\"") >&5
6641   (eval $ac_try) 2>&5
6642   ac_status=$?
6643   echo "$as_me:6643: \$? = $ac_status" >&5
6644   (exit $ac_status); }; }; then
6645
6646                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6647
6648 echo "${as_me:-configure}:6648: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6649
6650                 cf_cv_find_linkage_utf8=yes
6651                 cf_cv_library_file_utf8="-lutf8"
6652                 break
6653 else
6654   echo "$as_me: failed program was:" >&5
6655 cat conftest.$ac_ext >&5
6656
6657                 CPPFLAGS="$cf_save_CPPFLAGS"
6658                 LIBS="$cf_save_LIBS"
6659                 LDFLAGS="$cf_save_LDFLAGS"
6660
6661 fi
6662 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6663           fi
6664         done
6665         CPPFLAGS="$cf_save_CPPFLAGS"
6666         LDFLAGS="$cf_save_LDFLAGS"
6667       fi
6668
6669     else
6670       cf_cv_find_linkage_utf8=no
6671     fi
6672
6673 fi
6674 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6675
6676 fi
6677 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6678
6679 LIBS="$cf_save_LIBS"
6680
6681 if test "$cf_cv_find_linkage_utf8" = yes ; then
6682 cf_cv_utf8_lib=add-on
6683 else
6684 cf_cv_utf8_lib=no
6685 fi
6686
6687 fi
6688 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6689 fi
6690 echo "$as_me:6690: result: $cf_cv_utf8_lib" >&5
6691 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6692
6693 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6694 # ncurses/ncursesw:
6695 if test "$cf_cv_utf8_lib" = "add-on" ; then
6696         cat >>confdefs.h <<\EOF
6697 #define HAVE_LIBUTF8_H 1
6698 EOF
6699
6700 if test -n "$cf_cv_header_path_utf8" ; then
6701   for cf_add_incdir in $cf_cv_header_path_utf8
6702   do
6703         while test $cf_add_incdir != /usr/include
6704         do
6705           if test -d $cf_add_incdir
6706           then
6707                 cf_have_incdir=no
6708                 if test -n "$CFLAGS$CPPFLAGS" ; then
6709                   # a loop is needed to ensure we can add subdirs of existing dirs
6710                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6711                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6712                           cf_have_incdir=yes; break
6713                         fi
6714                   done
6715                 fi
6716
6717                 if test "$cf_have_incdir" = no ; then
6718                   if test "$cf_add_incdir" = /usr/local/include ; then
6719                         if test "$GCC" = yes
6720                         then
6721                           cf_save_CPPFLAGS=$CPPFLAGS
6722                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6723                           cat >conftest.$ac_ext <<_ACEOF
6724 #line 6724 "configure"
6725 #include "confdefs.h"
6726 #include <stdio.h>
6727 int
6728 main ()
6729 {
6730 printf("Hello")
6731   ;
6732   return 0;
6733 }
6734 _ACEOF
6735 rm -f conftest.$ac_objext
6736 if { (eval echo "$as_me:6736: \"$ac_compile\"") >&5
6737   (eval $ac_compile) 2>&5
6738   ac_status=$?
6739   echo "$as_me:6739: \$? = $ac_status" >&5
6740   (exit $ac_status); } &&
6741          { ac_try='test -s conftest.$ac_objext'
6742   { (eval echo "$as_me:6742: \"$ac_try\"") >&5
6743   (eval $ac_try) 2>&5
6744   ac_status=$?
6745   echo "$as_me:6745: \$? = $ac_status" >&5
6746   (exit $ac_status); }; }; then
6747   :
6748 else
6749   echo "$as_me: failed program was:" >&5
6750 cat conftest.$ac_ext >&5
6751 cf_have_incdir=yes
6752 fi
6753 rm -f conftest.$ac_objext conftest.$ac_ext
6754                           CPPFLAGS=$cf_save_CPPFLAGS
6755                         fi
6756                   fi
6757                 fi
6758
6759                 if test "$cf_have_incdir" = no ; then
6760                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6761
6762 echo "${as_me:-configure}:6762: testing adding $cf_add_incdir to include-path ..." 1>&5
6763
6764                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6765
6766                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6767                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6768                   cf_add_incdir="$cf_top_incdir"
6769                 else
6770                   break
6771                 fi
6772           fi
6773         done
6774   done
6775 fi
6776
6777 if test -n "$cf_cv_library_path_utf8" ; then
6778   for cf_add_libdir in $cf_cv_library_path_utf8
6779   do
6780     if test $cf_add_libdir = /usr/lib ; then
6781       :
6782     elif test -d $cf_add_libdir
6783     then
6784       cf_have_libdir=no
6785       if test -n "$LDFLAGS$LIBS" ; then
6786         # a loop is needed to ensure we can add subdirs of existing dirs
6787         for cf_test_libdir in $LDFLAGS $LIBS ; do
6788           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6789             cf_have_libdir=yes; break
6790           fi
6791         done
6792       fi
6793       if test "$cf_have_libdir" = no ; then
6794         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6795
6796 echo "${as_me:-configure}:6796: testing adding $cf_add_libdir to library-path ..." 1>&5
6797
6798         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6799       fi
6800     fi
6801   done
6802 fi
6803
6804         LIBS="$cf_cv_library_file_utf8 $LIBS"
6805 fi
6806
6807 cf_ncuconfig_root=ncursesw
6808
6809 echo "Looking for ${cf_ncuconfig_root}-config"
6810 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6811 do
6812   # Extract the first word of "$ac_prog", so it can be a program name with args.
6813 set dummy $ac_prog; ac_word=$2
6814 echo "$as_me:6814: checking for $ac_word" >&5
6815 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6816 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
6817   echo $ECHO_N "(cached) $ECHO_C" >&6
6818 else
6819   case $NCURSES_CONFIG in
6820   [\\/]* | ?:[\\/]*)
6821   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
6822   ;;
6823   *)
6824   ac_save_IFS=$IFS; IFS=$ac_path_separator
6825 ac_dummy="$PATH"
6826 for ac_dir in $ac_dummy; do
6827   IFS=$ac_save_IFS
6828   test -z "$ac_dir" && ac_dir=.
6829   if $as_executable_p "$ac_dir/$ac_word"; then
6830    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
6831    echo "$as_me:6831: found $ac_dir/$ac_word" >&5
6832    break
6833 fi
6834 done
6835
6836   ;;
6837 esac
6838 fi
6839 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
6840
6841 if test -n "$NCURSES_CONFIG"; then
6842   echo "$as_me:6842: result: $NCURSES_CONFIG" >&5
6843 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6844 else
6845   echo "$as_me:6845: result: no" >&5
6846 echo "${ECHO_T}no" >&6
6847 fi
6848
6849   test -n "$NCURSES_CONFIG" && break
6850 done
6851 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
6852
6853 if test "$NCURSES_CONFIG" != none ; then
6854
6855 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6856 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
6857
6858 # even with config script, some packages use no-override for curses.h
6859
6860 echo "$as_me:6860: checking if we have identified curses headers" >&5
6861 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6862 if test "${cf_cv_ncurses_header+set}" = set; then
6863   echo $ECHO_N "(cached) $ECHO_C" >&6
6864 else
6865
6866 cf_cv_ncurses_header=none
6867 for cf_header in  \
6868     ncursesw/curses.h \
6869         ncursesw/ncurses.h \
6870         curses.h \
6871         ncurses.h
6872 do
6873 cat >conftest.$ac_ext <<_ACEOF
6874 #line 6874 "configure"
6875 #include "confdefs.h"
6876 #include <${cf_header}>
6877 int
6878 main ()
6879 {
6880 initscr(); tgoto("?", 0,0)
6881   ;
6882   return 0;
6883 }
6884 _ACEOF
6885 rm -f conftest.$ac_objext
6886 if { (eval echo "$as_me:6886: \"$ac_compile\"") >&5
6887   (eval $ac_compile) 2>&5
6888   ac_status=$?
6889   echo "$as_me:6889: \$? = $ac_status" >&5
6890   (exit $ac_status); } &&
6891          { ac_try='test -s conftest.$ac_objext'
6892   { (eval echo "$as_me:6892: \"$ac_try\"") >&5
6893   (eval $ac_try) 2>&5
6894   ac_status=$?
6895   echo "$as_me:6895: \$? = $ac_status" >&5
6896   (exit $ac_status); }; }; then
6897   cf_cv_ncurses_header=$cf_header; break
6898 else
6899   echo "$as_me: failed program was:" >&5
6900 cat conftest.$ac_ext >&5
6901 fi
6902 rm -f conftest.$ac_objext conftest.$ac_ext
6903 done
6904
6905 fi
6906 echo "$as_me:6906: result: $cf_cv_ncurses_header" >&5
6907 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6908
6909 if test "$cf_cv_ncurses_header" = none ; then
6910         { { echo "$as_me:6910: error: No curses header-files found" >&5
6911 echo "$as_me: error: No curses header-files found" >&2;}
6912    { (exit 1); exit 1; }; }
6913 fi
6914
6915 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6916
6917 for ac_header in $cf_cv_ncurses_header
6918 do
6919 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6920 echo "$as_me:6920: checking for $ac_header" >&5
6921 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6922 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6923   echo $ECHO_N "(cached) $ECHO_C" >&6
6924 else
6925   cat >conftest.$ac_ext <<_ACEOF
6926 #line 6926 "configure"
6927 #include "confdefs.h"
6928 #include <$ac_header>
6929 _ACEOF
6930 if { (eval echo "$as_me:6930: \"$ac_cpp conftest.$ac_ext\"") >&5
6931   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6932   ac_status=$?
6933   egrep -v '^ *\+' conftest.er1 >conftest.err
6934   rm -f conftest.er1
6935   cat conftest.err >&5
6936   echo "$as_me:6936: \$? = $ac_status" >&5
6937   (exit $ac_status); } >/dev/null; then
6938   if test -s conftest.err; then
6939     ac_cpp_err=$ac_c_preproc_warn_flag
6940   else
6941     ac_cpp_err=
6942   fi
6943 else
6944   ac_cpp_err=yes
6945 fi
6946 if test -z "$ac_cpp_err"; then
6947   eval "$as_ac_Header=yes"
6948 else
6949   echo "$as_me: failed program was:" >&5
6950   cat conftest.$ac_ext >&5
6951   eval "$as_ac_Header=no"
6952 fi
6953 rm -f conftest.err conftest.$ac_ext
6954 fi
6955 echo "$as_me:6955: result: `eval echo '${'$as_ac_Header'}'`" >&5
6956 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6957 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6958   cat >>confdefs.h <<EOF
6959 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6960 EOF
6961
6962 fi
6963 done
6964
6965 cat >>confdefs.h <<\EOF
6966 #define NCURSES 1
6967 EOF
6968
6969 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6970
6971 cat >>confdefs.h <<EOF
6972 #define $cf_nculib_ROOT 1
6973 EOF
6974
6975 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6976
6977 else
6978
6979 cf_ncuhdr_root=ncursesw
6980
6981 test -n "$cf_cv_curses_dir" && \
6982 test "$cf_cv_curses_dir" != "no" && { \
6983
6984 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6985   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
6986   do
6987         while test $cf_add_incdir != /usr/include
6988         do
6989           if test -d $cf_add_incdir
6990           then
6991                 cf_have_incdir=no
6992                 if test -n "$CFLAGS$CPPFLAGS" ; then
6993                   # a loop is needed to ensure we can add subdirs of existing dirs
6994                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6995                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6996                           cf_have_incdir=yes; break
6997                         fi
6998                   done
6999                 fi
7000
7001                 if test "$cf_have_incdir" = no ; then
7002                   if test "$cf_add_incdir" = /usr/local/include ; then
7003                         if test "$GCC" = yes
7004                         then
7005                           cf_save_CPPFLAGS=$CPPFLAGS
7006                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7007                           cat >conftest.$ac_ext <<_ACEOF
7008 #line 7008 "configure"
7009 #include "confdefs.h"
7010 #include <stdio.h>
7011 int
7012 main ()
7013 {
7014 printf("Hello")
7015   ;
7016   return 0;
7017 }
7018 _ACEOF
7019 rm -f conftest.$ac_objext
7020 if { (eval echo "$as_me:7020: \"$ac_compile\"") >&5
7021   (eval $ac_compile) 2>&5
7022   ac_status=$?
7023   echo "$as_me:7023: \$? = $ac_status" >&5
7024   (exit $ac_status); } &&
7025          { ac_try='test -s conftest.$ac_objext'
7026   { (eval echo "$as_me:7026: \"$ac_try\"") >&5
7027   (eval $ac_try) 2>&5
7028   ac_status=$?
7029   echo "$as_me:7029: \$? = $ac_status" >&5
7030   (exit $ac_status); }; }; then
7031   :
7032 else
7033   echo "$as_me: failed program was:" >&5
7034 cat conftest.$ac_ext >&5
7035 cf_have_incdir=yes
7036 fi
7037 rm -f conftest.$ac_objext conftest.$ac_ext
7038                           CPPFLAGS=$cf_save_CPPFLAGS
7039                         fi
7040                   fi
7041                 fi
7042
7043                 if test "$cf_have_incdir" = no ; then
7044                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7045
7046 echo "${as_me:-configure}:7046: testing adding $cf_add_incdir to include-path ..." 1>&5
7047
7048                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7049
7050                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7051                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7052                   cf_add_incdir="$cf_top_incdir"
7053                 else
7054                   break
7055                 fi
7056           fi
7057         done
7058   done
7059 fi
7060
7061 }
7062
7063 echo "$as_me:7063: checking for $cf_ncuhdr_root header in include-path" >&5
7064 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7065 if test "${cf_cv_ncurses_h+set}" = set; then
7066   echo $ECHO_N "(cached) $ECHO_C" >&6
7067 else
7068
7069         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7070         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7071         for cf_header in $cf_header_list
7072         do
7073
7074         cat >conftest.$ac_ext <<_ACEOF
7075 #line 7075 "configure"
7076 #include "confdefs.h"
7077
7078 #define _XOPEN_SOURCE_EXTENDED
7079 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7080 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7081
7082 #include <$cf_header>
7083 int
7084 main ()
7085 {
7086
7087 #ifdef NCURSES_VERSION
7088
7089 #ifndef WACS_BSSB
7090         make an error
7091 #endif
7092
7093 printf("%s\n", NCURSES_VERSION);
7094 #else
7095 #ifdef __NCURSES_H
7096 printf("old\n");
7097 #else
7098         make an error
7099 #endif
7100 #endif
7101
7102   ;
7103   return 0;
7104 }
7105 _ACEOF
7106 rm -f conftest.$ac_objext
7107 if { (eval echo "$as_me:7107: \"$ac_compile\"") >&5
7108   (eval $ac_compile) 2>&5
7109   ac_status=$?
7110   echo "$as_me:7110: \$? = $ac_status" >&5
7111   (exit $ac_status); } &&
7112          { ac_try='test -s conftest.$ac_objext'
7113   { (eval echo "$as_me:7113: \"$ac_try\"") >&5
7114   (eval $ac_try) 2>&5
7115   ac_status=$?
7116   echo "$as_me:7116: \$? = $ac_status" >&5
7117   (exit $ac_status); }; }; then
7118   cf_cv_ncurses_h=$cf_header
7119
7120 else
7121   echo "$as_me: failed program was:" >&5
7122 cat conftest.$ac_ext >&5
7123 cf_cv_ncurses_h=no
7124 fi
7125 rm -f conftest.$ac_objext conftest.$ac_ext
7126
7127                 test "$cf_cv_ncurses_h" != no && break
7128         done
7129
7130 fi
7131 echo "$as_me:7131: result: $cf_cv_ncurses_h" >&5
7132 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7133
7134 if test "$cf_cv_ncurses_h" != no ; then
7135         cf_cv_ncurses_header=$cf_cv_ncurses_h
7136 else
7137
7138 echo "$as_me:7138: checking for $cf_ncuhdr_root include-path" >&5
7139 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7140 if test "${cf_cv_ncurses_h2+set}" = set; then
7141   echo $ECHO_N "(cached) $ECHO_C" >&6
7142 else
7143
7144         test -n "$verbose" && echo
7145
7146 cf_search=
7147
7148 # collect the current set of include-directories from compiler flags
7149 cf_header_path_list=""
7150 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7151         for cf_header_path in $CPPFLAGS $CFLAGS
7152         do
7153                 case $cf_header_path in #(vi
7154                 -I*)
7155                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7156
7157 test "$cf_header_path" != "NONE" && \
7158 test -d "$cf_header_path" && \
7159  {
7160         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7161         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7162         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7163         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7164         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7165         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"
7166 }
7167
7168                         cf_header_path_list="$cf_header_path_list $cf_search"
7169                         ;;
7170                 esac
7171         done
7172 fi
7173
7174 # add the variations for the package we are looking for
7175
7176 cf_search=
7177
7178 test "/usr" != "$prefix" && \
7179 test -d "/usr" && \
7180 (test $prefix = NONE || test "/usr" != "$prefix") && {
7181         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7182         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7183         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
7184         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
7185         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
7186         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7187 }
7188
7189 test "$prefix" != "NONE" && \
7190 test -d "$prefix" && \
7191  {
7192         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7193         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7194         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7195         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7196         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7197         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7198 }
7199
7200 test "/usr/local" != "$prefix" && \
7201 test -d "/usr/local" && \
7202 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7203         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7204         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7205         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
7206         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
7207         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
7208         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7209 }
7210
7211 test "/opt" != "$prefix" && \
7212 test -d "/opt" && \
7213 (test $prefix = NONE || test "/opt" != "$prefix") && {
7214         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7215         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7216         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
7217         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
7218         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
7219         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7220 }
7221
7222 test "$HOME" != "$prefix" && \
7223 test -d "$HOME" && \
7224 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7225         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7226         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7227         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
7228         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
7229         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
7230         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7231 }
7232
7233 test "$includedir" != NONE && \
7234 test "$includedir" != "/usr/include" && \
7235 test -d "$includedir" && {
7236         test -d $includedir &&    cf_search="$cf_search $includedir"
7237         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7238 }
7239
7240 test "$oldincludedir" != NONE && \
7241 test "$oldincludedir" != "/usr/include" && \
7242 test -d "$oldincludedir" && {
7243         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7244         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7245 }
7246
7247 cf_search="$cf_search $cf_header_path_list"
7248
7249         test -n "$verbose" && echo search path $cf_search
7250         cf_save2_CPPFLAGS="$CPPFLAGS"
7251         for cf_incdir in $cf_search
7252         do
7253
7254 if test -n "$cf_incdir" ; then
7255   for cf_add_incdir in $cf_incdir
7256   do
7257         while test $cf_add_incdir != /usr/include
7258         do
7259           if test -d $cf_add_incdir
7260           then
7261                 cf_have_incdir=no
7262                 if test -n "$CFLAGS$CPPFLAGS" ; then
7263                   # a loop is needed to ensure we can add subdirs of existing dirs
7264                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7265                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7266                           cf_have_incdir=yes; break
7267                         fi
7268                   done
7269                 fi
7270
7271                 if test "$cf_have_incdir" = no ; then
7272                   if test "$cf_add_incdir" = /usr/local/include ; then
7273                         if test "$GCC" = yes
7274                         then
7275                           cf_save_CPPFLAGS=$CPPFLAGS
7276                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7277                           cat >conftest.$ac_ext <<_ACEOF
7278 #line 7278 "configure"
7279 #include "confdefs.h"
7280 #include <stdio.h>
7281 int
7282 main ()
7283 {
7284 printf("Hello")
7285   ;
7286   return 0;
7287 }
7288 _ACEOF
7289 rm -f conftest.$ac_objext
7290 if { (eval echo "$as_me:7290: \"$ac_compile\"") >&5
7291   (eval $ac_compile) 2>&5
7292   ac_status=$?
7293   echo "$as_me:7293: \$? = $ac_status" >&5
7294   (exit $ac_status); } &&
7295          { ac_try='test -s conftest.$ac_objext'
7296   { (eval echo "$as_me:7296: \"$ac_try\"") >&5
7297   (eval $ac_try) 2>&5
7298   ac_status=$?
7299   echo "$as_me:7299: \$? = $ac_status" >&5
7300   (exit $ac_status); }; }; then
7301   :
7302 else
7303   echo "$as_me: failed program was:" >&5
7304 cat conftest.$ac_ext >&5
7305 cf_have_incdir=yes
7306 fi
7307 rm -f conftest.$ac_objext conftest.$ac_ext
7308                           CPPFLAGS=$cf_save_CPPFLAGS
7309                         fi
7310                   fi
7311                 fi
7312
7313                 if test "$cf_have_incdir" = no ; then
7314                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7315
7316 echo "${as_me:-configure}:7316: testing adding $cf_add_incdir to include-path ..." 1>&5
7317
7318                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7319
7320                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7321                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7322                   cf_add_incdir="$cf_top_incdir"
7323                 else
7324                   break
7325                 fi
7326           fi
7327         done
7328   done
7329 fi
7330
7331                 for cf_header in \
7332                         ncurses.h \
7333                         curses.h
7334                 do
7335
7336         cat >conftest.$ac_ext <<_ACEOF
7337 #line 7337 "configure"
7338 #include "confdefs.h"
7339
7340 #include <$cf_header>
7341 int
7342 main ()
7343 {
7344
7345 #ifdef NCURSES_VERSION
7346
7347 printf("%s\n", NCURSES_VERSION);
7348 #else
7349 #ifdef __NCURSES_H
7350 printf("old\n");
7351 #else
7352         make an error
7353 #endif
7354 #endif
7355
7356   ;
7357   return 0;
7358 }
7359 _ACEOF
7360 rm -f conftest.$ac_objext
7361 if { (eval echo "$as_me:7361: \"$ac_compile\"") >&5
7362   (eval $ac_compile) 2>&5
7363   ac_status=$?
7364   echo "$as_me:7364: \$? = $ac_status" >&5
7365   (exit $ac_status); } &&
7366          { ac_try='test -s conftest.$ac_objext'
7367   { (eval echo "$as_me:7367: \"$ac_try\"") >&5
7368   (eval $ac_try) 2>&5
7369   ac_status=$?
7370   echo "$as_me:7370: \$? = $ac_status" >&5
7371   (exit $ac_status); }; }; then
7372   cf_cv_ncurses_h2=$cf_header
7373
7374 else
7375   echo "$as_me: failed program was:" >&5
7376 cat conftest.$ac_ext >&5
7377 cf_cv_ncurses_h2=no
7378 fi
7379 rm -f conftest.$ac_objext conftest.$ac_ext
7380
7381                         if test "$cf_cv_ncurses_h2" != no ; then
7382                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7383                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7384                                 break
7385                         fi
7386                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7387                 done
7388                 CPPFLAGS="$cf_save2_CPPFLAGS"
7389                 test "$cf_cv_ncurses_h2" != no && break
7390         done
7391         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7391: error: not found" >&5
7392 echo "$as_me: error: not found" >&2;}
7393    { (exit 1); exit 1; }; }
7394
7395 fi
7396 echo "$as_me:7396: result: $cf_cv_ncurses_h2" >&5
7397 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7398
7399         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7400         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7401         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7402                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7403         fi
7404
7405 if test -n "$cf_1st_incdir" ; then
7406   for cf_add_incdir in $cf_1st_incdir
7407   do
7408         while test $cf_add_incdir != /usr/include
7409         do
7410           if test -d $cf_add_incdir
7411           then
7412                 cf_have_incdir=no
7413                 if test -n "$CFLAGS$CPPFLAGS" ; then
7414                   # a loop is needed to ensure we can add subdirs of existing dirs
7415                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7416                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7417                           cf_have_incdir=yes; break
7418                         fi
7419                   done
7420                 fi
7421
7422                 if test "$cf_have_incdir" = no ; then
7423                   if test "$cf_add_incdir" = /usr/local/include ; then
7424                         if test "$GCC" = yes
7425                         then
7426                           cf_save_CPPFLAGS=$CPPFLAGS
7427                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7428                           cat >conftest.$ac_ext <<_ACEOF
7429 #line 7429 "configure"
7430 #include "confdefs.h"
7431 #include <stdio.h>
7432 int
7433 main ()
7434 {
7435 printf("Hello")
7436   ;
7437   return 0;
7438 }
7439 _ACEOF
7440 rm -f conftest.$ac_objext
7441 if { (eval echo "$as_me:7441: \"$ac_compile\"") >&5
7442   (eval $ac_compile) 2>&5
7443   ac_status=$?
7444   echo "$as_me:7444: \$? = $ac_status" >&5
7445   (exit $ac_status); } &&
7446          { ac_try='test -s conftest.$ac_objext'
7447   { (eval echo "$as_me:7447: \"$ac_try\"") >&5
7448   (eval $ac_try) 2>&5
7449   ac_status=$?
7450   echo "$as_me:7450: \$? = $ac_status" >&5
7451   (exit $ac_status); }; }; then
7452   :
7453 else
7454   echo "$as_me: failed program was:" >&5
7455 cat conftest.$ac_ext >&5
7456 cf_have_incdir=yes
7457 fi
7458 rm -f conftest.$ac_objext conftest.$ac_ext
7459                           CPPFLAGS=$cf_save_CPPFLAGS
7460                         fi
7461                   fi
7462                 fi
7463
7464                 if test "$cf_have_incdir" = no ; then
7465                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7466
7467 echo "${as_me:-configure}:7467: testing adding $cf_add_incdir to include-path ..." 1>&5
7468
7469                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7470
7471                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7472                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7473                   cf_add_incdir="$cf_top_incdir"
7474                 else
7475                   break
7476                 fi
7477           fi
7478         done
7479   done
7480 fi
7481
7482 fi
7483
7484 # Set definitions to allow ifdef'ing for ncurses.h
7485
7486 case $cf_cv_ncurses_header in # (vi
7487 *ncurses.h)
7488         cat >>confdefs.h <<\EOF
7489 #define HAVE_NCURSES_H 1
7490 EOF
7491
7492         ;;
7493 esac
7494
7495 case $cf_cv_ncurses_header in # (vi
7496 ncurses/curses.h|ncurses/ncurses.h)
7497         cat >>confdefs.h <<\EOF
7498 #define HAVE_NCURSES_NCURSES_H 1
7499 EOF
7500
7501         ;;
7502 ncursesw/curses.h|ncursesw/ncurses.h)
7503         cat >>confdefs.h <<\EOF
7504 #define HAVE_NCURSESW_NCURSES_H 1
7505 EOF
7506
7507         ;;
7508 esac
7509
7510 echo "$as_me:7510: checking for terminfo header" >&5
7511 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7512 if test "${cf_cv_term_header+set}" = set; then
7513   echo $ECHO_N "(cached) $ECHO_C" >&6
7514 else
7515
7516 case ${cf_cv_ncurses_header} in #(vi
7517 */ncurses.h|*/ncursesw.h) #(vi
7518         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7519         ;;
7520 *)
7521         cf_term_header=term.h
7522         ;;
7523 esac
7524
7525 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7526 do
7527 cat >conftest.$ac_ext <<_ACEOF
7528 #line 7528 "configure"
7529 #include "confdefs.h"
7530 #include <stdio.h>
7531 #include <${cf_cv_ncurses_header:-curses.h}>
7532 #include <$cf_test>
7533
7534 int
7535 main ()
7536 {
7537 int x = auto_left_margin
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
7555         cf_cv_term_header="$cf_test"
7556 else
7557   echo "$as_me: failed program was:" >&5
7558 cat conftest.$ac_ext >&5
7559
7560         cf_cv_term_header=unknown
7561
7562 fi
7563 rm -f conftest.$ac_objext conftest.$ac_ext
7564         test "$cf_cv_term_header" != unknown && break
7565 done
7566
7567 fi
7568 echo "$as_me:7568: result: $cf_cv_term_header" >&5
7569 echo "${ECHO_T}$cf_cv_term_header" >&6
7570
7571 # Set definitions to allow ifdef'ing to accommodate subdirectories
7572
7573 case $cf_cv_term_header in # (vi
7574 *term.h)
7575         cat >>confdefs.h <<\EOF
7576 #define HAVE_TERM_H 1
7577 EOF
7578
7579         ;;
7580 esac
7581
7582 case $cf_cv_term_header in # (vi
7583 ncurses/term.h) #(vi
7584         cat >>confdefs.h <<\EOF
7585 #define HAVE_NCURSES_TERM_H 1
7586 EOF
7587
7588         ;;
7589 ncursesw/term.h)
7590         cat >>confdefs.h <<\EOF
7591 #define HAVE_NCURSESW_TERM_H 1
7592 EOF
7593
7594         ;;
7595 esac
7596
7597 # some applications need this, but should check for NCURSES_VERSION
7598 cat >>confdefs.h <<\EOF
7599 #define NCURSES 1
7600 EOF
7601
7602 echo "$as_me:7602: checking for ncurses version" >&5
7603 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7604 if test "${cf_cv_ncurses_version+set}" = set; then
7605   echo $ECHO_N "(cached) $ECHO_C" >&6
7606 else
7607
7608         cf_cv_ncurses_version=no
7609         cf_tempfile=out$$
7610         rm -f $cf_tempfile
7611         if test "$cross_compiling" = yes; then
7612
7613         # This will not work if the preprocessor splits the line after the
7614         # Autoconf token.  The 'unproto' program does that.
7615         cat > conftest.$ac_ext <<EOF
7616 #include <${cf_cv_ncurses_header:-curses.h}>
7617 #undef Autoconf
7618 #ifdef NCURSES_VERSION
7619 Autoconf NCURSES_VERSION
7620 #else
7621 #ifdef __NCURSES_H
7622 Autoconf "old"
7623 #endif
7624 ;
7625 #endif
7626 EOF
7627         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7628         { (eval echo "$as_me:7628: \"$cf_try\"") >&5
7629   (eval $cf_try) 2>&5
7630   ac_status=$?
7631   echo "$as_me:7631: \$? = $ac_status" >&5
7632   (exit $ac_status); }
7633         if test -f conftest.out ; then
7634                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7635                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7636                 rm -f conftest.out
7637         fi
7638
7639 else
7640   cat >conftest.$ac_ext <<_ACEOF
7641 #line 7641 "configure"
7642 #include "confdefs.h"
7643
7644 #include <${cf_cv_ncurses_header:-curses.h}>
7645 #include <stdio.h>
7646 int main()
7647 {
7648         FILE *fp = fopen("$cf_tempfile", "w");
7649 #ifdef NCURSES_VERSION
7650 # ifdef NCURSES_VERSION_PATCH
7651         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7652 # else
7653         fprintf(fp, "%s\n", NCURSES_VERSION);
7654 # endif
7655 #else
7656 # ifdef __NCURSES_H
7657         fprintf(fp, "old\n");
7658 # else
7659         make an error
7660 # endif
7661 #endif
7662         ${cf_cv_main_return:-return}(0);
7663 }
7664 _ACEOF
7665 rm -f conftest$ac_exeext
7666 if { (eval echo "$as_me:7666: \"$ac_link\"") >&5
7667   (eval $ac_link) 2>&5
7668   ac_status=$?
7669   echo "$as_me:7669: \$? = $ac_status" >&5
7670   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7671   { (eval echo "$as_me:7671: \"$ac_try\"") >&5
7672   (eval $ac_try) 2>&5
7673   ac_status=$?
7674   echo "$as_me:7674: \$? = $ac_status" >&5
7675   (exit $ac_status); }; }; then
7676
7677         cf_cv_ncurses_version=`cat $cf_tempfile`
7678 else
7679   echo "$as_me: program exited with status $ac_status" >&5
7680 echo "$as_me: failed program was:" >&5
7681 cat conftest.$ac_ext >&5
7682 fi
7683 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7684 fi
7685         rm -f $cf_tempfile
7686
7687 fi
7688 echo "$as_me:7688: result: $cf_cv_ncurses_version" >&5
7689 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7690 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
7691 #define NCURSES 1
7692 EOF
7693
7694 cf_nculib_root=ncursesw
7695         # This works, except for the special case where we find gpm, but
7696         # ncurses is in a nonstandard location via $LIBS, and we really want
7697         # to link gpm.
7698 cf_ncurses_LIBS=""
7699 cf_ncurses_SAVE="$LIBS"
7700 echo "$as_me:7700: checking for Gpm_Open in -lgpm" >&5
7701 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7702 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7703   echo $ECHO_N "(cached) $ECHO_C" >&6
7704 else
7705   ac_check_lib_save_LIBS=$LIBS
7706 LIBS="-lgpm  $LIBS"
7707 cat >conftest.$ac_ext <<_ACEOF
7708 #line 7708 "configure"
7709 #include "confdefs.h"
7710
7711 /* Override any gcc2 internal prototype to avoid an error.  */
7712 #ifdef __cplusplus
7713 extern "C"
7714 #endif
7715 /* We use char because int might match the return type of a gcc2
7716    builtin and then its argument prototype would still apply.  */
7717 char Gpm_Open ();
7718 int
7719 main ()
7720 {
7721 Gpm_Open ();
7722   ;
7723   return 0;
7724 }
7725 _ACEOF
7726 rm -f conftest.$ac_objext conftest$ac_exeext
7727 if { (eval echo "$as_me:7727: \"$ac_link\"") >&5
7728   (eval $ac_link) 2>&5
7729   ac_status=$?
7730   echo "$as_me:7730: \$? = $ac_status" >&5
7731   (exit $ac_status); } &&
7732          { ac_try='test -s conftest$ac_exeext'
7733   { (eval echo "$as_me:7733: \"$ac_try\"") >&5
7734   (eval $ac_try) 2>&5
7735   ac_status=$?
7736   echo "$as_me:7736: \$? = $ac_status" >&5
7737   (exit $ac_status); }; }; then
7738   ac_cv_lib_gpm_Gpm_Open=yes
7739 else
7740   echo "$as_me: failed program was:" >&5
7741 cat conftest.$ac_ext >&5
7742 ac_cv_lib_gpm_Gpm_Open=no
7743 fi
7744 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7745 LIBS=$ac_check_lib_save_LIBS
7746 fi
7747 echo "$as_me:7747: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7748 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7749 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7750   echo "$as_me:7750: checking for initscr in -lgpm" >&5
7751 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7752 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7753   echo $ECHO_N "(cached) $ECHO_C" >&6
7754 else
7755   ac_check_lib_save_LIBS=$LIBS
7756 LIBS="-lgpm  $LIBS"
7757 cat >conftest.$ac_ext <<_ACEOF
7758 #line 7758 "configure"
7759 #include "confdefs.h"
7760
7761 /* Override any gcc2 internal prototype to avoid an error.  */
7762 #ifdef __cplusplus
7763 extern "C"
7764 #endif
7765 /* We use char because int might match the return type of a gcc2
7766    builtin and then its argument prototype would still apply.  */
7767 char initscr ();
7768 int
7769 main ()
7770 {
7771 initscr ();
7772   ;
7773   return 0;
7774 }
7775 _ACEOF
7776 rm -f conftest.$ac_objext conftest$ac_exeext
7777 if { (eval echo "$as_me:7777: \"$ac_link\"") >&5
7778   (eval $ac_link) 2>&5
7779   ac_status=$?
7780   echo "$as_me:7780: \$? = $ac_status" >&5
7781   (exit $ac_status); } &&
7782          { ac_try='test -s conftest$ac_exeext'
7783   { (eval echo "$as_me:7783: \"$ac_try\"") >&5
7784   (eval $ac_try) 2>&5
7785   ac_status=$?
7786   echo "$as_me:7786: \$? = $ac_status" >&5
7787   (exit $ac_status); }; }; then
7788   ac_cv_lib_gpm_initscr=yes
7789 else
7790   echo "$as_me: failed program was:" >&5
7791 cat conftest.$ac_ext >&5
7792 ac_cv_lib_gpm_initscr=no
7793 fi
7794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7795 LIBS=$ac_check_lib_save_LIBS
7796 fi
7797 echo "$as_me:7797: result: $ac_cv_lib_gpm_initscr" >&5
7798 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7799 if test $ac_cv_lib_gpm_initscr = yes; then
7800   LIBS="$cf_ncurses_SAVE"
7801 else
7802   cf_ncurses_LIBS="-lgpm"
7803 fi
7804
7805 fi
7806
7807 case $host_os in #(vi
7808 freebsd*)
7809         # This is only necessary if you are linking against an obsolete
7810         # version of ncurses (but it should do no harm, since it's static).
7811         if test "$cf_nculib_root" = ncurses ; then
7812                 echo "$as_me:7812: checking for tgoto in -lmytinfo" >&5
7813 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7814 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7815   echo $ECHO_N "(cached) $ECHO_C" >&6
7816 else
7817   ac_check_lib_save_LIBS=$LIBS
7818 LIBS="-lmytinfo  $LIBS"
7819 cat >conftest.$ac_ext <<_ACEOF
7820 #line 7820 "configure"
7821 #include "confdefs.h"
7822
7823 /* Override any gcc2 internal prototype to avoid an error.  */
7824 #ifdef __cplusplus
7825 extern "C"
7826 #endif
7827 /* We use char because int might match the return type of a gcc2
7828    builtin and then its argument prototype would still apply.  */
7829 char tgoto ();
7830 int
7831 main ()
7832 {
7833 tgoto ();
7834   ;
7835   return 0;
7836 }
7837 _ACEOF
7838 rm -f conftest.$ac_objext conftest$ac_exeext
7839 if { (eval echo "$as_me:7839: \"$ac_link\"") >&5
7840   (eval $ac_link) 2>&5
7841   ac_status=$?
7842   echo "$as_me:7842: \$? = $ac_status" >&5
7843   (exit $ac_status); } &&
7844          { ac_try='test -s conftest$ac_exeext'
7845   { (eval echo "$as_me:7845: \"$ac_try\"") >&5
7846   (eval $ac_try) 2>&5
7847   ac_status=$?
7848   echo "$as_me:7848: \$? = $ac_status" >&5
7849   (exit $ac_status); }; }; then
7850   ac_cv_lib_mytinfo_tgoto=yes
7851 else
7852   echo "$as_me: failed program was:" >&5
7853 cat conftest.$ac_ext >&5
7854 ac_cv_lib_mytinfo_tgoto=no
7855 fi
7856 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7857 LIBS=$ac_check_lib_save_LIBS
7858 fi
7859 echo "$as_me:7859: result: $ac_cv_lib_mytinfo_tgoto" >&5
7860 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7861 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7862   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7863 fi
7864
7865         fi
7866         ;;
7867 esac
7868
7869 LIBS="$cf_ncurses_LIBS $LIBS"
7870
7871 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7872 then
7873
7874 if test -n "$cf_cv_curses_dir/lib" ; then
7875   for cf_add_libdir in $cf_cv_curses_dir/lib
7876   do
7877     if test $cf_add_libdir = /usr/lib ; then
7878       :
7879     elif test -d $cf_add_libdir
7880     then
7881       cf_have_libdir=no
7882       if test -n "$LDFLAGS$LIBS" ; then
7883         # a loop is needed to ensure we can add subdirs of existing dirs
7884         for cf_test_libdir in $LDFLAGS $LIBS ; do
7885           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7886             cf_have_libdir=yes; break
7887           fi
7888         done
7889       fi
7890       if test "$cf_have_libdir" = no ; then
7891         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7892
7893 echo "${as_me:-configure}:7893: testing adding $cf_add_libdir to library-path ..." 1>&5
7894
7895         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7896       fi
7897     fi
7898   done
7899 fi
7900
7901         LIBS="-l$cf_nculib_root $LIBS"
7902 else
7903
7904         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7905         cf_libdir=""
7906         echo "$as_me:7906: checking for initscr" >&5
7907 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7908 if test "${ac_cv_func_initscr+set}" = set; then
7909   echo $ECHO_N "(cached) $ECHO_C" >&6
7910 else
7911   cat >conftest.$ac_ext <<_ACEOF
7912 #line 7912 "configure"
7913 #include "confdefs.h"
7914 /* System header to define __stub macros and hopefully few prototypes,
7915     which can conflict with char initscr (); below.  */
7916 #include <assert.h>
7917 /* Override any gcc2 internal prototype to avoid an error.  */
7918 #ifdef __cplusplus
7919 extern "C"
7920 #endif
7921 /* We use char because int might match the return type of a gcc2
7922    builtin and then its argument prototype would still apply.  */
7923 char initscr ();
7924 char (*f) ();
7925
7926 int
7927 main ()
7928 {
7929 /* The GNU C library defines this for functions which it implements
7930     to always fail with ENOSYS.  Some functions are actually named
7931     something starting with __ and the normal name is an alias.  */
7932 #if defined (__stub_initscr) || defined (__stub___initscr)
7933 choke me
7934 #else
7935 f = initscr;
7936 #endif
7937
7938   ;
7939   return 0;
7940 }
7941 _ACEOF
7942 rm -f conftest.$ac_objext conftest$ac_exeext
7943 if { (eval echo "$as_me:7943: \"$ac_link\"") >&5
7944   (eval $ac_link) 2>&5
7945   ac_status=$?
7946   echo "$as_me:7946: \$? = $ac_status" >&5
7947   (exit $ac_status); } &&
7948          { ac_try='test -s conftest$ac_exeext'
7949   { (eval echo "$as_me:7949: \"$ac_try\"") >&5
7950   (eval $ac_try) 2>&5
7951   ac_status=$?
7952   echo "$as_me:7952: \$? = $ac_status" >&5
7953   (exit $ac_status); }; }; then
7954   ac_cv_func_initscr=yes
7955 else
7956   echo "$as_me: failed program was:" >&5
7957 cat conftest.$ac_ext >&5
7958 ac_cv_func_initscr=no
7959 fi
7960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7961 fi
7962 echo "$as_me:7962: result: $ac_cv_func_initscr" >&5
7963 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7964 if test $ac_cv_func_initscr = yes; then
7965   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7966 else
7967
7968                 cf_save_LIBS="$LIBS"
7969                 echo "$as_me:7969: checking for initscr in -l$cf_nculib_root" >&5
7970 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7971                 LIBS="-l$cf_nculib_root $LIBS"
7972                 cat >conftest.$ac_ext <<_ACEOF
7973 #line 7973 "configure"
7974 #include "confdefs.h"
7975 #include <${cf_cv_ncurses_header:-curses.h}>
7976 int
7977 main ()
7978 {
7979 initscr()
7980   ;
7981   return 0;
7982 }
7983 _ACEOF
7984 rm -f conftest.$ac_objext conftest$ac_exeext
7985 if { (eval echo "$as_me:7985: \"$ac_link\"") >&5
7986   (eval $ac_link) 2>&5
7987   ac_status=$?
7988   echo "$as_me:7988: \$? = $ac_status" >&5
7989   (exit $ac_status); } &&
7990          { ac_try='test -s conftest$ac_exeext'
7991   { (eval echo "$as_me:7991: \"$ac_try\"") >&5
7992   (eval $ac_try) 2>&5
7993   ac_status=$?
7994   echo "$as_me:7994: \$? = $ac_status" >&5
7995   (exit $ac_status); }; }; then
7996   echo "$as_me:7996: result: yes" >&5
7997 echo "${ECHO_T}yes" >&6
7998                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7999
8000 else
8001   echo "$as_me: failed program was:" >&5
8002 cat conftest.$ac_ext >&5
8003 echo "$as_me:8003: result: no" >&5
8004 echo "${ECHO_T}no" >&6
8005
8006 cf_search=
8007 cf_library_path_list=""
8008 if test -n "${LDFLAGS}${LIBS}" ; then
8009         for cf_library_path in $LDFLAGS $LIBS
8010         do
8011                 case $cf_library_path in #(vi
8012                 -L*)
8013                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8014
8015 test "$cf_library_path" != "NONE" && \
8016 test -d "$cf_library_path" && \
8017  {
8018         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8019         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8020         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8021         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8022         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8023         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"
8024 }
8025
8026                         cf_library_path_list="$cf_library_path_list $cf_search"
8027                         ;;
8028                 esac
8029         done
8030 fi
8031
8032 cf_search=
8033
8034 test "/usr" != "$prefix" && \
8035 test -d "/usr" && \
8036 (test $prefix = NONE || test "/usr" != "$prefix") && {
8037         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8038         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8039         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8040         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8041         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8042         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8043 }
8044
8045 test "$prefix" != "NONE" && \
8046 test -d "$prefix" && \
8047  {
8048         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8049         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8050         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8051         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8052         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8053         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8054 }
8055
8056 test "/usr/local" != "$prefix" && \
8057 test -d "/usr/local" && \
8058 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8059         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8060         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8061         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8062         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8063         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8064         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8065 }
8066
8067 test "/opt" != "$prefix" && \
8068 test -d "/opt" && \
8069 (test $prefix = NONE || test "/opt" != "$prefix") && {
8070         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8071         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8072         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8073         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8074         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8075         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8076 }
8077
8078 test "$HOME" != "$prefix" && \
8079 test -d "$HOME" && \
8080 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8081         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8082         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8083         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8084         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8085         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8086         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8087 }
8088
8089 cf_search="$cf_library_path_list $cf_search"
8090
8091                         for cf_libdir in $cf_search
8092                         do
8093                                 echo "$as_me:8093: checking for -l$cf_nculib_root in $cf_libdir" >&5
8094 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8095                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8096                                 cat >conftest.$ac_ext <<_ACEOF
8097 #line 8097 "configure"
8098 #include "confdefs.h"
8099 #include <${cf_cv_ncurses_header:-curses.h}>
8100 int
8101 main ()
8102 {
8103 initscr()
8104   ;
8105   return 0;
8106 }
8107 _ACEOF
8108 rm -f conftest.$ac_objext conftest$ac_exeext
8109 if { (eval echo "$as_me:8109: \"$ac_link\"") >&5
8110   (eval $ac_link) 2>&5
8111   ac_status=$?
8112   echo "$as_me:8112: \$? = $ac_status" >&5
8113   (exit $ac_status); } &&
8114          { ac_try='test -s conftest$ac_exeext'
8115   { (eval echo "$as_me:8115: \"$ac_try\"") >&5
8116   (eval $ac_try) 2>&5
8117   ac_status=$?
8118   echo "$as_me:8118: \$? = $ac_status" >&5
8119   (exit $ac_status); }; }; then
8120   echo "$as_me:8120: result: yes" >&5
8121 echo "${ECHO_T}yes" >&6
8122                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8123                                          break
8124 else
8125   echo "$as_me: failed program was:" >&5
8126 cat conftest.$ac_ext >&5
8127 echo "$as_me:8127: result: no" >&5
8128 echo "${ECHO_T}no" >&6
8129                                          LIBS="$cf_save_LIBS"
8130 fi
8131 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8132                         done
8133
8134 fi
8135 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8136
8137 fi
8138
8139 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8140
8141 if test $cf_found_library = no ; then
8142         { { echo "$as_me:8142: error: Cannot link $cf_nculib_root library" >&5
8143 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8144    { (exit 1); exit 1; }; }
8145 fi
8146
8147 fi
8148
8149 if test -n "$cf_ncurses_LIBS" ; then
8150         echo "$as_me:8150: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8151 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8152         cf_ncurses_SAVE="$LIBS"
8153         for p in $cf_ncurses_LIBS ; do
8154                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8155                 if test "$q" != "$LIBS" ; then
8156                         LIBS="$q"
8157                 fi
8158         done
8159         cat >conftest.$ac_ext <<_ACEOF
8160 #line 8160 "configure"
8161 #include "confdefs.h"
8162 #include <${cf_cv_ncurses_header:-curses.h}>
8163 int
8164 main ()
8165 {
8166 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8167   ;
8168   return 0;
8169 }
8170 _ACEOF
8171 rm -f conftest.$ac_objext conftest$ac_exeext
8172 if { (eval echo "$as_me:8172: \"$ac_link\"") >&5
8173   (eval $ac_link) 2>&5
8174   ac_status=$?
8175   echo "$as_me:8175: \$? = $ac_status" >&5
8176   (exit $ac_status); } &&
8177          { ac_try='test -s conftest$ac_exeext'
8178   { (eval echo "$as_me:8178: \"$ac_try\"") >&5
8179   (eval $ac_try) 2>&5
8180   ac_status=$?
8181   echo "$as_me:8181: \$? = $ac_status" >&5
8182   (exit $ac_status); }; }; then
8183   echo "$as_me:8183: result: yes" >&5
8184 echo "${ECHO_T}yes" >&6
8185 else
8186   echo "$as_me: failed program was:" >&5
8187 cat conftest.$ac_ext >&5
8188 echo "$as_me:8188: result: no" >&5
8189 echo "${ECHO_T}no" >&6
8190                  LIBS="$cf_ncurses_SAVE"
8191 fi
8192 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8193 fi
8194
8195 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8196
8197 cat >>confdefs.h <<EOF
8198 #define $cf_nculib_ROOT 1
8199 EOF
8200
8201 fi
8202
8203         ;;
8204 pdcurses) #(vi
8205
8206 echo "$as_me:8206: checking if you want to use pkg-config" >&5
8207 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
8208
8209 # Check whether --with-pkg-config or --without-pkg-config was given.
8210 if test "${with_pkg_config+set}" = set; then
8211   withval="$with_pkg_config"
8212   cf_pkg_config=$withval
8213 else
8214   cf_pkg_config=yes
8215 fi;
8216 echo "$as_me:8216: result: $cf_pkg_config" >&5
8217 echo "${ECHO_T}$cf_pkg_config" >&6
8218
8219 case $cf_pkg_config in #(vi
8220 no) #(vi
8221         PKG_CONFIG=none
8222         ;;
8223 yes) #(vi
8224         # Extract the first word of "pkg-config", so it can be a program name with args.
8225 set dummy pkg-config; ac_word=$2
8226 echo "$as_me:8226: checking for $ac_word" >&5
8227 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8228 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
8229   echo $ECHO_N "(cached) $ECHO_C" >&6
8230 else
8231   case $PKG_CONFIG in
8232   [\\/]* | ?:[\\/]*)
8233   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
8234   ;;
8235   *)
8236   ac_save_IFS=$IFS; IFS=$ac_path_separator
8237 ac_dummy="$PATH"
8238 for ac_dir in $ac_dummy; do
8239   IFS=$ac_save_IFS
8240   test -z "$ac_dir" && ac_dir=.
8241   if $as_executable_p "$ac_dir/$ac_word"; then
8242    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
8243    echo "$as_me:8243: found $ac_dir/$ac_word" >&5
8244    break
8245 fi
8246 done
8247
8248   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
8249   ;;
8250 esac
8251 fi
8252 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
8253
8254 if test -n "$PKG_CONFIG"; then
8255   echo "$as_me:8255: result: $PKG_CONFIG" >&5
8256 echo "${ECHO_T}$PKG_CONFIG" >&6
8257 else
8258   echo "$as_me:8258: result: no" >&5
8259 echo "${ECHO_T}no" >&6
8260 fi
8261
8262         ;;
8263 *)
8264         PKG_CONFIG=$withval
8265         ;;
8266 esac
8267
8268 test -z "$PKG_CONFIG" && PKG_CONFIG=none
8269 if test "$PKG_CONFIG" != none ; then
8270
8271 if test "x$prefix" != xNONE; then
8272   cf_path_syntax="$prefix"
8273 else
8274   cf_path_syntax="$ac_default_prefix"
8275 fi
8276
8277 case ".$PKG_CONFIG" in #(vi
8278 .\$\(*\)*|.\'*\'*) #(vi
8279   ;;
8280 ..|./*|.\\*) #(vi
8281   ;;
8282 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
8283   ;;
8284 .\${*prefix}*) #(vi
8285   eval PKG_CONFIG="$PKG_CONFIG"
8286   case ".$PKG_CONFIG" in #(vi
8287   .NONE/*)
8288     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
8289     ;;
8290   esac
8291   ;; #(vi
8292 .no|.NONE/*)
8293   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
8294   ;;
8295 *)
8296   { { echo "$as_me:8296: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
8297 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
8298    { (exit 1); exit 1; }; }
8299   ;;
8300 esac
8301
8302 fi
8303
8304 echo "$as_me:8304: checking for X" >&5
8305 echo $ECHO_N "checking for X... $ECHO_C" >&6
8306
8307 # Check whether --with-x or --without-x was given.
8308 if test "${with_x+set}" = set; then
8309   withval="$with_x"
8310
8311 fi;
8312 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8313 if test "x$with_x" = xno; then
8314   # The user explicitly disabled X.
8315   have_x=disabled
8316 else
8317   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8318     # Both variables are already set.
8319     have_x=yes
8320   else
8321     if test "${ac_cv_have_x+set}" = set; then
8322   echo $ECHO_N "(cached) $ECHO_C" >&6
8323 else
8324   # One or both of the vars are not set, and there is no cached value.
8325 ac_x_includes=no ac_x_libraries=no
8326 rm -fr conftest.dir
8327 if mkdir conftest.dir; then
8328   cd conftest.dir
8329   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8330   cat >Imakefile <<'EOF'
8331 acfindx:
8332         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8333 EOF
8334   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8335     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8336     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8337     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8338     for ac_extension in a so sl dylib dll; do
8339       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8340          test -f $ac_im_libdir/libX11.$ac_extension; then
8341         ac_im_usrlibdir=$ac_im_libdir; break
8342       fi
8343     done
8344     # Screen out bogus values from the imake configuration.  They are
8345     # bogus both because they are the default anyway, and because
8346     # using them would break gcc on systems where it needs fixed includes.
8347     case $ac_im_incroot in
8348         /usr/include) ;;
8349         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
8350     esac
8351     case $ac_im_usrlibdir in
8352         /usr/lib | /lib) ;;
8353         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
8354     esac
8355   fi
8356   cd ..
8357   rm -fr conftest.dir
8358 fi
8359
8360 # Standard set of common directories for X headers.
8361 # Check X11 before X11Rn because it is often a symlink to the current release.
8362 ac_x_header_dirs='
8363 /usr/X11/include
8364 /usr/X11R6/include
8365 /usr/X11R5/include
8366 /usr/X11R4/include
8367
8368 /usr/include/X11
8369 /usr/include/X11R6
8370 /usr/include/X11R5
8371 /usr/include/X11R4
8372
8373 /usr/local/X11/include
8374 /usr/local/X11R6/include
8375 /usr/local/X11R5/include
8376 /usr/local/X11R4/include
8377
8378 /usr/local/include/X11
8379 /usr/local/include/X11R6
8380 /usr/local/include/X11R5
8381 /usr/local/include/X11R4
8382
8383 /usr/X386/include
8384 /usr/x386/include
8385 /usr/XFree86/include/X11
8386
8387 /usr/include
8388 /usr/local/include
8389 /usr/unsupported/include
8390 /usr/athena/include
8391 /usr/local/x11r5/include
8392 /usr/lpp/Xamples/include
8393
8394 /usr/openwin/include
8395 /usr/openwin/share/include'
8396
8397 if test "$ac_x_includes" = no; then
8398   # Guess where to find include files, by looking for Intrinsic.h.
8399   # First, try using that file with no special directory specified.
8400   cat >conftest.$ac_ext <<_ACEOF
8401 #line 8401 "configure"
8402 #include "confdefs.h"
8403 #include <X11/Intrinsic.h>
8404 _ACEOF
8405 if { (eval echo "$as_me:8405: \"$ac_cpp conftest.$ac_ext\"") >&5
8406   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8407   ac_status=$?
8408   egrep -v '^ *\+' conftest.er1 >conftest.err
8409   rm -f conftest.er1
8410   cat conftest.err >&5
8411   echo "$as_me:8411: \$? = $ac_status" >&5
8412   (exit $ac_status); } >/dev/null; then
8413   if test -s conftest.err; then
8414     ac_cpp_err=$ac_c_preproc_warn_flag
8415   else
8416     ac_cpp_err=
8417   fi
8418 else
8419   ac_cpp_err=yes
8420 fi
8421 if test -z "$ac_cpp_err"; then
8422   # We can compile using X headers with no special include directory.
8423 ac_x_includes=
8424 else
8425   echo "$as_me: failed program was:" >&5
8426   cat conftest.$ac_ext >&5
8427   for ac_dir in $ac_x_header_dirs; do
8428   if test -r "$ac_dir/X11/Intrinsic.h"; then
8429     ac_x_includes=$ac_dir
8430     break
8431   fi
8432 done
8433 fi
8434 rm -f conftest.err conftest.$ac_ext
8435 fi # $ac_x_includes = no
8436
8437 if test "$ac_x_libraries" = no; then
8438   # Check for the libraries.
8439   # See if we find them without any special options.
8440   # Don't add to $LIBS permanently.
8441   ac_save_LIBS=$LIBS
8442   LIBS="-lXt $LIBS"
8443   cat >conftest.$ac_ext <<_ACEOF
8444 #line 8444 "configure"
8445 #include "confdefs.h"
8446 #include <X11/Intrinsic.h>
8447 int
8448 main ()
8449 {
8450 XtMalloc (0)
8451   ;
8452   return 0;
8453 }
8454 _ACEOF
8455 rm -f conftest.$ac_objext conftest$ac_exeext
8456 if { (eval echo "$as_me:8456: \"$ac_link\"") >&5
8457   (eval $ac_link) 2>&5
8458   ac_status=$?
8459   echo "$as_me:8459: \$? = $ac_status" >&5
8460   (exit $ac_status); } &&
8461          { ac_try='test -s conftest$ac_exeext'
8462   { (eval echo "$as_me:8462: \"$ac_try\"") >&5
8463   (eval $ac_try) 2>&5
8464   ac_status=$?
8465   echo "$as_me:8465: \$? = $ac_status" >&5
8466   (exit $ac_status); }; }; then
8467   LIBS=$ac_save_LIBS
8468 # We can link X programs with no special library path.
8469 ac_x_libraries=
8470 else
8471   echo "$as_me: failed program was:" >&5
8472 cat conftest.$ac_ext >&5
8473 LIBS=$ac_save_LIBS
8474 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
8475 do
8476   # Don't even attempt the hair of trying to link an X program!
8477   for ac_extension in a so sl dylib dll; do
8478     if test -r $ac_dir/libXt.$ac_extension; then
8479       ac_x_libraries=$ac_dir
8480       break 2
8481     fi
8482   done
8483 done
8484 fi
8485 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8486 fi # $ac_x_libraries = no
8487
8488 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
8489   # Didn't find X anywhere.  Cache the known absence of X.
8490   ac_cv_have_x="have_x=no"
8491 else
8492   # Record where we found X for the cache.
8493   ac_cv_have_x="have_x=yes \
8494                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
8495 fi
8496 fi
8497
8498   fi
8499   eval "$ac_cv_have_x"
8500 fi # $with_x != no
8501
8502 if test "$have_x" != yes; then
8503   echo "$as_me:8503: result: $have_x" >&5
8504 echo "${ECHO_T}$have_x" >&6
8505   no_x=yes
8506 else
8507   # If each of the values was on the command line, it overrides each guess.
8508   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
8509   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
8510   # Update the cache value to reflect the command line values.
8511   ac_cv_have_x="have_x=yes \
8512                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
8513   echo "$as_me:8513: result: libraries $x_libraries, headers $x_includes" >&5
8514 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
8515 fi
8516
8517 if test "$no_x" = yes; then
8518   # Not all programs may use this symbol, but it does not hurt to define it.
8519
8520 cat >>confdefs.h <<\EOF
8521 #define X_DISPLAY_MISSING 1
8522 EOF
8523
8524   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
8525 else
8526   if test -n "$x_includes"; then
8527     X_CFLAGS="$X_CFLAGS -I$x_includes"
8528   fi
8529
8530   # It would also be nice to do this for all -L options, not just this one.
8531   if test -n "$x_libraries"; then
8532     X_LIBS="$X_LIBS -L$x_libraries"
8533     # For Solaris; some versions of Sun CC require a space after -R and
8534     # others require no space.  Words are not sufficient . . . .
8535     case `(uname -sr) 2>/dev/null` in
8536     "SunOS 5"*)
8537       echo "$as_me:8537: checking whether -R must be followed by a space" >&5
8538 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
8539       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
8540       cat >conftest.$ac_ext <<_ACEOF
8541 #line 8541 "configure"
8542 #include "confdefs.h"
8543
8544 int
8545 main ()
8546 {
8547
8548   ;
8549   return 0;
8550 }
8551 _ACEOF
8552 rm -f conftest.$ac_objext conftest$ac_exeext
8553 if { (eval echo "$as_me:8553: \"$ac_link\"") >&5
8554   (eval $ac_link) 2>&5
8555   ac_status=$?
8556   echo "$as_me:8556: \$? = $ac_status" >&5
8557   (exit $ac_status); } &&
8558          { ac_try='test -s conftest$ac_exeext'
8559   { (eval echo "$as_me:8559: \"$ac_try\"") >&5
8560   (eval $ac_try) 2>&5
8561   ac_status=$?
8562   echo "$as_me:8562: \$? = $ac_status" >&5
8563   (exit $ac_status); }; }; then
8564   ac_R_nospace=yes
8565 else
8566   echo "$as_me: failed program was:" >&5
8567 cat conftest.$ac_ext >&5
8568 ac_R_nospace=no
8569 fi
8570 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8571       if test $ac_R_nospace = yes; then
8572         echo "$as_me:8572: result: no" >&5
8573 echo "${ECHO_T}no" >&6
8574         X_LIBS="$X_LIBS -R$x_libraries"
8575       else
8576         LIBS="$ac_xsave_LIBS -R $x_libraries"
8577         cat >conftest.$ac_ext <<_ACEOF
8578 #line 8578 "configure"
8579 #include "confdefs.h"
8580
8581 int
8582 main ()
8583 {
8584
8585   ;
8586   return 0;
8587 }
8588 _ACEOF
8589 rm -f conftest.$ac_objext conftest$ac_exeext
8590 if { (eval echo "$as_me:8590: \"$ac_link\"") >&5
8591   (eval $ac_link) 2>&5
8592   ac_status=$?
8593   echo "$as_me:8593: \$? = $ac_status" >&5
8594   (exit $ac_status); } &&
8595          { ac_try='test -s conftest$ac_exeext'
8596   { (eval echo "$as_me:8596: \"$ac_try\"") >&5
8597   (eval $ac_try) 2>&5
8598   ac_status=$?
8599   echo "$as_me:8599: \$? = $ac_status" >&5
8600   (exit $ac_status); }; }; then
8601   ac_R_space=yes
8602 else
8603   echo "$as_me: failed program was:" >&5
8604 cat conftest.$ac_ext >&5
8605 ac_R_space=no
8606 fi
8607 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8608         if test $ac_R_space = yes; then
8609           echo "$as_me:8609: result: yes" >&5
8610 echo "${ECHO_T}yes" >&6
8611           X_LIBS="$X_LIBS -R $x_libraries"
8612         else
8613           echo "$as_me:8613: result: neither works" >&5
8614 echo "${ECHO_T}neither works" >&6
8615         fi
8616       fi
8617       LIBS=$ac_xsave_LIBS
8618     esac
8619   fi
8620
8621   # Check for system-dependent libraries X programs must link with.
8622   # Do this before checking for the system-independent R6 libraries
8623   # (-lICE), since we may need -lsocket or whatever for X linking.
8624
8625   if test "$ISC" = yes; then
8626     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
8627   else
8628     # Martyn Johnson says this is needed for Ultrix, if the X
8629     # libraries were built with DECnet support.  And Karl Berry says
8630     # the Alpha needs dnet_stub (dnet does not exist).
8631     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
8632     cat >conftest.$ac_ext <<_ACEOF
8633 #line 8633 "configure"
8634 #include "confdefs.h"
8635
8636 /* Override any gcc2 internal prototype to avoid an error.  */
8637 #ifdef __cplusplus
8638 extern "C"
8639 #endif
8640 /* We use char because int might match the return type of a gcc2
8641    builtin and then its argument prototype would still apply.  */
8642 char XOpenDisplay ();
8643 int
8644 main ()
8645 {
8646 XOpenDisplay ();
8647   ;
8648   return 0;
8649 }
8650 _ACEOF
8651 rm -f conftest.$ac_objext conftest$ac_exeext
8652 if { (eval echo "$as_me:8652: \"$ac_link\"") >&5
8653   (eval $ac_link) 2>&5
8654   ac_status=$?
8655   echo "$as_me:8655: \$? = $ac_status" >&5
8656   (exit $ac_status); } &&
8657          { ac_try='test -s conftest$ac_exeext'
8658   { (eval echo "$as_me:8658: \"$ac_try\"") >&5
8659   (eval $ac_try) 2>&5
8660   ac_status=$?
8661   echo "$as_me:8661: \$? = $ac_status" >&5
8662   (exit $ac_status); }; }; then
8663   :
8664 else
8665   echo "$as_me: failed program was:" >&5
8666 cat conftest.$ac_ext >&5
8667 echo "$as_me:8667: checking for dnet_ntoa in -ldnet" >&5
8668 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
8669 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
8670   echo $ECHO_N "(cached) $ECHO_C" >&6
8671 else
8672   ac_check_lib_save_LIBS=$LIBS
8673 LIBS="-ldnet  $LIBS"
8674 cat >conftest.$ac_ext <<_ACEOF
8675 #line 8675 "configure"
8676 #include "confdefs.h"
8677
8678 /* Override any gcc2 internal prototype to avoid an error.  */
8679 #ifdef __cplusplus
8680 extern "C"
8681 #endif
8682 /* We use char because int might match the return type of a gcc2
8683    builtin and then its argument prototype would still apply.  */
8684 char dnet_ntoa ();
8685 int
8686 main ()
8687 {
8688 dnet_ntoa ();
8689   ;
8690   return 0;
8691 }
8692 _ACEOF
8693 rm -f conftest.$ac_objext conftest$ac_exeext
8694 if { (eval echo "$as_me:8694: \"$ac_link\"") >&5
8695   (eval $ac_link) 2>&5
8696   ac_status=$?
8697   echo "$as_me:8697: \$? = $ac_status" >&5
8698   (exit $ac_status); } &&
8699          { ac_try='test -s conftest$ac_exeext'
8700   { (eval echo "$as_me:8700: \"$ac_try\"") >&5
8701   (eval $ac_try) 2>&5
8702   ac_status=$?
8703   echo "$as_me:8703: \$? = $ac_status" >&5
8704   (exit $ac_status); }; }; then
8705   ac_cv_lib_dnet_dnet_ntoa=yes
8706 else
8707   echo "$as_me: failed program was:" >&5
8708 cat conftest.$ac_ext >&5
8709 ac_cv_lib_dnet_dnet_ntoa=no
8710 fi
8711 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8712 LIBS=$ac_check_lib_save_LIBS
8713 fi
8714 echo "$as_me:8714: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
8715 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
8716 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
8717   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
8718 fi
8719
8720     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
8721       echo "$as_me:8721: checking for dnet_ntoa in -ldnet_stub" >&5
8722 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
8723 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
8724   echo $ECHO_N "(cached) $ECHO_C" >&6
8725 else
8726   ac_check_lib_save_LIBS=$LIBS
8727 LIBS="-ldnet_stub  $LIBS"
8728 cat >conftest.$ac_ext <<_ACEOF
8729 #line 8729 "configure"
8730 #include "confdefs.h"
8731
8732 /* Override any gcc2 internal prototype to avoid an error.  */
8733 #ifdef __cplusplus
8734 extern "C"
8735 #endif
8736 /* We use char because int might match the return type of a gcc2
8737    builtin and then its argument prototype would still apply.  */
8738 char dnet_ntoa ();
8739 int
8740 main ()
8741 {
8742 dnet_ntoa ();
8743   ;
8744   return 0;
8745 }
8746 _ACEOF
8747 rm -f conftest.$ac_objext conftest$ac_exeext
8748 if { (eval echo "$as_me:8748: \"$ac_link\"") >&5
8749   (eval $ac_link) 2>&5
8750   ac_status=$?
8751   echo "$as_me:8751: \$? = $ac_status" >&5
8752   (exit $ac_status); } &&
8753          { ac_try='test -s conftest$ac_exeext'
8754   { (eval echo "$as_me:8754: \"$ac_try\"") >&5
8755   (eval $ac_try) 2>&5
8756   ac_status=$?
8757   echo "$as_me:8757: \$? = $ac_status" >&5
8758   (exit $ac_status); }; }; then
8759   ac_cv_lib_dnet_stub_dnet_ntoa=yes
8760 else
8761   echo "$as_me: failed program was:" >&5
8762 cat conftest.$ac_ext >&5
8763 ac_cv_lib_dnet_stub_dnet_ntoa=no
8764 fi
8765 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8766 LIBS=$ac_check_lib_save_LIBS
8767 fi
8768 echo "$as_me:8768: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
8769 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
8770 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
8771   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
8772 fi
8773
8774     fi
8775 fi
8776 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8777     LIBS="$ac_xsave_LIBS"
8778
8779     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
8780     # to get the SysV transport functions.
8781     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
8782     # needs -lnsl.
8783     # The nsl library prevents programs from opening the X display
8784     # on Irix 5.2, according to T.E. Dickey.
8785     # The functions gethostbyname, getservbyname, and inet_addr are
8786     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
8787     echo "$as_me:8787: checking for gethostbyname" >&5
8788 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
8789 if test "${ac_cv_func_gethostbyname+set}" = set; then
8790   echo $ECHO_N "(cached) $ECHO_C" >&6
8791 else
8792   cat >conftest.$ac_ext <<_ACEOF
8793 #line 8793 "configure"
8794 #include "confdefs.h"
8795 /* System header to define __stub macros and hopefully few prototypes,
8796     which can conflict with char gethostbyname (); below.  */
8797 #include <assert.h>
8798 /* Override any gcc2 internal prototype to avoid an error.  */
8799 #ifdef __cplusplus
8800 extern "C"
8801 #endif
8802 /* We use char because int might match the return type of a gcc2
8803    builtin and then its argument prototype would still apply.  */
8804 char gethostbyname ();
8805 char (*f) ();
8806
8807 int
8808 main ()
8809 {
8810 /* The GNU C library defines this for functions which it implements
8811     to always fail with ENOSYS.  Some functions are actually named
8812     something starting with __ and the normal name is an alias.  */
8813 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
8814 choke me
8815 #else
8816 f = gethostbyname;
8817 #endif
8818
8819   ;
8820   return 0;
8821 }
8822 _ACEOF
8823 rm -f conftest.$ac_objext conftest$ac_exeext
8824 if { (eval echo "$as_me:8824: \"$ac_link\"") >&5
8825   (eval $ac_link) 2>&5
8826   ac_status=$?
8827   echo "$as_me:8827: \$? = $ac_status" >&5
8828   (exit $ac_status); } &&
8829          { ac_try='test -s conftest$ac_exeext'
8830   { (eval echo "$as_me:8830: \"$ac_try\"") >&5
8831   (eval $ac_try) 2>&5
8832   ac_status=$?
8833   echo "$as_me:8833: \$? = $ac_status" >&5
8834   (exit $ac_status); }; }; then
8835   ac_cv_func_gethostbyname=yes
8836 else
8837   echo "$as_me: failed program was:" >&5
8838 cat conftest.$ac_ext >&5
8839 ac_cv_func_gethostbyname=no
8840 fi
8841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8842 fi
8843 echo "$as_me:8843: result: $ac_cv_func_gethostbyname" >&5
8844 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
8845
8846     if test $ac_cv_func_gethostbyname = no; then
8847       echo "$as_me:8847: checking for gethostbyname in -lnsl" >&5
8848 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
8849 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
8850   echo $ECHO_N "(cached) $ECHO_C" >&6
8851 else
8852   ac_check_lib_save_LIBS=$LIBS
8853 LIBS="-lnsl  $LIBS"
8854 cat >conftest.$ac_ext <<_ACEOF
8855 #line 8855 "configure"
8856 #include "confdefs.h"
8857
8858 /* Override any gcc2 internal prototype to avoid an error.  */
8859 #ifdef __cplusplus
8860 extern "C"
8861 #endif
8862 /* We use char because int might match the return type of a gcc2
8863    builtin and then its argument prototype would still apply.  */
8864 char gethostbyname ();
8865 int
8866 main ()
8867 {
8868 gethostbyname ();
8869   ;
8870   return 0;
8871 }
8872 _ACEOF
8873 rm -f conftest.$ac_objext conftest$ac_exeext
8874 if { (eval echo "$as_me:8874: \"$ac_link\"") >&5
8875   (eval $ac_link) 2>&5
8876   ac_status=$?
8877   echo "$as_me:8877: \$? = $ac_status" >&5
8878   (exit $ac_status); } &&
8879          { ac_try='test -s conftest$ac_exeext'
8880   { (eval echo "$as_me:8880: \"$ac_try\"") >&5
8881   (eval $ac_try) 2>&5
8882   ac_status=$?
8883   echo "$as_me:8883: \$? = $ac_status" >&5
8884   (exit $ac_status); }; }; then
8885   ac_cv_lib_nsl_gethostbyname=yes
8886 else
8887   echo "$as_me: failed program was:" >&5
8888 cat conftest.$ac_ext >&5
8889 ac_cv_lib_nsl_gethostbyname=no
8890 fi
8891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8892 LIBS=$ac_check_lib_save_LIBS
8893 fi
8894 echo "$as_me:8894: result: $ac_cv_lib_nsl_gethostbyname" >&5
8895 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
8896 if test $ac_cv_lib_nsl_gethostbyname = yes; then
8897   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
8898 fi
8899
8900       if test $ac_cv_lib_nsl_gethostbyname = no; then
8901         echo "$as_me:8901: checking for gethostbyname in -lbsd" >&5
8902 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
8903 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
8904   echo $ECHO_N "(cached) $ECHO_C" >&6
8905 else
8906   ac_check_lib_save_LIBS=$LIBS
8907 LIBS="-lbsd  $LIBS"
8908 cat >conftest.$ac_ext <<_ACEOF
8909 #line 8909 "configure"
8910 #include "confdefs.h"
8911
8912 /* Override any gcc2 internal prototype to avoid an error.  */
8913 #ifdef __cplusplus
8914 extern "C"
8915 #endif
8916 /* We use char because int might match the return type of a gcc2
8917    builtin and then its argument prototype would still apply.  */
8918 char gethostbyname ();
8919 int
8920 main ()
8921 {
8922 gethostbyname ();
8923   ;
8924   return 0;
8925 }
8926 _ACEOF
8927 rm -f conftest.$ac_objext conftest$ac_exeext
8928 if { (eval echo "$as_me:8928: \"$ac_link\"") >&5
8929   (eval $ac_link) 2>&5
8930   ac_status=$?
8931   echo "$as_me:8931: \$? = $ac_status" >&5
8932   (exit $ac_status); } &&
8933          { ac_try='test -s conftest$ac_exeext'
8934   { (eval echo "$as_me:8934: \"$ac_try\"") >&5
8935   (eval $ac_try) 2>&5
8936   ac_status=$?
8937   echo "$as_me:8937: \$? = $ac_status" >&5
8938   (exit $ac_status); }; }; then
8939   ac_cv_lib_bsd_gethostbyname=yes
8940 else
8941   echo "$as_me: failed program was:" >&5
8942 cat conftest.$ac_ext >&5
8943 ac_cv_lib_bsd_gethostbyname=no
8944 fi
8945 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8946 LIBS=$ac_check_lib_save_LIBS
8947 fi
8948 echo "$as_me:8948: result: $ac_cv_lib_bsd_gethostbyname" >&5
8949 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
8950 if test $ac_cv_lib_bsd_gethostbyname = yes; then
8951   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
8952 fi
8953
8954       fi
8955     fi
8956
8957     # lieder@skyler.mavd.honeywell.com says without -lsocket,
8958     # socket/setsockopt and other routines are undefined under SCO ODT
8959     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
8960     # on later versions), says Simon Leinen: it contains gethostby*
8961     # variants that don't use the nameserver (or something).  -lsocket
8962     # must be given before -lnsl if both are needed.  We assume that
8963     # if connect needs -lnsl, so does gethostbyname.
8964     echo "$as_me:8964: checking for connect" >&5
8965 echo $ECHO_N "checking for connect... $ECHO_C" >&6
8966 if test "${ac_cv_func_connect+set}" = set; then
8967   echo $ECHO_N "(cached) $ECHO_C" >&6
8968 else
8969   cat >conftest.$ac_ext <<_ACEOF
8970 #line 8970 "configure"
8971 #include "confdefs.h"
8972 /* System header to define __stub macros and hopefully few prototypes,
8973     which can conflict with char connect (); below.  */
8974 #include <assert.h>
8975 /* Override any gcc2 internal prototype to avoid an error.  */
8976 #ifdef __cplusplus
8977 extern "C"
8978 #endif
8979 /* We use char because int might match the return type of a gcc2
8980    builtin and then its argument prototype would still apply.  */
8981 char connect ();
8982 char (*f) ();
8983
8984 int
8985 main ()
8986 {
8987 /* The GNU C library defines this for functions which it implements
8988     to always fail with ENOSYS.  Some functions are actually named
8989     something starting with __ and the normal name is an alias.  */
8990 #if defined (__stub_connect) || defined (__stub___connect)
8991 choke me
8992 #else
8993 f = connect;
8994 #endif
8995
8996   ;
8997   return 0;
8998 }
8999 _ACEOF
9000 rm -f conftest.$ac_objext conftest$ac_exeext
9001 if { (eval echo "$as_me:9001: \"$ac_link\"") >&5
9002   (eval $ac_link) 2>&5
9003   ac_status=$?
9004   echo "$as_me:9004: \$? = $ac_status" >&5
9005   (exit $ac_status); } &&
9006          { ac_try='test -s conftest$ac_exeext'
9007   { (eval echo "$as_me:9007: \"$ac_try\"") >&5
9008   (eval $ac_try) 2>&5
9009   ac_status=$?
9010   echo "$as_me:9010: \$? = $ac_status" >&5
9011   (exit $ac_status); }; }; then
9012   ac_cv_func_connect=yes
9013 else
9014   echo "$as_me: failed program was:" >&5
9015 cat conftest.$ac_ext >&5
9016 ac_cv_func_connect=no
9017 fi
9018 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9019 fi
9020 echo "$as_me:9020: result: $ac_cv_func_connect" >&5
9021 echo "${ECHO_T}$ac_cv_func_connect" >&6
9022
9023     if test $ac_cv_func_connect = no; then
9024       echo "$as_me:9024: checking for connect in -lsocket" >&5
9025 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9026 if test "${ac_cv_lib_socket_connect+set}" = set; then
9027   echo $ECHO_N "(cached) $ECHO_C" >&6
9028 else
9029   ac_check_lib_save_LIBS=$LIBS
9030 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9031 cat >conftest.$ac_ext <<_ACEOF
9032 #line 9032 "configure"
9033 #include "confdefs.h"
9034
9035 /* Override any gcc2 internal prototype to avoid an error.  */
9036 #ifdef __cplusplus
9037 extern "C"
9038 #endif
9039 /* We use char because int might match the return type of a gcc2
9040    builtin and then its argument prototype would still apply.  */
9041 char connect ();
9042 int
9043 main ()
9044 {
9045 connect ();
9046   ;
9047   return 0;
9048 }
9049 _ACEOF
9050 rm -f conftest.$ac_objext conftest$ac_exeext
9051 if { (eval echo "$as_me:9051: \"$ac_link\"") >&5
9052   (eval $ac_link) 2>&5
9053   ac_status=$?
9054   echo "$as_me:9054: \$? = $ac_status" >&5
9055   (exit $ac_status); } &&
9056          { ac_try='test -s conftest$ac_exeext'
9057   { (eval echo "$as_me:9057: \"$ac_try\"") >&5
9058   (eval $ac_try) 2>&5
9059   ac_status=$?
9060   echo "$as_me:9060: \$? = $ac_status" >&5
9061   (exit $ac_status); }; }; then
9062   ac_cv_lib_socket_connect=yes
9063 else
9064   echo "$as_me: failed program was:" >&5
9065 cat conftest.$ac_ext >&5
9066 ac_cv_lib_socket_connect=no
9067 fi
9068 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9069 LIBS=$ac_check_lib_save_LIBS
9070 fi
9071 echo "$as_me:9071: result: $ac_cv_lib_socket_connect" >&5
9072 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9073 if test $ac_cv_lib_socket_connect = yes; then
9074   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9075 fi
9076
9077     fi
9078
9079     # Guillermo Gomez says -lposix is necessary on A/UX.
9080     echo "$as_me:9080: checking for remove" >&5
9081 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9082 if test "${ac_cv_func_remove+set}" = set; then
9083   echo $ECHO_N "(cached) $ECHO_C" >&6
9084 else
9085   cat >conftest.$ac_ext <<_ACEOF
9086 #line 9086 "configure"
9087 #include "confdefs.h"
9088 /* System header to define __stub macros and hopefully few prototypes,
9089     which can conflict with char remove (); below.  */
9090 #include <assert.h>
9091 /* Override any gcc2 internal prototype to avoid an error.  */
9092 #ifdef __cplusplus
9093 extern "C"
9094 #endif
9095 /* We use char because int might match the return type of a gcc2
9096    builtin and then its argument prototype would still apply.  */
9097 char remove ();
9098 char (*f) ();
9099
9100 int
9101 main ()
9102 {
9103 /* The GNU C library defines this for functions which it implements
9104     to always fail with ENOSYS.  Some functions are actually named
9105     something starting with __ and the normal name is an alias.  */
9106 #if defined (__stub_remove) || defined (__stub___remove)
9107 choke me
9108 #else
9109 f = remove;
9110 #endif
9111
9112   ;
9113   return 0;
9114 }
9115 _ACEOF
9116 rm -f conftest.$ac_objext conftest$ac_exeext
9117 if { (eval echo "$as_me:9117: \"$ac_link\"") >&5
9118   (eval $ac_link) 2>&5
9119   ac_status=$?
9120   echo "$as_me:9120: \$? = $ac_status" >&5
9121   (exit $ac_status); } &&
9122          { ac_try='test -s conftest$ac_exeext'
9123   { (eval echo "$as_me:9123: \"$ac_try\"") >&5
9124   (eval $ac_try) 2>&5
9125   ac_status=$?
9126   echo "$as_me:9126: \$? = $ac_status" >&5
9127   (exit $ac_status); }; }; then
9128   ac_cv_func_remove=yes
9129 else
9130   echo "$as_me: failed program was:" >&5
9131 cat conftest.$ac_ext >&5
9132 ac_cv_func_remove=no
9133 fi
9134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9135 fi
9136 echo "$as_me:9136: result: $ac_cv_func_remove" >&5
9137 echo "${ECHO_T}$ac_cv_func_remove" >&6
9138
9139     if test $ac_cv_func_remove = no; then
9140       echo "$as_me:9140: checking for remove in -lposix" >&5
9141 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9142 if test "${ac_cv_lib_posix_remove+set}" = set; then
9143   echo $ECHO_N "(cached) $ECHO_C" >&6
9144 else
9145   ac_check_lib_save_LIBS=$LIBS
9146 LIBS="-lposix  $LIBS"
9147 cat >conftest.$ac_ext <<_ACEOF
9148 #line 9148 "configure"
9149 #include "confdefs.h"
9150
9151 /* Override any gcc2 internal prototype to avoid an error.  */
9152 #ifdef __cplusplus
9153 extern "C"
9154 #endif
9155 /* We use char because int might match the return type of a gcc2
9156    builtin and then its argument prototype would still apply.  */
9157 char remove ();
9158 int
9159 main ()
9160 {
9161 remove ();
9162   ;
9163   return 0;
9164 }
9165 _ACEOF
9166 rm -f conftest.$ac_objext conftest$ac_exeext
9167 if { (eval echo "$as_me:9167: \"$ac_link\"") >&5
9168   (eval $ac_link) 2>&5
9169   ac_status=$?
9170   echo "$as_me:9170: \$? = $ac_status" >&5
9171   (exit $ac_status); } &&
9172          { ac_try='test -s conftest$ac_exeext'
9173   { (eval echo "$as_me:9173: \"$ac_try\"") >&5
9174   (eval $ac_try) 2>&5
9175   ac_status=$?
9176   echo "$as_me:9176: \$? = $ac_status" >&5
9177   (exit $ac_status); }; }; then
9178   ac_cv_lib_posix_remove=yes
9179 else
9180   echo "$as_me: failed program was:" >&5
9181 cat conftest.$ac_ext >&5
9182 ac_cv_lib_posix_remove=no
9183 fi
9184 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9185 LIBS=$ac_check_lib_save_LIBS
9186 fi
9187 echo "$as_me:9187: result: $ac_cv_lib_posix_remove" >&5
9188 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9189 if test $ac_cv_lib_posix_remove = yes; then
9190   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9191 fi
9192
9193     fi
9194
9195     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9196     echo "$as_me:9196: checking for shmat" >&5
9197 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
9198 if test "${ac_cv_func_shmat+set}" = set; then
9199   echo $ECHO_N "(cached) $ECHO_C" >&6
9200 else
9201   cat >conftest.$ac_ext <<_ACEOF
9202 #line 9202 "configure"
9203 #include "confdefs.h"
9204 /* System header to define __stub macros and hopefully few prototypes,
9205     which can conflict with char shmat (); below.  */
9206 #include <assert.h>
9207 /* Override any gcc2 internal prototype to avoid an error.  */
9208 #ifdef __cplusplus
9209 extern "C"
9210 #endif
9211 /* We use char because int might match the return type of a gcc2
9212    builtin and then its argument prototype would still apply.  */
9213 char shmat ();
9214 char (*f) ();
9215
9216 int
9217 main ()
9218 {
9219 /* The GNU C library defines this for functions which it implements
9220     to always fail with ENOSYS.  Some functions are actually named
9221     something starting with __ and the normal name is an alias.  */
9222 #if defined (__stub_shmat) || defined (__stub___shmat)
9223 choke me
9224 #else
9225 f = shmat;
9226 #endif
9227
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_func_shmat=yes
9245 else
9246   echo "$as_me: failed program was:" >&5
9247 cat conftest.$ac_ext >&5
9248 ac_cv_func_shmat=no
9249 fi
9250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9251 fi
9252 echo "$as_me:9252: result: $ac_cv_func_shmat" >&5
9253 echo "${ECHO_T}$ac_cv_func_shmat" >&6
9254
9255     if test $ac_cv_func_shmat = no; then
9256       echo "$as_me:9256: checking for shmat in -lipc" >&5
9257 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
9258 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
9259   echo $ECHO_N "(cached) $ECHO_C" >&6
9260 else
9261   ac_check_lib_save_LIBS=$LIBS
9262 LIBS="-lipc  $LIBS"
9263 cat >conftest.$ac_ext <<_ACEOF
9264 #line 9264 "configure"
9265 #include "confdefs.h"
9266
9267 /* Override any gcc2 internal prototype to avoid an error.  */
9268 #ifdef __cplusplus
9269 extern "C"
9270 #endif
9271 /* We use char because int might match the return type of a gcc2
9272    builtin and then its argument prototype would still apply.  */
9273 char shmat ();
9274 int
9275 main ()
9276 {
9277 shmat ();
9278   ;
9279   return 0;
9280 }
9281 _ACEOF
9282 rm -f conftest.$ac_objext conftest$ac_exeext
9283 if { (eval echo "$as_me:9283: \"$ac_link\"") >&5
9284   (eval $ac_link) 2>&5
9285   ac_status=$?
9286   echo "$as_me:9286: \$? = $ac_status" >&5
9287   (exit $ac_status); } &&
9288          { ac_try='test -s conftest$ac_exeext'
9289   { (eval echo "$as_me:9289: \"$ac_try\"") >&5
9290   (eval $ac_try) 2>&5
9291   ac_status=$?
9292   echo "$as_me:9292: \$? = $ac_status" >&5
9293   (exit $ac_status); }; }; then
9294   ac_cv_lib_ipc_shmat=yes
9295 else
9296   echo "$as_me: failed program was:" >&5
9297 cat conftest.$ac_ext >&5
9298 ac_cv_lib_ipc_shmat=no
9299 fi
9300 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9301 LIBS=$ac_check_lib_save_LIBS
9302 fi
9303 echo "$as_me:9303: result: $ac_cv_lib_ipc_shmat" >&5
9304 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
9305 if test $ac_cv_lib_ipc_shmat = yes; then
9306   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
9307 fi
9308
9309     fi
9310   fi
9311
9312   # Check for libraries that X11R6 Xt/Xaw programs need.
9313   ac_save_LDFLAGS=$LDFLAGS
9314   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
9315   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
9316   # check for ICE first), but we must link in the order -lSM -lICE or
9317   # we get undefined symbols.  So assume we have SM if we have ICE.
9318   # These have to be linked with before -lX11, unlike the other
9319   # libraries we check for below, so use a different variable.
9320   # John Interrante, Karl Berry
9321   echo "$as_me:9321: checking for IceConnectionNumber in -lICE" >&5
9322 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
9323 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
9324   echo $ECHO_N "(cached) $ECHO_C" >&6
9325 else
9326   ac_check_lib_save_LIBS=$LIBS
9327 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
9328 cat >conftest.$ac_ext <<_ACEOF
9329 #line 9329 "configure"
9330 #include "confdefs.h"
9331
9332 /* Override any gcc2 internal prototype to avoid an error.  */
9333 #ifdef __cplusplus
9334 extern "C"
9335 #endif
9336 /* We use char because int might match the return type of a gcc2
9337    builtin and then its argument prototype would still apply.  */
9338 char IceConnectionNumber ();
9339 int
9340 main ()
9341 {
9342 IceConnectionNumber ();
9343   ;
9344   return 0;
9345 }
9346 _ACEOF
9347 rm -f conftest.$ac_objext conftest$ac_exeext
9348 if { (eval echo "$as_me:9348: \"$ac_link\"") >&5
9349   (eval $ac_link) 2>&5
9350   ac_status=$?
9351   echo "$as_me:9351: \$? = $ac_status" >&5
9352   (exit $ac_status); } &&
9353          { ac_try='test -s conftest$ac_exeext'
9354   { (eval echo "$as_me:9354: \"$ac_try\"") >&5
9355   (eval $ac_try) 2>&5
9356   ac_status=$?
9357   echo "$as_me:9357: \$? = $ac_status" >&5
9358   (exit $ac_status); }; }; then
9359   ac_cv_lib_ICE_IceConnectionNumber=yes
9360 else
9361   echo "$as_me: failed program was:" >&5
9362 cat conftest.$ac_ext >&5
9363 ac_cv_lib_ICE_IceConnectionNumber=no
9364 fi
9365 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9366 LIBS=$ac_check_lib_save_LIBS
9367 fi
9368 echo "$as_me:9368: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
9369 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
9370 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
9371   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
9372 fi
9373
9374   LDFLAGS=$ac_save_LDFLAGS
9375
9376 fi
9377
9378 cf_x_athena=${cf_x_athena:-Xaw}
9379
9380 echo "$as_me:9380: checking if you want to link with Xaw 3d library" >&5
9381 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
9382 withval=
9383
9384 # Check whether --with-Xaw3d or --without-Xaw3d was given.
9385 if test "${with_Xaw3d+set}" = set; then
9386   withval="$with_Xaw3d"
9387
9388 fi;
9389 if test "$withval" = yes ; then
9390         cf_x_athena=Xaw3d
9391         echo "$as_me:9391: result: yes" >&5
9392 echo "${ECHO_T}yes" >&6
9393 else
9394         echo "$as_me:9394: result: no" >&5
9395 echo "${ECHO_T}no" >&6
9396 fi
9397
9398 echo "$as_me:9398: checking if you want to link with neXT Athena library" >&5
9399 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
9400 withval=
9401
9402 # Check whether --with-neXtaw or --without-neXtaw was given.
9403 if test "${with_neXtaw+set}" = set; then
9404   withval="$with_neXtaw"
9405
9406 fi;
9407 if test "$withval" = yes ; then
9408         cf_x_athena=neXtaw
9409         echo "$as_me:9409: result: yes" >&5
9410 echo "${ECHO_T}yes" >&6
9411 else
9412         echo "$as_me:9412: result: no" >&5
9413 echo "${ECHO_T}no" >&6
9414 fi
9415
9416 echo "$as_me:9416: checking if you want to link with Athena-Plus library" >&5
9417 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
9418 withval=
9419
9420 # Check whether --with-XawPlus or --without-XawPlus was given.
9421 if test "${with_XawPlus+set}" = set; then
9422   withval="$with_XawPlus"
9423
9424 fi;
9425 if test "$withval" = yes ; then
9426         cf_x_athena=XawPlus
9427         echo "$as_me:9427: result: yes" >&5
9428 echo "${ECHO_T}yes" >&6
9429 else
9430         echo "$as_me:9430: result: no" >&5
9431 echo "${ECHO_T}no" >&6
9432 fi
9433
9434 cf_x_athena_lib=""
9435
9436 if test "$PKG_CONFIG" != none ; then
9437         cf_athena_list=
9438         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
9439         for cf_athena_pkg in \
9440                 $cf_athena_list \
9441                 ${cf_x_athena} \
9442                 ${cf_x_athena}-devel \
9443                 lib${cf_x_athena} \
9444                 lib${cf_x_athena}-devel
9445         do
9446
9447 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
9448         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
9449
9450 echo "${as_me:-configure}:9450: testing found package $cf_athena_pkg ..." 1>&5
9451
9452         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
9453         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
9454         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
9455
9456 echo "${as_me:-configure}:9456: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9457
9458         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
9459
9460 echo "${as_me:-configure}:9460: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
9461
9462 cf_fix_cppflags=no
9463 cf_new_cflags=
9464 cf_new_cppflags=
9465 cf_new_extra_cppflags=
9466
9467 for cf_add_cflags in $cf_pkgconfig_incs
9468 do
9469 case $cf_fix_cppflags in
9470 no)
9471         case $cf_add_cflags in #(vi
9472         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9473                 case $cf_add_cflags in
9474                 -D*)
9475                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9476
9477                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9478                                 && test -z "${cf_tst_cflags}" \
9479                                 && cf_fix_cppflags=yes
9480
9481                         if test $cf_fix_cppflags = yes ; then
9482                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9483                                 continue
9484                         elif test "${cf_tst_cflags}" = "\"'" ; then
9485                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9486                                 continue
9487                         fi
9488                         ;;
9489                 esac
9490                 case "$CPPFLAGS" in
9491                 *$cf_add_cflags) #(vi
9492                         ;;
9493                 *) #(vi
9494                         case $cf_add_cflags in #(vi
9495                         -D*)
9496                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9497
9498 CPPFLAGS=`echo "$CPPFLAGS" | \
9499         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9500                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9501
9502                                 ;;
9503                         esac
9504                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9505                         ;;
9506                 esac
9507                 ;;
9508         *)
9509                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9510                 ;;
9511         esac
9512         ;;
9513 yes)
9514         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9515
9516         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9517
9518         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9519                 && test -z "${cf_tst_cflags}" \
9520                 && cf_fix_cppflags=no
9521         ;;
9522 esac
9523 done
9524
9525 if test -n "$cf_new_cflags" ; then
9526
9527         CFLAGS="$CFLAGS $cf_new_cflags"
9528 fi
9529
9530 if test -n "$cf_new_cppflags" ; then
9531
9532         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9533 fi
9534
9535 if test -n "$cf_new_extra_cppflags" ; then
9536
9537         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9538 fi
9539
9540         LIBS="$cf_pkgconfig_libs $LIBS"
9541
9542                         cf_x_athena_lib="$cf_pkgconfig_libs"
9543
9544 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9545
9546                         cat >>confdefs.h <<EOF
9547 #define $cf_x_athena_LIBS 1
9548 EOF
9549
9550                         break
9551 else
9552         :
9553 fi
9554
9555         done
9556 fi
9557
9558 if test -z "$cf_x_athena_lib" ; then
9559
9560 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
9561         test -n "$verbose" && echo "    found package Xext" 1>&6
9562
9563 echo "${as_me:-configure}:9563: testing found package Xext ..." 1>&5
9564
9565         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
9566         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
9567         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
9568
9569 echo "${as_me:-configure}:9569: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9570
9571         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
9572
9573 echo "${as_me:-configure}:9573: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
9574
9575 cf_fix_cppflags=no
9576 cf_new_cflags=
9577 cf_new_cppflags=
9578 cf_new_extra_cppflags=
9579
9580 for cf_add_cflags in $cf_pkgconfig_incs
9581 do
9582 case $cf_fix_cppflags in
9583 no)
9584         case $cf_add_cflags in #(vi
9585         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9586                 case $cf_add_cflags in
9587                 -D*)
9588                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9589
9590                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9591                                 && test -z "${cf_tst_cflags}" \
9592                                 && cf_fix_cppflags=yes
9593
9594                         if test $cf_fix_cppflags = yes ; then
9595                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9596                                 continue
9597                         elif test "${cf_tst_cflags}" = "\"'" ; then
9598                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9599                                 continue
9600                         fi
9601                         ;;
9602                 esac
9603                 case "$CPPFLAGS" in
9604                 *$cf_add_cflags) #(vi
9605                         ;;
9606                 *) #(vi
9607                         case $cf_add_cflags in #(vi
9608                         -D*)
9609                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9610
9611 CPPFLAGS=`echo "$CPPFLAGS" | \
9612         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9613                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9614
9615                                 ;;
9616                         esac
9617                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9618                         ;;
9619                 esac
9620                 ;;
9621         *)
9622                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9623                 ;;
9624         esac
9625         ;;
9626 yes)
9627         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9628
9629         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9630
9631         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9632                 && test -z "${cf_tst_cflags}" \
9633                 && cf_fix_cppflags=no
9634         ;;
9635 esac
9636 done
9637
9638 if test -n "$cf_new_cflags" ; then
9639
9640         CFLAGS="$CFLAGS $cf_new_cflags"
9641 fi
9642
9643 if test -n "$cf_new_cppflags" ; then
9644
9645         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9646 fi
9647
9648 if test -n "$cf_new_extra_cppflags" ; then
9649
9650         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9651 fi
9652
9653         LIBS="$cf_pkgconfig_libs $LIBS"
9654         :
9655 else
9656
9657         echo "$as_me:9657: checking for XextCreateExtension in -lXext" >&5
9658 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
9659 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
9660   echo $ECHO_N "(cached) $ECHO_C" >&6
9661 else
9662   ac_check_lib_save_LIBS=$LIBS
9663 LIBS="-lXext  $LIBS"
9664 cat >conftest.$ac_ext <<_ACEOF
9665 #line 9665 "configure"
9666 #include "confdefs.h"
9667
9668 /* Override any gcc2 internal prototype to avoid an error.  */
9669 #ifdef __cplusplus
9670 extern "C"
9671 #endif
9672 /* We use char because int might match the return type of a gcc2
9673    builtin and then its argument prototype would still apply.  */
9674 char XextCreateExtension ();
9675 int
9676 main ()
9677 {
9678 XextCreateExtension ();
9679   ;
9680   return 0;
9681 }
9682 _ACEOF
9683 rm -f conftest.$ac_objext conftest$ac_exeext
9684 if { (eval echo "$as_me:9684: \"$ac_link\"") >&5
9685   (eval $ac_link) 2>&5
9686   ac_status=$?
9687   echo "$as_me:9687: \$? = $ac_status" >&5
9688   (exit $ac_status); } &&
9689          { ac_try='test -s conftest$ac_exeext'
9690   { (eval echo "$as_me:9690: \"$ac_try\"") >&5
9691   (eval $ac_try) 2>&5
9692   ac_status=$?
9693   echo "$as_me:9693: \$? = $ac_status" >&5
9694   (exit $ac_status); }; }; then
9695   ac_cv_lib_Xext_XextCreateExtension=yes
9696 else
9697   echo "$as_me: failed program was:" >&5
9698 cat conftest.$ac_ext >&5
9699 ac_cv_lib_Xext_XextCreateExtension=no
9700 fi
9701 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9702 LIBS=$ac_check_lib_save_LIBS
9703 fi
9704 echo "$as_me:9704: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
9705 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
9706 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
9707   LIBS="-lXext $LIBS"
9708 fi
9709
9710 fi
9711
9712 cf_have_X_LIBS=no
9713
9714 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
9715         test -n "$verbose" && echo "    found package xt" 1>&6
9716
9717 echo "${as_me:-configure}:9717: testing found package xt ..." 1>&5
9718
9719         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
9720         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
9721         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
9722
9723 echo "${as_me:-configure}:9723: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
9724
9725         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
9726
9727 echo "${as_me:-configure}:9727: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
9728
9729 cf_fix_cppflags=no
9730 cf_new_cflags=
9731 cf_new_cppflags=
9732 cf_new_extra_cppflags=
9733
9734 for cf_add_cflags in $cf_pkgconfig_incs
9735 do
9736 case $cf_fix_cppflags in
9737 no)
9738         case $cf_add_cflags in #(vi
9739         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9740                 case $cf_add_cflags in
9741                 -D*)
9742                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9743
9744                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9745                                 && test -z "${cf_tst_cflags}" \
9746                                 && cf_fix_cppflags=yes
9747
9748                         if test $cf_fix_cppflags = yes ; then
9749                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9750                                 continue
9751                         elif test "${cf_tst_cflags}" = "\"'" ; then
9752                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9753                                 continue
9754                         fi
9755                         ;;
9756                 esac
9757                 case "$CPPFLAGS" in
9758                 *$cf_add_cflags) #(vi
9759                         ;;
9760                 *) #(vi
9761                         case $cf_add_cflags in #(vi
9762                         -D*)
9763                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9764
9765 CPPFLAGS=`echo "$CPPFLAGS" | \
9766         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9767                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9768
9769                                 ;;
9770                         esac
9771                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9772                         ;;
9773                 esac
9774                 ;;
9775         *)
9776                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9777                 ;;
9778         esac
9779         ;;
9780 yes)
9781         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9782
9783         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9784
9785         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9786                 && test -z "${cf_tst_cflags}" \
9787                 && cf_fix_cppflags=no
9788         ;;
9789 esac
9790 done
9791
9792 if test -n "$cf_new_cflags" ; then
9793
9794         CFLAGS="$CFLAGS $cf_new_cflags"
9795 fi
9796
9797 if test -n "$cf_new_cppflags" ; then
9798
9799         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9800 fi
9801
9802 if test -n "$cf_new_extra_cppflags" ; then
9803
9804         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9805 fi
9806
9807         LIBS="$cf_pkgconfig_libs $LIBS"
9808
9809         # workaround for broken ".pc" files used for X Toolkit.
9810         case "x$X_PRE_LIBS" in #(vi
9811         *-lICE*)
9812                 case "x$LIBS" in #(vi
9813                 *-lICE*) #(vi
9814                         ;;
9815                 *)
9816                         test -n "$verbose" && echo "    work around broken package" 1>&6
9817
9818 echo "${as_me:-configure}:9818: testing work around broken package ..." 1>&5
9819
9820                         test -n "$verbose" && echo "    ...before $LIBS" 1>&6
9821
9822 echo "${as_me:-configure}:9822: testing ...before $LIBS ..." 1>&5
9823
9824                         LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
9825                         test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
9826
9827 echo "${as_me:-configure}:9827: testing ...after  $LIBS ..." 1>&5
9828
9829                         ;;
9830                 esac
9831                 ;;
9832         esac
9833
9834         cf_have_X_LIBS=yes
9835
9836 else
9837
9838         LDFLAGS="$X_LIBS $LDFLAGS"
9839
9840 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
9841
9842 echo "${as_me:-configure}:9842: testing checking additions to CFLAGS ..." 1>&5
9843
9844 cf_check_cflags="$CFLAGS"
9845 cf_check_cppflags="$CPPFLAGS"
9846
9847 cf_fix_cppflags=no
9848 cf_new_cflags=
9849 cf_new_cppflags=
9850 cf_new_extra_cppflags=
9851
9852 for cf_add_cflags in $X_CFLAGS
9853 do
9854 case $cf_fix_cppflags in
9855 no)
9856         case $cf_add_cflags in #(vi
9857         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
9858                 case $cf_add_cflags in
9859                 -D*)
9860                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9861
9862                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9863                                 && test -z "${cf_tst_cflags}" \
9864                                 && cf_fix_cppflags=yes
9865
9866                         if test $cf_fix_cppflags = yes ; then
9867                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9868                                 continue
9869                         elif test "${cf_tst_cflags}" = "\"'" ; then
9870                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9871                                 continue
9872                         fi
9873                         ;;
9874                 esac
9875                 case "$CPPFLAGS" in
9876                 *$cf_add_cflags) #(vi
9877                         ;;
9878                 *) #(vi
9879                         case $cf_add_cflags in #(vi
9880                         -D*)
9881                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9882
9883 CPPFLAGS=`echo "$CPPFLAGS" | \
9884         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9885                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9886
9887                                 ;;
9888                         esac
9889                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
9890                         ;;
9891                 esac
9892                 ;;
9893         *)
9894                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
9895                 ;;
9896         esac
9897         ;;
9898 yes)
9899         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9900
9901         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9902
9903         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
9904                 && test -z "${cf_tst_cflags}" \
9905                 && cf_fix_cppflags=no
9906         ;;
9907 esac
9908 done
9909
9910 if test -n "$cf_new_cflags" ; then
9911         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
9912
9913 echo "${as_me:-configure}:9913: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
9914
9915         CFLAGS="$CFLAGS $cf_new_cflags"
9916 fi
9917
9918 if test -n "$cf_new_cppflags" ; then
9919         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
9920
9921 echo "${as_me:-configure}:9921: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
9922
9923         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
9924 fi
9925
9926 if test -n "$cf_new_extra_cppflags" ; then
9927         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
9928
9929 echo "${as_me:-configure}:9929: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
9930
9931         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
9932 fi
9933
9934 if test "$cf_check_cflags" != "$CFLAGS" ; then
9935 cat >conftest.$ac_ext <<_ACEOF
9936 #line 9936 "configure"
9937 #include "confdefs.h"
9938 #include <stdio.h>
9939 int
9940 main ()
9941 {
9942 printf("Hello world");
9943   ;
9944   return 0;
9945 }
9946 _ACEOF
9947 rm -f conftest.$ac_objext conftest$ac_exeext
9948 if { (eval echo "$as_me:9948: \"$ac_link\"") >&5
9949   (eval $ac_link) 2>&5
9950   ac_status=$?
9951   echo "$as_me:9951: \$? = $ac_status" >&5
9952   (exit $ac_status); } &&
9953          { ac_try='test -s conftest$ac_exeext'
9954   { (eval echo "$as_me:9954: \"$ac_try\"") >&5
9955   (eval $ac_try) 2>&5
9956   ac_status=$?
9957   echo "$as_me:9957: \$? = $ac_status" >&5
9958   (exit $ac_status); }; }; then
9959   :
9960 else
9961   echo "$as_me: failed program was:" >&5
9962 cat conftest.$ac_ext >&5
9963 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
9964
9965 echo "${as_me:-configure}:9965: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
9966
9967          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
9968                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
9969
9970 echo "${as_me:-configure}:9970: testing but keeping change to \$CPPFLAGS ..." 1>&5
9971
9972          fi
9973          CFLAGS="$cf_check_flags"
9974 fi
9975 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9976 fi
9977
9978         echo "$as_me:9978: checking for XOpenDisplay" >&5
9979 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
9980 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
9981   echo $ECHO_N "(cached) $ECHO_C" >&6
9982 else
9983   cat >conftest.$ac_ext <<_ACEOF
9984 #line 9984 "configure"
9985 #include "confdefs.h"
9986 /* System header to define __stub macros and hopefully few prototypes,
9987     which can conflict with char XOpenDisplay (); below.  */
9988 #include <assert.h>
9989 /* Override any gcc2 internal prototype to avoid an error.  */
9990 #ifdef __cplusplus
9991 extern "C"
9992 #endif
9993 /* We use char because int might match the return type of a gcc2
9994    builtin and then its argument prototype would still apply.  */
9995 char XOpenDisplay ();
9996 char (*f) ();
9997
9998 int
9999 main ()
10000 {
10001 /* The GNU C library defines this for functions which it implements
10002     to always fail with ENOSYS.  Some functions are actually named
10003     something starting with __ and the normal name is an alias.  */
10004 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
10005 choke me
10006 #else
10007 f = XOpenDisplay;
10008 #endif
10009
10010   ;
10011   return 0;
10012 }
10013 _ACEOF
10014 rm -f conftest.$ac_objext conftest$ac_exeext
10015 if { (eval echo "$as_me:10015: \"$ac_link\"") >&5
10016   (eval $ac_link) 2>&5
10017   ac_status=$?
10018   echo "$as_me:10018: \$? = $ac_status" >&5
10019   (exit $ac_status); } &&
10020          { ac_try='test -s conftest$ac_exeext'
10021   { (eval echo "$as_me:10021: \"$ac_try\"") >&5
10022   (eval $ac_try) 2>&5
10023   ac_status=$?
10024   echo "$as_me:10024: \$? = $ac_status" >&5
10025   (exit $ac_status); }; }; then
10026   ac_cv_func_XOpenDisplay=yes
10027 else
10028   echo "$as_me: failed program was:" >&5
10029 cat conftest.$ac_ext >&5
10030 ac_cv_func_XOpenDisplay=no
10031 fi
10032 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10033 fi
10034 echo "$as_me:10034: result: $ac_cv_func_XOpenDisplay" >&5
10035 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
10036 if test $ac_cv_func_XOpenDisplay = yes; then
10037   :
10038 else
10039
10040         echo "$as_me:10040: checking for XOpenDisplay in -lX11" >&5
10041 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
10042 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
10043   echo $ECHO_N "(cached) $ECHO_C" >&6
10044 else
10045   ac_check_lib_save_LIBS=$LIBS
10046 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
10047 cat >conftest.$ac_ext <<_ACEOF
10048 #line 10048 "configure"
10049 #include "confdefs.h"
10050
10051 /* Override any gcc2 internal prototype to avoid an error.  */
10052 #ifdef __cplusplus
10053 extern "C"
10054 #endif
10055 /* We use char because int might match the return type of a gcc2
10056    builtin and then its argument prototype would still apply.  */
10057 char XOpenDisplay ();
10058 int
10059 main ()
10060 {
10061 XOpenDisplay ();
10062   ;
10063   return 0;
10064 }
10065 _ACEOF
10066 rm -f conftest.$ac_objext conftest$ac_exeext
10067 if { (eval echo "$as_me:10067: \"$ac_link\"") >&5
10068   (eval $ac_link) 2>&5
10069   ac_status=$?
10070   echo "$as_me:10070: \$? = $ac_status" >&5
10071   (exit $ac_status); } &&
10072          { ac_try='test -s conftest$ac_exeext'
10073   { (eval echo "$as_me:10073: \"$ac_try\"") >&5
10074   (eval $ac_try) 2>&5
10075   ac_status=$?
10076   echo "$as_me:10076: \$? = $ac_status" >&5
10077   (exit $ac_status); }; }; then
10078   ac_cv_lib_X11_XOpenDisplay=yes
10079 else
10080   echo "$as_me: failed program was:" >&5
10081 cat conftest.$ac_ext >&5
10082 ac_cv_lib_X11_XOpenDisplay=no
10083 fi
10084 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10085 LIBS=$ac_check_lib_save_LIBS
10086 fi
10087 echo "$as_me:10087: result: $ac_cv_lib_X11_XOpenDisplay" >&5
10088 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
10089 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
10090   LIBS="-lX11 $LIBS"
10091 fi
10092
10093 fi
10094
10095         echo "$as_me:10095: checking for XtAppInitialize" >&5
10096 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
10097 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
10098   echo $ECHO_N "(cached) $ECHO_C" >&6
10099 else
10100   cat >conftest.$ac_ext <<_ACEOF
10101 #line 10101 "configure"
10102 #include "confdefs.h"
10103 /* System header to define __stub macros and hopefully few prototypes,
10104     which can conflict with char XtAppInitialize (); below.  */
10105 #include <assert.h>
10106 /* Override any gcc2 internal prototype to avoid an error.  */
10107 #ifdef __cplusplus
10108 extern "C"
10109 #endif
10110 /* We use char because int might match the return type of a gcc2
10111    builtin and then its argument prototype would still apply.  */
10112 char XtAppInitialize ();
10113 char (*f) ();
10114
10115 int
10116 main ()
10117 {
10118 /* The GNU C library defines this for functions which it implements
10119     to always fail with ENOSYS.  Some functions are actually named
10120     something starting with __ and the normal name is an alias.  */
10121 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
10122 choke me
10123 #else
10124 f = XtAppInitialize;
10125 #endif
10126
10127   ;
10128   return 0;
10129 }
10130 _ACEOF
10131 rm -f conftest.$ac_objext conftest$ac_exeext
10132 if { (eval echo "$as_me:10132: \"$ac_link\"") >&5
10133   (eval $ac_link) 2>&5
10134   ac_status=$?
10135   echo "$as_me:10135: \$? = $ac_status" >&5
10136   (exit $ac_status); } &&
10137          { ac_try='test -s conftest$ac_exeext'
10138   { (eval echo "$as_me:10138: \"$ac_try\"") >&5
10139   (eval $ac_try) 2>&5
10140   ac_status=$?
10141   echo "$as_me:10141: \$? = $ac_status" >&5
10142   (exit $ac_status); }; }; then
10143   ac_cv_func_XtAppInitialize=yes
10144 else
10145   echo "$as_me: failed program was:" >&5
10146 cat conftest.$ac_ext >&5
10147 ac_cv_func_XtAppInitialize=no
10148 fi
10149 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10150 fi
10151 echo "$as_me:10151: result: $ac_cv_func_XtAppInitialize" >&5
10152 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
10153 if test $ac_cv_func_XtAppInitialize = yes; then
10154   :
10155 else
10156
10157         echo "$as_me:10157: checking for XtAppInitialize in -lXt" >&5
10158 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
10159 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
10160   echo $ECHO_N "(cached) $ECHO_C" >&6
10161 else
10162   ac_check_lib_save_LIBS=$LIBS
10163 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
10164 cat >conftest.$ac_ext <<_ACEOF
10165 #line 10165 "configure"
10166 #include "confdefs.h"
10167
10168 /* Override any gcc2 internal prototype to avoid an error.  */
10169 #ifdef __cplusplus
10170 extern "C"
10171 #endif
10172 /* We use char because int might match the return type of a gcc2
10173    builtin and then its argument prototype would still apply.  */
10174 char XtAppInitialize ();
10175 int
10176 main ()
10177 {
10178 XtAppInitialize ();
10179   ;
10180   return 0;
10181 }
10182 _ACEOF
10183 rm -f conftest.$ac_objext conftest$ac_exeext
10184 if { (eval echo "$as_me:10184: \"$ac_link\"") >&5
10185   (eval $ac_link) 2>&5
10186   ac_status=$?
10187   echo "$as_me:10187: \$? = $ac_status" >&5
10188   (exit $ac_status); } &&
10189          { ac_try='test -s conftest$ac_exeext'
10190   { (eval echo "$as_me:10190: \"$ac_try\"") >&5
10191   (eval $ac_try) 2>&5
10192   ac_status=$?
10193   echo "$as_me:10193: \$? = $ac_status" >&5
10194   (exit $ac_status); }; }; then
10195   ac_cv_lib_Xt_XtAppInitialize=yes
10196 else
10197   echo "$as_me: failed program was:" >&5
10198 cat conftest.$ac_ext >&5
10199 ac_cv_lib_Xt_XtAppInitialize=no
10200 fi
10201 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10202 LIBS=$ac_check_lib_save_LIBS
10203 fi
10204 echo "$as_me:10204: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
10205 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
10206 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
10207   cat >>confdefs.h <<\EOF
10208 #define HAVE_LIBXT 1
10209 EOF
10210
10211                  cf_have_X_LIBS=Xt
10212                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
10213 fi
10214
10215 fi
10216
10217 fi
10218
10219 if test $cf_have_X_LIBS = no ; then
10220         { echo "$as_me:10220: WARNING: Unable to successfully link X Toolkit library (-lXt) with
10221 test program.  You will have to check and add the proper libraries by hand
10222 to makefile." >&5
10223 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
10224 test program.  You will have to check and add the proper libraries by hand
10225 to makefile." >&2;}
10226 fi
10227
10228 cf_x_athena_root=$cf_x_athena
10229 cf_x_athena_inc=""
10230
10231 for cf_path in default \
10232         /usr/contrib/X11R6 \
10233         /usr/contrib/X11R5 \
10234         /usr/lib/X11R5 \
10235         /usr/local
10236 do
10237         if test -z "$cf_x_athena_inc" ; then
10238                 cf_save="$CPPFLAGS"
10239                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
10240                 if test $cf_path != default ; then
10241                         CPPFLAGS="$cf_save -I$cf_path/include"
10242                         echo "$as_me:10242: checking for $cf_test in $cf_path" >&5
10243 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
10244                 else
10245                         echo "$as_me:10245: checking for $cf_test" >&5
10246 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
10247                 fi
10248                 cat >conftest.$ac_ext <<_ACEOF
10249 #line 10249 "configure"
10250 #include "confdefs.h"
10251
10252 #include <X11/Intrinsic.h>
10253 #include <$cf_test>
10254 int
10255 main ()
10256 {
10257
10258   ;
10259   return 0;
10260 }
10261 _ACEOF
10262 rm -f conftest.$ac_objext
10263 if { (eval echo "$as_me:10263: \"$ac_compile\"") >&5
10264   (eval $ac_compile) 2>&5
10265   ac_status=$?
10266   echo "$as_me:10266: \$? = $ac_status" >&5
10267   (exit $ac_status); } &&
10268          { ac_try='test -s conftest.$ac_objext'
10269   { (eval echo "$as_me:10269: \"$ac_try\"") >&5
10270   (eval $ac_try) 2>&5
10271   ac_status=$?
10272   echo "$as_me:10272: \$? = $ac_status" >&5
10273   (exit $ac_status); }; }; then
10274   cf_result=yes
10275 else
10276   echo "$as_me: failed program was:" >&5
10277 cat conftest.$ac_ext >&5
10278 cf_result=no
10279 fi
10280 rm -f conftest.$ac_objext conftest.$ac_ext
10281                 echo "$as_me:10281: result: $cf_result" >&5
10282 echo "${ECHO_T}$cf_result" >&6
10283                 if test "$cf_result" = yes ; then
10284                         cf_x_athena_inc=$cf_path
10285                         break
10286                 else
10287                         CPPFLAGS="$cf_save"
10288                 fi
10289         fi
10290 done
10291
10292 if test -z "$cf_x_athena_inc" ; then
10293         { echo "$as_me:10293: WARNING: Unable to successfully find Athena header files with test program" >&5
10294 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
10295 elif test "$cf_x_athena_inc" != default ; then
10296         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
10297 fi
10298
10299 cf_x_athena_root=$cf_x_athena
10300 cf_x_athena_lib=""
10301
10302 for cf_path in default \
10303         /usr/contrib/X11R6 \
10304         /usr/contrib/X11R5 \
10305         /usr/lib/X11R5 \
10306         /usr/local
10307 do
10308         for cf_lib in \
10309                 "-l$cf_x_athena_root -lXmu" \
10310                 "-l$cf_x_athena_root -lXpm -lXmu" \
10311                 "-l${cf_x_athena_root}_s -lXmu_s"
10312         do
10313                 if test -z "$cf_x_athena_lib" ; then
10314                         cf_save="$LIBS"
10315                         cf_test=XawSimpleMenuAddGlobalActions
10316                         if test $cf_path != default ; then
10317                                 LIBS="-L$cf_path/lib $cf_lib $LIBS"
10318                                 echo "$as_me:10318: checking for $cf_lib in $cf_path" >&5
10319 echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6
10320                         else
10321                                 LIBS="$cf_lib $LIBS"
10322                                 echo "$as_me:10322: checking for $cf_test in $cf_lib" >&5
10323 echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6
10324                         fi
10325                         cat >conftest.$ac_ext <<_ACEOF
10326 #line 10326 "configure"
10327 #include "confdefs.h"
10328
10329 int
10330 main ()
10331 {
10332 $cf_test()
10333   ;
10334   return 0;
10335 }
10336 _ACEOF
10337 rm -f conftest.$ac_objext conftest$ac_exeext
10338 if { (eval echo "$as_me:10338: \"$ac_link\"") >&5
10339   (eval $ac_link) 2>&5
10340   ac_status=$?
10341   echo "$as_me:10341: \$? = $ac_status" >&5
10342   (exit $ac_status); } &&
10343          { ac_try='test -s conftest$ac_exeext'
10344   { (eval echo "$as_me:10344: \"$ac_try\"") >&5
10345   (eval $ac_try) 2>&5
10346   ac_status=$?
10347   echo "$as_me:10347: \$? = $ac_status" >&5
10348   (exit $ac_status); }; }; then
10349   cf_result=yes
10350 else
10351   echo "$as_me: failed program was:" >&5
10352 cat conftest.$ac_ext >&5
10353 cf_result=no
10354 fi
10355 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10356                         echo "$as_me:10356: result: $cf_result" >&5
10357 echo "${ECHO_T}$cf_result" >&6
10358                         if test "$cf_result" = yes ; then
10359                                 cf_x_athena_lib="$cf_lib"
10360                                 break
10361                         fi
10362                         LIBS="$cf_save"
10363                 fi
10364         done
10365 done
10366
10367 if test -z "$cf_x_athena_lib" ; then
10368         { { echo "$as_me:10368: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
10369 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
10370    { (exit 1); exit 1; }; }
10371 fi
10372
10373 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10374
10375 cat >>confdefs.h <<EOF
10376 #define $cf_x_athena_LIBS 1
10377 EOF
10378
10379 fi
10380
10381 for ac_prog in xcurses-config
10382 do
10383   # Extract the first word of "$ac_prog", so it can be a program name with args.
10384 set dummy $ac_prog; ac_word=$2
10385 echo "$as_me:10385: checking for $ac_word" >&5
10386 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10387 if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
10388   echo $ECHO_N "(cached) $ECHO_C" >&6
10389 else
10390   case $XCURSES_CONFIG in
10391   [\\/]* | ?:[\\/]*)
10392   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
10393   ;;
10394   *)
10395   ac_save_IFS=$IFS; IFS=$ac_path_separator
10396 ac_dummy="$PATH"
10397 for ac_dir in $ac_dummy; do
10398   IFS=$ac_save_IFS
10399   test -z "$ac_dir" && ac_dir=.
10400   if $as_executable_p "$ac_dir/$ac_word"; then
10401    ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
10402    echo "$as_me:10402: found $ac_dir/$ac_word" >&5
10403    break
10404 fi
10405 done
10406
10407   ;;
10408 esac
10409 fi
10410 XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
10411
10412 if test -n "$XCURSES_CONFIG"; then
10413   echo "$as_me:10413: result: $XCURSES_CONFIG" >&5
10414 echo "${ECHO_T}$XCURSES_CONFIG" >&6
10415 else
10416   echo "$as_me:10416: result: no" >&5
10417 echo "${ECHO_T}no" >&6
10418 fi
10419
10420   test -n "$XCURSES_CONFIG" && break
10421 done
10422 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
10423
10424 if test "$XCURSES_CONFIG" != none ; then
10425
10426 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
10427 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
10428
10429 cf_cv_lib_XCurses=yes
10430
10431 else
10432
10433 LDFLAGS="$LDFLAGS $X_LIBS"
10434
10435 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
10436
10437 echo "${as_me:-configure}:10437: testing checking additions to CFLAGS ..." 1>&5
10438
10439 cf_check_cflags="$CFLAGS"
10440 cf_check_cppflags="$CPPFLAGS"
10441
10442 cf_fix_cppflags=no
10443 cf_new_cflags=
10444 cf_new_cppflags=
10445 cf_new_extra_cppflags=
10446
10447 for cf_add_cflags in $X_CFLAGS
10448 do
10449 case $cf_fix_cppflags in
10450 no)
10451         case $cf_add_cflags in #(vi
10452         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10453                 case $cf_add_cflags in
10454                 -D*)
10455                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10456
10457                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10458                                 && test -z "${cf_tst_cflags}" \
10459                                 && cf_fix_cppflags=yes
10460
10461                         if test $cf_fix_cppflags = yes ; then
10462                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10463                                 continue
10464                         elif test "${cf_tst_cflags}" = "\"'" ; then
10465                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10466                                 continue
10467                         fi
10468                         ;;
10469                 esac
10470                 case "$CPPFLAGS" in
10471                 *$cf_add_cflags) #(vi
10472                         ;;
10473                 *) #(vi
10474                         case $cf_add_cflags in #(vi
10475                         -D*)
10476                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10477
10478 CPPFLAGS=`echo "$CPPFLAGS" | \
10479         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10480                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10481
10482                                 ;;
10483                         esac
10484                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10485                         ;;
10486                 esac
10487                 ;;
10488         *)
10489                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10490                 ;;
10491         esac
10492         ;;
10493 yes)
10494         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10495
10496         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10497
10498         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10499                 && test -z "${cf_tst_cflags}" \
10500                 && cf_fix_cppflags=no
10501         ;;
10502 esac
10503 done
10504
10505 if test -n "$cf_new_cflags" ; then
10506         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10507
10508 echo "${as_me:-configure}:10508: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10509
10510         CFLAGS="$CFLAGS $cf_new_cflags"
10511 fi
10512
10513 if test -n "$cf_new_cppflags" ; then
10514         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10515
10516 echo "${as_me:-configure}:10516: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10517
10518         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10519 fi
10520
10521 if test -n "$cf_new_extra_cppflags" ; then
10522         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10523
10524 echo "${as_me:-configure}:10524: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10525
10526         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10527 fi
10528
10529 if test "$cf_check_cflags" != "$CFLAGS" ; then
10530 cat >conftest.$ac_ext <<_ACEOF
10531 #line 10531 "configure"
10532 #include "confdefs.h"
10533 #include <stdio.h>
10534 int
10535 main ()
10536 {
10537 printf("Hello world");
10538   ;
10539   return 0;
10540 }
10541 _ACEOF
10542 rm -f conftest.$ac_objext conftest$ac_exeext
10543 if { (eval echo "$as_me:10543: \"$ac_link\"") >&5
10544   (eval $ac_link) 2>&5
10545   ac_status=$?
10546   echo "$as_me:10546: \$? = $ac_status" >&5
10547   (exit $ac_status); } &&
10548          { ac_try='test -s conftest$ac_exeext'
10549   { (eval echo "$as_me:10549: \"$ac_try\"") >&5
10550   (eval $ac_try) 2>&5
10551   ac_status=$?
10552   echo "$as_me:10552: \$? = $ac_status" >&5
10553   (exit $ac_status); }; }; then
10554   :
10555 else
10556   echo "$as_me: failed program was:" >&5
10557 cat conftest.$ac_ext >&5
10558 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
10559
10560 echo "${as_me:-configure}:10560: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
10561
10562          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
10563                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
10564
10565 echo "${as_me:-configure}:10565: testing but keeping change to \$CPPFLAGS ..." 1>&5
10566
10567          fi
10568          CFLAGS="$cf_check_flags"
10569 fi
10570 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10571 fi
10572
10573 echo "$as_me:10573: checking for XOpenDisplay in -lX11" >&5
10574 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
10575 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
10576   echo $ECHO_N "(cached) $ECHO_C" >&6
10577 else
10578   ac_check_lib_save_LIBS=$LIBS
10579 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
10580 cat >conftest.$ac_ext <<_ACEOF
10581 #line 10581 "configure"
10582 #include "confdefs.h"
10583
10584 /* Override any gcc2 internal prototype to avoid an error.  */
10585 #ifdef __cplusplus
10586 extern "C"
10587 #endif
10588 /* We use char because int might match the return type of a gcc2
10589    builtin and then its argument prototype would still apply.  */
10590 char XOpenDisplay ();
10591 int
10592 main ()
10593 {
10594 XOpenDisplay ();
10595   ;
10596   return 0;
10597 }
10598 _ACEOF
10599 rm -f conftest.$ac_objext conftest$ac_exeext
10600 if { (eval echo "$as_me:10600: \"$ac_link\"") >&5
10601   (eval $ac_link) 2>&5
10602   ac_status=$?
10603   echo "$as_me:10603: \$? = $ac_status" >&5
10604   (exit $ac_status); } &&
10605          { ac_try='test -s conftest$ac_exeext'
10606   { (eval echo "$as_me:10606: \"$ac_try\"") >&5
10607   (eval $ac_try) 2>&5
10608   ac_status=$?
10609   echo "$as_me:10609: \$? = $ac_status" >&5
10610   (exit $ac_status); }; }; then
10611   ac_cv_lib_X11_XOpenDisplay=yes
10612 else
10613   echo "$as_me: failed program was:" >&5
10614 cat conftest.$ac_ext >&5
10615 ac_cv_lib_X11_XOpenDisplay=no
10616 fi
10617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10618 LIBS=$ac_check_lib_save_LIBS
10619 fi
10620 echo "$as_me:10620: result: $ac_cv_lib_X11_XOpenDisplay" >&5
10621 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
10622 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
10623   LIBS="-lX11 $LIBS"
10624 fi
10625
10626 echo "$as_me:10626: checking for XCurses library" >&5
10627 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
10628 if test "${cf_cv_lib_XCurses+set}" = set; then
10629   echo $ECHO_N "(cached) $ECHO_C" >&6
10630 else
10631
10632 LIBS="-lXCurses $LIBS"
10633 cat >conftest.$ac_ext <<_ACEOF
10634 #line 10634 "configure"
10635 #include "confdefs.h"
10636
10637 #include <xcurses.h>
10638 char *XCursesProgramName = "test";
10639
10640 int
10641 main ()
10642 {
10643 XCursesExit();
10644   ;
10645   return 0;
10646 }
10647 _ACEOF
10648 rm -f conftest.$ac_objext conftest$ac_exeext
10649 if { (eval echo "$as_me:10649: \"$ac_link\"") >&5
10650   (eval $ac_link) 2>&5
10651   ac_status=$?
10652   echo "$as_me:10652: \$? = $ac_status" >&5
10653   (exit $ac_status); } &&
10654          { ac_try='test -s conftest$ac_exeext'
10655   { (eval echo "$as_me:10655: \"$ac_try\"") >&5
10656   (eval $ac_try) 2>&5
10657   ac_status=$?
10658   echo "$as_me:10658: \$? = $ac_status" >&5
10659   (exit $ac_status); }; }; then
10660   cf_cv_lib_XCurses=yes
10661 else
10662   echo "$as_me: failed program was:" >&5
10663 cat conftest.$ac_ext >&5
10664 cf_cv_lib_XCurses=no
10665 fi
10666 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10667
10668 fi
10669 echo "$as_me:10669: result: $cf_cv_lib_XCurses" >&5
10670 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
10671
10672 fi
10673
10674 if test $cf_cv_lib_XCurses = yes ; then
10675         cat >>confdefs.h <<\EOF
10676 #define UNIX 1
10677 EOF
10678
10679         cat >>confdefs.h <<\EOF
10680 #define XCURSES 1
10681 EOF
10682
10683         cat >>confdefs.h <<\EOF
10684 #define HAVE_XCURSES 1
10685 EOF
10686
10687 else
10688         { { echo "$as_me:10688: error: Cannot link with XCurses" >&5
10689 echo "$as_me: error: Cannot link with XCurses" >&2;}
10690    { (exit 1); exit 1; }; }
10691 fi
10692
10693         ;;
10694 esac
10695
10696 case $cf_cv_screen in #(vi
10697 pdcurses) #(vi
10698         ;;
10699 *)
10700         # look for curses-related libraries
10701
10702 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
10703 echo "$as_me:10703: checking for new_panel in -lpanel$cf_cv_libtype" >&5
10704 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
10705 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
10706   echo $ECHO_N "(cached) $ECHO_C" >&6
10707 else
10708   ac_check_lib_save_LIBS=$LIBS
10709 LIBS="-lpanel$cf_cv_libtype  $LIBS"
10710 cat >conftest.$ac_ext <<_ACEOF
10711 #line 10711 "configure"
10712 #include "confdefs.h"
10713
10714 /* Override any gcc2 internal prototype to avoid an error.  */
10715 #ifdef __cplusplus
10716 extern "C"
10717 #endif
10718 /* We use char because int might match the return type of a gcc2
10719    builtin and then its argument prototype would still apply.  */
10720 char new_panel ();
10721 int
10722 main ()
10723 {
10724 new_panel ();
10725   ;
10726   return 0;
10727 }
10728 _ACEOF
10729 rm -f conftest.$ac_objext conftest$ac_exeext
10730 if { (eval echo "$as_me:10730: \"$ac_link\"") >&5
10731   (eval $ac_link) 2>&5
10732   ac_status=$?
10733   echo "$as_me:10733: \$? = $ac_status" >&5
10734   (exit $ac_status); } &&
10735          { ac_try='test -s conftest$ac_exeext'
10736   { (eval echo "$as_me:10736: \"$ac_try\"") >&5
10737   (eval $ac_try) 2>&5
10738   ac_status=$?
10739   echo "$as_me:10739: \$? = $ac_status" >&5
10740   (exit $ac_status); }; }; then
10741   eval "$as_ac_Lib=yes"
10742 else
10743   echo "$as_me: failed program was:" >&5
10744 cat conftest.$ac_ext >&5
10745 eval "$as_ac_Lib=no"
10746 fi
10747 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10748 LIBS=$ac_check_lib_save_LIBS
10749 fi
10750 echo "$as_me:10750: result: `eval echo '${'$as_ac_Lib'}'`" >&5
10751 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
10752 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
10753   cat >>confdefs.h <<EOF
10754 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
10755 EOF
10756
10757   LIBS="-lpanel$cf_cv_libtype $LIBS"
10758
10759 fi
10760
10761 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
10762 echo "$as_me:10762: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
10763 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
10764 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
10765   echo $ECHO_N "(cached) $ECHO_C" >&6
10766 else
10767   ac_check_lib_save_LIBS=$LIBS
10768 LIBS="-lmenu$cf_cv_libtype  $LIBS"
10769 cat >conftest.$ac_ext <<_ACEOF
10770 #line 10770 "configure"
10771 #include "confdefs.h"
10772
10773 /* Override any gcc2 internal prototype to avoid an error.  */
10774 #ifdef __cplusplus
10775 extern "C"
10776 #endif
10777 /* We use char because int might match the return type of a gcc2
10778    builtin and then its argument prototype would still apply.  */
10779 char menu_driver ();
10780 int
10781 main ()
10782 {
10783 menu_driver ();
10784   ;
10785   return 0;
10786 }
10787 _ACEOF
10788 rm -f conftest.$ac_objext conftest$ac_exeext
10789 if { (eval echo "$as_me:10789: \"$ac_link\"") >&5
10790   (eval $ac_link) 2>&5
10791   ac_status=$?
10792   echo "$as_me:10792: \$? = $ac_status" >&5
10793   (exit $ac_status); } &&
10794          { ac_try='test -s conftest$ac_exeext'
10795   { (eval echo "$as_me:10795: \"$ac_try\"") >&5
10796   (eval $ac_try) 2>&5
10797   ac_status=$?
10798   echo "$as_me:10798: \$? = $ac_status" >&5
10799   (exit $ac_status); }; }; then
10800   eval "$as_ac_Lib=yes"
10801 else
10802   echo "$as_me: failed program was:" >&5
10803 cat conftest.$ac_ext >&5
10804 eval "$as_ac_Lib=no"
10805 fi
10806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10807 LIBS=$ac_check_lib_save_LIBS
10808 fi
10809 echo "$as_me:10809: result: `eval echo '${'$as_ac_Lib'}'`" >&5
10810 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
10811 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
10812   cat >>confdefs.h <<EOF
10813 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
10814 EOF
10815
10816   LIBS="-lmenu$cf_cv_libtype $LIBS"
10817
10818 fi
10819
10820 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
10821 echo "$as_me:10821: checking for form_driver in -lform$cf_cv_libtype" >&5
10822 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
10823 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
10824   echo $ECHO_N "(cached) $ECHO_C" >&6
10825 else
10826   ac_check_lib_save_LIBS=$LIBS
10827 LIBS="-lform$cf_cv_libtype  $LIBS"
10828 cat >conftest.$ac_ext <<_ACEOF
10829 #line 10829 "configure"
10830 #include "confdefs.h"
10831
10832 /* Override any gcc2 internal prototype to avoid an error.  */
10833 #ifdef __cplusplus
10834 extern "C"
10835 #endif
10836 /* We use char because int might match the return type of a gcc2
10837    builtin and then its argument prototype would still apply.  */
10838 char form_driver ();
10839 int
10840 main ()
10841 {
10842 form_driver ();
10843   ;
10844   return 0;
10845 }
10846 _ACEOF
10847 rm -f conftest.$ac_objext conftest$ac_exeext
10848 if { (eval echo "$as_me:10848: \"$ac_link\"") >&5
10849   (eval $ac_link) 2>&5
10850   ac_status=$?
10851   echo "$as_me:10851: \$? = $ac_status" >&5
10852   (exit $ac_status); } &&
10853          { ac_try='test -s conftest$ac_exeext'
10854   { (eval echo "$as_me:10854: \"$ac_try\"") >&5
10855   (eval $ac_try) 2>&5
10856   ac_status=$?
10857   echo "$as_me:10857: \$? = $ac_status" >&5
10858   (exit $ac_status); }; }; then
10859   eval "$as_ac_Lib=yes"
10860 else
10861   echo "$as_me: failed program was:" >&5
10862 cat conftest.$ac_ext >&5
10863 eval "$as_ac_Lib=no"
10864 fi
10865 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10866 LIBS=$ac_check_lib_save_LIBS
10867 fi
10868 echo "$as_me:10868: result: `eval echo '${'$as_ac_Lib'}'`" >&5
10869 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
10870 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
10871   cat >>confdefs.h <<EOF
10872 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
10873 EOF
10874
10875   LIBS="-lform$cf_cv_libtype $LIBS"
10876
10877 fi
10878
10879         # look for curses-related headers
10880
10881 for ac_header in \
10882                 nc_alloc.h \
10883                 nomacros.h \
10884                 form.h \
10885                 menu.h \
10886                 panel.h \
10887
10888 do
10889 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10890 echo "$as_me:10890: checking for $ac_header" >&5
10891 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10892 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10893   echo $ECHO_N "(cached) $ECHO_C" >&6
10894 else
10895   cat >conftest.$ac_ext <<_ACEOF
10896 #line 10896 "configure"
10897 #include "confdefs.h"
10898 #include <$ac_header>
10899 _ACEOF
10900 if { (eval echo "$as_me:10900: \"$ac_cpp conftest.$ac_ext\"") >&5
10901   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10902   ac_status=$?
10903   egrep -v '^ *\+' conftest.er1 >conftest.err
10904   rm -f conftest.er1
10905   cat conftest.err >&5
10906   echo "$as_me:10906: \$? = $ac_status" >&5
10907   (exit $ac_status); } >/dev/null; then
10908   if test -s conftest.err; then
10909     ac_cpp_err=$ac_c_preproc_warn_flag
10910   else
10911     ac_cpp_err=
10912   fi
10913 else
10914   ac_cpp_err=yes
10915 fi
10916 if test -z "$ac_cpp_err"; then
10917   eval "$as_ac_Header=yes"
10918 else
10919   echo "$as_me: failed program was:" >&5
10920   cat conftest.$ac_ext >&5
10921   eval "$as_ac_Header=no"
10922 fi
10923 rm -f conftest.err conftest.$ac_ext
10924 fi
10925 echo "$as_me:10925: result: `eval echo '${'$as_ac_Header'}'`" >&5
10926 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10927 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10928   cat >>confdefs.h <<EOF
10929 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10930 EOF
10931
10932 fi
10933 done
10934
10935         ;;
10936 esac
10937
10938 echo "$as_me:10938: checking return type of signal handlers" >&5
10939 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
10940 if test "${ac_cv_type_signal+set}" = set; then
10941   echo $ECHO_N "(cached) $ECHO_C" >&6
10942 else
10943   cat >conftest.$ac_ext <<_ACEOF
10944 #line 10944 "configure"
10945 #include "confdefs.h"
10946 #include <sys/types.h>
10947 #include <signal.h>
10948 #ifdef signal
10949 # undef signal
10950 #endif
10951 #ifdef __cplusplus
10952 extern "C" void (*signal (int, void (*)(int)))(int);
10953 #else
10954 void (*signal ()) ();
10955 #endif
10956
10957 int
10958 main ()
10959 {
10960 int i;
10961   ;
10962   return 0;
10963 }
10964 _ACEOF
10965 rm -f conftest.$ac_objext
10966 if { (eval echo "$as_me:10966: \"$ac_compile\"") >&5
10967   (eval $ac_compile) 2>&5
10968   ac_status=$?
10969   echo "$as_me:10969: \$? = $ac_status" >&5
10970   (exit $ac_status); } &&
10971          { ac_try='test -s conftest.$ac_objext'
10972   { (eval echo "$as_me:10972: \"$ac_try\"") >&5
10973   (eval $ac_try) 2>&5
10974   ac_status=$?
10975   echo "$as_me:10975: \$? = $ac_status" >&5
10976   (exit $ac_status); }; }; then
10977   ac_cv_type_signal=void
10978 else
10979   echo "$as_me: failed program was:" >&5
10980 cat conftest.$ac_ext >&5
10981 ac_cv_type_signal=int
10982 fi
10983 rm -f conftest.$ac_objext conftest.$ac_ext
10984 fi
10985 echo "$as_me:10985: result: $ac_cv_type_signal" >&5
10986 echo "${ECHO_T}$ac_cv_type_signal" >&6
10987
10988 cat >>confdefs.h <<EOF
10989 #define RETSIGTYPE $ac_cv_type_signal
10990 EOF
10991
10992 echo "$as_me:10992: checking for ANSI C header files" >&5
10993 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10994 if test "${ac_cv_header_stdc+set}" = set; then
10995   echo $ECHO_N "(cached) $ECHO_C" >&6
10996 else
10997   cat >conftest.$ac_ext <<_ACEOF
10998 #line 10998 "configure"
10999 #include "confdefs.h"
11000 #include <stdlib.h>
11001 #include <stdarg.h>
11002 #include <string.h>
11003 #include <float.h>
11004
11005 _ACEOF
11006 if { (eval echo "$as_me:11006: \"$ac_cpp conftest.$ac_ext\"") >&5
11007   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11008   ac_status=$?
11009   egrep -v '^ *\+' conftest.er1 >conftest.err
11010   rm -f conftest.er1
11011   cat conftest.err >&5
11012   echo "$as_me:11012: \$? = $ac_status" >&5
11013   (exit $ac_status); } >/dev/null; then
11014   if test -s conftest.err; then
11015     ac_cpp_err=$ac_c_preproc_warn_flag
11016   else
11017     ac_cpp_err=
11018   fi
11019 else
11020   ac_cpp_err=yes
11021 fi
11022 if test -z "$ac_cpp_err"; then
11023   ac_cv_header_stdc=yes
11024 else
11025   echo "$as_me: failed program was:" >&5
11026   cat conftest.$ac_ext >&5
11027   ac_cv_header_stdc=no
11028 fi
11029 rm -f conftest.err conftest.$ac_ext
11030
11031 if test $ac_cv_header_stdc = yes; then
11032   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
11033   cat >conftest.$ac_ext <<_ACEOF
11034 #line 11034 "configure"
11035 #include "confdefs.h"
11036 #include <string.h>
11037
11038 _ACEOF
11039 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11040   egrep "memchr" >/dev/null 2>&1; then
11041   :
11042 else
11043   ac_cv_header_stdc=no
11044 fi
11045 rm -rf conftest*
11046
11047 fi
11048
11049 if test $ac_cv_header_stdc = yes; then
11050   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
11051   cat >conftest.$ac_ext <<_ACEOF
11052 #line 11052 "configure"
11053 #include "confdefs.h"
11054 #include <stdlib.h>
11055
11056 _ACEOF
11057 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11058   egrep "free" >/dev/null 2>&1; then
11059   :
11060 else
11061   ac_cv_header_stdc=no
11062 fi
11063 rm -rf conftest*
11064
11065 fi
11066
11067 if test $ac_cv_header_stdc = yes; then
11068   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
11069   if test "$cross_compiling" = yes; then
11070   :
11071 else
11072   cat >conftest.$ac_ext <<_ACEOF
11073 #line 11073 "configure"
11074 #include "confdefs.h"
11075 #include <ctype.h>
11076 #if ((' ' & 0x0FF) == 0x020)
11077 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
11078 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
11079 #else
11080 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
11081                      || ('j' <= (c) && (c) <= 'r') \
11082                      || ('s' <= (c) && (c) <= 'z'))
11083 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
11084 #endif
11085
11086 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
11087 int
11088 main ()
11089 {
11090   int i;
11091   for (i = 0; i < 256; i++)
11092     if (XOR (islower (i), ISLOWER (i))
11093         || toupper (i) != TOUPPER (i))
11094       $ac_main_return(2);
11095   $ac_main_return (0);
11096 }
11097 _ACEOF
11098 rm -f conftest$ac_exeext
11099 if { (eval echo "$as_me:11099: \"$ac_link\"") >&5
11100   (eval $ac_link) 2>&5
11101   ac_status=$?
11102   echo "$as_me:11102: \$? = $ac_status" >&5
11103   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11104   { (eval echo "$as_me:11104: \"$ac_try\"") >&5
11105   (eval $ac_try) 2>&5
11106   ac_status=$?
11107   echo "$as_me:11107: \$? = $ac_status" >&5
11108   (exit $ac_status); }; }; then
11109   :
11110 else
11111   echo "$as_me: program exited with status $ac_status" >&5
11112 echo "$as_me: failed program was:" >&5
11113 cat conftest.$ac_ext >&5
11114 ac_cv_header_stdc=no
11115 fi
11116 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11117 fi
11118 fi
11119 fi
11120 echo "$as_me:11120: result: $ac_cv_header_stdc" >&5
11121 echo "${ECHO_T}$ac_cv_header_stdc" >&6
11122 if test $ac_cv_header_stdc = yes; then
11123
11124 cat >>confdefs.h <<\EOF
11125 #define STDC_HEADERS 1
11126 EOF
11127
11128 fi
11129
11130 echo "$as_me:11130: checking whether time.h and sys/time.h may both be included" >&5
11131 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
11132 if test "${ac_cv_header_time+set}" = set; then
11133   echo $ECHO_N "(cached) $ECHO_C" >&6
11134 else
11135   cat >conftest.$ac_ext <<_ACEOF
11136 #line 11136 "configure"
11137 #include "confdefs.h"
11138 #include <sys/types.h>
11139 #include <sys/time.h>
11140 #include <time.h>
11141
11142 int
11143 main ()
11144 {
11145 if ((struct tm *) 0)
11146 return 0;
11147   ;
11148   return 0;
11149 }
11150 _ACEOF
11151 rm -f conftest.$ac_objext
11152 if { (eval echo "$as_me:11152: \"$ac_compile\"") >&5
11153   (eval $ac_compile) 2>&5
11154   ac_status=$?
11155   echo "$as_me:11155: \$? = $ac_status" >&5
11156   (exit $ac_status); } &&
11157          { ac_try='test -s conftest.$ac_objext'
11158   { (eval echo "$as_me:11158: \"$ac_try\"") >&5
11159   (eval $ac_try) 2>&5
11160   ac_status=$?
11161   echo "$as_me:11161: \$? = $ac_status" >&5
11162   (exit $ac_status); }; }; then
11163   ac_cv_header_time=yes
11164 else
11165   echo "$as_me: failed program was:" >&5
11166 cat conftest.$ac_ext >&5
11167 ac_cv_header_time=no
11168 fi
11169 rm -f conftest.$ac_objext conftest.$ac_ext
11170 fi
11171 echo "$as_me:11171: result: $ac_cv_header_time" >&5
11172 echo "${ECHO_T}$ac_cv_header_time" >&6
11173 if test $ac_cv_header_time = yes; then
11174
11175 cat >>confdefs.h <<\EOF
11176 #define TIME_WITH_SYS_TIME 1
11177 EOF
11178
11179 fi
11180
11181 for ac_header in \
11182 getopt.h \
11183 locale.h \
11184 stdarg.h \
11185 sys/ioctl.h \
11186 sys/select.h \
11187 sys/time.h \
11188 termios.h \
11189 unistd.h \
11190
11191 do
11192 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11193 echo "$as_me:11193: checking for $ac_header" >&5
11194 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11195 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11196   echo $ECHO_N "(cached) $ECHO_C" >&6
11197 else
11198   cat >conftest.$ac_ext <<_ACEOF
11199 #line 11199 "configure"
11200 #include "confdefs.h"
11201 #include <$ac_header>
11202 _ACEOF
11203 if { (eval echo "$as_me:11203: \"$ac_cpp conftest.$ac_ext\"") >&5
11204   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11205   ac_status=$?
11206   egrep -v '^ *\+' conftest.er1 >conftest.err
11207   rm -f conftest.er1
11208   cat conftest.err >&5
11209   echo "$as_me:11209: \$? = $ac_status" >&5
11210   (exit $ac_status); } >/dev/null; then
11211   if test -s conftest.err; then
11212     ac_cpp_err=$ac_c_preproc_warn_flag
11213   else
11214     ac_cpp_err=
11215   fi
11216 else
11217   ac_cpp_err=yes
11218 fi
11219 if test -z "$ac_cpp_err"; then
11220   eval "$as_ac_Header=yes"
11221 else
11222   echo "$as_me: failed program was:" >&5
11223   cat conftest.$ac_ext >&5
11224   eval "$as_ac_Header=no"
11225 fi
11226 rm -f conftest.err conftest.$ac_ext
11227 fi
11228 echo "$as_me:11228: result: `eval echo '${'$as_ac_Header'}'`" >&5
11229 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
11230 if test `eval echo '${'$as_ac_Header'}'` = yes; then
11231   cat >>confdefs.h <<EOF
11232 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11233 EOF
11234
11235 fi
11236 done
11237
11238 for ac_func in \
11239 gettimeofday \
11240 mblen \
11241 mbrlen \
11242 mbrtowc \
11243 mbsrtowcs \
11244 mbstowcs \
11245 mbtowc \
11246 strdup \
11247 wcsrtombs \
11248 wcstombs \
11249
11250 do
11251 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
11252 echo "$as_me:11252: checking for $ac_func" >&5
11253 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
11254 if eval "test \"\${$as_ac_var+set}\" = set"; then
11255   echo $ECHO_N "(cached) $ECHO_C" >&6
11256 else
11257   cat >conftest.$ac_ext <<_ACEOF
11258 #line 11258 "configure"
11259 #include "confdefs.h"
11260 /* System header to define __stub macros and hopefully few prototypes,
11261     which can conflict with char $ac_func (); below.  */
11262 #include <assert.h>
11263 /* Override any gcc2 internal prototype to avoid an error.  */
11264 #ifdef __cplusplus
11265 extern "C"
11266 #endif
11267 /* We use char because int might match the return type of a gcc2
11268    builtin and then its argument prototype would still apply.  */
11269 char $ac_func ();
11270 char (*f) ();
11271
11272 int
11273 main ()
11274 {
11275 /* The GNU C library defines this for functions which it implements
11276     to always fail with ENOSYS.  Some functions are actually named
11277     something starting with __ and the normal name is an alias.  */
11278 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11279 choke me
11280 #else
11281 f = $ac_func;
11282 #endif
11283
11284   ;
11285   return 0;
11286 }
11287 _ACEOF
11288 rm -f conftest.$ac_objext conftest$ac_exeext
11289 if { (eval echo "$as_me:11289: \"$ac_link\"") >&5
11290   (eval $ac_link) 2>&5
11291   ac_status=$?
11292   echo "$as_me:11292: \$? = $ac_status" >&5
11293   (exit $ac_status); } &&
11294          { ac_try='test -s conftest$ac_exeext'
11295   { (eval echo "$as_me:11295: \"$ac_try\"") >&5
11296   (eval $ac_try) 2>&5
11297   ac_status=$?
11298   echo "$as_me:11298: \$? = $ac_status" >&5
11299   (exit $ac_status); }; }; then
11300   eval "$as_ac_var=yes"
11301 else
11302   echo "$as_me: failed program was:" >&5
11303 cat conftest.$ac_ext >&5
11304 eval "$as_ac_var=no"
11305 fi
11306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11307 fi
11308 echo "$as_me:11308: result: `eval echo '${'$as_ac_var'}'`" >&5
11309 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
11310 if test `eval echo '${'$as_ac_var'}'` = yes; then
11311   cat >>confdefs.h <<EOF
11312 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
11313 EOF
11314
11315 fi
11316 done
11317
11318 echo "$as_me:11318: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
11319 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
11320 if test "${cf_cv_need_xopen_extension+set}" = set; then
11321   echo $ECHO_N "(cached) $ECHO_C" >&6
11322 else
11323
11324 cat >conftest.$ac_ext <<_ACEOF
11325 #line 11325 "configure"
11326 #include "confdefs.h"
11327
11328 #include <stdlib.h>
11329 #include <${cf_cv_ncurses_header:-curses.h}>
11330 int
11331 main ()
11332 {
11333
11334 #if defined(NCURSES_VERSION_PATCH)
11335 if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
11336         make an error
11337 #endif
11338 #endif
11339         long x = winnstr(stdscr, "", 0);
11340         int x1, y1;
11341         getbegyx(stdscr, y1, x1)
11342   ;
11343   return 0;
11344 }
11345 _ACEOF
11346 rm -f conftest.$ac_objext conftest$ac_exeext
11347 if { (eval echo "$as_me:11347: \"$ac_link\"") >&5
11348   (eval $ac_link) 2>&5
11349   ac_status=$?
11350   echo "$as_me:11350: \$? = $ac_status" >&5
11351   (exit $ac_status); } &&
11352          { ac_try='test -s conftest$ac_exeext'
11353   { (eval echo "$as_me:11353: \"$ac_try\"") >&5
11354   (eval $ac_try) 2>&5
11355   ac_status=$?
11356   echo "$as_me:11356: \$? = $ac_status" >&5
11357   (exit $ac_status); }; }; then
11358   cf_cv_need_xopen_extension=no
11359 else
11360   echo "$as_me: failed program was:" >&5
11361 cat conftest.$ac_ext >&5
11362 cat >conftest.$ac_ext <<_ACEOF
11363 #line 11363 "configure"
11364 #include "confdefs.h"
11365
11366 #define _XOPEN_SOURCE_EXTENDED
11367 #include <stdlib.h>
11368 #include <${cf_cv_ncurses_header:-curses.h}>
11369 int
11370 main ()
11371 {
11372
11373 #ifdef NCURSES_VERSION
11374         cchar_t check;
11375         int check2 = curs_set((int)sizeof(check));
11376 #endif
11377         long x = winnstr(stdscr, "", 0);
11378         int x1, y1;
11379         getbegyx(stdscr, y1, x1)
11380   ;
11381   return 0;
11382 }
11383 _ACEOF
11384 rm -f conftest.$ac_objext conftest$ac_exeext
11385 if { (eval echo "$as_me:11385: \"$ac_link\"") >&5
11386   (eval $ac_link) 2>&5
11387   ac_status=$?
11388   echo "$as_me:11388: \$? = $ac_status" >&5
11389   (exit $ac_status); } &&
11390          { ac_try='test -s conftest$ac_exeext'
11391   { (eval echo "$as_me:11391: \"$ac_try\"") >&5
11392   (eval $ac_try) 2>&5
11393   ac_status=$?
11394   echo "$as_me:11394: \$? = $ac_status" >&5
11395   (exit $ac_status); }; }; then
11396   cf_cv_need_xopen_extension=yes
11397 else
11398   echo "$as_me: failed program was:" >&5
11399 cat conftest.$ac_ext >&5
11400 cf_cv_need_xopen_extension=unknown
11401 fi
11402 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11403 fi
11404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11405 fi
11406 echo "$as_me:11406: result: $cf_cv_need_xopen_extension" >&5
11407 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
11408 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
11409
11410 echo "$as_me:11410: checking for term.h" >&5
11411 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
11412 if test "${cf_cv_term_header+set}" = set; then
11413   echo $ECHO_N "(cached) $ECHO_C" >&6
11414 else
11415
11416 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
11417 # for <term.h> if we do not find the variant.
11418 for cf_header in \
11419         `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
11420         term.h
11421 do
11422         cat >conftest.$ac_ext <<_ACEOF
11423 #line 11423 "configure"
11424 #include "confdefs.h"
11425
11426 #include <${cf_cv_ncurses_header:-curses.h}>
11427 #include <${cf_header}>
11428 int
11429 main ()
11430 {
11431 WINDOW *x
11432   ;
11433   return 0;
11434 }
11435 _ACEOF
11436 rm -f conftest.$ac_objext
11437 if { (eval echo "$as_me:11437: \"$ac_compile\"") >&5
11438   (eval $ac_compile) 2>&5
11439   ac_status=$?
11440   echo "$as_me:11440: \$? = $ac_status" >&5
11441   (exit $ac_status); } &&
11442          { ac_try='test -s conftest.$ac_objext'
11443   { (eval echo "$as_me:11443: \"$ac_try\"") >&5
11444   (eval $ac_try) 2>&5
11445   ac_status=$?
11446   echo "$as_me:11446: \$? = $ac_status" >&5
11447   (exit $ac_status); }; }; then
11448   cf_cv_term_header=$cf_header
11449          break
11450 else
11451   echo "$as_me: failed program was:" >&5
11452 cat conftest.$ac_ext >&5
11453 cf_cv_term_header=no
11454 fi
11455 rm -f conftest.$ac_objext conftest.$ac_ext
11456 done
11457
11458 case $cf_cv_term_header in #(vi
11459 no)
11460         # If curses is ncurses, some packagers still mess it up by trying to make
11461         # us use GNU termcap.  This handles the most common case.
11462         for cf_header in ncurses/term.h ncursesw/term.h
11463         do
11464                 cat >conftest.$ac_ext <<_ACEOF
11465 #line 11465 "configure"
11466 #include "confdefs.h"
11467
11468 #include <${cf_cv_ncurses_header:-curses.h}>
11469 #ifdef NCURSES_VERSION
11470 #include <${cf_header}>
11471 #else
11472 make an error
11473 #endif
11474 int
11475 main ()
11476 {
11477 WINDOW *x
11478   ;
11479   return 0;
11480 }
11481 _ACEOF
11482 rm -f conftest.$ac_objext
11483 if { (eval echo "$as_me:11483: \"$ac_compile\"") >&5
11484   (eval $ac_compile) 2>&5
11485   ac_status=$?
11486   echo "$as_me:11486: \$? = $ac_status" >&5
11487   (exit $ac_status); } &&
11488          { ac_try='test -s conftest.$ac_objext'
11489   { (eval echo "$as_me:11489: \"$ac_try\"") >&5
11490   (eval $ac_try) 2>&5
11491   ac_status=$?
11492   echo "$as_me:11492: \$? = $ac_status" >&5
11493   (exit $ac_status); }; }; then
11494   cf_cv_term_header=$cf_header
11495                          break
11496 else
11497   echo "$as_me: failed program was:" >&5
11498 cat conftest.$ac_ext >&5
11499 cf_cv_term_header=no
11500 fi
11501 rm -f conftest.$ac_objext conftest.$ac_ext
11502         done
11503         ;;
11504 esac
11505
11506 fi
11507 echo "$as_me:11507: result: $cf_cv_term_header" >&5
11508 echo "${ECHO_T}$cf_cv_term_header" >&6
11509
11510 case $cf_cv_term_header in #(vi
11511 term.h) #(vi
11512         cat >>confdefs.h <<\EOF
11513 #define HAVE_TERM_H 1
11514 EOF
11515
11516         ;;
11517 ncurses/term.h) #(vi
11518         cat >>confdefs.h <<\EOF
11519 #define HAVE_NCURSES_TERM_H 1
11520 EOF
11521
11522         ;;
11523 ncursesw/term.h)
11524         cat >>confdefs.h <<\EOF
11525 #define HAVE_NCURSESW_TERM_H 1
11526 EOF
11527
11528         ;;
11529 esac
11530
11531 for cf_func in \
11532 chgat \
11533 color_set \
11534 filter \
11535 getbegx \
11536 getcurx \
11537 getmaxx \
11538 getnstr \
11539 getparx \
11540 getwin \
11541 mvvline \
11542 mvwvline \
11543 napms \
11544 putwin \
11545 resize_term \
11546 resizeterm \
11547 ripoffline \
11548 setupterm \
11549 slk_color \
11550 slk_init \
11551 termattrs \
11552 tgetent \
11553 tigetnum \
11554 tigetstr \
11555 typeahead \
11556 use_default_colors \
11557 vw_printw \
11558 vsscanf \
11559 wchgat \
11560 winsstr \
11561 wresize \
11562
11563 do
11564
11565 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11566
11567         echo "$as_me:11567: checking for ${cf_func}" >&5
11568 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
11569
11570 echo "${as_me:-configure}:11570: testing ${cf_func} ..." 1>&5
11571
11572         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
11573   echo $ECHO_N "(cached) $ECHO_C" >&6
11574 else
11575
11576                 eval cf_result='$ac_cv_func_'$cf_func
11577                 if test ".$cf_result" != ".no"; then
11578                         cat >conftest.$ac_ext <<_ACEOF
11579 #line 11579 "configure"
11580 #include "confdefs.h"
11581
11582 #ifdef HAVE_XCURSES
11583 #include <xcurses.h>
11584 char * XCursesProgramName = "test";
11585 #else
11586 #include <${cf_cv_ncurses_header:-curses.h}>
11587 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
11588 #include <ncursesw/term.h>
11589 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
11590 #include <ncurses/term.h>
11591 #elif defined(HAVE_TERM_H)
11592 #include <term.h>
11593 #endif
11594 #endif
11595
11596 int
11597 main ()
11598 {
11599
11600 #ifndef ${cf_func}
11601 long foo = (long)(&${cf_func});
11602 ${cf_cv_main_return:-return}(foo == 0);
11603 #endif
11604
11605   ;
11606   return 0;
11607 }
11608 _ACEOF
11609 rm -f conftest.$ac_objext conftest$ac_exeext
11610 if { (eval echo "$as_me:11610: \"$ac_link\"") >&5
11611   (eval $ac_link) 2>&5
11612   ac_status=$?
11613   echo "$as_me:11613: \$? = $ac_status" >&5
11614   (exit $ac_status); } &&
11615          { ac_try='test -s conftest$ac_exeext'
11616   { (eval echo "$as_me:11616: \"$ac_try\"") >&5
11617   (eval $ac_try) 2>&5
11618   ac_status=$?
11619   echo "$as_me:11619: \$? = $ac_status" >&5
11620   (exit $ac_status); }; }; then
11621   cf_result=yes
11622 else
11623   echo "$as_me: failed program was:" >&5
11624 cat conftest.$ac_ext >&5
11625 cf_result=no
11626 fi
11627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11628                 fi
11629                 eval 'cf_cv_func_'$cf_func'=$cf_result'
11630
11631 fi
11632
11633         # use the computed/retrieved cache-value:
11634         eval 'cf_result=$cf_cv_func_'$cf_func
11635         echo "$as_me:11635: result: $cf_result" >&5
11636 echo "${ECHO_T}$cf_result" >&6
11637         if test $cf_result != no; then
11638                 cat >>confdefs.h <<EOF
11639 #define HAVE_${cf_tr_func} 1
11640 EOF
11641
11642         fi
11643 done
11644
11645 echo "$as_me:11645: checking for ncurses extended functions" >&5
11646 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
11647 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
11648   echo $ECHO_N "(cached) $ECHO_C" >&6
11649 else
11650
11651 cat >conftest.$ac_ext <<_ACEOF
11652 #line 11652 "configure"
11653 #include "confdefs.h"
11654
11655 #include <${cf_cv_ncurses_header:-curses.h}>
11656 int
11657 main ()
11658 {
11659
11660 int x = NCURSES_EXT_FUNCS
11661
11662   ;
11663   return 0;
11664 }
11665 _ACEOF
11666 rm -f conftest.$ac_objext
11667 if { (eval echo "$as_me:11667: \"$ac_compile\"") >&5
11668   (eval $ac_compile) 2>&5
11669   ac_status=$?
11670   echo "$as_me:11670: \$? = $ac_status" >&5
11671   (exit $ac_status); } &&
11672          { ac_try='test -s conftest.$ac_objext'
11673   { (eval echo "$as_me:11673: \"$ac_try\"") >&5
11674   (eval $ac_try) 2>&5
11675   ac_status=$?
11676   echo "$as_me:11676: \$? = $ac_status" >&5
11677   (exit $ac_status); }; }; then
11678   cf_cv_ncurses_ext_funcs=defined
11679 else
11680   echo "$as_me: failed program was:" >&5
11681 cat conftest.$ac_ext >&5
11682
11683 cat >conftest.$ac_ext <<_ACEOF
11684 #line 11684 "configure"
11685 #include "confdefs.h"
11686
11687 #include <${cf_cv_ncurses_header:-curses.h}>
11688 int
11689 main ()
11690 {
11691
11692         (void) assume_default_colors (0, 0);
11693         (void) curses_version ();
11694         (void) define_key (0, 0);
11695         (void) is_term_resized (0, 0);
11696         (void) key_defined (0);
11697         (void) keybound (0, 0);
11698         (void) keyok (0, 0);
11699         (void) resize_term (0, 0);
11700         (void) resizeterm (0, 0);
11701         (void) use_default_colors ();
11702         (void) use_extended_names (0);
11703         (void) wresize (0, 0, 0);
11704   ;
11705   return 0;
11706 }
11707 _ACEOF
11708 rm -f conftest.$ac_objext conftest$ac_exeext
11709 if { (eval echo "$as_me:11709: \"$ac_link\"") >&5
11710   (eval $ac_link) 2>&5
11711   ac_status=$?
11712   echo "$as_me:11712: \$? = $ac_status" >&5
11713   (exit $ac_status); } &&
11714          { ac_try='test -s conftest$ac_exeext'
11715   { (eval echo "$as_me:11715: \"$ac_try\"") >&5
11716   (eval $ac_try) 2>&5
11717   ac_status=$?
11718   echo "$as_me:11718: \$? = $ac_status" >&5
11719   (exit $ac_status); }; }; then
11720   cf_cv_ncurses_ext_funcs=yes
11721 else
11722   echo "$as_me: failed program was:" >&5
11723 cat conftest.$ac_ext >&5
11724 cf_cv_ncurses_ext_funcs=no
11725 fi
11726 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11727
11728 fi
11729 rm -f conftest.$ac_objext conftest.$ac_ext
11730
11731 fi
11732 echo "$as_me:11732: result: $cf_cv_ncurses_ext_funcs" >&5
11733 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
11734 test "$cf_cv_ncurses_ext_funcs" == yes && cat >>confdefs.h <<\EOF
11735 #define NCURSES_EXT_FUNCS 1
11736 EOF
11737
11738 echo "$as_me:11738: checking for wide-character functions" >&5
11739 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
11740 if test "${cf_cv_widechar_funcs+set}" = set; then
11741   echo $ECHO_N "(cached) $ECHO_C" >&6
11742 else
11743
11744 cat >conftest.$ac_ext <<_ACEOF
11745 #line 11745 "configure"
11746 #include "confdefs.h"
11747
11748 #include <${cf_cv_ncurses_header:-curses.h}>
11749 int
11750 main ()
11751 {
11752
11753         static wchar_t src_wchar[2];
11754         static cchar_t dst_cchar;
11755         setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
11756
11757   ;
11758   return 0;
11759 }
11760 _ACEOF
11761 rm -f conftest.$ac_objext conftest$ac_exeext
11762 if { (eval echo "$as_me:11762: \"$ac_link\"") >&5
11763   (eval $ac_link) 2>&5
11764   ac_status=$?
11765   echo "$as_me:11765: \$? = $ac_status" >&5
11766   (exit $ac_status); } &&
11767          { ac_try='test -s conftest$ac_exeext'
11768   { (eval echo "$as_me:11768: \"$ac_try\"") >&5
11769   (eval $ac_try) 2>&5
11770   ac_status=$?
11771   echo "$as_me:11771: \$? = $ac_status" >&5
11772   (exit $ac_status); }; }; then
11773   cf_cv_widechar_funcs=yes
11774 else
11775   echo "$as_me: failed program was:" >&5
11776 cat conftest.$ac_ext >&5
11777 cf_cv_widechar_funcs=no
11778 fi
11779 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11780
11781 fi
11782 echo "$as_me:11782: result: $cf_cv_widechar_funcs" >&5
11783 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
11784 if test "$cf_cv_widechar_funcs" != no ; then
11785         cat >>confdefs.h <<\EOF
11786 #define USE_WIDEC_SUPPORT 1
11787 EOF
11788
11789 else
11790         cat >>confdefs.h <<\EOF
11791 #define USE_WIDEC_SUPPORT 0
11792 EOF
11793
11794 fi
11795
11796 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
11797
11798 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
11799                   inttypes.h stdint.h unistd.h
11800 do
11801 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11802 echo "$as_me:11802: checking for $ac_header" >&5
11803 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11804 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11805   echo $ECHO_N "(cached) $ECHO_C" >&6
11806 else
11807   cat >conftest.$ac_ext <<_ACEOF
11808 #line 11808 "configure"
11809 #include "confdefs.h"
11810 $ac_includes_default
11811 #include <$ac_header>
11812 _ACEOF
11813 rm -f conftest.$ac_objext
11814 if { (eval echo "$as_me:11814: \"$ac_compile\"") >&5
11815   (eval $ac_compile) 2>&5
11816   ac_status=$?
11817   echo "$as_me:11817: \$? = $ac_status" >&5
11818   (exit $ac_status); } &&
11819          { ac_try='test -s conftest.$ac_objext'
11820   { (eval echo "$as_me:11820: \"$ac_try\"") >&5
11821   (eval $ac_try) 2>&5
11822   ac_status=$?
11823   echo "$as_me:11823: \$? = $ac_status" >&5
11824   (exit $ac_status); }; }; then
11825   eval "$as_ac_Header=yes"
11826 else
11827   echo "$as_me: failed program was:" >&5
11828 cat conftest.$ac_ext >&5
11829 eval "$as_ac_Header=no"
11830 fi
11831 rm -f conftest.$ac_objext conftest.$ac_ext
11832 fi
11833 echo "$as_me:11833: result: `eval echo '${'$as_ac_Header'}'`" >&5
11834 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
11835 if test `eval echo '${'$as_ac_Header'}'` = yes; then
11836   cat >>confdefs.h <<EOF
11837 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11838 EOF
11839
11840 fi
11841 done
11842
11843 echo "$as_me:11843: checking for pid_t" >&5
11844 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
11845 if test "${ac_cv_type_pid_t+set}" = set; then
11846   echo $ECHO_N "(cached) $ECHO_C" >&6
11847 else
11848   cat >conftest.$ac_ext <<_ACEOF
11849 #line 11849 "configure"
11850 #include "confdefs.h"
11851 $ac_includes_default
11852 int
11853 main ()
11854 {
11855 if ((pid_t *) 0)
11856   return 0;
11857 if (sizeof (pid_t))
11858   return 0;
11859   ;
11860   return 0;
11861 }
11862 _ACEOF
11863 rm -f conftest.$ac_objext
11864 if { (eval echo "$as_me:11864: \"$ac_compile\"") >&5
11865   (eval $ac_compile) 2>&5
11866   ac_status=$?
11867   echo "$as_me:11867: \$? = $ac_status" >&5
11868   (exit $ac_status); } &&
11869          { ac_try='test -s conftest.$ac_objext'
11870   { (eval echo "$as_me:11870: \"$ac_try\"") >&5
11871   (eval $ac_try) 2>&5
11872   ac_status=$?
11873   echo "$as_me:11873: \$? = $ac_status" >&5
11874   (exit $ac_status); }; }; then
11875   ac_cv_type_pid_t=yes
11876 else
11877   echo "$as_me: failed program was:" >&5
11878 cat conftest.$ac_ext >&5
11879 ac_cv_type_pid_t=no
11880 fi
11881 rm -f conftest.$ac_objext conftest.$ac_ext
11882 fi
11883 echo "$as_me:11883: result: $ac_cv_type_pid_t" >&5
11884 echo "${ECHO_T}$ac_cv_type_pid_t" >&6
11885 if test $ac_cv_type_pid_t = yes; then
11886   :
11887 else
11888
11889 cat >>confdefs.h <<EOF
11890 #define pid_t int
11891 EOF
11892
11893 fi
11894
11895 for ac_header in unistd.h vfork.h
11896 do
11897 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11898 echo "$as_me:11898: checking for $ac_header" >&5
11899 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11900 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11901   echo $ECHO_N "(cached) $ECHO_C" >&6
11902 else
11903   cat >conftest.$ac_ext <<_ACEOF
11904 #line 11904 "configure"
11905 #include "confdefs.h"
11906 #include <$ac_header>
11907 _ACEOF
11908 if { (eval echo "$as_me:11908: \"$ac_cpp conftest.$ac_ext\"") >&5
11909   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11910   ac_status=$?
11911   egrep -v '^ *\+' conftest.er1 >conftest.err
11912   rm -f conftest.er1
11913   cat conftest.err >&5
11914   echo "$as_me:11914: \$? = $ac_status" >&5
11915   (exit $ac_status); } >/dev/null; then
11916   if test -s conftest.err; then
11917     ac_cpp_err=$ac_c_preproc_warn_flag
11918   else
11919     ac_cpp_err=
11920   fi
11921 else
11922   ac_cpp_err=yes
11923 fi
11924 if test -z "$ac_cpp_err"; then
11925   eval "$as_ac_Header=yes"
11926 else
11927   echo "$as_me: failed program was:" >&5
11928   cat conftest.$ac_ext >&5
11929   eval "$as_ac_Header=no"
11930 fi
11931 rm -f conftest.err conftest.$ac_ext
11932 fi
11933 echo "$as_me:11933: result: `eval echo '${'$as_ac_Header'}'`" >&5
11934 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
11935 if test `eval echo '${'$as_ac_Header'}'` = yes; then
11936   cat >>confdefs.h <<EOF
11937 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11938 EOF
11939
11940 fi
11941 done
11942
11943 for ac_func in fork vfork
11944 do
11945 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
11946 echo "$as_me:11946: checking for $ac_func" >&5
11947 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
11948 if eval "test \"\${$as_ac_var+set}\" = set"; then
11949   echo $ECHO_N "(cached) $ECHO_C" >&6
11950 else
11951   cat >conftest.$ac_ext <<_ACEOF
11952 #line 11952 "configure"
11953 #include "confdefs.h"
11954 /* System header to define __stub macros and hopefully few prototypes,
11955     which can conflict with char $ac_func (); below.  */
11956 #include <assert.h>
11957 /* Override any gcc2 internal prototype to avoid an error.  */
11958 #ifdef __cplusplus
11959 extern "C"
11960 #endif
11961 /* We use char because int might match the return type of a gcc2
11962    builtin and then its argument prototype would still apply.  */
11963 char $ac_func ();
11964 char (*f) ();
11965
11966 int
11967 main ()
11968 {
11969 /* The GNU C library defines this for functions which it implements
11970     to always fail with ENOSYS.  Some functions are actually named
11971     something starting with __ and the normal name is an alias.  */
11972 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11973 choke me
11974 #else
11975 f = $ac_func;
11976 #endif
11977
11978   ;
11979   return 0;
11980 }
11981 _ACEOF
11982 rm -f conftest.$ac_objext conftest$ac_exeext
11983 if { (eval echo "$as_me:11983: \"$ac_link\"") >&5
11984   (eval $ac_link) 2>&5
11985   ac_status=$?
11986   echo "$as_me:11986: \$? = $ac_status" >&5
11987   (exit $ac_status); } &&
11988          { ac_try='test -s conftest$ac_exeext'
11989   { (eval echo "$as_me:11989: \"$ac_try\"") >&5
11990   (eval $ac_try) 2>&5
11991   ac_status=$?
11992   echo "$as_me:11992: \$? = $ac_status" >&5
11993   (exit $ac_status); }; }; then
11994   eval "$as_ac_var=yes"
11995 else
11996   echo "$as_me: failed program was:" >&5
11997 cat conftest.$ac_ext >&5
11998 eval "$as_ac_var=no"
11999 fi
12000 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12001 fi
12002 echo "$as_me:12002: result: `eval echo '${'$as_ac_var'}'`" >&5
12003 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12004 if test `eval echo '${'$as_ac_var'}'` = yes; then
12005   cat >>confdefs.h <<EOF
12006 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12007 EOF
12008
12009 fi
12010 done
12011
12012 ac_cv_func_fork_works=$ac_cv_func_fork
12013 if test "x$ac_cv_func_fork" = xyes; then
12014   echo "$as_me:12014: checking for working fork" >&5
12015 echo $ECHO_N "checking for working fork... $ECHO_C" >&6
12016 if test "${ac_cv_func_fork_works+set}" = set; then
12017   echo $ECHO_N "(cached) $ECHO_C" >&6
12018 else
12019   if test "$cross_compiling" = yes; then
12020   ac_cv_func_fork_works=cross
12021 else
12022   cat >conftest.$ac_ext <<_ACEOF
12023 /* By Rüdiger Kuhlmann. */
12024       #include <sys/types.h>
12025       #if HAVE_UNISTD_H
12026       # include <unistd.h>
12027       #endif
12028       /* Some systems only have a dummy stub for fork() */
12029       int main ()
12030       {
12031         if (fork() < 0)
12032           $ac_main_return (1);
12033         $ac_main_return (0);
12034       }
12035 _ACEOF
12036 rm -f conftest$ac_exeext
12037 if { (eval echo "$as_me:12037: \"$ac_link\"") >&5
12038   (eval $ac_link) 2>&5
12039   ac_status=$?
12040   echo "$as_me:12040: \$? = $ac_status" >&5
12041   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12042   { (eval echo "$as_me:12042: \"$ac_try\"") >&5
12043   (eval $ac_try) 2>&5
12044   ac_status=$?
12045   echo "$as_me:12045: \$? = $ac_status" >&5
12046   (exit $ac_status); }; }; then
12047   ac_cv_func_fork_works=yes
12048 else
12049   echo "$as_me: program exited with status $ac_status" >&5
12050 echo "$as_me: failed program was:" >&5
12051 cat conftest.$ac_ext >&5
12052 ac_cv_func_fork_works=no
12053 fi
12054 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12055 fi
12056 fi
12057 echo "$as_me:12057: result: $ac_cv_func_fork_works" >&5
12058 echo "${ECHO_T}$ac_cv_func_fork_works" >&6
12059
12060 fi
12061 if test "x$ac_cv_func_fork_works" = xcross; then
12062   case $host in
12063     *-*-amigaos* | *-*-msdosdjgpp*)
12064       # Override, as these systems have only a dummy fork() stub
12065       ac_cv_func_fork_works=no
12066       ;;
12067     *)
12068       ac_cv_func_fork_works=yes
12069       ;;
12070   esac
12071   { echo "$as_me:12071: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
12072 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
12073 fi
12074 ac_cv_func_vfork_works=$ac_cv_func_vfork
12075 if test "x$ac_cv_func_vfork" = xyes; then
12076   echo "$as_me:12076: checking for working vfork" >&5
12077 echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
12078 if test "${ac_cv_func_vfork_works+set}" = set; then
12079   echo $ECHO_N "(cached) $ECHO_C" >&6
12080 else
12081   if test "$cross_compiling" = yes; then
12082   ac_cv_func_vfork_works=cross
12083 else
12084   cat >conftest.$ac_ext <<_ACEOF
12085 #line 12085 "configure"
12086 #include "confdefs.h"
12087 /* Thanks to Paul Eggert for this test.  */
12088 #include <stdio.h>
12089 #include <sys/types.h>
12090 #include <sys/stat.h>
12091 #if HAVE_UNISTD_H
12092 # include <unistd.h>
12093 #endif
12094 #if HAVE_VFORK_H
12095 # include <vfork.h>
12096 #endif
12097 /* On some sparc systems, changes by the child to local and incoming
12098    argument registers are propagated back to the parent.  The compiler
12099    is told about this with #include <vfork.h>, but some compilers
12100    (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
12101    static variable whose address is put into a register that is
12102    clobbered by the vfork.  */
12103 static
12104 #ifdef __cplusplus
12105 sparc_address_test (int arg)
12106 # else
12107 sparc_address_test (arg) int arg;
12108 #endif
12109 {
12110   static pid_t child;
12111   if (!child) {
12112     child = vfork ();
12113     if (child < 0) {
12114       perror ("vfork");
12115       _exit(2);
12116     }
12117     if (!child) {
12118       arg = getpid();
12119       write(-1, "", 0);
12120       _exit (arg);
12121     }
12122   }
12123 }
12124
12125 int
12126 main ()
12127 {
12128   pid_t parent = getpid ();
12129   pid_t child;
12130
12131   sparc_address_test ();
12132
12133   child = vfork ();
12134
12135   if (child == 0) {
12136     /* Here is another test for sparc vfork register problems.  This
12137        test uses lots of local variables, at least as many local
12138        variables as main has allocated so far including compiler
12139        temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
12140        4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
12141        reuse the register of parent for one of the local variables,
12142        since it will think that parent can't possibly be used any more
12143        in this routine.  Assigning to the local variable will thus
12144        munge parent in the parent process.  */
12145     pid_t
12146       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
12147       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
12148     /* Convince the compiler that p..p7 are live; otherwise, it might
12149        use the same hardware register for all 8 local variables.  */
12150     if (p != p1 || p != p2 || p != p3 || p != p4
12151         || p != p5 || p != p6 || p != p7)
12152       _exit(1);
12153
12154     /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
12155        from child file descriptors.  If the child closes a descriptor
12156        before it execs or exits, this munges the parent's descriptor
12157        as well.  Test for this by closing stdout in the child.  */
12158     _exit(close(fileno(stdout)) != 0);
12159   } else {
12160     int status;
12161     struct stat st;
12162
12163     while (wait(&status) != child)
12164       ;
12165     $ac_main_return(
12166          /* Was there some problem with vforking?  */
12167          child < 0
12168
12169          /* Did the child fail?  (This shouldn't happen.)  */
12170          || status
12171
12172          /* Did the vfork/compiler bug occur?  */
12173          || parent != getpid()
12174
12175          /* Did the file descriptor bug occur?  */
12176          || fstat(fileno(stdout), &st) != 0
12177          );
12178   }
12179 }
12180 _ACEOF
12181 rm -f conftest$ac_exeext
12182 if { (eval echo "$as_me:12182: \"$ac_link\"") >&5
12183   (eval $ac_link) 2>&5
12184   ac_status=$?
12185   echo "$as_me:12185: \$? = $ac_status" >&5
12186   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12187   { (eval echo "$as_me:12187: \"$ac_try\"") >&5
12188   (eval $ac_try) 2>&5
12189   ac_status=$?
12190   echo "$as_me:12190: \$? = $ac_status" >&5
12191   (exit $ac_status); }; }; then
12192   ac_cv_func_vfork_works=yes
12193 else
12194   echo "$as_me: program exited with status $ac_status" >&5
12195 echo "$as_me: failed program was:" >&5
12196 cat conftest.$ac_ext >&5
12197 ac_cv_func_vfork_works=no
12198 fi
12199 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12200 fi
12201 fi
12202 echo "$as_me:12202: result: $ac_cv_func_vfork_works" >&5
12203 echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
12204
12205 fi;
12206 if test "x$ac_cv_func_fork_works" = xcross; then
12207   ac_cv_func_vfork_works=ac_cv_func_vfork
12208   { echo "$as_me:12208: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
12209 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
12210 fi
12211
12212 if test "x$ac_cv_func_vfork_works" = xyes; then
12213
12214 cat >>confdefs.h <<\EOF
12215 #define HAVE_WORKING_VFORK 1
12216 EOF
12217
12218 else
12219
12220 cat >>confdefs.h <<\EOF
12221 #define vfork fork
12222 EOF
12223
12224 fi
12225 if test "x$ac_cv_func_fork_works" = xyes; then
12226
12227 cat >>confdefs.h <<\EOF
12228 #define HAVE_WORKING_FORK 1
12229 EOF
12230
12231 fi
12232
12233 echo "$as_me:12233: checking if sys/time.h works with sys/select.h" >&5
12234 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
12235 if test "${cf_cv_sys_time_select+set}" = set; then
12236   echo $ECHO_N "(cached) $ECHO_C" >&6
12237 else
12238
12239 cat >conftest.$ac_ext <<_ACEOF
12240 #line 12240 "configure"
12241 #include "confdefs.h"
12242
12243 #include <sys/types.h>
12244 #ifdef HAVE_SYS_TIME_H
12245 #include <sys/time.h>
12246 #endif
12247 #ifdef HAVE_SYS_SELECT_H
12248 #include <sys/select.h>
12249 #endif
12250
12251 int
12252 main ()
12253 {
12254
12255   ;
12256   return 0;
12257 }
12258 _ACEOF
12259 rm -f conftest.$ac_objext
12260 if { (eval echo "$as_me:12260: \"$ac_compile\"") >&5
12261   (eval $ac_compile) 2>&5
12262   ac_status=$?
12263   echo "$as_me:12263: \$? = $ac_status" >&5
12264   (exit $ac_status); } &&
12265          { ac_try='test -s conftest.$ac_objext'
12266   { (eval echo "$as_me:12266: \"$ac_try\"") >&5
12267   (eval $ac_try) 2>&5
12268   ac_status=$?
12269   echo "$as_me:12269: \$? = $ac_status" >&5
12270   (exit $ac_status); }; }; then
12271   cf_cv_sys_time_select=yes
12272 else
12273   echo "$as_me: failed program was:" >&5
12274 cat conftest.$ac_ext >&5
12275 cf_cv_sys_time_select=no
12276 fi
12277 rm -f conftest.$ac_objext conftest.$ac_ext
12278
12279 fi
12280
12281 echo "$as_me:12281: result: $cf_cv_sys_time_select" >&5
12282 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
12283 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
12284 #define HAVE_SYS_TIME_SELECT 1
12285 EOF
12286
12287 echo "$as_me:12287: checking for function curses_version" >&5
12288 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
12289 if test "${cf_cv_func_curses_version+set}" = set; then
12290   echo $ECHO_N "(cached) $ECHO_C" >&6
12291 else
12292
12293 if test "$cross_compiling" = yes; then
12294   cf_cv_func_curses_version=unknown
12295 else
12296   cat >conftest.$ac_ext <<_ACEOF
12297 #line 12297 "configure"
12298 #include "confdefs.h"
12299
12300 #include <${cf_cv_ncurses_header:-curses.h}>
12301 int main()
12302 {
12303         char temp[1024];
12304         sprintf(temp, "%s\n", curses_version());
12305         ${cf_cv_main_return:-return}(0);
12306 }
12307
12308 _ACEOF
12309 rm -f conftest$ac_exeext
12310 if { (eval echo "$as_me:12310: \"$ac_link\"") >&5
12311   (eval $ac_link) 2>&5
12312   ac_status=$?
12313   echo "$as_me:12313: \$? = $ac_status" >&5
12314   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12315   { (eval echo "$as_me:12315: \"$ac_try\"") >&5
12316   (eval $ac_try) 2>&5
12317   ac_status=$?
12318   echo "$as_me:12318: \$? = $ac_status" >&5
12319   (exit $ac_status); }; }; then
12320   cf_cv_func_curses_version=yes
12321
12322 else
12323   echo "$as_me: program exited with status $ac_status" >&5
12324 echo "$as_me: failed program was:" >&5
12325 cat conftest.$ac_ext >&5
12326 cf_cv_func_curses_version=no
12327
12328 fi
12329 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12330 fi
12331 rm -f core
12332 fi
12333 echo "$as_me:12333: result: $cf_cv_func_curses_version" >&5
12334 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
12335 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
12336 #define HAVE_CURSES_VERSION 1
12337 EOF
12338
12339 echo "$as_me:12339: checking for ncurses wrap-prefix" >&5
12340 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
12341
12342 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
12343 if test "${with_ncurses_wrap_prefix+set}" = set; then
12344   withval="$with_ncurses_wrap_prefix"
12345   NCURSES_WRAP_PREFIX=$withval
12346 else
12347   NCURSES_WRAP_PREFIX=_nc_
12348 fi;
12349 echo "$as_me:12349: result: $NCURSES_WRAP_PREFIX" >&5
12350 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
12351
12352 echo "$as_me:12352: checking for alternate character set array" >&5
12353 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
12354 if test "${cf_cv_curses_acs_map+set}" = set; then
12355   echo $ECHO_N "(cached) $ECHO_C" >&6
12356 else
12357
12358 cf_cv_curses_acs_map=unknown
12359 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
12360 do
12361 cat >conftest.$ac_ext <<_ACEOF
12362 #line 12362 "configure"
12363 #include "confdefs.h"
12364
12365 #include <${cf_cv_ncurses_header:-curses.h}>
12366
12367 int
12368 main ()
12369 {
12370
12371 $name['k'] = ACS_PLUS
12372
12373   ;
12374   return 0;
12375 }
12376 _ACEOF
12377 rm -f conftest.$ac_objext conftest$ac_exeext
12378 if { (eval echo "$as_me:12378: \"$ac_link\"") >&5
12379   (eval $ac_link) 2>&5
12380   ac_status=$?
12381   echo "$as_me:12381: \$? = $ac_status" >&5
12382   (exit $ac_status); } &&
12383          { ac_try='test -s conftest$ac_exeext'
12384   { (eval echo "$as_me:12384: \"$ac_try\"") >&5
12385   (eval $ac_try) 2>&5
12386   ac_status=$?
12387   echo "$as_me:12387: \$? = $ac_status" >&5
12388   (exit $ac_status); }; }; then
12389   cf_cv_curses_acs_map=$name; break
12390 else
12391   echo "$as_me: failed program was:" >&5
12392 cat conftest.$ac_ext >&5
12393 fi
12394 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12395 done
12396
12397 fi
12398 echo "$as_me:12398: result: $cf_cv_curses_acs_map" >&5
12399 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
12400
12401 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
12402 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
12403 EOF
12404
12405 echo "$as_me:12405: checking for wide alternate character set array" >&5
12406 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
12407 if test "${cf_cv_curses_wacs_map+set}" = set; then
12408   echo $ECHO_N "(cached) $ECHO_C" >&6
12409 else
12410
12411         cf_cv_curses_wacs_map=unknown
12412         for name in wacs_map _wacs_map __wacs_map _nc_wacs
12413         do
12414         cat >conftest.$ac_ext <<_ACEOF
12415 #line 12415 "configure"
12416 #include "confdefs.h"
12417
12418 #ifndef _XOPEN_SOURCE_EXTENDED
12419 #define _XOPEN_SOURCE_EXTENDED
12420 #endif
12421 #include <${cf_cv_ncurses_header:-curses.h}>
12422 int
12423 main ()
12424 {
12425 $name['k'] = *WACS_PLUS
12426   ;
12427   return 0;
12428 }
12429 _ACEOF
12430 rm -f conftest.$ac_objext conftest$ac_exeext
12431 if { (eval echo "$as_me:12431: \"$ac_link\"") >&5
12432   (eval $ac_link) 2>&5
12433   ac_status=$?
12434   echo "$as_me:12434: \$? = $ac_status" >&5
12435   (exit $ac_status); } &&
12436          { ac_try='test -s conftest$ac_exeext'
12437   { (eval echo "$as_me:12437: \"$ac_try\"") >&5
12438   (eval $ac_try) 2>&5
12439   ac_status=$?
12440   echo "$as_me:12440: \$? = $ac_status" >&5
12441   (exit $ac_status); }; }; then
12442   cf_cv_curses_wacs_map=$name
12443          break
12444 else
12445   echo "$as_me: failed program was:" >&5
12446 cat conftest.$ac_ext >&5
12447 fi
12448 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12449         done
12450 fi
12451 echo "$as_me:12451: result: $cf_cv_curses_wacs_map" >&5
12452 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
12453
12454 echo "$as_me:12454: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
12455 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
12456 cat >conftest.$ac_ext <<_ACEOF
12457 #line 12457 "configure"
12458 #include "confdefs.h"
12459
12460 #ifndef _XOPEN_SOURCE_EXTENDED
12461 #define _XOPEN_SOURCE_EXTENDED
12462 #endif
12463 #include <${cf_cv_ncurses_header:-curses.h}>
12464 int
12465 main ()
12466 {
12467
12468 attr_t foo
12469
12470   ;
12471   return 0;
12472 }
12473 _ACEOF
12474 rm -f conftest.$ac_objext
12475 if { (eval echo "$as_me:12475: \"$ac_compile\"") >&5
12476   (eval $ac_compile) 2>&5
12477   ac_status=$?
12478   echo "$as_me:12478: \$? = $ac_status" >&5
12479   (exit $ac_status); } &&
12480          { ac_try='test -s conftest.$ac_objext'
12481   { (eval echo "$as_me:12481: \"$ac_try\"") >&5
12482   (eval $ac_try) 2>&5
12483   ac_status=$?
12484   echo "$as_me:12484: \$? = $ac_status" >&5
12485   (exit $ac_status); }; }; then
12486   cf_result=yes
12487 else
12488   echo "$as_me: failed program was:" >&5
12489 cat conftest.$ac_ext >&5
12490 cf_result=no
12491 fi
12492 rm -f conftest.$ac_objext conftest.$ac_ext
12493 echo "$as_me:12493: result: $cf_result" >&5
12494 echo "${ECHO_T}$cf_result" >&6
12495 if test $cf_result = yes ; then
12496
12497 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12498
12499         cat >>confdefs.h <<EOF
12500 #define $cf_result 1
12501 EOF
12502
12503 else
12504         cat >>confdefs.h <<EOF
12505 #define attr_t long
12506 EOF
12507
12508 fi
12509
12510 # This is needed on Tru64 5.0 to declare mbstate_t
12511 echo "$as_me:12511: checking if we must include wchar.h to declare mbstate_t" >&5
12512 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
12513 if test "${cf_cv_mbstate_t+set}" = set; then
12514   echo $ECHO_N "(cached) $ECHO_C" >&6
12515 else
12516
12517 cat >conftest.$ac_ext <<_ACEOF
12518 #line 12518 "configure"
12519 #include "confdefs.h"
12520
12521 #include <stdlib.h>
12522 #include <stdarg.h>
12523 #include <stdio.h>
12524 #ifdef HAVE_LIBUTF8_H
12525 #include <libutf8.h>
12526 #endif
12527 int
12528 main ()
12529 {
12530 mbstate_t state
12531   ;
12532   return 0;
12533 }
12534 _ACEOF
12535 rm -f conftest.$ac_objext
12536 if { (eval echo "$as_me:12536: \"$ac_compile\"") >&5
12537   (eval $ac_compile) 2>&5
12538   ac_status=$?
12539   echo "$as_me:12539: \$? = $ac_status" >&5
12540   (exit $ac_status); } &&
12541          { ac_try='test -s conftest.$ac_objext'
12542   { (eval echo "$as_me:12542: \"$ac_try\"") >&5
12543   (eval $ac_try) 2>&5
12544   ac_status=$?
12545   echo "$as_me:12545: \$? = $ac_status" >&5
12546   (exit $ac_status); }; }; then
12547   cf_cv_mbstate_t=no
12548 else
12549   echo "$as_me: failed program was:" >&5
12550 cat conftest.$ac_ext >&5
12551 cat >conftest.$ac_ext <<_ACEOF
12552 #line 12552 "configure"
12553 #include "confdefs.h"
12554
12555 #include <stdlib.h>
12556 #include <stdarg.h>
12557 #include <stdio.h>
12558 #include <wchar.h>
12559 #ifdef HAVE_LIBUTF8_H
12560 #include <libutf8.h>
12561 #endif
12562 int
12563 main ()
12564 {
12565 mbstate_t value
12566   ;
12567   return 0;
12568 }
12569 _ACEOF
12570 rm -f conftest.$ac_objext
12571 if { (eval echo "$as_me:12571: \"$ac_compile\"") >&5
12572   (eval $ac_compile) 2>&5
12573   ac_status=$?
12574   echo "$as_me:12574: \$? = $ac_status" >&5
12575   (exit $ac_status); } &&
12576          { ac_try='test -s conftest.$ac_objext'
12577   { (eval echo "$as_me:12577: \"$ac_try\"") >&5
12578   (eval $ac_try) 2>&5
12579   ac_status=$?
12580   echo "$as_me:12580: \$? = $ac_status" >&5
12581   (exit $ac_status); }; }; then
12582   cf_cv_mbstate_t=yes
12583 else
12584   echo "$as_me: failed program was:" >&5
12585 cat conftest.$ac_ext >&5
12586 cf_cv_mbstate_t=unknown
12587 fi
12588 rm -f conftest.$ac_objext conftest.$ac_ext
12589 fi
12590 rm -f conftest.$ac_objext conftest.$ac_ext
12591 fi
12592 echo "$as_me:12592: result: $cf_cv_mbstate_t" >&5
12593 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
12594
12595 if test "$cf_cv_mbstate_t" = yes ; then
12596         cat >>confdefs.h <<\EOF
12597 #define NEED_WCHAR_H 1
12598 EOF
12599
12600         NEED_WCHAR_H=1
12601 fi
12602
12603 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
12604 if test "$cf_cv_mbstate_t" = unknown ; then
12605         NCURSES_MBSTATE_T=1
12606 fi
12607
12608 # if we find mbstate_t in either place, use substitution to provide a fallback.
12609 if test "$cf_cv_mbstate_t" != unknown ; then
12610         NCURSES_OK_MBSTATE_T=1
12611 fi
12612
12613 # This is needed on Tru64 5.0 to declare wchar_t
12614 echo "$as_me:12614: checking if we must include wchar.h to declare wchar_t" >&5
12615 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
12616 if test "${cf_cv_wchar_t+set}" = set; then
12617   echo $ECHO_N "(cached) $ECHO_C" >&6
12618 else
12619
12620 cat >conftest.$ac_ext <<_ACEOF
12621 #line 12621 "configure"
12622 #include "confdefs.h"
12623
12624 #include <stdlib.h>
12625 #include <stdarg.h>
12626 #include <stdio.h>
12627 #ifdef HAVE_LIBUTF8_H
12628 #include <libutf8.h>
12629 #endif
12630 int
12631 main ()
12632 {
12633 wchar_t state
12634   ;
12635   return 0;
12636 }
12637 _ACEOF
12638 rm -f conftest.$ac_objext
12639 if { (eval echo "$as_me:12639: \"$ac_compile\"") >&5
12640   (eval $ac_compile) 2>&5
12641   ac_status=$?
12642   echo "$as_me:12642: \$? = $ac_status" >&5
12643   (exit $ac_status); } &&
12644          { ac_try='test -s conftest.$ac_objext'
12645   { (eval echo "$as_me:12645: \"$ac_try\"") >&5
12646   (eval $ac_try) 2>&5
12647   ac_status=$?
12648   echo "$as_me:12648: \$? = $ac_status" >&5
12649   (exit $ac_status); }; }; then
12650   cf_cv_wchar_t=no
12651 else
12652   echo "$as_me: failed program was:" >&5
12653 cat conftest.$ac_ext >&5
12654 cat >conftest.$ac_ext <<_ACEOF
12655 #line 12655 "configure"
12656 #include "confdefs.h"
12657
12658 #include <stdlib.h>
12659 #include <stdarg.h>
12660 #include <stdio.h>
12661 #include <wchar.h>
12662 #ifdef HAVE_LIBUTF8_H
12663 #include <libutf8.h>
12664 #endif
12665 int
12666 main ()
12667 {
12668 wchar_t value
12669   ;
12670   return 0;
12671 }
12672 _ACEOF
12673 rm -f conftest.$ac_objext
12674 if { (eval echo "$as_me:12674: \"$ac_compile\"") >&5
12675   (eval $ac_compile) 2>&5
12676   ac_status=$?
12677   echo "$as_me:12677: \$? = $ac_status" >&5
12678   (exit $ac_status); } &&
12679          { ac_try='test -s conftest.$ac_objext'
12680   { (eval echo "$as_me:12680: \"$ac_try\"") >&5
12681   (eval $ac_try) 2>&5
12682   ac_status=$?
12683   echo "$as_me:12683: \$? = $ac_status" >&5
12684   (exit $ac_status); }; }; then
12685   cf_cv_wchar_t=yes
12686 else
12687   echo "$as_me: failed program was:" >&5
12688 cat conftest.$ac_ext >&5
12689 cf_cv_wchar_t=unknown
12690 fi
12691 rm -f conftest.$ac_objext conftest.$ac_ext
12692 fi
12693 rm -f conftest.$ac_objext conftest.$ac_ext
12694 fi
12695 echo "$as_me:12695: result: $cf_cv_wchar_t" >&5
12696 echo "${ECHO_T}$cf_cv_wchar_t" >&6
12697
12698 if test "$cf_cv_wchar_t" = yes ; then
12699         cat >>confdefs.h <<\EOF
12700 #define NEED_WCHAR_H 1
12701 EOF
12702
12703         NEED_WCHAR_H=1
12704 fi
12705
12706 # if we do not find wchar_t in either place, use substitution to provide a fallback.
12707 if test "$cf_cv_wchar_t" = unknown ; then
12708         NCURSES_WCHAR_T=1
12709 fi
12710
12711 # if we find wchar_t in either place, use substitution to provide a fallback.
12712 if test "$cf_cv_wchar_t" != unknown ; then
12713         NCURSES_OK_WCHAR_T=1
12714 fi
12715
12716 # This is needed on Tru64 5.0 to declare wint_t
12717 echo "$as_me:12717: checking if we must include wchar.h to declare wint_t" >&5
12718 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
12719 if test "${cf_cv_wint_t+set}" = set; then
12720   echo $ECHO_N "(cached) $ECHO_C" >&6
12721 else
12722
12723 cat >conftest.$ac_ext <<_ACEOF
12724 #line 12724 "configure"
12725 #include "confdefs.h"
12726
12727 #include <stdlib.h>
12728 #include <stdarg.h>
12729 #include <stdio.h>
12730 #ifdef HAVE_LIBUTF8_H
12731 #include <libutf8.h>
12732 #endif
12733 int
12734 main ()
12735 {
12736 wint_t state
12737   ;
12738   return 0;
12739 }
12740 _ACEOF
12741 rm -f conftest.$ac_objext
12742 if { (eval echo "$as_me:12742: \"$ac_compile\"") >&5
12743   (eval $ac_compile) 2>&5
12744   ac_status=$?
12745   echo "$as_me:12745: \$? = $ac_status" >&5
12746   (exit $ac_status); } &&
12747          { ac_try='test -s conftest.$ac_objext'
12748   { (eval echo "$as_me:12748: \"$ac_try\"") >&5
12749   (eval $ac_try) 2>&5
12750   ac_status=$?
12751   echo "$as_me:12751: \$? = $ac_status" >&5
12752   (exit $ac_status); }; }; then
12753   cf_cv_wint_t=no
12754 else
12755   echo "$as_me: failed program was:" >&5
12756 cat conftest.$ac_ext >&5
12757 cat >conftest.$ac_ext <<_ACEOF
12758 #line 12758 "configure"
12759 #include "confdefs.h"
12760
12761 #include <stdlib.h>
12762 #include <stdarg.h>
12763 #include <stdio.h>
12764 #include <wchar.h>
12765 #ifdef HAVE_LIBUTF8_H
12766 #include <libutf8.h>
12767 #endif
12768 int
12769 main ()
12770 {
12771 wint_t value
12772   ;
12773   return 0;
12774 }
12775 _ACEOF
12776 rm -f conftest.$ac_objext
12777 if { (eval echo "$as_me:12777: \"$ac_compile\"") >&5
12778   (eval $ac_compile) 2>&5
12779   ac_status=$?
12780   echo "$as_me:12780: \$? = $ac_status" >&5
12781   (exit $ac_status); } &&
12782          { ac_try='test -s conftest.$ac_objext'
12783   { (eval echo "$as_me:12783: \"$ac_try\"") >&5
12784   (eval $ac_try) 2>&5
12785   ac_status=$?
12786   echo "$as_me:12786: \$? = $ac_status" >&5
12787   (exit $ac_status); }; }; then
12788   cf_cv_wint_t=yes
12789 else
12790   echo "$as_me: failed program was:" >&5
12791 cat conftest.$ac_ext >&5
12792 cf_cv_wint_t=unknown
12793 fi
12794 rm -f conftest.$ac_objext conftest.$ac_ext
12795 fi
12796 rm -f conftest.$ac_objext conftest.$ac_ext
12797 fi
12798 echo "$as_me:12798: result: $cf_cv_wint_t" >&5
12799 echo "${ECHO_T}$cf_cv_wint_t" >&6
12800
12801 if test "$cf_cv_wint_t" = yes ; then
12802         cat >>confdefs.h <<\EOF
12803 #define NEED_WCHAR_H 1
12804 EOF
12805
12806         NEED_WCHAR_H=1
12807 fi
12808
12809 # if we do not find wint_t in either place, use substitution to provide a fallback.
12810 if test "$cf_cv_wint_t" = unknown ; then
12811         NCURSES_WINT_T=1
12812 fi
12813
12814 # if we find wint_t in either place, use substitution to provide a fallback.
12815 if test "$cf_cv_wint_t" != unknown ; then
12816         NCURSES_OK_WINT_T=1
12817 fi
12818
12819 if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
12820
12821 echo "$as_me:12821: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
12822 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
12823 cat >conftest.$ac_ext <<_ACEOF
12824 #line 12824 "configure"
12825 #include "confdefs.h"
12826
12827 #ifndef _XOPEN_SOURCE_EXTENDED
12828 #define _XOPEN_SOURCE_EXTENDED
12829 #endif
12830 #include <${cf_cv_ncurses_header:-curses.h}>
12831 int
12832 main ()
12833 {
12834
12835 mbstate_t foo
12836
12837   ;
12838   return 0;
12839 }
12840 _ACEOF
12841 rm -f conftest.$ac_objext
12842 if { (eval echo "$as_me:12842: \"$ac_compile\"") >&5
12843   (eval $ac_compile) 2>&5
12844   ac_status=$?
12845   echo "$as_me:12845: \$? = $ac_status" >&5
12846   (exit $ac_status); } &&
12847          { ac_try='test -s conftest.$ac_objext'
12848   { (eval echo "$as_me:12848: \"$ac_try\"") >&5
12849   (eval $ac_try) 2>&5
12850   ac_status=$?
12851   echo "$as_me:12851: \$? = $ac_status" >&5
12852   (exit $ac_status); }; }; then
12853   cf_result=yes
12854 else
12855   echo "$as_me: failed program was:" >&5
12856 cat conftest.$ac_ext >&5
12857 cf_result=no
12858 fi
12859 rm -f conftest.$ac_objext conftest.$ac_ext
12860 echo "$as_me:12860: result: $cf_result" >&5
12861 echo "${ECHO_T}$cf_result" >&6
12862 if test $cf_result = yes ; then
12863
12864 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12865
12866         cat >>confdefs.h <<EOF
12867 #define $cf_result 1
12868 EOF
12869
12870 else
12871         cat >>confdefs.h <<EOF
12872 #define mbstate_t long
12873 EOF
12874
12875 fi
12876
12877 fi
12878
12879 if test "$NCURSES_OK_WCHAR_T" = 0 ; then
12880
12881 echo "$as_me:12881: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
12882 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
12883 cat >conftest.$ac_ext <<_ACEOF
12884 #line 12884 "configure"
12885 #include "confdefs.h"
12886
12887 #ifndef _XOPEN_SOURCE_EXTENDED
12888 #define _XOPEN_SOURCE_EXTENDED
12889 #endif
12890 #include <${cf_cv_ncurses_header:-curses.h}>
12891 int
12892 main ()
12893 {
12894
12895 wchar_t foo
12896
12897   ;
12898   return 0;
12899 }
12900 _ACEOF
12901 rm -f conftest.$ac_objext
12902 if { (eval echo "$as_me:12902: \"$ac_compile\"") >&5
12903   (eval $ac_compile) 2>&5
12904   ac_status=$?
12905   echo "$as_me:12905: \$? = $ac_status" >&5
12906   (exit $ac_status); } &&
12907          { ac_try='test -s conftest.$ac_objext'
12908   { (eval echo "$as_me:12908: \"$ac_try\"") >&5
12909   (eval $ac_try) 2>&5
12910   ac_status=$?
12911   echo "$as_me:12911: \$? = $ac_status" >&5
12912   (exit $ac_status); }; }; then
12913   cf_result=yes
12914 else
12915   echo "$as_me: failed program was:" >&5
12916 cat conftest.$ac_ext >&5
12917 cf_result=no
12918 fi
12919 rm -f conftest.$ac_objext conftest.$ac_ext
12920 echo "$as_me:12920: result: $cf_result" >&5
12921 echo "${ECHO_T}$cf_result" >&6
12922 if test $cf_result = yes ; then
12923
12924 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12925
12926         cat >>confdefs.h <<EOF
12927 #define $cf_result 1
12928 EOF
12929
12930 else
12931         cat >>confdefs.h <<EOF
12932 #define wchar_t long
12933 EOF
12934
12935 fi
12936
12937 fi
12938
12939 if test "$NCURSES_OK_WINT_T" = 0 ; then
12940
12941 echo "$as_me:12941: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
12942 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
12943 cat >conftest.$ac_ext <<_ACEOF
12944 #line 12944 "configure"
12945 #include "confdefs.h"
12946
12947 #ifndef _XOPEN_SOURCE_EXTENDED
12948 #define _XOPEN_SOURCE_EXTENDED
12949 #endif
12950 #include <${cf_cv_ncurses_header:-curses.h}>
12951 int
12952 main ()
12953 {
12954
12955 wint_t foo
12956
12957   ;
12958   return 0;
12959 }
12960 _ACEOF
12961 rm -f conftest.$ac_objext
12962 if { (eval echo "$as_me:12962: \"$ac_compile\"") >&5
12963   (eval $ac_compile) 2>&5
12964   ac_status=$?
12965   echo "$as_me:12965: \$? = $ac_status" >&5
12966   (exit $ac_status); } &&
12967          { ac_try='test -s conftest.$ac_objext'
12968   { (eval echo "$as_me:12968: \"$ac_try\"") >&5
12969   (eval $ac_try) 2>&5
12970   ac_status=$?
12971   echo "$as_me:12971: \$? = $ac_status" >&5
12972   (exit $ac_status); }; }; then
12973   cf_result=yes
12974 else
12975   echo "$as_me: failed program was:" >&5
12976 cat conftest.$ac_ext >&5
12977 cf_result=no
12978 fi
12979 rm -f conftest.$ac_objext conftest.$ac_ext
12980 echo "$as_me:12980: result: $cf_result" >&5
12981 echo "${ECHO_T}$cf_result" >&6
12982 if test $cf_result = yes ; then
12983
12984 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12985
12986         cat >>confdefs.h <<EOF
12987 #define $cf_result 1
12988 EOF
12989
12990 else
12991         cat >>confdefs.h <<EOF
12992 #define wint_t long
12993 EOF
12994
12995 fi
12996
12997 fi
12998
12999 echo "$as_me:12999: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
13000 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13001 cat >conftest.$ac_ext <<_ACEOF
13002 #line 13002 "configure"
13003 #include "confdefs.h"
13004
13005 #ifdef HAVE_XCURSES
13006 #include <xcurses.h>
13007 char * XCursesProgramName = "test";
13008 #else
13009 #include <${cf_cv_ncurses_header:-curses.h}>
13010 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13011 #include <ncursesw/term.h>
13012 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13013 #include <ncurses/term.h>
13014 #elif defined(HAVE_TERM_H)
13015 #include <term.h>
13016 #endif
13017 #endif
13018
13019 int
13020 main ()
13021 {
13022
13023 void *foo = &(boolnames)
13024
13025   ;
13026   return 0;
13027 }
13028 _ACEOF
13029 rm -f conftest.$ac_objext
13030 if { (eval echo "$as_me:13030: \"$ac_compile\"") >&5
13031   (eval $ac_compile) 2>&5
13032   ac_status=$?
13033   echo "$as_me:13033: \$? = $ac_status" >&5
13034   (exit $ac_status); } &&
13035          { ac_try='test -s conftest.$ac_objext'
13036   { (eval echo "$as_me:13036: \"$ac_try\"") >&5
13037   (eval $ac_try) 2>&5
13038   ac_status=$?
13039   echo "$as_me:13039: \$? = $ac_status" >&5
13040   (exit $ac_status); }; }; then
13041   cf_result=yes
13042 else
13043   echo "$as_me: failed program was:" >&5
13044 cat conftest.$ac_ext >&5
13045 cf_result=no
13046 fi
13047 rm -f conftest.$ac_objext conftest.$ac_ext
13048 echo "$as_me:13048: result: $cf_result" >&5
13049 echo "${ECHO_T}$cf_result" >&6
13050 if test $cf_result = yes ; then
13051
13052 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13053
13054         cat >>confdefs.h <<EOF
13055 #define $cf_result 1
13056 EOF
13057
13058 else
13059         echo "$as_me:13059: checking for data boolnames in library" >&5
13060 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
13061         cat >conftest.$ac_ext <<_ACEOF
13062 #line 13062 "configure"
13063 #include "confdefs.h"
13064
13065 #ifdef HAVE_XCURSES
13066 #include <xcurses.h>
13067 char * XCursesProgramName = "test";
13068 #else
13069 #include <${cf_cv_ncurses_header:-curses.h}>
13070 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13071 #include <ncursesw/term.h>
13072 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13073 #include <ncurses/term.h>
13074 #elif defined(HAVE_TERM_H)
13075 #include <term.h>
13076 #endif
13077 #endif
13078
13079 extern char boolnames;
13080 int
13081 main ()
13082 {
13083
13084         do {
13085                 void *foo = &(boolnames);
13086                 ${cf_cv_main_return:-return}(foo == 0);
13087         } while (0)
13088
13089   ;
13090   return 0;
13091 }
13092 _ACEOF
13093 rm -f conftest.$ac_objext conftest$ac_exeext
13094 if { (eval echo "$as_me:13094: \"$ac_link\"") >&5
13095   (eval $ac_link) 2>&5
13096   ac_status=$?
13097   echo "$as_me:13097: \$? = $ac_status" >&5
13098   (exit $ac_status); } &&
13099          { ac_try='test -s conftest$ac_exeext'
13100   { (eval echo "$as_me:13100: \"$ac_try\"") >&5
13101   (eval $ac_try) 2>&5
13102   ac_status=$?
13103   echo "$as_me:13103: \$? = $ac_status" >&5
13104   (exit $ac_status); }; }; then
13105   cf_result=yes
13106 else
13107   echo "$as_me: failed program was:" >&5
13108 cat conftest.$ac_ext >&5
13109 cf_result=no
13110 fi
13111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13112         echo "$as_me:13112: result: $cf_result" >&5
13113 echo "${ECHO_T}$cf_result" >&6
13114         if test $cf_result = yes ; then
13115
13116 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13117
13118                 cat >>confdefs.h <<EOF
13119 #define $cf_result 1
13120 EOF
13121
13122         fi
13123 fi
13124
13125 echo "$as_me:13125: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
13126 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13127 cat >conftest.$ac_ext <<_ACEOF
13128 #line 13128 "configure"
13129 #include "confdefs.h"
13130
13131 #ifdef HAVE_XCURSES
13132 #include <xcurses.h>
13133 char * XCursesProgramName = "test";
13134 #else
13135 #include <${cf_cv_ncurses_header:-curses.h}>
13136 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13137 #include <ncursesw/term.h>
13138 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13139 #include <ncurses/term.h>
13140 #elif defined(HAVE_TERM_H)
13141 #include <term.h>
13142 #endif
13143 #endif
13144
13145 int
13146 main ()
13147 {
13148
13149 void *foo = &(boolfnames)
13150
13151   ;
13152   return 0;
13153 }
13154 _ACEOF
13155 rm -f conftest.$ac_objext
13156 if { (eval echo "$as_me:13156: \"$ac_compile\"") >&5
13157   (eval $ac_compile) 2>&5
13158   ac_status=$?
13159   echo "$as_me:13159: \$? = $ac_status" >&5
13160   (exit $ac_status); } &&
13161          { ac_try='test -s conftest.$ac_objext'
13162   { (eval echo "$as_me:13162: \"$ac_try\"") >&5
13163   (eval $ac_try) 2>&5
13164   ac_status=$?
13165   echo "$as_me:13165: \$? = $ac_status" >&5
13166   (exit $ac_status); }; }; then
13167   cf_result=yes
13168 else
13169   echo "$as_me: failed program was:" >&5
13170 cat conftest.$ac_ext >&5
13171 cf_result=no
13172 fi
13173 rm -f conftest.$ac_objext conftest.$ac_ext
13174 echo "$as_me:13174: result: $cf_result" >&5
13175 echo "${ECHO_T}$cf_result" >&6
13176 if test $cf_result = yes ; then
13177
13178 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13179
13180         cat >>confdefs.h <<EOF
13181 #define $cf_result 1
13182 EOF
13183
13184 else
13185         echo "$as_me:13185: checking for data boolfnames in library" >&5
13186 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
13187         cat >conftest.$ac_ext <<_ACEOF
13188 #line 13188 "configure"
13189 #include "confdefs.h"
13190
13191 #ifdef HAVE_XCURSES
13192 #include <xcurses.h>
13193 char * XCursesProgramName = "test";
13194 #else
13195 #include <${cf_cv_ncurses_header:-curses.h}>
13196 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
13197 #include <ncursesw/term.h>
13198 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
13199 #include <ncurses/term.h>
13200 #elif defined(HAVE_TERM_H)
13201 #include <term.h>
13202 #endif
13203 #endif
13204
13205 extern char boolfnames;
13206 int
13207 main ()
13208 {
13209
13210         do {
13211                 void *foo = &(boolfnames);
13212                 ${cf_cv_main_return:-return}(foo == 0);
13213         } while (0)
13214
13215   ;
13216   return 0;
13217 }
13218 _ACEOF
13219 rm -f conftest.$ac_objext conftest$ac_exeext
13220 if { (eval echo "$as_me:13220: \"$ac_link\"") >&5
13221   (eval $ac_link) 2>&5
13222   ac_status=$?
13223   echo "$as_me:13223: \$? = $ac_status" >&5
13224   (exit $ac_status); } &&
13225          { ac_try='test -s conftest$ac_exeext'
13226   { (eval echo "$as_me:13226: \"$ac_try\"") >&5
13227   (eval $ac_try) 2>&5
13228   ac_status=$?
13229   echo "$as_me:13229: \$? = $ac_status" >&5
13230   (exit $ac_status); }; }; then
13231   cf_result=yes
13232 else
13233   echo "$as_me: failed program was:" >&5
13234 cat conftest.$ac_ext >&5
13235 cf_result=no
13236 fi
13237 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13238         echo "$as_me:13238: result: $cf_result" >&5
13239 echo "${ECHO_T}$cf_result" >&6
13240         if test $cf_result = yes ; then
13241
13242 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13243
13244                 cat >>confdefs.h <<EOF
13245 #define $cf_result 1
13246 EOF
13247
13248         fi
13249 fi
13250
13251 TEST_ARGS="$LIBS"
13252 LIBS=
13253
13254 ac_config_files="$ac_config_files Makefile"
13255 ac_config_commands="$ac_config_commands default"
13256 cat >confcache <<\_ACEOF
13257 # This file is a shell script that caches the results of configure
13258 # tests run on this system so they can be shared between configure
13259 # scripts and configure runs, see configure's option --config-cache.
13260 # It is not useful on other systems.  If it contains results you don't
13261 # want to keep, you may remove or edit it.
13262 #
13263 # config.status only pays attention to the cache file if you give it
13264 # the --recheck option to rerun configure.
13265 #
13266 # `ac_cv_env_foo' variables (set or unset) will be overriden when
13267 # loading this file, other *unset* `ac_cv_foo' will be assigned the
13268 # following values.
13269
13270 _ACEOF
13271
13272 # The following way of writing the cache mishandles newlines in values,
13273 # but we know of no workaround that is simple, portable, and efficient.
13274 # So, don't put newlines in cache variables' values.
13275 # Ultrix sh set writes to stderr and can't be redirected directly,
13276 # and sets the high bit in the cache file unless we assign to the vars.
13277 {
13278   (set) 2>&1 |
13279     case `(ac_space=' '; set | grep ac_space) 2>&1` in
13280     *ac_space=\ *)
13281       # `set' does not quote correctly, so add quotes (double-quote
13282       # substitution turns \\\\ into \\, and sed turns \\ into \).
13283       sed -n \
13284         "s/'/'\\\\''/g;
13285           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
13286       ;;
13287     *)
13288       # `set' quotes correctly as required by POSIX, so do not add quotes.
13289       sed -n \
13290         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
13291       ;;
13292     esac;
13293 } |
13294   sed '
13295      t clear
13296      : clear
13297      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
13298      t end
13299      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
13300      : end' >>confcache
13301 if cmp -s $cache_file confcache; then :; else
13302   if test -w $cache_file; then
13303     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
13304     cat confcache >$cache_file
13305   else
13306     echo "not updating unwritable cache $cache_file"
13307   fi
13308 fi
13309 rm -f confcache
13310
13311 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13312 # Let make expand exec_prefix.
13313 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13314
13315 # VPATH may cause trouble with some makes, so we remove $(srcdir),
13316 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
13317 # trailing colons and then remove the whole line if VPATH becomes empty
13318 # (actually we leave an empty line to preserve line numbers).
13319 if test "x$srcdir" = x.; then
13320   ac_vpsub='/^[         ]*VPATH[        ]*=/{
13321 s/:*\$(srcdir):*/:/;
13322 s/:*\${srcdir}:*/:/;
13323 s/:*@srcdir@:*/:/;
13324 s/^\([^=]*=[    ]*\):*/\1/;
13325 s/:*$//;
13326 s/^[^=]*=[      ]*$//;
13327 }'
13328 fi
13329
13330 DEFS=-DHAVE_CONFIG_H
13331
13332 : ${CONFIG_STATUS=./config.status}
13333 ac_clean_files_save=$ac_clean_files
13334 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
13335 { echo "$as_me:13335: creating $CONFIG_STATUS" >&5
13336 echo "$as_me: creating $CONFIG_STATUS" >&6;}
13337 cat >$CONFIG_STATUS <<_ACEOF
13338 #! $SHELL
13339 # Generated automatically by configure.
13340 # Run this file to recreate the current configuration.
13341 # Compiler output produced by configure, useful for debugging
13342 # configure, is in config.log if it exists.
13343
13344 debug=false
13345 SHELL=\${CONFIG_SHELL-$SHELL}
13346 ac_cs_invocation="\$0 \$@"
13347
13348 _ACEOF
13349
13350 cat >>$CONFIG_STATUS <<\_ACEOF
13351 # Be Bourne compatible
13352 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
13353   emulate sh
13354   NULLCMD=:
13355 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
13356   set -o posix
13357 fi
13358
13359 # Name of the executable.
13360 as_me=`echo "$0" |sed 's,.*[\\/],,'`
13361
13362 if expr a : '\(a\)' >/dev/null 2>&1; then
13363   as_expr=expr
13364 else
13365   as_expr=false
13366 fi
13367
13368 rm -f conf$$ conf$$.exe conf$$.file
13369 echo >conf$$.file
13370 if ln -s conf$$.file conf$$ 2>/dev/null; then
13371   # We could just check for DJGPP; but this test a) works b) is more generic
13372   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
13373   if test -f conf$$.exe; then
13374     # Don't use ln at all; we don't have any links
13375     as_ln_s='cp -p'
13376   else
13377     as_ln_s='ln -s'
13378   fi
13379 elif ln conf$$.file conf$$ 2>/dev/null; then
13380   as_ln_s=ln
13381 else
13382   as_ln_s='cp -p'
13383 fi
13384 rm -f conf$$ conf$$.exe conf$$.file
13385
13386 as_executable_p="test -f"
13387
13388 # Support unset when possible.
13389 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
13390   as_unset=unset
13391 else
13392   as_unset=false
13393 fi
13394
13395 # NLS nuisances.
13396 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
13397 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
13398 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
13399 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
13400 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
13401 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
13402 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
13403 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
13404
13405 # IFS
13406 # We need space, tab and new line, in precisely that order.
13407 as_nl='
13408 '
13409 IFS="   $as_nl"
13410
13411 # CDPATH.
13412 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
13413
13414 exec 6>&1
13415
13416 _ACEOF
13417
13418 # Files that config.status was made for.
13419 if test -n "$ac_config_files"; then
13420   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
13421 fi
13422
13423 if test -n "$ac_config_headers"; then
13424   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
13425 fi
13426
13427 if test -n "$ac_config_links"; then
13428   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
13429 fi
13430
13431 if test -n "$ac_config_commands"; then
13432   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
13433 fi
13434
13435 cat >>$CONFIG_STATUS <<\EOF
13436
13437 ac_cs_usage="\
13438 \`$as_me' instantiates files from templates according to the
13439 current configuration.
13440
13441 Usage: $0 [OPTIONS] [FILE]...
13442
13443   -h, --help       print this help, then exit
13444   -V, --version    print version number, then exit
13445   -d, --debug      don't remove temporary files
13446       --recheck    update $as_me by reconfiguring in the same conditions
13447   --file=FILE[:TEMPLATE]
13448                    instantiate the configuration file FILE
13449   --header=FILE[:TEMPLATE]
13450                    instantiate the configuration header FILE
13451
13452 Configuration files:
13453 $config_files
13454
13455 Configuration headers:
13456 $config_headers
13457
13458 Configuration commands:
13459 $config_commands
13460
13461 Report bugs to <dickey@invisible-island.net>."
13462 EOF
13463
13464 cat >>$CONFIG_STATUS <<EOF
13465 ac_cs_version="\\
13466 config.status
13467 configured by $0, generated by GNU Autoconf 2.52.20101001,
13468   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
13469
13470 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
13471 Free Software Foundation, Inc.
13472 This config.status script is free software; the Free Software Foundation
13473 gives unlimited permission to copy, distribute and modify it."
13474 srcdir=$srcdir
13475 EOF
13476
13477 cat >>$CONFIG_STATUS <<\EOF
13478 # If no file are specified by the user, then we need to provide default
13479 # value.  By we need to know if files were specified by the user.
13480 ac_need_defaults=:
13481 while test $# != 0
13482 do
13483   case $1 in
13484   --*=*)
13485     ac_option=`expr "x$1" : 'x\([^=]*\)='`
13486     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
13487     shift
13488     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
13489     shift
13490     ;;
13491   -*);;
13492   *) # This is not an option, so the user has probably given explicit
13493      # arguments.
13494      ac_need_defaults=false;;
13495   esac
13496
13497   case $1 in
13498   # Handling of the options.
13499 EOF
13500 cat >>$CONFIG_STATUS <<EOF
13501   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
13502     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
13503     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
13504 EOF
13505 cat >>$CONFIG_STATUS <<\EOF
13506   --version | --vers* | -V )
13507     echo "$ac_cs_version"; exit 0 ;;
13508   --he | --h)
13509     # Conflict between --help and --header
13510     { { echo "$as_me:13510: error: ambiguous option: $1
13511 Try \`$0 --help' for more information." >&5
13512 echo "$as_me: error: ambiguous option: $1
13513 Try \`$0 --help' for more information." >&2;}
13514    { (exit 1); exit 1; }; };;
13515   --help | --hel | -h )
13516     echo "$ac_cs_usage"; exit 0 ;;
13517   --debug | --d* | -d )
13518     debug=: ;;
13519   --file | --fil | --fi | --f )
13520     shift
13521     CONFIG_FILES="$CONFIG_FILES $1"
13522     ac_need_defaults=false;;
13523   --header | --heade | --head | --hea )
13524     shift
13525     CONFIG_HEADERS="$CONFIG_HEADERS $1"
13526     ac_need_defaults=false;;
13527
13528   # This is an error.
13529   -*) { { echo "$as_me:13529: error: unrecognized option: $1
13530 Try \`$0 --help' for more information." >&5
13531 echo "$as_me: error: unrecognized option: $1
13532 Try \`$0 --help' for more information." >&2;}
13533    { (exit 1); exit 1; }; } ;;
13534
13535   *) ac_config_targets="$ac_config_targets $1" ;;
13536
13537   esac
13538   shift
13539 done
13540
13541 exec 5>>config.log
13542 cat >&5 << _ACEOF
13543
13544 ## ----------------------- ##
13545 ## Running config.status.  ##
13546 ## ----------------------- ##
13547
13548 This file was extended by $as_me 2.52.20101001, executed with
13549   CONFIG_FILES    = $CONFIG_FILES
13550   CONFIG_HEADERS  = $CONFIG_HEADERS
13551   CONFIG_LINKS    = $CONFIG_LINKS
13552   CONFIG_COMMANDS = $CONFIG_COMMANDS
13553   > $ac_cs_invocation
13554 on `(hostname || uname -n) 2>/dev/null | sed 1q`
13555
13556 _ACEOF
13557 EOF
13558
13559 cat >>$CONFIG_STATUS <<EOF
13560 #
13561 # INIT-COMMANDS section.
13562 #
13563
13564 AWK="$AWK"
13565 ECHO_LD="$ECHO_LD"
13566
13567 EOF
13568
13569 cat >>$CONFIG_STATUS <<\EOF
13570 for ac_config_target in $ac_config_targets
13571 do
13572   case "$ac_config_target" in
13573   # Handling of arguments.
13574   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
13575   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
13576   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
13577   *) { { echo "$as_me:13577: error: invalid argument: $ac_config_target" >&5
13578 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
13579    { (exit 1); exit 1; }; };;
13580   esac
13581 done
13582
13583 # If the user did not use the arguments to specify the items to instantiate,
13584 # then the envvar interface is used.  Set only those that are not.
13585 # We use the long form for the default assignment because of an extremely
13586 # bizarre bug on SunOS 4.1.3.
13587 if $ac_need_defaults; then
13588   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
13589   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
13590   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
13591 fi
13592
13593 # Create a temporary directory, and hook for its removal unless debugging.
13594 $debug ||
13595 {
13596   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
13597   trap '{ (exit 1); exit 1; }' 1 2 13 15
13598 }
13599
13600 # Create a (secure) tmp directory for tmp files.
13601 : ${TMPDIR=/tmp}
13602 {
13603   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
13604   test -n "$tmp" && test -d "$tmp"
13605 }  ||
13606 {
13607   tmp=$TMPDIR/cs$$-$RANDOM
13608   (umask 077 && mkdir $tmp)
13609 } ||
13610 {
13611    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
13612    { (exit 1); exit 1; }
13613 }
13614
13615 EOF
13616
13617 cat >>$CONFIG_STATUS <<EOF
13618
13619 #
13620 # CONFIG_FILES section.
13621 #
13622
13623 # No need to generate the scripts if there are no CONFIG_FILES.
13624 # This happens for instance when ./config.status config.h
13625 if test -n "\$CONFIG_FILES"; then
13626   # Protect against being on the right side of a sed subst in config.status.
13627   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
13628    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
13629 s,@SHELL@,$SHELL,;t t
13630 s,@exec_prefix@,$exec_prefix,;t t
13631 s,@prefix@,$prefix,;t t
13632 s,@program_transform_name@,$program_transform_name,;t t
13633 s,@bindir@,$bindir,;t t
13634 s,@sbindir@,$sbindir,;t t
13635 s,@libexecdir@,$libexecdir,;t t
13636 s,@datadir@,$datadir,;t t
13637 s,@sysconfdir@,$sysconfdir,;t t
13638 s,@sharedstatedir@,$sharedstatedir,;t t
13639 s,@localstatedir@,$localstatedir,;t t
13640 s,@libdir@,$libdir,;t t
13641 s,@includedir@,$includedir,;t t
13642 s,@oldincludedir@,$oldincludedir,;t t
13643 s,@infodir@,$infodir,;t t
13644 s,@mandir@,$mandir,;t t
13645 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
13646 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
13647 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
13648 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
13649 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
13650 s,@build_alias@,$build_alias,;t t
13651 s,@host_alias@,$host_alias,;t t
13652 s,@target_alias@,$target_alias,;t t
13653 s,@ECHO_C@,$ECHO_C,;t t
13654 s,@ECHO_N@,$ECHO_N,;t t
13655 s,@ECHO_T@,$ECHO_T,;t t
13656 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
13657 s,@DEFS@,$DEFS,;t t
13658 s,@LIBS@,$LIBS,;t t
13659 s,@build@,$build,;t t
13660 s,@build_cpu@,$build_cpu,;t t
13661 s,@build_vendor@,$build_vendor,;t t
13662 s,@build_os@,$build_os,;t t
13663 s,@host@,$host,;t t
13664 s,@host_cpu@,$host_cpu,;t t
13665 s,@host_vendor@,$host_vendor,;t t
13666 s,@host_os@,$host_os,;t t
13667 s,@SET_MAKE@,$SET_MAKE,;t t
13668 s,@CC@,$CC,;t t
13669 s,@CFLAGS@,$CFLAGS,;t t
13670 s,@LDFLAGS@,$LDFLAGS,;t t
13671 s,@CPPFLAGS@,$CPPFLAGS,;t t
13672 s,@ac_ct_CC@,$ac_ct_CC,;t t
13673 s,@EXEEXT@,$EXEEXT,;t t
13674 s,@OBJEXT@,$OBJEXT,;t t
13675 s,@CPP@,$CPP,;t t
13676 s,@AWK@,$AWK,;t t
13677 s,@CTAGS@,$CTAGS,;t t
13678 s,@ETAGS@,$ETAGS,;t t
13679 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
13680 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
13681 s,@CC_G_OPT@,$CC_G_OPT,;t t
13682 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
13683 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
13684 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
13685 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
13686 s,@LD@,$LD,;t t
13687 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
13688 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
13689 s,@LD_MODEL@,$LD_MODEL,;t t
13690 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
13691 s,@LIBTOOL@,$LIBTOOL,;t t
13692 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
13693 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
13694 s,@LIB_LINK@,$LIB_LINK,;t t
13695 s,@LINK_TESTS@,$LINK_TESTS,;t t
13696 s,@LINT@,$LINT,;t t
13697 s,@LINT_OPTS@,$LINT_OPTS,;t t
13698 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
13699 s,@MATH_LIB@,$MATH_LIB,;t t
13700 s,@PTHREAD@,$PTHREAD,;t t
13701 s,@TEST_ARGS@,$TEST_ARGS,;t t
13702 s,@TEST_DEPS@,$TEST_DEPS,;t t
13703 s,@TEST_LIBS@,$TEST_LIBS,;t t
13704 s,@TINFO_ARGS@,$TINFO_ARGS,;t t
13705 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
13706 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
13707 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
13708 s,@ECHO_LT@,$ECHO_LT,;t t
13709 s,@ECHO_LD@,$ECHO_LD,;t t
13710 s,@RULE_CC@,$RULE_CC,;t t
13711 s,@SHOW_CC@,$SHOW_CC,;t t
13712 s,@ECHO_CC@,$ECHO_CC,;t t
13713 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
13714 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
13715 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
13716 s,@X_CFLAGS@,$X_CFLAGS,;t t
13717 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
13718 s,@X_LIBS@,$X_LIBS,;t t
13719 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
13720 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
13721 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
13722 CEOF
13723
13724 EOF
13725
13726   cat >>$CONFIG_STATUS <<\EOF
13727   # Split the substitutions into bite-sized pieces for seds with
13728   # small command number limits, like on Digital OSF/1 and HP-UX.
13729   ac_max_sed_lines=48
13730   ac_sed_frag=1 # Number of current file.
13731   ac_beg=1 # First line for current file.
13732   ac_end=$ac_max_sed_lines # Line after last line for current file.
13733   ac_more_lines=:
13734   ac_sed_cmds=
13735   while $ac_more_lines; do
13736     if test $ac_beg -gt 1; then
13737       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
13738     else
13739       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
13740     fi
13741     if test ! -s $tmp/subs.frag; then
13742       ac_more_lines=false
13743     else
13744       # The purpose of the label and of the branching condition is to
13745       # speed up the sed processing (if there are no `@' at all, there
13746       # is no need to browse any of the substitutions).
13747       # These are the two extra sed commands mentioned above.
13748       (echo ':t
13749   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
13750       if test -z "$ac_sed_cmds"; then
13751         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
13752       else
13753         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
13754       fi
13755       ac_sed_frag=`expr $ac_sed_frag + 1`
13756       ac_beg=$ac_end
13757       ac_end=`expr $ac_end + $ac_max_sed_lines`
13758     fi
13759   done
13760   if test -z "$ac_sed_cmds"; then
13761     ac_sed_cmds=cat
13762   fi
13763 fi # test -n "$CONFIG_FILES"
13764
13765 EOF
13766 cat >>$CONFIG_STATUS <<\EOF
13767 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
13768   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13769   case $ac_file in
13770   - | *:- | *:-:* ) # input from stdin
13771         cat >$tmp/stdin
13772         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
13773         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
13774   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
13775         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
13776   * )   ac_file_in=$ac_file.in ;;
13777   esac
13778
13779   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
13780   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13781          X"$ac_file" : 'X\(//\)[^/]' \| \
13782          X"$ac_file" : 'X\(//\)$' \| \
13783          X"$ac_file" : 'X\(/\)' \| \
13784          .     : '\(.\)' 2>/dev/null ||
13785 echo X"$ac_file" |
13786     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13787           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13788           /^X\(\/\/\)$/{ s//\1/; q; }
13789           /^X\(\/\).*/{ s//\1/; q; }
13790           s/.*/./; q'`
13791   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
13792     { case "$ac_dir" in
13793   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
13794   *)                      as_incr_dir=.;;
13795 esac
13796 as_dummy="$ac_dir"
13797 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
13798   case $as_mkdir_dir in
13799     # Skip DOS drivespec
13800     ?:) as_incr_dir=$as_mkdir_dir ;;
13801     *)
13802       as_incr_dir=$as_incr_dir/$as_mkdir_dir
13803       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
13804     ;;
13805   esac
13806 done; }
13807
13808     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
13809     # A "../" for each directory in $ac_dir_suffix.
13810     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
13811   else
13812     ac_dir_suffix= ac_dots=
13813   fi
13814
13815   case $srcdir in
13816   .)  ac_srcdir=.
13817       if test -z "$ac_dots"; then
13818          ac_top_srcdir=.
13819       else
13820          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
13821       fi ;;
13822   [\\/]* | ?:[\\/]* )
13823       ac_srcdir=$srcdir$ac_dir_suffix;
13824       ac_top_srcdir=$srcdir ;;
13825   *) # Relative path.
13826     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
13827     ac_top_srcdir=$ac_dots$srcdir ;;
13828   esac
13829
13830   if test x"$ac_file" != x-; then
13831     { echo "$as_me:13831: creating $ac_file" >&5
13832 echo "$as_me: creating $ac_file" >&6;}
13833     rm -f "$ac_file"
13834   fi
13835   # Let's still pretend it is `configure' which instantiates (i.e., don't
13836   # use $as_me), people would be surprised to read:
13837   #    /* config.h.  Generated automatically by config.status.  */
13838   configure_input="Generated automatically from `echo $ac_file_in |
13839                                                  sed 's,.*/,,'` by configure."
13840
13841   # First look for the input files in the build tree, otherwise in the
13842   # src tree.
13843   ac_file_inputs=`IFS=:
13844     for f in $ac_file_in; do
13845       case $f in
13846       -) echo $tmp/stdin ;;
13847       [\\/$]*)
13848          # Absolute (can't be DOS-style, as IFS=:)
13849          test -f "$f" || { { echo "$as_me:13849: error: cannot find input file: $f" >&5
13850 echo "$as_me: error: cannot find input file: $f" >&2;}
13851    { (exit 1); exit 1; }; }
13852          echo $f;;
13853       *) # Relative
13854          if test -f "$f"; then
13855            # Build tree
13856            echo $f
13857          elif test -f "$srcdir/$f"; then
13858            # Source tree
13859            echo $srcdir/$f
13860          else
13861            # /dev/null tree
13862            { { echo "$as_me:13862: error: cannot find input file: $f" >&5
13863 echo "$as_me: error: cannot find input file: $f" >&2;}
13864    { (exit 1); exit 1; }; }
13865          fi;;
13866       esac
13867     done` || { (exit 1); exit 1; }
13868 EOF
13869 cat >>$CONFIG_STATUS <<EOF
13870   sed "$ac_vpsub
13871 $extrasub
13872 EOF
13873 cat >>$CONFIG_STATUS <<\EOF
13874 :t
13875 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
13876 s,@configure_input@,$configure_input,;t t
13877 s,@srcdir@,$ac_srcdir,;t t
13878 s,@top_srcdir@,$ac_top_srcdir,;t t
13879 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
13880   rm -f $tmp/stdin
13881   if test x"$ac_file" != x-; then
13882     mv $tmp/out $ac_file
13883   else
13884     cat $tmp/out
13885     rm -f $tmp/out
13886   fi
13887
13888 done
13889 EOF
13890 cat >>$CONFIG_STATUS <<\EOF
13891
13892 #
13893 # CONFIG_HEADER section.
13894 #
13895
13896 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
13897 # NAME is the cpp macro being defined and VALUE is the value it is being given.
13898 #
13899 # ac_d sets the value in "#define NAME VALUE" lines.
13900 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
13901 ac_dB='[        ].*$,\1#\2'
13902 ac_dC=' '
13903 ac_dD=',;t'
13904 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
13905 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13906 ac_iB='\([      ]\),\1#\2define\3'
13907 ac_iC=' '
13908 ac_iD='\4,;t'
13909 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
13910 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
13911 ac_uB='$,\1#\2define\3'
13912 ac_uC=' '
13913 ac_uD=',;t'
13914
13915 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
13916   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
13917   case $ac_file in
13918   - | *:- | *:-:* ) # input from stdin
13919         cat >$tmp/stdin
13920         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
13921         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
13922   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
13923         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
13924   * )   ac_file_in=$ac_file.in ;;
13925   esac
13926
13927   test x"$ac_file" != x- && { echo "$as_me:13927: creating $ac_file" >&5
13928 echo "$as_me: creating $ac_file" >&6;}
13929
13930   # First look for the input files in the build tree, otherwise in the
13931   # src tree.
13932   ac_file_inputs=`IFS=:
13933     for f in $ac_file_in; do
13934       case $f in
13935       -) echo $tmp/stdin ;;
13936       [\\/$]*)
13937          # Absolute (can't be DOS-style, as IFS=:)
13938          test -f "$f" || { { echo "$as_me:13938: error: cannot find input file: $f" >&5
13939 echo "$as_me: error: cannot find input file: $f" >&2;}
13940    { (exit 1); exit 1; }; }
13941          echo $f;;
13942       *) # Relative
13943          if test -f "$f"; then
13944            # Build tree
13945            echo $f
13946          elif test -f "$srcdir/$f"; then
13947            # Source tree
13948            echo $srcdir/$f
13949          else
13950            # /dev/null tree
13951            { { echo "$as_me:13951: error: cannot find input file: $f" >&5
13952 echo "$as_me: error: cannot find input file: $f" >&2;}
13953    { (exit 1); exit 1; }; }
13954          fi;;
13955       esac
13956     done` || { (exit 1); exit 1; }
13957   # Remove the trailing spaces.
13958   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
13959
13960 EOF
13961
13962 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
13963 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
13964 # be either 'cat' or 'sort'.
13965 cat confdefs.h | uniq >conftest.vals
13966
13967 # Break up conftest.vals because some shells have a limit on
13968 # the size of here documents, and old seds have small limits too.
13969
13970 rm -f conftest.tail
13971 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
13972 while grep . conftest.vals >/dev/null
13973 do
13974   # Write chunks of a limited-size here document to conftest.frag.
13975   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
13976   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
13977   echo 'CEOF' >> $CONFIG_STATUS
13978   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
13979   rm -f conftest.vals
13980   mv conftest.tail conftest.vals
13981 done
13982 rm -f conftest.vals
13983
13984 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
13985 # marker @DEFS@.
13986 echo '  cat >> conftest.edit <<CEOF
13987 /@DEFS@/r conftest.frag
13988 /@DEFS@/d
13989 CEOF
13990 sed -f conftest.edit $tmp/in > $tmp/out
13991 rm -f $tmp/in
13992 mv $tmp/out $tmp/in
13993 rm -f conftest.edit conftest.frag
13994 ' >> $CONFIG_STATUS
13995
13996 cat >>$CONFIG_STATUS <<\EOF
13997   # Let's still pretend it is `configure' which instantiates (i.e., don't
13998   # use $as_me), people would be surprised to read:
13999   #    /* config.h.  Generated automatically by config.status.  */
14000   if test x"$ac_file" = x-; then
14001     echo "/* Generated automatically by configure.  */" >$tmp/config.h
14002   else
14003     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
14004   fi
14005   cat $tmp/in >>$tmp/config.h
14006   rm -f $tmp/in
14007   if test x"$ac_file" != x-; then
14008     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
14009       { echo "$as_me:14009: $ac_file is unchanged" >&5
14010 echo "$as_me: $ac_file is unchanged" >&6;}
14011     else
14012       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14013          X"$ac_file" : 'X\(//\)[^/]' \| \
14014          X"$ac_file" : 'X\(//\)$' \| \
14015          X"$ac_file" : 'X\(/\)' \| \
14016          .     : '\(.\)' 2>/dev/null ||
14017 echo X"$ac_file" |
14018     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
14019           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
14020           /^X\(\/\/\)$/{ s//\1/; q; }
14021           /^X\(\/\).*/{ s//\1/; q; }
14022           s/.*/./; q'`
14023       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
14024         { case "$ac_dir" in
14025   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
14026   *)                      as_incr_dir=.;;
14027 esac
14028 as_dummy="$ac_dir"
14029 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
14030   case $as_mkdir_dir in
14031     # Skip DOS drivespec
14032     ?:) as_incr_dir=$as_mkdir_dir ;;
14033     *)
14034       as_incr_dir=$as_incr_dir/$as_mkdir_dir
14035       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
14036     ;;
14037   esac
14038 done; }
14039
14040       fi
14041       rm -f $ac_file
14042       mv $tmp/config.h $ac_file
14043     fi
14044   else
14045     cat $tmp/config.h
14046     rm -f $tmp/config.h
14047   fi
14048 done
14049 EOF
14050 cat >>$CONFIG_STATUS <<\EOF
14051 #
14052 # CONFIG_COMMANDS section.
14053 #
14054 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
14055   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
14056   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
14057
14058   case $ac_dest in
14059     default )
14060
14061 for cf_dir in .
14062 do
14063         if test ! -d $srcdir/$cf_dir; then
14064                 continue
14065         elif test -f $srcdir/$cf_dir/programs; then
14066                 $AWK -f $srcdir/mk-test.awk ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
14067         fi
14068 done
14069
14070         cat >>Makefile <<TEST_EOF
14071
14072 # These rules are generated so we do not rely on suffix rules, which do not
14073 # work consistently for different make-programs (the '\$(MODEL)/' confuses
14074 # some, and the '\$x' confuses others).
14075 TEST_EOF
14076 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
14077 for N in $LIST
14078 do
14079         cat >>Makefile <<TEST_EOF
14080
14081 \$(MODEL)/$N.o : $N.c \\
14082         test.priv.h \\
14083         ncurses_cfg.h
14084         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
14085 TEST_EOF
14086 done
14087  ;;
14088   esac
14089 done
14090 EOF
14091
14092 cat >>$CONFIG_STATUS <<\EOF
14093
14094 { (exit 0); exit 0; }
14095 EOF
14096 chmod +x $CONFIG_STATUS
14097 ac_clean_files=$ac_clean_files_save
14098
14099 # configure is writing to config.log, and then calls config.status.
14100 # config.status does its own redirection, appending to config.log.
14101 # Unfortunately, on DOS this fails, as config.log is still kept open
14102 # by configure, so config.status won't be able to write to it; its
14103 # output is simply discarded.  So we exec the FD to /dev/null,
14104 # effectively closing config.log, so it can be properly (re)opened and
14105 # appended to by config.status.  When coming back to configure, we
14106 # need to make the FD available again.
14107 if test "$no_create" != yes; then
14108   ac_cs_success=:
14109   exec 5>/dev/null
14110   $SHELL $CONFIG_STATUS || ac_cs_success=false
14111   exec 5>>config.log
14112   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
14113   # would make configure fail if this is the last instruction.
14114   $ac_cs_success || { (exit 1); exit 1; }
14115 fi
14116