]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.7 - patch 20101127
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20101001.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108 # Factoring default headers for most tests.
109 ac_includes_default="\
110 #include <stdio.h>
111 #if HAVE_SYS_TYPES_H
112 # include <sys/types.h>
113 #endif
114 #if HAVE_SYS_STAT_H
115 # include <sys/stat.h>
116 #endif
117 #if STDC_HEADERS
118 # include <stdlib.h>
119 # include <stddef.h>
120 #else
121 # if HAVE_STDLIB_H
122 #  include <stdlib.h>
123 # endif
124 #endif
125 #if HAVE_STRING_H
126 # if !STDC_HEADERS && HAVE_MEMORY_H
127 #  include <memory.h>
128 # endif
129 # include <string.h>
130 #endif
131 #if HAVE_STRINGS_H
132 # include <strings.h>
133 #endif
134 #if HAVE_INTTYPES_H
135 # include <inttypes.h>
136 #else
137 # if HAVE_STDINT_H
138 #  include <stdint.h>
139 # endif
140 #endif
141 #if HAVE_UNISTD_H
142 # include <unistd.h>
143 #endif"
144
145 # Initialize some variables set by options.
146 ac_init_help=
147 ac_init_version=false
148 # The variables have the same names as the options, with
149 # dashes changed to underlines.
150 cache_file=/dev/null
151 exec_prefix=NONE
152 no_create=
153 no_recursion=
154 prefix=NONE
155 program_prefix=NONE
156 program_suffix=NONE
157 program_transform_name=s,x,x,
158 silent=
159 site=
160 srcdir=
161 verbose=
162 x_includes=NONE
163 x_libraries=NONE
164
165 # Installation directory options.
166 # These are left unexpanded so users can "make install exec_prefix=/foo"
167 # and all the variables that are supposed to be based on exec_prefix
168 # by default will actually change.
169 # Use braces instead of parens because sh, perl, etc. also accept them.
170 bindir='${exec_prefix}/bin'
171 sbindir='${exec_prefix}/sbin'
172 libexecdir='${exec_prefix}/libexec'
173 datadir='${prefix}/share'
174 sysconfdir='${prefix}/etc'
175 sharedstatedir='${prefix}/com'
176 localstatedir='${prefix}/var'
177 libdir='${exec_prefix}/lib'
178 includedir='${prefix}/include'
179 oldincludedir='/usr/include'
180 infodir='${prefix}/info'
181 mandir='${prefix}/man'
182
183 # Identity of this package.
184 PACKAGE_NAME=
185 PACKAGE_TARNAME=
186 PACKAGE_VERSION=
187 PACKAGE_STRING=
188 PACKAGE_BUGREPORT=
189
190 ac_prev=
191 for ac_option
192 do
193   # If the previous option needs an argument, assign it.
194   if test -n "$ac_prev"; then
195     eval "$ac_prev=\$ac_option"
196     ac_prev=
197     continue
198   fi
199
200   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
201
202   # Accept the important Cygnus configure options, so we can diagnose typos.
203
204   case $ac_option in
205
206   -bindir | --bindir | --bindi | --bind | --bin | --bi)
207     ac_prev=bindir ;;
208   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
209     bindir=$ac_optarg ;;
210
211   -build | --build | --buil | --bui | --bu)
212     ac_prev=build_alias ;;
213   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
214     build_alias=$ac_optarg ;;
215
216   -cache-file | --cache-file | --cache-fil | --cache-fi \
217   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
218     ac_prev=cache_file ;;
219   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
220   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
221     cache_file=$ac_optarg ;;
222
223   --config-cache | -C)
224     cache_file=config.cache ;;
225
226   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
227     ac_prev=datadir ;;
228   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
229   | --da=*)
230     datadir=$ac_optarg ;;
231
232   -disable-* | --disable-*)
233     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
234     # Reject names that are not valid shell variable names.
235     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
236       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
237    { (exit 1); exit 1; }; }
238     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
239     eval "enable_$ac_feature=no" ;;
240
241   -enable-* | --enable-*)
242     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
243     # Reject names that are not valid shell variable names.
244     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
245       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
246    { (exit 1); exit 1; }; }
247     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
248     case $ac_option in
249       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
250       *) ac_optarg=yes ;;
251     esac
252     eval "enable_$ac_feature='$ac_optarg'" ;;
253
254   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
255   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
256   | --exec | --exe | --ex)
257     ac_prev=exec_prefix ;;
258   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
259   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
260   | --exec=* | --exe=* | --ex=*)
261     exec_prefix=$ac_optarg ;;
262
263   -gas | --gas | --ga | --g)
264     # Obsolete; use --with-gas.
265     with_gas=yes ;;
266
267   -help | --help | --hel | --he | -h)
268     ac_init_help=long ;;
269   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
270     ac_init_help=recursive ;;
271   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
272     ac_init_help=short ;;
273
274   -host | --host | --hos | --ho)
275     ac_prev=host_alias ;;
276   -host=* | --host=* | --hos=* | --ho=*)
277     host_alias=$ac_optarg ;;
278
279   -includedir | --includedir | --includedi | --included | --include \
280   | --includ | --inclu | --incl | --inc)
281     ac_prev=includedir ;;
282   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
283   | --includ=* | --inclu=* | --incl=* | --inc=*)
284     includedir=$ac_optarg ;;
285
286   -infodir | --infodir | --infodi | --infod | --info | --inf)
287     ac_prev=infodir ;;
288   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
289     infodir=$ac_optarg ;;
290
291   -libdir | --libdir | --libdi | --libd)
292     ac_prev=libdir ;;
293   -libdir=* | --libdir=* | --libdi=* | --libd=*)
294     libdir=$ac_optarg ;;
295
296   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
297   | --libexe | --libex | --libe)
298     ac_prev=libexecdir ;;
299   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
300   | --libexe=* | --libex=* | --libe=*)
301     libexecdir=$ac_optarg ;;
302
303   -localstatedir | --localstatedir | --localstatedi | --localstated \
304   | --localstate | --localstat | --localsta | --localst \
305   | --locals | --local | --loca | --loc | --lo)
306     ac_prev=localstatedir ;;
307   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
308   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
309   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
310     localstatedir=$ac_optarg ;;
311
312   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
313     ac_prev=mandir ;;
314   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
315     mandir=$ac_optarg ;;
316
317   -nfp | --nfp | --nf)
318     # Obsolete; use --without-fp.
319     with_fp=no ;;
320
321   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
322   | --no-cr | --no-c)
323     no_create=yes ;;
324
325   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
326   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
327     no_recursion=yes ;;
328
329   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
330   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
331   | --oldin | --oldi | --old | --ol | --o)
332     ac_prev=oldincludedir ;;
333   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
334   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
335   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
336     oldincludedir=$ac_optarg ;;
337
338   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
339     ac_prev=prefix ;;
340   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
341     prefix=$ac_optarg ;;
342
343   -program-prefix | --program-prefix | --program-prefi | --program-pref \
344   | --program-pre | --program-pr | --program-p)
345     ac_prev=program_prefix ;;
346   -program-prefix=* | --program-prefix=* | --program-prefi=* \
347   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
348     program_prefix=$ac_optarg ;;
349
350   -program-suffix | --program-suffix | --program-suffi | --program-suff \
351   | --program-suf | --program-su | --program-s)
352     ac_prev=program_suffix ;;
353   -program-suffix=* | --program-suffix=* | --program-suffi=* \
354   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
355     program_suffix=$ac_optarg ;;
356
357   -program-transform-name | --program-transform-name \
358   | --program-transform-nam | --program-transform-na \
359   | --program-transform-n | --program-transform- \
360   | --program-transform | --program-transfor \
361   | --program-transfo | --program-transf \
362   | --program-trans | --program-tran \
363   | --progr-tra | --program-tr | --program-t)
364     ac_prev=program_transform_name ;;
365   -program-transform-name=* | --program-transform-name=* \
366   | --program-transform-nam=* | --program-transform-na=* \
367   | --program-transform-n=* | --program-transform-=* \
368   | --program-transform=* | --program-transfor=* \
369   | --program-transfo=* | --program-transf=* \
370   | --program-trans=* | --program-tran=* \
371   | --progr-tra=* | --program-tr=* | --program-t=*)
372     program_transform_name=$ac_optarg ;;
373
374   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
375   | -silent | --silent | --silen | --sile | --sil)
376     silent=yes ;;
377
378   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
379     ac_prev=sbindir ;;
380   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
381   | --sbi=* | --sb=*)
382     sbindir=$ac_optarg ;;
383
384   -sharedstatedir | --sharedstatedir | --sharedstatedi \
385   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
386   | --sharedst | --shareds | --shared | --share | --shar \
387   | --sha | --sh)
388     ac_prev=sharedstatedir ;;
389   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
390   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
391   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
392   | --sha=* | --sh=*)
393     sharedstatedir=$ac_optarg ;;
394
395   -site | --site | --sit)
396     ac_prev=site ;;
397   -site=* | --site=* | --sit=*)
398     site=$ac_optarg ;;
399
400   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
401     ac_prev=srcdir ;;
402   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
403     srcdir=$ac_optarg ;;
404
405   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
406   | --syscon | --sysco | --sysc | --sys | --sy)
407     ac_prev=sysconfdir ;;
408   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
409   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
410     sysconfdir=$ac_optarg ;;
411
412   -target | --target | --targe | --targ | --tar | --ta | --t)
413     ac_prev=target_alias ;;
414   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
415     target_alias=$ac_optarg ;;
416
417   -v | -verbose | --verbose | --verbos | --verbo | --verb)
418     verbose=yes ;;
419
420   -version | --version | --versio | --versi | --vers | -V)
421     ac_init_version=: ;;
422
423   -with-* | --with-*)
424     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
425     # Reject names that are not valid shell variable names.
426     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
427       { echo "$as_me: error: invalid package name: $ac_package" >&2
428    { (exit 1); exit 1; }; }
429     ac_package=`echo $ac_package| sed 's/-/_/g'`
430     case $ac_option in
431       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
432       *) ac_optarg=yes ;;
433     esac
434     eval "with_$ac_package='$ac_optarg'" ;;
435
436   -without-* | --without-*)
437     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
438     # Reject names that are not valid shell variable names.
439     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
440       { echo "$as_me: error: invalid package name: $ac_package" >&2
441    { (exit 1); exit 1; }; }
442     ac_package=`echo $ac_package | sed 's/-/_/g'`
443     eval "with_$ac_package=no" ;;
444
445   --x)
446     # Obsolete; use --with-x.
447     with_x=yes ;;
448
449   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
450   | --x-incl | --x-inc | --x-in | --x-i)
451     ac_prev=x_includes ;;
452   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
453   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
454     x_includes=$ac_optarg ;;
455
456   -x-libraries | --x-libraries | --x-librarie | --x-librari \
457   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
458     ac_prev=x_libraries ;;
459   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
460   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
461     x_libraries=$ac_optarg ;;
462
463   -*) { echo "$as_me: error: unrecognized option: $ac_option
464 Try \`$0 --help' for more information." >&2
465    { (exit 1); exit 1; }; }
466     ;;
467
468   *=*)
469     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
470     # Reject names that are not valid shell variable names.
471     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
472       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
473    { (exit 1); exit 1; }; }
474     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
475     eval "$ac_envvar='$ac_optarg'"
476     export $ac_envvar ;;
477
478   *)
479     # FIXME: should be removed in autoconf 3.0.
480     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
481     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
482       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
483     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
484     ;;
485
486   esac
487 done
488
489 if test -n "$ac_prev"; then
490   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
491   { echo "$as_me: error: missing argument to $ac_option" >&2
492    { (exit 1); exit 1; }; }
493 fi
494
495 # Be sure to have absolute paths.
496 for ac_var in exec_prefix prefix
497 do
498   eval ac_val=$`echo $ac_var`
499   case $ac_val in
500     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
501     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
502    { (exit 1); exit 1; }; };;
503   esac
504 done
505
506 # Be sure to have absolute paths.
507 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
508               localstatedir libdir includedir oldincludedir infodir mandir
509 do
510   eval ac_val=$`echo $ac_var`
511   case $ac_val in
512     [\\/$]* | ?:[\\/]* ) ;;
513     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
514    { (exit 1); exit 1; }; };;
515   esac
516 done
517
518 # There might be people who depend on the old broken behavior: `$host'
519 # used to hold the argument of --host etc.
520 build=$build_alias
521 host=$host_alias
522 target=$target_alias
523
524 # FIXME: should be removed in autoconf 3.0.
525 if test "x$host_alias" != x; then
526   if test "x$build_alias" = x; then
527     cross_compiling=maybe
528     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
529     If a cross compiler is detected then cross compile mode will be used." >&2
530   elif test "x$build_alias" != "x$host_alias"; then
531     cross_compiling=yes
532   fi
533 fi
534
535 ac_tool_prefix=
536 test -n "$host_alias" && ac_tool_prefix=$host_alias-
537
538 test "$silent" = yes && exec 6>/dev/null
539
540 # Find the source files, if location was not specified.
541 if test -z "$srcdir"; then
542   ac_srcdir_defaulted=yes
543   # Try the directory containing this script, then its parent.
544   ac_prog=$0
545   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
546   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
547   srcdir=$ac_confdir
548   if test ! -r $srcdir/$ac_unique_file; then
549     srcdir=..
550   fi
551 else
552   ac_srcdir_defaulted=no
553 fi
554 if test ! -r $srcdir/$ac_unique_file; then
555   if test "$ac_srcdir_defaulted" = yes; then
556     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
557    { (exit 1); exit 1; }; }
558   else
559     { echo "$as_me: error: cannot find sources in $srcdir" >&2
560    { (exit 1); exit 1; }; }
561   fi
562 fi
563 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
564 ac_env_build_alias_set=${build_alias+set}
565 ac_env_build_alias_value=$build_alias
566 ac_cv_env_build_alias_set=${build_alias+set}
567 ac_cv_env_build_alias_value=$build_alias
568 ac_env_host_alias_set=${host_alias+set}
569 ac_env_host_alias_value=$host_alias
570 ac_cv_env_host_alias_set=${host_alias+set}
571 ac_cv_env_host_alias_value=$host_alias
572 ac_env_target_alias_set=${target_alias+set}
573 ac_env_target_alias_value=$target_alias
574 ac_cv_env_target_alias_set=${target_alias+set}
575 ac_cv_env_target_alias_value=$target_alias
576 ac_env_CC_set=${CC+set}
577 ac_env_CC_value=$CC
578 ac_cv_env_CC_set=${CC+set}
579 ac_cv_env_CC_value=$CC
580 ac_env_CFLAGS_set=${CFLAGS+set}
581 ac_env_CFLAGS_value=$CFLAGS
582 ac_cv_env_CFLAGS_set=${CFLAGS+set}
583 ac_cv_env_CFLAGS_value=$CFLAGS
584 ac_env_LDFLAGS_set=${LDFLAGS+set}
585 ac_env_LDFLAGS_value=$LDFLAGS
586 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
587 ac_cv_env_LDFLAGS_value=$LDFLAGS
588 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
589 ac_env_CPPFLAGS_value=$CPPFLAGS
590 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
591 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
592 ac_env_CPP_set=${CPP+set}
593 ac_env_CPP_value=$CPP
594 ac_cv_env_CPP_set=${CPP+set}
595 ac_cv_env_CPP_value=$CPP
596
597 #
598 # Report the --help message.
599 #
600 if test "$ac_init_help" = "long"; then
601   # Omit some internal or obsolete options to make the list less imposing.
602   # This message is too long to be a string in the A/UX 3.1 sh.
603   cat <<EOF
604 \`configure' configures this package to adapt to many kinds of systems.
605
606 Usage: $0 [OPTION]... [VAR=VALUE]...
607
608 To assign environment variables (e.g., CC, CFLAGS...), specify them as
609 VAR=VALUE.  See below for descriptions of some of the useful variables.
610
611 Defaults for the options are specified in brackets.
612
613 Configuration:
614   -h, --help              display this help and exit
615       --help=short        display options specific to this package
616       --help=recursive    display the short help of all the included packages
617   -V, --version           display version information and exit
618   -q, --quiet, --silent   do not print \`checking...' messages
619       --cache-file=FILE   cache test results in FILE [disabled]
620   -C, --config-cache      alias for \`--cache-file=config.cache'
621   -n, --no-create         do not create output files
622       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
623
624 EOF
625
626   cat <<EOF
627 Installation directories:
628   --prefix=PREFIX         install architecture-independent files in PREFIX
629                           [$ac_default_prefix]
630   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
631                           [PREFIX]
632
633 By default, \`make install' will install all the files in
634 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
635 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
636 for instance \`--prefix=\$HOME'.
637
638 For better control, use the options below.
639
640 Fine tuning of the installation directories:
641   --bindir=DIR            user executables [EPREFIX/bin]
642   --sbindir=DIR           system admin executables [EPREFIX/sbin]
643   --libexecdir=DIR        program executables [EPREFIX/libexec]
644   --datadir=DIR           read-only architecture-independent data [PREFIX/share]
645   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
646   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
647   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
648   --libdir=DIR            object code libraries [EPREFIX/lib]
649   --includedir=DIR        C header files [PREFIX/include]
650   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
651   --infodir=DIR           info documentation [PREFIX/info]
652   --mandir=DIR            man documentation [PREFIX/man]
653 EOF
654
655   cat <<\EOF
656
657 Program names:
658   --program-prefix=PREFIX            prepend PREFIX to installed program names
659   --program-suffix=SUFFIX            append SUFFIX to installed program names
660   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
661
662 X features:
663   --x-includes=DIR    X include files are in DIR
664   --x-libraries=DIR   X library files are in DIR
665
666 System types:
667   --build=BUILD           configure for building on BUILD [guessed]
668   --host=HOST       build programs to run on HOST [BUILD]
669 EOF
670 fi
671
672 if test -n "$ac_init_help"; then
673
674   cat <<\EOF
675
676 Optional Features:
677   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
678   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
679
680 Optional Packages:
681   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
682   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
683
684   --disable-echo          display "compiling" commands
685   --enable-warnings       test: turn on gcc compiler warnings
686   --with-dmalloc          test: use Gray Watson's dmalloc library
687   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
688   --with-valgrind         test: use valgrind
689   --disable-leaks         test: free permanent memory, analyze leaks
690   --with-curses-dir=DIR   directory in which (n)curses is installed
691   --with-5lib             use SunOS sysv-libraries
692   --with-ncursesw         use wide ncurses-libraries (installed)
693   --with-ncurses          use ncurses-libraries (installed)
694   --with-pdcurses         compile/link with pdcurses X11 library
695   --with-Xaw3d            link with Xaw 3d library
696   --with-neXtaw           link with neXT Athena library
697   --with-XawPlus          link with Athena-Plus library
698   --with-pkg-config{=path} enable/disable use of pkg-config
699   --with-x                use the X Window System
700   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
701
702 Some influential environment variables:
703   CC          C compiler command
704   CFLAGS      C compiler flags
705   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
706               nonstandard directory <lib dir>
707   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
708               headers in a nonstandard directory <include dir>
709   CPP         C preprocessor
710
711 Use these variables to override the choices made by `configure' or to help
712 it to find libraries and programs with nonstandard names/locations.
713
714 EOF
715 fi
716
717 if test "$ac_init_help" = "recursive"; then
718   # If there are subdirs, report their specific --help.
719   ac_popdir=`pwd`
720   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
721     cd $ac_subdir
722     # A "../" for each directory in /$ac_subdir.
723     ac_dots=`echo $ac_subdir |
724              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
725
726     case $srcdir in
727     .) # No --srcdir option.  We are building in place.
728       ac_sub_srcdir=$srcdir ;;
729     [\\/]* | ?:[\\/]* ) # Absolute path.
730       ac_sub_srcdir=$srcdir/$ac_subdir ;;
731     *) # Relative path.
732       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
733     esac
734
735     # Check for guested configure; otherwise get Cygnus style configure.
736     if test -f $ac_sub_srcdir/configure.gnu; then
737       echo
738       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
739     elif test -f $ac_sub_srcdir/configure; then
740       echo
741       $SHELL $ac_sub_srcdir/configure  --help=recursive
742     elif test -f $ac_sub_srcdir/configure.ac ||
743            test -f $ac_sub_srcdir/configure.in; then
744       echo
745       $ac_configure --help
746     else
747       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
748     fi
749     cd $ac_popdir
750   done
751 fi
752
753 test -n "$ac_init_help" && exit 0
754 if $ac_init_version; then
755   cat <<\EOF
756
757 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
758 Free Software Foundation, Inc.
759 This configure script is free software; the Free Software Foundation
760 gives unlimited permission to copy, distribute and modify it.
761 EOF
762   exit 0
763 fi
764 exec 5>config.log
765 cat >&5 <<EOF
766 This file contains any messages produced by compilers while
767 running configure, to aid debugging if configure makes a mistake.
768
769 It was created by $as_me, which was
770 generated by GNU Autoconf 2.52.20101001.  Invocation command line was
771
772   $ $0 $@
773
774 EOF
775 {
776 cat <<_ASUNAME
777 ## ---------- ##
778 ## Platform.  ##
779 ## ---------- ##
780
781 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
782 uname -m = `(uname -m) 2>/dev/null || echo unknown`
783 uname -r = `(uname -r) 2>/dev/null || echo unknown`
784 uname -s = `(uname -s) 2>/dev/null || echo unknown`
785 uname -v = `(uname -v) 2>/dev/null || echo unknown`
786
787 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
788 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
789
790 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
791 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
792 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
793 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
794 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
795 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
796 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
797
798 PATH = $PATH
799
800 _ASUNAME
801 } >&5
802
803 cat >&5 <<EOF
804 ## ------------ ##
805 ## Core tests.  ##
806 ## ------------ ##
807
808 EOF
809
810 # Keep a trace of the command line.
811 # Strip out --no-create and --no-recursion so they do not pile up.
812 # Also quote any args containing shell meta-characters.
813 ac_configure_args=
814 ac_sep=
815 for ac_arg
816 do
817   case $ac_arg in
818   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
819   | --no-cr | --no-c) ;;
820   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
821   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
822   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
823     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
824     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
825     ac_sep=" " ;;
826   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
827      ac_sep=" " ;;
828   esac
829   # Get rid of the leading space.
830 done
831
832 # When interrupted or exit'd, cleanup temporary files, and complete
833 # config.log.  We remove comments because anyway the quotes in there
834 # would cause problems or look ugly.
835 trap 'exit_status=$?
836   # Save into config.log some information that might help in debugging.
837   echo >&5
838   echo "## ----------------- ##" >&5
839   echo "## Cache variables.  ##" >&5
840   echo "## ----------------- ##" >&5
841   echo >&5
842   # The following way of writing the cache mishandles newlines in values,
843 {
844   (set) 2>&1 |
845     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
846     *ac_space=\ *)
847       sed -n \
848         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
849           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
850       ;;
851     *)
852       sed -n \
853         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
854       ;;
855     esac;
856 } >&5
857   sed "/^$/d" confdefs.h >conftest.log
858   if test -s conftest.log; then
859     echo >&5
860     echo "## ------------ ##" >&5
861     echo "## confdefs.h.  ##" >&5
862     echo "## ------------ ##" >&5
863     echo >&5
864     cat conftest.log >&5
865   fi
866   (echo; echo) >&5
867   test "$ac_signal" != 0 &&
868     echo "$as_me: caught signal $ac_signal" >&5
869   echo "$as_me: exit $exit_status" >&5
870   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
871     exit $exit_status
872      ' 0
873 for ac_signal in 1 2 13 15; do
874   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
875 done
876 ac_signal=0
877
878 # confdefs.h avoids OS command line length limits that DEFS can exceed.
879 rm -rf conftest* confdefs.h
880 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
881 echo >confdefs.h
882
883 # Let the site file select an alternate cache file if it wants to.
884 # Prefer explicitly selected file to automatically selected ones.
885 if test -z "$CONFIG_SITE"; then
886   if test "x$prefix" != xNONE; then
887     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
888   else
889     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
890   fi
891 fi
892 for ac_site_file in $CONFIG_SITE; do
893   if test -r "$ac_site_file"; then
894     { echo "$as_me:894: loading site script $ac_site_file" >&5
895 echo "$as_me: loading site script $ac_site_file" >&6;}
896     cat "$ac_site_file" >&5
897     . "$ac_site_file"
898   fi
899 done
900
901 if test -r "$cache_file"; then
902   # Some versions of bash will fail to source /dev/null (special
903   # files actually), so we avoid doing that.
904   if test -f "$cache_file"; then
905     { echo "$as_me:905: loading cache $cache_file" >&5
906 echo "$as_me: loading cache $cache_file" >&6;}
907     case $cache_file in
908       [\\/]* | ?:[\\/]* ) . $cache_file;;
909       *)                      . ./$cache_file;;
910     esac
911   fi
912 else
913   { echo "$as_me:913: creating cache $cache_file" >&5
914 echo "$as_me: creating cache $cache_file" >&6;}
915   >$cache_file
916 fi
917
918 # Check that the precious variables saved in the cache have kept the same
919 # value.
920 ac_cache_corrupted=false
921 for ac_var in `(set) 2>&1 |
922                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
923   eval ac_old_set=\$ac_cv_env_${ac_var}_set
924   eval ac_new_set=\$ac_env_${ac_var}_set
925   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
926   eval ac_new_val="\$ac_env_${ac_var}_value"
927   case $ac_old_set,$ac_new_set in
928     set,)
929       { echo "$as_me:929: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
930 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
931       ac_cache_corrupted=: ;;
932     ,set)
933       { echo "$as_me:933: error: \`$ac_var' was not set in the previous run" >&5
934 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
935       ac_cache_corrupted=: ;;
936     ,);;
937     *)
938       if test "x$ac_old_val" != "x$ac_new_val"; then
939         { echo "$as_me:939: error: \`$ac_var' has changed since the previous run:" >&5
940 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
941         { echo "$as_me:941:   former value:  $ac_old_val" >&5
942 echo "$as_me:   former value:  $ac_old_val" >&2;}
943         { echo "$as_me:943:   current value: $ac_new_val" >&5
944 echo "$as_me:   current value: $ac_new_val" >&2;}
945         ac_cache_corrupted=:
946       fi;;
947   esac
948   # Pass precious variables to config.status.  It doesn't matter if
949   # we pass some twice (in addition to the command line arguments).
950   if test "$ac_new_set" = set; then
951     case $ac_new_val in
952     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
953       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
954       ac_configure_args="$ac_configure_args '$ac_arg'"
955       ;;
956     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
957        ;;
958     esac
959   fi
960 done
961 if $ac_cache_corrupted; then
962   { echo "$as_me:962: error: changes in the environment can compromise the build" >&5
963 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
964   { { echo "$as_me:964: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
965 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
966    { (exit 1); exit 1; }; }
967 fi
968
969 ac_ext=c
970 ac_cpp='$CPP $CPPFLAGS'
971 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
972 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
973 ac_compiler_gnu=$ac_cv_c_compiler_gnu
974 ac_main_return=return
975
976 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
977   *c*,-n*) ECHO_N= ECHO_C='
978 ' ECHO_T='      ' ;;
979   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
980   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
981 esac
982 echo "#! $SHELL" >conftest.sh
983 echo  "exit 0"   >>conftest.sh
984 chmod +x conftest.sh
985 if { (echo "$as_me:985: PATH=\".;.\"; conftest.sh") >&5
986   (PATH=".;."; conftest.sh) 2>&5
987   ac_status=$?
988   echo "$as_me:988: \$? = $ac_status" >&5
989   (exit $ac_status); }; then
990   ac_path_separator=';'
991 else
992   ac_path_separator=:
993 fi
994 PATH_SEPARATOR="$ac_path_separator"
995 rm -f conftest.sh
996
997 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
998
999 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1000
1001 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1002
1003 ac_aux_dir=
1004 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1005   if test -f $ac_dir/install-sh; then
1006     ac_aux_dir=$ac_dir
1007     ac_install_sh="$ac_aux_dir/install-sh -c"
1008     break
1009   elif test -f $ac_dir/install.sh; then
1010     ac_aux_dir=$ac_dir
1011     ac_install_sh="$ac_aux_dir/install.sh -c"
1012     break
1013   elif test -f $ac_dir/shtool; then
1014     ac_aux_dir=$ac_dir
1015     ac_install_sh="$ac_aux_dir/shtool install -c"
1016     break
1017   fi
1018 done
1019 if test -z "$ac_aux_dir"; then
1020   { { echo "$as_me:1020: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1021 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1022    { (exit 1); exit 1; }; }
1023 fi
1024 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1025 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1026 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1027
1028 # Make sure we can run config.sub.
1029 $ac_config_sub sun4 >/dev/null 2>&1 ||
1030   { { echo "$as_me:1030: error: cannot run $ac_config_sub" >&5
1031 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1032    { (exit 1); exit 1; }; }
1033
1034 echo "$as_me:1034: checking build system type" >&5
1035 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1036 if test "${ac_cv_build+set}" = set; then
1037   echo $ECHO_N "(cached) $ECHO_C" >&6
1038 else
1039   ac_cv_build_alias=$build_alias
1040 test -z "$ac_cv_build_alias" &&
1041   ac_cv_build_alias=`$ac_config_guess`
1042 test -z "$ac_cv_build_alias" &&
1043   { { echo "$as_me:1043: error: cannot guess build type; you must specify one" >&5
1044 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1045    { (exit 1); exit 1; }; }
1046 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1047   { { echo "$as_me:1047: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1048 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1049    { (exit 1); exit 1; }; }
1050
1051 fi
1052 echo "$as_me:1052: result: $ac_cv_build" >&5
1053 echo "${ECHO_T}$ac_cv_build" >&6
1054 build=$ac_cv_build
1055 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1056 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1057 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1058
1059 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1060         echo "$as_me:1060: checking host system type" >&5
1061 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1062 if test "${ac_cv_host+set}" = set; then
1063   echo $ECHO_N "(cached) $ECHO_C" >&6
1064 else
1065   ac_cv_host_alias=$host_alias
1066 test -z "$ac_cv_host_alias" &&
1067   ac_cv_host_alias=$ac_cv_build_alias
1068 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1069   { { echo "$as_me:1069: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1070 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1071    { (exit 1); exit 1; }; }
1072
1073 fi
1074 echo "$as_me:1074: result: $ac_cv_host" >&5
1075 echo "${ECHO_T}$ac_cv_host" >&6
1076 host=$ac_cv_host
1077 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1078 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1079 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1080
1081         system_name="$host_os"
1082 else
1083         system_name="`(uname -s -r) 2>/dev/null`"
1084         if test -z "$system_name" ; then
1085                 system_name="`(hostname) 2>/dev/null`"
1086         fi
1087 fi
1088 test -n "$system_name" && cat >>confdefs.h <<EOF
1089 #define SYSTEM_NAME "$system_name"
1090 EOF
1091
1092 if test "${cf_cv_system_name+set}" = set; then
1093   echo $ECHO_N "(cached) $ECHO_C" >&6
1094 else
1095   cf_cv_system_name="$system_name"
1096 fi
1097
1098 test -z "$system_name" && system_name="$cf_cv_system_name"
1099 test -n "$cf_cv_system_name" && echo "$as_me:1099: result: Configuring for $cf_cv_system_name" >&5
1100 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1101
1102 if test ".$system_name" != ".$cf_cv_system_name" ; then
1103         echo "$as_me:1103: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1104 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1105         { { echo "$as_me:1105: error: \"Please remove config.cache and try again.\"" >&5
1106 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1107    { (exit 1); exit 1; }; }
1108 fi
1109
1110 test "$program_prefix" != NONE &&
1111   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1112 # Use a double $ so make ignores it.
1113 test "$program_suffix" != NONE &&
1114   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1115 # Double any \ or $.  echo might interpret backslashes.
1116 # By default was `s,x,x', remove it if useless.
1117 cat <<\_ACEOF >conftest.sed
1118 s/[\\$]/&&/g;s/;s,x,x,$//
1119 _ACEOF
1120 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1121 rm conftest.sed
1122
1123 echo "$as_me:1123: checking whether ${MAKE-make} sets \${MAKE}" >&5
1124 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1125 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1126 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1127   echo $ECHO_N "(cached) $ECHO_C" >&6
1128 else
1129   cat >conftest.make <<\EOF
1130 all:
1131         @echo 'ac_maketemp="${MAKE}"'
1132 EOF
1133 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1134 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1135 if test -n "$ac_maketemp"; then
1136   eval ac_cv_prog_make_${ac_make}_set=yes
1137 else
1138   eval ac_cv_prog_make_${ac_make}_set=no
1139 fi
1140 rm -f conftest.make
1141 fi
1142 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1143   echo "$as_me:1143: result: yes" >&5
1144 echo "${ECHO_T}yes" >&6
1145   SET_MAKE=
1146 else
1147   echo "$as_me:1147: result: no" >&5
1148 echo "${ECHO_T}no" >&6
1149   SET_MAKE="MAKE=${MAKE-make}"
1150 fi
1151
1152 ac_ext=c
1153 ac_cpp='$CPP $CPPFLAGS'
1154 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1155 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1156 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1157 ac_main_return=return
1158 if test -n "$ac_tool_prefix"; then
1159   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1160 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1161 echo "$as_me:1161: checking for $ac_word" >&5
1162 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1163 if test "${ac_cv_prog_CC+set}" = set; then
1164   echo $ECHO_N "(cached) $ECHO_C" >&6
1165 else
1166   if test -n "$CC"; then
1167   ac_cv_prog_CC="$CC" # Let the user override the test.
1168 else
1169   ac_save_IFS=$IFS; IFS=$ac_path_separator
1170 ac_dummy="$PATH"
1171 for ac_dir in $ac_dummy; do
1172   IFS=$ac_save_IFS
1173   test -z "$ac_dir" && ac_dir=.
1174   $as_executable_p "$ac_dir/$ac_word" || continue
1175 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1176 echo "$as_me:1176: found $ac_dir/$ac_word" >&5
1177 break
1178 done
1179
1180 fi
1181 fi
1182 CC=$ac_cv_prog_CC
1183 if test -n "$CC"; then
1184   echo "$as_me:1184: result: $CC" >&5
1185 echo "${ECHO_T}$CC" >&6
1186 else
1187   echo "$as_me:1187: result: no" >&5
1188 echo "${ECHO_T}no" >&6
1189 fi
1190
1191 fi
1192 if test -z "$ac_cv_prog_CC"; then
1193   ac_ct_CC=$CC
1194   # Extract the first word of "gcc", so it can be a program name with args.
1195 set dummy gcc; ac_word=$2
1196 echo "$as_me:1196: checking for $ac_word" >&5
1197 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1198 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1199   echo $ECHO_N "(cached) $ECHO_C" >&6
1200 else
1201   if test -n "$ac_ct_CC"; then
1202   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1203 else
1204   ac_save_IFS=$IFS; IFS=$ac_path_separator
1205 ac_dummy="$PATH"
1206 for ac_dir in $ac_dummy; do
1207   IFS=$ac_save_IFS
1208   test -z "$ac_dir" && ac_dir=.
1209   $as_executable_p "$ac_dir/$ac_word" || continue
1210 ac_cv_prog_ac_ct_CC="gcc"
1211 echo "$as_me:1211: found $ac_dir/$ac_word" >&5
1212 break
1213 done
1214
1215 fi
1216 fi
1217 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1218 if test -n "$ac_ct_CC"; then
1219   echo "$as_me:1219: result: $ac_ct_CC" >&5
1220 echo "${ECHO_T}$ac_ct_CC" >&6
1221 else
1222   echo "$as_me:1222: result: no" >&5
1223 echo "${ECHO_T}no" >&6
1224 fi
1225
1226   CC=$ac_ct_CC
1227 else
1228   CC="$ac_cv_prog_CC"
1229 fi
1230
1231 if test -z "$CC"; then
1232   if test -n "$ac_tool_prefix"; then
1233   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1234 set dummy ${ac_tool_prefix}cc; ac_word=$2
1235 echo "$as_me:1235: checking for $ac_word" >&5
1236 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1237 if test "${ac_cv_prog_CC+set}" = set; then
1238   echo $ECHO_N "(cached) $ECHO_C" >&6
1239 else
1240   if test -n "$CC"; then
1241   ac_cv_prog_CC="$CC" # Let the user override the test.
1242 else
1243   ac_save_IFS=$IFS; IFS=$ac_path_separator
1244 ac_dummy="$PATH"
1245 for ac_dir in $ac_dummy; do
1246   IFS=$ac_save_IFS
1247   test -z "$ac_dir" && ac_dir=.
1248   $as_executable_p "$ac_dir/$ac_word" || continue
1249 ac_cv_prog_CC="${ac_tool_prefix}cc"
1250 echo "$as_me:1250: found $ac_dir/$ac_word" >&5
1251 break
1252 done
1253
1254 fi
1255 fi
1256 CC=$ac_cv_prog_CC
1257 if test -n "$CC"; then
1258   echo "$as_me:1258: result: $CC" >&5
1259 echo "${ECHO_T}$CC" >&6
1260 else
1261   echo "$as_me:1261: result: no" >&5
1262 echo "${ECHO_T}no" >&6
1263 fi
1264
1265 fi
1266 if test -z "$ac_cv_prog_CC"; then
1267   ac_ct_CC=$CC
1268   # Extract the first word of "cc", so it can be a program name with args.
1269 set dummy cc; ac_word=$2
1270 echo "$as_me:1270: checking for $ac_word" >&5
1271 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1272 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1273   echo $ECHO_N "(cached) $ECHO_C" >&6
1274 else
1275   if test -n "$ac_ct_CC"; then
1276   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1277 else
1278   ac_save_IFS=$IFS; IFS=$ac_path_separator
1279 ac_dummy="$PATH"
1280 for ac_dir in $ac_dummy; do
1281   IFS=$ac_save_IFS
1282   test -z "$ac_dir" && ac_dir=.
1283   $as_executable_p "$ac_dir/$ac_word" || continue
1284 ac_cv_prog_ac_ct_CC="cc"
1285 echo "$as_me:1285: found $ac_dir/$ac_word" >&5
1286 break
1287 done
1288
1289 fi
1290 fi
1291 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1292 if test -n "$ac_ct_CC"; then
1293   echo "$as_me:1293: result: $ac_ct_CC" >&5
1294 echo "${ECHO_T}$ac_ct_CC" >&6
1295 else
1296   echo "$as_me:1296: result: no" >&5
1297 echo "${ECHO_T}no" >&6
1298 fi
1299
1300   CC=$ac_ct_CC
1301 else
1302   CC="$ac_cv_prog_CC"
1303 fi
1304
1305 fi
1306 if test -z "$CC"; then
1307   # Extract the first word of "cc", so it can be a program name with args.
1308 set dummy cc; ac_word=$2
1309 echo "$as_me:1309: checking for $ac_word" >&5
1310 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1311 if test "${ac_cv_prog_CC+set}" = set; then
1312   echo $ECHO_N "(cached) $ECHO_C" >&6
1313 else
1314   if test -n "$CC"; then
1315   ac_cv_prog_CC="$CC" # Let the user override the test.
1316 else
1317   ac_prog_rejected=no
1318   ac_save_IFS=$IFS; IFS=$ac_path_separator
1319 ac_dummy="$PATH"
1320 for ac_dir in $ac_dummy; do
1321   IFS=$ac_save_IFS
1322   test -z "$ac_dir" && ac_dir=.
1323   $as_executable_p "$ac_dir/$ac_word" || continue
1324 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1325   ac_prog_rejected=yes
1326   continue
1327 fi
1328 ac_cv_prog_CC="cc"
1329 echo "$as_me:1329: found $ac_dir/$ac_word" >&5
1330 break
1331 done
1332
1333 if test $ac_prog_rejected = yes; then
1334   # We found a bogon in the path, so make sure we never use it.
1335   set dummy $ac_cv_prog_CC
1336   shift
1337   if test $# != 0; then
1338     # We chose a different compiler from the bogus one.
1339     # However, it has the same basename, so the bogon will be chosen
1340     # first if we set CC to just the basename; use the full file name.
1341     shift
1342     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1343     shift
1344     ac_cv_prog_CC="$@"
1345   fi
1346 fi
1347 fi
1348 fi
1349 CC=$ac_cv_prog_CC
1350 if test -n "$CC"; then
1351   echo "$as_me:1351: result: $CC" >&5
1352 echo "${ECHO_T}$CC" >&6
1353 else
1354   echo "$as_me:1354: result: no" >&5
1355 echo "${ECHO_T}no" >&6
1356 fi
1357
1358 fi
1359 if test -z "$CC"; then
1360   if test -n "$ac_tool_prefix"; then
1361   for ac_prog in cl
1362   do
1363     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1364 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1365 echo "$as_me:1365: checking for $ac_word" >&5
1366 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1367 if test "${ac_cv_prog_CC+set}" = set; then
1368   echo $ECHO_N "(cached) $ECHO_C" >&6
1369 else
1370   if test -n "$CC"; then
1371   ac_cv_prog_CC="$CC" # Let the user override the test.
1372 else
1373   ac_save_IFS=$IFS; IFS=$ac_path_separator
1374 ac_dummy="$PATH"
1375 for ac_dir in $ac_dummy; do
1376   IFS=$ac_save_IFS
1377   test -z "$ac_dir" && ac_dir=.
1378   $as_executable_p "$ac_dir/$ac_word" || continue
1379 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1380 echo "$as_me:1380: found $ac_dir/$ac_word" >&5
1381 break
1382 done
1383
1384 fi
1385 fi
1386 CC=$ac_cv_prog_CC
1387 if test -n "$CC"; then
1388   echo "$as_me:1388: result: $CC" >&5
1389 echo "${ECHO_T}$CC" >&6
1390 else
1391   echo "$as_me:1391: result: no" >&5
1392 echo "${ECHO_T}no" >&6
1393 fi
1394
1395     test -n "$CC" && break
1396   done
1397 fi
1398 if test -z "$CC"; then
1399   ac_ct_CC=$CC
1400   for ac_prog in cl
1401 do
1402   # Extract the first word of "$ac_prog", so it can be a program name with args.
1403 set dummy $ac_prog; ac_word=$2
1404 echo "$as_me:1404: checking for $ac_word" >&5
1405 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1406 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1407   echo $ECHO_N "(cached) $ECHO_C" >&6
1408 else
1409   if test -n "$ac_ct_CC"; then
1410   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1411 else
1412   ac_save_IFS=$IFS; IFS=$ac_path_separator
1413 ac_dummy="$PATH"
1414 for ac_dir in $ac_dummy; do
1415   IFS=$ac_save_IFS
1416   test -z "$ac_dir" && ac_dir=.
1417   $as_executable_p "$ac_dir/$ac_word" || continue
1418 ac_cv_prog_ac_ct_CC="$ac_prog"
1419 echo "$as_me:1419: found $ac_dir/$ac_word" >&5
1420 break
1421 done
1422
1423 fi
1424 fi
1425 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1426 if test -n "$ac_ct_CC"; then
1427   echo "$as_me:1427: result: $ac_ct_CC" >&5
1428 echo "${ECHO_T}$ac_ct_CC" >&6
1429 else
1430   echo "$as_me:1430: result: no" >&5
1431 echo "${ECHO_T}no" >&6
1432 fi
1433
1434   test -n "$ac_ct_CC" && break
1435 done
1436
1437   CC=$ac_ct_CC
1438 fi
1439
1440 fi
1441
1442 test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
1443 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Provide some information about the compiler.
1447 echo "$as_me:1447:" \
1448      "checking for C compiler version" >&5
1449 ac_compiler=`set X $ac_compile; echo $2`
1450 { (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
1451   (eval $ac_compiler --version </dev/null >&5) 2>&5
1452   ac_status=$?
1453   echo "$as_me:1453: \$? = $ac_status" >&5
1454   (exit $ac_status); }
1455 { (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
1456   (eval $ac_compiler -v </dev/null >&5) 2>&5
1457   ac_status=$?
1458   echo "$as_me:1458: \$? = $ac_status" >&5
1459   (exit $ac_status); }
1460 { (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
1461   (eval $ac_compiler -V </dev/null >&5) 2>&5
1462   ac_status=$?
1463   echo "$as_me:1463: \$? = $ac_status" >&5
1464   (exit $ac_status); }
1465
1466 cat >conftest.$ac_ext <<_ACEOF
1467 #line 1467 "configure"
1468 #include "confdefs.h"
1469
1470 int
1471 main ()
1472 {
1473
1474   ;
1475   return 0;
1476 }
1477 _ACEOF
1478 ac_clean_files_save=$ac_clean_files
1479 ac_clean_files="$ac_clean_files a.out a.exe"
1480 # Try to create an executable without -o first, disregard a.out.
1481 # It will help us diagnose broken compilers, and finding out an intuition
1482 # of exeext.
1483 echo "$as_me:1483: checking for C compiler default output" >&5
1484 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1485 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1486 if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
1487   (eval $ac_link_default) 2>&5
1488   ac_status=$?
1489   echo "$as_me:1489: \$? = $ac_status" >&5
1490   (exit $ac_status); }; then
1491   # Find the output, starting from the most likely.  This scheme is
1492 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1493 # resort.
1494 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1495                 ls a.out conftest 2>/dev/null;
1496                 ls a.* conftest.* 2>/dev/null`; do
1497   case $ac_file in
1498     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1499     a.out ) # We found the default executable, but exeext='' is most
1500             # certainly right.
1501             break;;
1502     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1503           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1504           export ac_cv_exeext
1505           break;;
1506     * ) break;;
1507   esac
1508 done
1509 else
1510   echo "$as_me: failed program was:" >&5
1511 cat conftest.$ac_ext >&5
1512 { { echo "$as_me:1512: error: C compiler cannot create executables" >&5
1513 echo "$as_me: error: C compiler cannot create executables" >&2;}
1514    { (exit 77); exit 77; }; }
1515 fi
1516
1517 ac_exeext=$ac_cv_exeext
1518 echo "$as_me:1518: result: $ac_file" >&5
1519 echo "${ECHO_T}$ac_file" >&6
1520
1521 # Check the compiler produces executables we can run.  If not, either
1522 # the compiler is broken, or we cross compile.
1523 echo "$as_me:1523: checking whether the C compiler works" >&5
1524 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1525 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1526 # If not cross compiling, check that we can run a simple program.
1527 if test "$cross_compiling" != yes; then
1528   if { ac_try='./$ac_file'
1529   { (eval echo "$as_me:1529: \"$ac_try\"") >&5
1530   (eval $ac_try) 2>&5
1531   ac_status=$?
1532   echo "$as_me:1532: \$? = $ac_status" >&5
1533   (exit $ac_status); }; }; then
1534     cross_compiling=no
1535   else
1536     if test "$cross_compiling" = maybe; then
1537         cross_compiling=yes
1538     else
1539         { { echo "$as_me:1539: error: cannot run C compiled programs.
1540 If you meant to cross compile, use \`--host'." >&5
1541 echo "$as_me: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&2;}
1543    { (exit 1); exit 1; }; }
1544     fi
1545   fi
1546 fi
1547 echo "$as_me:1547: result: yes" >&5
1548 echo "${ECHO_T}yes" >&6
1549
1550 rm -f a.out a.exe conftest$ac_cv_exeext
1551 ac_clean_files=$ac_clean_files_save
1552 # Check the compiler produces executables we can run.  If not, either
1553 # the compiler is broken, or we cross compile.
1554 echo "$as_me:1554: checking whether we are cross compiling" >&5
1555 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1556 echo "$as_me:1556: result: $cross_compiling" >&5
1557 echo "${ECHO_T}$cross_compiling" >&6
1558
1559 echo "$as_me:1559: checking for executable suffix" >&5
1560 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1561 if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
1562   (eval $ac_link) 2>&5
1563   ac_status=$?
1564   echo "$as_me:1564: \$? = $ac_status" >&5
1565   (exit $ac_status); }; then
1566   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1567 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1568 # work properly (i.e., refer to `conftest.exe'), while it won't with
1569 # `rm'.
1570 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1571   case $ac_file in
1572     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1573     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1574           export ac_cv_exeext
1575           break;;
1576     * ) break;;
1577   esac
1578 done
1579 else
1580   { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
1581 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1582    { (exit 1); exit 1; }; }
1583 fi
1584
1585 rm -f conftest$ac_cv_exeext
1586 echo "$as_me:1586: result: $ac_cv_exeext" >&5
1587 echo "${ECHO_T}$ac_cv_exeext" >&6
1588
1589 rm -f conftest.$ac_ext
1590 EXEEXT=$ac_cv_exeext
1591 ac_exeext=$EXEEXT
1592 echo "$as_me:1592: checking for object suffix" >&5
1593 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1594 if test "${ac_cv_objext+set}" = set; then
1595   echo $ECHO_N "(cached) $ECHO_C" >&6
1596 else
1597   cat >conftest.$ac_ext <<_ACEOF
1598 #line 1598 "configure"
1599 #include "confdefs.h"
1600
1601 int
1602 main ()
1603 {
1604
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.o conftest.obj
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit $ac_status); }; then
1615   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1616   case $ac_file in
1617     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1618     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1619        break;;
1620   esac
1621 done
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat conftest.$ac_ext >&5
1625 { { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
1626 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1627    { (exit 1); exit 1; }; }
1628 fi
1629
1630 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1631 fi
1632 echo "$as_me:1632: result: $ac_cv_objext" >&5
1633 echo "${ECHO_T}$ac_cv_objext" >&6
1634 OBJEXT=$ac_cv_objext
1635 ac_objext=$OBJEXT
1636 echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
1637 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1638 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1639   echo $ECHO_N "(cached) $ECHO_C" >&6
1640 else
1641   cat >conftest.$ac_ext <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644
1645 int
1646 main ()
1647 {
1648 #ifndef __GNUC__
1649        choke me
1650 #endif
1651
1652   ;
1653   return 0;
1654 }
1655 _ACEOF
1656 rm -f conftest.$ac_objext
1657 if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
1658   (eval $ac_compile) 2>&5
1659   ac_status=$?
1660   echo "$as_me:1660: \$? = $ac_status" >&5
1661   (exit $ac_status); } &&
1662          { ac_try='test -s conftest.$ac_objext'
1663   { (eval echo "$as_me:1663: \"$ac_try\"") >&5
1664   (eval $ac_try) 2>&5
1665   ac_status=$?
1666   echo "$as_me:1666: \$? = $ac_status" >&5
1667   (exit $ac_status); }; }; then
1668   ac_compiler_gnu=yes
1669 else
1670   echo "$as_me: failed program was:" >&5
1671 cat conftest.$ac_ext >&5
1672 ac_compiler_gnu=no
1673 fi
1674 rm -f conftest.$ac_objext conftest.$ac_ext
1675 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1676
1677 fi
1678 echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
1679 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1680 GCC=`test $ac_compiler_gnu = yes && echo yes`
1681 ac_test_CFLAGS=${CFLAGS+set}
1682 ac_save_CFLAGS=$CFLAGS
1683 CFLAGS="-g"
1684 echo "$as_me:1684: checking whether $CC accepts -g" >&5
1685 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1686 if test "${ac_cv_prog_cc_g+set}" = set; then
1687   echo $ECHO_N "(cached) $ECHO_C" >&6
1688 else
1689   cat >conftest.$ac_ext <<_ACEOF
1690 #line 1690 "configure"
1691 #include "confdefs.h"
1692
1693 int
1694 main ()
1695 {
1696
1697   ;
1698   return 0;
1699 }
1700 _ACEOF
1701 rm -f conftest.$ac_objext
1702 if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
1703   (eval $ac_compile) 2>&5
1704   ac_status=$?
1705   echo "$as_me:1705: \$? = $ac_status" >&5
1706   (exit $ac_status); } &&
1707          { ac_try='test -s conftest.$ac_objext'
1708   { (eval echo "$as_me:1708: \"$ac_try\"") >&5
1709   (eval $ac_try) 2>&5
1710   ac_status=$?
1711   echo "$as_me:1711: \$? = $ac_status" >&5
1712   (exit $ac_status); }; }; then
1713   ac_cv_prog_cc_g=yes
1714 else
1715   echo "$as_me: failed program was:" >&5
1716 cat conftest.$ac_ext >&5
1717 ac_cv_prog_cc_g=no
1718 fi
1719 rm -f conftest.$ac_objext conftest.$ac_ext
1720 fi
1721 echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
1722 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1723 if test "$ac_test_CFLAGS" = set; then
1724   CFLAGS=$ac_save_CFLAGS
1725 elif test $ac_cv_prog_cc_g = yes; then
1726   if test "$GCC" = yes; then
1727     CFLAGS="-g -O2"
1728   else
1729     CFLAGS="-g"
1730   fi
1731 else
1732   if test "$GCC" = yes; then
1733     CFLAGS="-O2"
1734   else
1735     CFLAGS=
1736   fi
1737 fi
1738 # Some people use a C++ compiler to compile C.  Since we use `exit',
1739 # in C++ we need to declare it.  In case someone uses the same compiler
1740 # for both compiling C and C++ we need to have the C++ compiler decide
1741 # the declaration of exit, since it's the most demanding environment.
1742 cat >conftest.$ac_ext <<_ACEOF
1743 #ifndef __cplusplus
1744   choke me
1745 #endif
1746 _ACEOF
1747 rm -f conftest.$ac_objext
1748 if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
1749   (eval $ac_compile) 2>&5
1750   ac_status=$?
1751   echo "$as_me:1751: \$? = $ac_status" >&5
1752   (exit $ac_status); } &&
1753          { ac_try='test -s conftest.$ac_objext'
1754   { (eval echo "$as_me:1754: \"$ac_try\"") >&5
1755   (eval $ac_try) 2>&5
1756   ac_status=$?
1757   echo "$as_me:1757: \$? = $ac_status" >&5
1758   (exit $ac_status); }; }; then
1759   for ac_declaration in \
1760    ''\
1761    '#include <stdlib.h>' \
1762    'extern "C" void std::exit (int) throw (); using std::exit;' \
1763    'extern "C" void std::exit (int); using std::exit;' \
1764    'extern "C" void exit (int) throw ();' \
1765    'extern "C" void exit (int);' \
1766    'void exit (int);'
1767 do
1768   cat >conftest.$ac_ext <<_ACEOF
1769 #line 1769 "configure"
1770 #include "confdefs.h"
1771 #include <stdlib.h>
1772 $ac_declaration
1773 int
1774 main ()
1775 {
1776 exit (42);
1777   ;
1778   return 0;
1779 }
1780 _ACEOF
1781 rm -f conftest.$ac_objext
1782 if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
1783   (eval $ac_compile) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit $ac_status); } &&
1787          { ac_try='test -s conftest.$ac_objext'
1788   { (eval echo "$as_me:1788: \"$ac_try\"") >&5
1789   (eval $ac_try) 2>&5
1790   ac_status=$?
1791   echo "$as_me:1791: \$? = $ac_status" >&5
1792   (exit $ac_status); }; }; then
1793   :
1794 else
1795   echo "$as_me: failed program was:" >&5
1796 cat conftest.$ac_ext >&5
1797 continue
1798 fi
1799 rm -f conftest.$ac_objext conftest.$ac_ext
1800   cat >conftest.$ac_ext <<_ACEOF
1801 #line 1801 "configure"
1802 #include "confdefs.h"
1803 $ac_declaration
1804 int
1805 main ()
1806 {
1807 exit (42);
1808   ;
1809   return 0;
1810 }
1811 _ACEOF
1812 rm -f conftest.$ac_objext
1813 if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
1814   (eval $ac_compile) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit $ac_status); } &&
1818          { ac_try='test -s conftest.$ac_objext'
1819   { (eval echo "$as_me:1819: \"$ac_try\"") >&5
1820   (eval $ac_try) 2>&5
1821   ac_status=$?
1822   echo "$as_me:1822: \$? = $ac_status" >&5
1823   (exit $ac_status); }; }; then
1824   break
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat conftest.$ac_ext >&5
1828 fi
1829 rm -f conftest.$ac_objext conftest.$ac_ext
1830 done
1831 rm -rf conftest*
1832 if test -n "$ac_declaration"; then
1833   echo '#ifdef __cplusplus' >>confdefs.h
1834   echo $ac_declaration      >>confdefs.h
1835   echo '#endif'             >>confdefs.h
1836 fi
1837
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat conftest.$ac_ext >&5
1841 fi
1842 rm -f conftest.$ac_objext conftest.$ac_ext
1843 ac_ext=c
1844 ac_cpp='$CPP $CPPFLAGS'
1845 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1846 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1848 ac_main_return=return
1849
1850 ac_ext=c
1851 ac_cpp='$CPP $CPPFLAGS'
1852 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1853 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1854 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1855 ac_main_return=return
1856 echo "$as_me:1856: checking how to run the C preprocessor" >&5
1857 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1858 # On Suns, sometimes $CPP names a directory.
1859 if test -n "$CPP" && test -d "$CPP"; then
1860   CPP=
1861 fi
1862 if test -z "$CPP"; then
1863   if test "${ac_cv_prog_CPP+set}" = set; then
1864   echo $ECHO_N "(cached) $ECHO_C" >&6
1865 else
1866       # Double quotes because CPP needs to be expanded
1867     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1868     do
1869       ac_preproc_ok=false
1870 for ac_c_preproc_warn_flag in '' yes
1871 do
1872   # Use a header file that comes with gcc, so configuring glibc
1873   # with a fresh cross-compiler works.
1874   # On the NeXT, cc -E runs the code through the compiler's parser,
1875   # not just through cpp. "Syntax error" is here to catch this case.
1876   cat >conftest.$ac_ext <<_ACEOF
1877 #line 1877 "configure"
1878 #include "confdefs.h"
1879 #include <assert.h>
1880                      Syntax error
1881 _ACEOF
1882 if { (eval echo "$as_me:1882: \"$ac_cpp conftest.$ac_ext\"") >&5
1883   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1884   ac_status=$?
1885   egrep -v '^ *\+' conftest.er1 >conftest.err
1886   rm -f conftest.er1
1887   cat conftest.err >&5
1888   echo "$as_me:1888: \$? = $ac_status" >&5
1889   (exit $ac_status); } >/dev/null; then
1890   if test -s conftest.err; then
1891     ac_cpp_err=$ac_c_preproc_warn_flag
1892   else
1893     ac_cpp_err=
1894   fi
1895 else
1896   ac_cpp_err=yes
1897 fi
1898 if test -z "$ac_cpp_err"; then
1899   :
1900 else
1901   echo "$as_me: failed program was:" >&5
1902   cat conftest.$ac_ext >&5
1903   # Broken: fails on valid input.
1904 continue
1905 fi
1906 rm -f conftest.err conftest.$ac_ext
1907
1908   # OK, works on sane cases.  Now check whether non-existent headers
1909   # can be detected and how.
1910   cat >conftest.$ac_ext <<_ACEOF
1911 #line 1911 "configure"
1912 #include "confdefs.h"
1913 #include <ac_nonexistent.h>
1914 _ACEOF
1915 if { (eval echo "$as_me:1915: \"$ac_cpp conftest.$ac_ext\"") >&5
1916   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1917   ac_status=$?
1918   egrep -v '^ *\+' conftest.er1 >conftest.err
1919   rm -f conftest.er1
1920   cat conftest.err >&5
1921   echo "$as_me:1921: \$? = $ac_status" >&5
1922   (exit $ac_status); } >/dev/null; then
1923   if test -s conftest.err; then
1924     ac_cpp_err=$ac_c_preproc_warn_flag
1925   else
1926     ac_cpp_err=
1927   fi
1928 else
1929   ac_cpp_err=yes
1930 fi
1931 if test -z "$ac_cpp_err"; then
1932   # Broken: success on invalid input.
1933 continue
1934 else
1935   echo "$as_me: failed program was:" >&5
1936   cat conftest.$ac_ext >&5
1937   # Passes both tests.
1938 ac_preproc_ok=:
1939 break
1940 fi
1941 rm -f conftest.err conftest.$ac_ext
1942
1943 done
1944 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1945 rm -f conftest.err conftest.$ac_ext
1946 if $ac_preproc_ok; then
1947   break
1948 fi
1949
1950     done
1951     ac_cv_prog_CPP=$CPP
1952
1953 fi
1954   CPP=$ac_cv_prog_CPP
1955 else
1956   ac_cv_prog_CPP=$CPP
1957 fi
1958 echo "$as_me:1958: result: $CPP" >&5
1959 echo "${ECHO_T}$CPP" >&6
1960 ac_preproc_ok=false
1961 for ac_c_preproc_warn_flag in '' yes
1962 do
1963   # Use a header file that comes with gcc, so configuring glibc
1964   # with a fresh cross-compiler works.
1965   # On the NeXT, cc -E runs the code through the compiler's parser,
1966   # not just through cpp. "Syntax error" is here to catch this case.
1967   cat >conftest.$ac_ext <<_ACEOF
1968 #line 1968 "configure"
1969 #include "confdefs.h"
1970 #include <assert.h>
1971                      Syntax error
1972 _ACEOF
1973 if { (eval echo "$as_me:1973: \"$ac_cpp conftest.$ac_ext\"") >&5
1974   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1975   ac_status=$?
1976   egrep -v '^ *\+' conftest.er1 >conftest.err
1977   rm -f conftest.er1
1978   cat conftest.err >&5
1979   echo "$as_me:1979: \$? = $ac_status" >&5
1980   (exit $ac_status); } >/dev/null; then
1981   if test -s conftest.err; then
1982     ac_cpp_err=$ac_c_preproc_warn_flag
1983   else
1984     ac_cpp_err=
1985   fi
1986 else
1987   ac_cpp_err=yes
1988 fi
1989 if test -z "$ac_cpp_err"; then
1990   :
1991 else
1992   echo "$as_me: failed program was:" >&5
1993   cat conftest.$ac_ext >&5
1994   # Broken: fails on valid input.
1995 continue
1996 fi
1997 rm -f conftest.err conftest.$ac_ext
1998
1999   # OK, works on sane cases.  Now check whether non-existent headers
2000   # can be detected and how.
2001   cat >conftest.$ac_ext <<_ACEOF
2002 #line 2002 "configure"
2003 #include "confdefs.h"
2004 #include <ac_nonexistent.h>
2005 _ACEOF
2006 if { (eval echo "$as_me:2006: \"$ac_cpp conftest.$ac_ext\"") >&5
2007   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2008   ac_status=$?
2009   egrep -v '^ *\+' conftest.er1 >conftest.err
2010   rm -f conftest.er1
2011   cat conftest.err >&5
2012   echo "$as_me:2012: \$? = $ac_status" >&5
2013   (exit $ac_status); } >/dev/null; then
2014   if test -s conftest.err; then
2015     ac_cpp_err=$ac_c_preproc_warn_flag
2016   else
2017     ac_cpp_err=
2018   fi
2019 else
2020   ac_cpp_err=yes
2021 fi
2022 if test -z "$ac_cpp_err"; then
2023   # Broken: success on invalid input.
2024 continue
2025 else
2026   echo "$as_me: failed program was:" >&5
2027   cat conftest.$ac_ext >&5
2028   # Passes both tests.
2029 ac_preproc_ok=:
2030 break
2031 fi
2032 rm -f conftest.err conftest.$ac_ext
2033
2034 done
2035 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2036 rm -f conftest.err conftest.$ac_ext
2037 if $ac_preproc_ok; then
2038   :
2039 else
2040   { { echo "$as_me:2040: error: C preprocessor \"$CPP\" fails sanity check" >&5
2041 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2042    { (exit 1); exit 1; }; }
2043 fi
2044
2045 ac_ext=c
2046 ac_cpp='$CPP $CPPFLAGS'
2047 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2048 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2049 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2050 ac_main_return=return
2051
2052 for ac_prog in mawk gawk nawk awk
2053 do
2054   # Extract the first word of "$ac_prog", so it can be a program name with args.
2055 set dummy $ac_prog; ac_word=$2
2056 echo "$as_me:2056: checking for $ac_word" >&5
2057 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2058 if test "${ac_cv_prog_AWK+set}" = set; then
2059   echo $ECHO_N "(cached) $ECHO_C" >&6
2060 else
2061   if test -n "$AWK"; then
2062   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2063 else
2064   ac_save_IFS=$IFS; IFS=$ac_path_separator
2065 ac_dummy="$PATH"
2066 for ac_dir in $ac_dummy; do
2067   IFS=$ac_save_IFS
2068   test -z "$ac_dir" && ac_dir=.
2069   $as_executable_p "$ac_dir/$ac_word" || continue
2070 ac_cv_prog_AWK="$ac_prog"
2071 echo "$as_me:2071: found $ac_dir/$ac_word" >&5
2072 break
2073 done
2074
2075 fi
2076 fi
2077 AWK=$ac_cv_prog_AWK
2078 if test -n "$AWK"; then
2079   echo "$as_me:2079: result: $AWK" >&5
2080 echo "${ECHO_T}$AWK" >&6
2081 else
2082   echo "$as_me:2082: result: no" >&5
2083 echo "${ECHO_T}no" >&6
2084 fi
2085
2086   test -n "$AWK" && break
2087 done
2088
2089 # Find a good install program.  We prefer a C program (faster),
2090 # so one script is as good as another.  But avoid the broken or
2091 # incompatible versions:
2092 # SysV /etc/install, /usr/sbin/install
2093 # SunOS /usr/etc/install
2094 # IRIX /sbin/install
2095 # AIX /bin/install
2096 # AmigaOS /C/install, which installs bootblocks on floppy discs
2097 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2098 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2099 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2100 # ./install, which can be erroneously created by make from ./install.sh.
2101 echo "$as_me:2101: checking for a BSD compatible install" >&5
2102 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2103 if test -z "$INSTALL"; then
2104 if test "${ac_cv_path_install+set}" = set; then
2105   echo $ECHO_N "(cached) $ECHO_C" >&6
2106 else
2107     ac_save_IFS=$IFS; IFS=$ac_path_separator
2108   for ac_dir in $PATH; do
2109     IFS=$ac_save_IFS
2110     # Account for people who put trailing slashes in PATH elements.
2111     case $ac_dir/ in
2112     / | ./ | .// | /cC/* \
2113     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2114     | /usr/ucb/* ) ;;
2115     *)
2116       # OSF1 and SCO ODT 3.0 have their own names for install.
2117       # Don't use installbsd from OSF since it installs stuff as root
2118       # by default.
2119       for ac_prog in ginstall scoinst install; do
2120         if $as_executable_p "$ac_dir/$ac_prog"; then
2121           if test $ac_prog = install &&
2122             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2123             # AIX install.  It has an incompatible calling convention.
2124             :
2125           elif test $ac_prog = install &&
2126             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2127             # program-specific install script used by HP pwplus--don't use.
2128             :
2129           else
2130             ac_cv_path_install="$ac_dir/$ac_prog -c"
2131             break 2
2132           fi
2133         fi
2134       done
2135       ;;
2136     esac
2137   done
2138
2139 fi
2140   if test "${ac_cv_path_install+set}" = set; then
2141     INSTALL=$ac_cv_path_install
2142   else
2143     # As a last resort, use the slow shell script.  We don't cache a
2144     # path for INSTALL within a source directory, because that will
2145     # break other packages using the cache if that directory is
2146     # removed, or if the path is relative.
2147     INSTALL=$ac_install_sh
2148   fi
2149 fi
2150 echo "$as_me:2150: result: $INSTALL" >&5
2151 echo "${ECHO_T}$INSTALL" >&6
2152
2153 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2154 # It thinks the first close brace ends the variable substitution.
2155 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2156
2157 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2158
2159 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2160
2161 case $INSTALL in
2162 /*)
2163   ;;
2164 *)
2165   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2166   test -z "$cf_dir" && cf_dir=.
2167   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2168   ;;
2169 esac
2170
2171 for ac_prog in tdlint lint alint splint lclint
2172 do
2173   # Extract the first word of "$ac_prog", so it can be a program name with args.
2174 set dummy $ac_prog; ac_word=$2
2175 echo "$as_me:2175: checking for $ac_word" >&5
2176 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2177 if test "${ac_cv_prog_LINT+set}" = set; then
2178   echo $ECHO_N "(cached) $ECHO_C" >&6
2179 else
2180   if test -n "$LINT"; then
2181   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2182 else
2183   ac_save_IFS=$IFS; IFS=$ac_path_separator
2184 ac_dummy="$PATH"
2185 for ac_dir in $ac_dummy; do
2186   IFS=$ac_save_IFS
2187   test -z "$ac_dir" && ac_dir=.
2188   $as_executable_p "$ac_dir/$ac_word" || continue
2189 ac_cv_prog_LINT="$ac_prog"
2190 echo "$as_me:2190: found $ac_dir/$ac_word" >&5
2191 break
2192 done
2193
2194 fi
2195 fi
2196 LINT=$ac_cv_prog_LINT
2197 if test -n "$LINT"; then
2198   echo "$as_me:2198: result: $LINT" >&5
2199 echo "${ECHO_T}$LINT" >&6
2200 else
2201   echo "$as_me:2201: result: no" >&5
2202 echo "${ECHO_T}no" >&6
2203 fi
2204
2205   test -n "$LINT" && break
2206 done
2207
2208 echo "$as_me:2208: checking if filesystem supports mixed-case filenames" >&5
2209 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2210 if test "${cf_cv_mixedcase+set}" = set; then
2211   echo $ECHO_N "(cached) $ECHO_C" >&6
2212 else
2213
2214 if test "$cross_compiling" = yes ; then
2215         case $target_alias in #(vi
2216         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2217                 cf_cv_mixedcase=no
2218                 ;;
2219         *)
2220                 cf_cv_mixedcase=yes
2221                 ;;
2222         esac
2223 else
2224         rm -f conftest CONFTEST
2225         echo test >conftest
2226         if test -f CONFTEST ; then
2227                 cf_cv_mixedcase=no
2228         else
2229                 cf_cv_mixedcase=yes
2230         fi
2231         rm -f conftest CONFTEST
2232 fi
2233
2234 fi
2235 echo "$as_me:2235: result: $cf_cv_mixedcase" >&5
2236 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2237 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2238 #define MIXEDCASE_FILENAMES 1
2239 EOF
2240
2241 for ac_prog in exctags ctags
2242 do
2243   # Extract the first word of "$ac_prog", so it can be a program name with args.
2244 set dummy $ac_prog; ac_word=$2
2245 echo "$as_me:2245: checking for $ac_word" >&5
2246 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2247 if test "${ac_cv_prog_CTAGS+set}" = set; then
2248   echo $ECHO_N "(cached) $ECHO_C" >&6
2249 else
2250   if test -n "$CTAGS"; then
2251   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2252 else
2253   ac_save_IFS=$IFS; IFS=$ac_path_separator
2254 ac_dummy="$PATH"
2255 for ac_dir in $ac_dummy; do
2256   IFS=$ac_save_IFS
2257   test -z "$ac_dir" && ac_dir=.
2258   $as_executable_p "$ac_dir/$ac_word" || continue
2259 ac_cv_prog_CTAGS="$ac_prog"
2260 echo "$as_me:2260: found $ac_dir/$ac_word" >&5
2261 break
2262 done
2263
2264 fi
2265 fi
2266 CTAGS=$ac_cv_prog_CTAGS
2267 if test -n "$CTAGS"; then
2268   echo "$as_me:2268: result: $CTAGS" >&5
2269 echo "${ECHO_T}$CTAGS" >&6
2270 else
2271   echo "$as_me:2271: result: no" >&5
2272 echo "${ECHO_T}no" >&6
2273 fi
2274
2275   test -n "$CTAGS" && break
2276 done
2277
2278 for ac_prog in exetags etags
2279 do
2280   # Extract the first word of "$ac_prog", so it can be a program name with args.
2281 set dummy $ac_prog; ac_word=$2
2282 echo "$as_me:2282: checking for $ac_word" >&5
2283 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2284 if test "${ac_cv_prog_ETAGS+set}" = set; then
2285   echo $ECHO_N "(cached) $ECHO_C" >&6
2286 else
2287   if test -n "$ETAGS"; then
2288   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2289 else
2290   ac_save_IFS=$IFS; IFS=$ac_path_separator
2291 ac_dummy="$PATH"
2292 for ac_dir in $ac_dummy; do
2293   IFS=$ac_save_IFS
2294   test -z "$ac_dir" && ac_dir=.
2295   $as_executable_p "$ac_dir/$ac_word" || continue
2296 ac_cv_prog_ETAGS="$ac_prog"
2297 echo "$as_me:2297: found $ac_dir/$ac_word" >&5
2298 break
2299 done
2300
2301 fi
2302 fi
2303 ETAGS=$ac_cv_prog_ETAGS
2304 if test -n "$ETAGS"; then
2305   echo "$as_me:2305: result: $ETAGS" >&5
2306 echo "${ECHO_T}$ETAGS" >&6
2307 else
2308   echo "$as_me:2308: result: no" >&5
2309 echo "${ECHO_T}no" >&6
2310 fi
2311
2312   test -n "$ETAGS" && break
2313 done
2314
2315 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2316 set dummy ${CTAGS:-ctags}; ac_word=$2
2317 echo "$as_me:2317: checking for $ac_word" >&5
2318 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2319 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2320   echo $ECHO_N "(cached) $ECHO_C" >&6
2321 else
2322   if test -n "$MAKE_LOWER_TAGS"; then
2323   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2324 else
2325   ac_save_IFS=$IFS; IFS=$ac_path_separator
2326 ac_dummy="$PATH"
2327 for ac_dir in $ac_dummy; do
2328   IFS=$ac_save_IFS
2329   test -z "$ac_dir" && ac_dir=.
2330   $as_executable_p "$ac_dir/$ac_word" || continue
2331 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2332 echo "$as_me:2332: found $ac_dir/$ac_word" >&5
2333 break
2334 done
2335
2336   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2337 fi
2338 fi
2339 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2340 if test -n "$MAKE_LOWER_TAGS"; then
2341   echo "$as_me:2341: result: $MAKE_LOWER_TAGS" >&5
2342 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2343 else
2344   echo "$as_me:2344: result: no" >&5
2345 echo "${ECHO_T}no" >&6
2346 fi
2347
2348 if test "$cf_cv_mixedcase" = yes ; then
2349         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2350 set dummy ${ETAGS:-etags}; ac_word=$2
2351 echo "$as_me:2351: checking for $ac_word" >&5
2352 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2353 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2354   echo $ECHO_N "(cached) $ECHO_C" >&6
2355 else
2356   if test -n "$MAKE_UPPER_TAGS"; then
2357   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2358 else
2359   ac_save_IFS=$IFS; IFS=$ac_path_separator
2360 ac_dummy="$PATH"
2361 for ac_dir in $ac_dummy; do
2362   IFS=$ac_save_IFS
2363   test -z "$ac_dir" && ac_dir=.
2364   $as_executable_p "$ac_dir/$ac_word" || continue
2365 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2366 echo "$as_me:2366: found $ac_dir/$ac_word" >&5
2367 break
2368 done
2369
2370   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2371 fi
2372 fi
2373 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2374 if test -n "$MAKE_UPPER_TAGS"; then
2375   echo "$as_me:2375: result: $MAKE_UPPER_TAGS" >&5
2376 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2377 else
2378   echo "$as_me:2378: result: no" >&5
2379 echo "${ECHO_T}no" >&6
2380 fi
2381
2382 else
2383         MAKE_UPPER_TAGS=no
2384 fi
2385
2386 if test "$MAKE_UPPER_TAGS" = yes ; then
2387         MAKE_UPPER_TAGS=
2388 else
2389         MAKE_UPPER_TAGS="#"
2390 fi
2391
2392 if test "$MAKE_LOWER_TAGS" = yes ; then
2393         MAKE_LOWER_TAGS=
2394 else
2395         MAKE_LOWER_TAGS="#"
2396 fi
2397
2398 echo "$as_me:2398: checking if -lm needed for math functions" >&5
2399 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2400 if test "${cf_cv_need_libm+set}" = set; then
2401   echo $ECHO_N "(cached) $ECHO_C" >&6
2402 else
2403
2404         cat >conftest.$ac_ext <<_ACEOF
2405 #line 2405 "configure"
2406 #include "confdefs.h"
2407
2408         #include <stdio.h>
2409         #include <math.h>
2410
2411 int
2412 main ()
2413 {
2414 double x = rand(); printf("result = %g\n", sin(x))
2415   ;
2416   return 0;
2417 }
2418 _ACEOF
2419 rm -f conftest.$ac_objext conftest$ac_exeext
2420 if { (eval echo "$as_me:2420: \"$ac_link\"") >&5
2421   (eval $ac_link) 2>&5
2422   ac_status=$?
2423   echo "$as_me:2423: \$? = $ac_status" >&5
2424   (exit $ac_status); } &&
2425          { ac_try='test -s conftest$ac_exeext'
2426   { (eval echo "$as_me:2426: \"$ac_try\"") >&5
2427   (eval $ac_try) 2>&5
2428   ac_status=$?
2429   echo "$as_me:2429: \$? = $ac_status" >&5
2430   (exit $ac_status); }; }; then
2431   cf_cv_need_libm=no
2432 else
2433   echo "$as_me: failed program was:" >&5
2434 cat conftest.$ac_ext >&5
2435 cf_cv_need_libm=yes
2436 fi
2437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2438 fi
2439 echo "$as_me:2439: result: $cf_cv_need_libm" >&5
2440 echo "${ECHO_T}$cf_cv_need_libm" >&6
2441 if test "$cf_cv_need_libm" = yes
2442 then
2443 MATH_LIB=-lm
2444 fi
2445
2446 CC_G_OPT="-g"
2447 CC_SHARED_OPTS=unknown
2448 CPPFLAGS="$CPPFLAGS"
2449 DFT_DEP_SUFFIX=""
2450 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2451 DFT_UPR_MODEL="NORMAL"
2452 LD="ld"
2453 LDFLAGS_SHARED=""
2454 LDFLAGS_STATIC=""
2455 LD_MODEL=""
2456 LD_SHARED_OPTS=""
2457 LIBTOOL=""
2458 LIB_CLEAN=""
2459 LIB_COMPILE=""
2460 LIB_LINK='${CC}'
2461 LINK_TESTS=""
2462 LOCAL_LDFLAGS=""
2463 PTHREAD="-lm"
2464 TEST_ARGS=""
2465 TEST_DEPS=""
2466 TEST_LIBS=""
2467 TINFO_ARGS='$(LIBS_CURSES)'
2468 cf_cv_abi_version=""
2469 cf_cv_rel_version=""
2470
2471 cf_cv_screen=curses
2472 cf_cv_libtype=
2473
2474 echo "$as_me:2474: checking for ${CC:-cc} option to accept ANSI C" >&5
2475 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
2476 if test "${cf_cv_ansi_cc+set}" = set; then
2477   echo $ECHO_N "(cached) $ECHO_C" >&6
2478 else
2479
2480 cf_cv_ansi_cc=no
2481 cf_save_CFLAGS="$CFLAGS"
2482 cf_save_CPPFLAGS="$CPPFLAGS"
2483 # Don't try gcc -ansi; that turns off useful extensions and
2484 # breaks some systems' header files.
2485 # AIX                   -qlanglvl=ansi
2486 # Ultrix and OSF/1      -std1
2487 # HP-UX                 -Aa -D_HPUX_SOURCE
2488 # SVR4                  -Xc
2489 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2490 for cf_arg in "-DCC_HAS_PROTOS" \
2491         "" \
2492         -qlanglvl=ansi \
2493         -std1 \
2494         -Ae \
2495         "-Aa -D_HPUX_SOURCE" \
2496         -Xc
2497 do
2498
2499 cf_fix_cppflags=no
2500 cf_new_cflags=
2501 cf_new_cppflags=
2502 cf_new_extra_cppflags=
2503
2504 for cf_add_cflags in $cf_arg
2505 do
2506 case $cf_fix_cppflags in
2507 no)
2508         case $cf_add_cflags in #(vi
2509         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2510                 case $cf_add_cflags in
2511                 -D*)
2512                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2513
2514                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2515                                 && test -z "${cf_tst_cflags}" \
2516                                 && cf_fix_cppflags=yes
2517
2518                         if test $cf_fix_cppflags = yes ; then
2519                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2520                                 continue
2521                         elif test "${cf_tst_cflags}" = "\"'" ; then
2522                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2523                                 continue
2524                         fi
2525                         ;;
2526                 esac
2527                 case "$CPPFLAGS" in
2528                 *$cf_add_cflags) #(vi
2529                         ;;
2530                 *) #(vi
2531                         case $cf_add_cflags in #(vi
2532                         -D*)
2533                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2534
2535 CPPFLAGS=`echo "$CPPFLAGS" | \
2536         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2537                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2538
2539                                 ;;
2540                         esac
2541                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2542                         ;;
2543                 esac
2544                 ;;
2545         *)
2546                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2547                 ;;
2548         esac
2549         ;;
2550 yes)
2551         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2552
2553         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2554
2555         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2556                 && test -z "${cf_tst_cflags}" \
2557                 && cf_fix_cppflags=no
2558         ;;
2559 esac
2560 done
2561
2562 if test -n "$cf_new_cflags" ; then
2563
2564         CFLAGS="$CFLAGS $cf_new_cflags"
2565 fi
2566
2567 if test -n "$cf_new_cppflags" ; then
2568
2569         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2570 fi
2571
2572 if test -n "$cf_new_extra_cppflags" ; then
2573
2574         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2575 fi
2576
2577         cat >conftest.$ac_ext <<_ACEOF
2578 #line 2578 "configure"
2579 #include "confdefs.h"
2580
2581 #ifndef CC_HAS_PROTOS
2582 #if !defined(__STDC__) || (__STDC__ != 1)
2583 choke me
2584 #endif
2585 #endif
2586
2587 int
2588 main ()
2589 {
2590
2591         int test (int i, double x);
2592         struct s1 {int (*f) (int a);};
2593         struct s2 {int (*f) (double a);};
2594   ;
2595   return 0;
2596 }
2597 _ACEOF
2598 rm -f conftest.$ac_objext
2599 if { (eval echo "$as_me:2599: \"$ac_compile\"") >&5
2600   (eval $ac_compile) 2>&5
2601   ac_status=$?
2602   echo "$as_me:2602: \$? = $ac_status" >&5
2603   (exit $ac_status); } &&
2604          { ac_try='test -s conftest.$ac_objext'
2605   { (eval echo "$as_me:2605: \"$ac_try\"") >&5
2606   (eval $ac_try) 2>&5
2607   ac_status=$?
2608   echo "$as_me:2608: \$? = $ac_status" >&5
2609   (exit $ac_status); }; }; then
2610   cf_cv_ansi_cc="$cf_arg"; break
2611 else
2612   echo "$as_me: failed program was:" >&5
2613 cat conftest.$ac_ext >&5
2614 fi
2615 rm -f conftest.$ac_objext conftest.$ac_ext
2616 done
2617 CFLAGS="$cf_save_CFLAGS"
2618 CPPFLAGS="$cf_save_CPPFLAGS"
2619
2620 fi
2621 echo "$as_me:2621: result: $cf_cv_ansi_cc" >&5
2622 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2623
2624 if test "$cf_cv_ansi_cc" != "no"; then
2625 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2626
2627 cf_fix_cppflags=no
2628 cf_new_cflags=
2629 cf_new_cppflags=
2630 cf_new_extra_cppflags=
2631
2632 for cf_add_cflags in $cf_cv_ansi_cc
2633 do
2634 case $cf_fix_cppflags in
2635 no)
2636         case $cf_add_cflags in #(vi
2637         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2638                 case $cf_add_cflags in
2639                 -D*)
2640                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2641
2642                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2643                                 && test -z "${cf_tst_cflags}" \
2644                                 && cf_fix_cppflags=yes
2645
2646                         if test $cf_fix_cppflags = yes ; then
2647                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2648                                 continue
2649                         elif test "${cf_tst_cflags}" = "\"'" ; then
2650                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2651                                 continue
2652                         fi
2653                         ;;
2654                 esac
2655                 case "$CPPFLAGS" in
2656                 *$cf_add_cflags) #(vi
2657                         ;;
2658                 *) #(vi
2659                         case $cf_add_cflags in #(vi
2660                         -D*)
2661                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2662
2663 CPPFLAGS=`echo "$CPPFLAGS" | \
2664         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2665                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2666
2667                                 ;;
2668                         esac
2669                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2670                         ;;
2671                 esac
2672                 ;;
2673         *)
2674                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2675                 ;;
2676         esac
2677         ;;
2678 yes)
2679         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2680
2681         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2682
2683         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2684                 && test -z "${cf_tst_cflags}" \
2685                 && cf_fix_cppflags=no
2686         ;;
2687 esac
2688 done
2689
2690 if test -n "$cf_new_cflags" ; then
2691
2692         CFLAGS="$CFLAGS $cf_new_cflags"
2693 fi
2694
2695 if test -n "$cf_new_cppflags" ; then
2696
2697         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2698 fi
2699
2700 if test -n "$cf_new_extra_cppflags" ; then
2701
2702         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2703 fi
2704
2705 else
2706         cat >>confdefs.h <<\EOF
2707 #define CC_HAS_PROTOS 1
2708 EOF
2709
2710 fi
2711 fi
2712
2713 if test "$cf_cv_ansi_cc" = "no"; then
2714         { { echo "$as_me:2714: error: Your compiler does not appear to recognize prototypes.
2715 You have the following choices:
2716         a. adjust your compiler options
2717         b. get an up-to-date compiler
2718         c. use a wrapper such as unproto" >&5
2719 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2720 You have the following choices:
2721         a. adjust your compiler options
2722         b. get an up-to-date compiler
2723         c. use a wrapper such as unproto" >&2;}
2724    { (exit 1); exit 1; }; }
2725 fi
2726
2727 if test "$GCC" = yes
2728 then
2729 cat > conftest.i <<EOF
2730 #ifndef GCC_PRINTF
2731 #define GCC_PRINTF 0
2732 #endif
2733 #ifndef GCC_SCANF
2734 #define GCC_SCANF 0
2735 #endif
2736 #ifndef GCC_NORETURN
2737 #define GCC_NORETURN /* nothing */
2738 #endif
2739 #ifndef GCC_UNUSED
2740 #define GCC_UNUSED /* nothing */
2741 #endif
2742 EOF
2743 if test "$GCC" = yes
2744 then
2745         { echo "$as_me:2745: checking for $CC __attribute__ directives..." >&5
2746 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2747 cat > conftest.$ac_ext <<EOF
2748 #line 2748 "${as_me:-configure}"
2749 #include "confdefs.h"
2750 #include "conftest.h"
2751 #include "conftest.i"
2752 #if     GCC_PRINTF
2753 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2754 #else
2755 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2756 #endif
2757 #if     GCC_SCANF
2758 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2759 #else
2760 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2761 #endif
2762 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2763 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2764 extern void foo(void) GCC_NORETURN;
2765 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2766 EOF
2767         cf_printf_attribute=no
2768         cf_scanf_attribute=no
2769         for cf_attribute in scanf printf unused noreturn
2770         do
2771
2772 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2773
2774                 cf_directive="__attribute__(($cf_attribute))"
2775                 echo "checking for $CC $cf_directive" 1>&5
2776
2777                 case $cf_attribute in #(vi
2778                 printf) #(vi
2779                         cf_printf_attribute=yes
2780                         cat >conftest.h <<EOF
2781 #define GCC_$cf_ATTRIBUTE 1
2782 EOF
2783                         ;;
2784                 scanf) #(vi
2785                         cf_scanf_attribute=yes
2786                         cat >conftest.h <<EOF
2787 #define GCC_$cf_ATTRIBUTE 1
2788 EOF
2789                         ;;
2790                 *) #(vi
2791                         cat >conftest.h <<EOF
2792 #define GCC_$cf_ATTRIBUTE $cf_directive
2793 EOF
2794                         ;;
2795                 esac
2796
2797                 if { (eval echo "$as_me:2797: \"$ac_compile\"") >&5
2798   (eval $ac_compile) 2>&5
2799   ac_status=$?
2800   echo "$as_me:2800: \$? = $ac_status" >&5
2801   (exit $ac_status); }; then
2802                         test -n "$verbose" && echo "$as_me:2802: result: ... $cf_attribute" >&5
2803 echo "${ECHO_T}... $cf_attribute" >&6
2804                         cat conftest.h >>confdefs.h
2805                         case $cf_attribute in #(vi
2806                         printf) #(vi
2807                                 if test "$cf_printf_attribute" = no ; then
2808                                         cat >>confdefs.h <<EOF
2809 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
2810 EOF
2811                                 else
2812                                         cat >>confdefs.h <<EOF
2813 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2814 EOF
2815                                 fi
2816                                 ;;
2817                         scanf) #(vi
2818                                 if test "$cf_scanf_attribute" = no ; then
2819                                         cat >>confdefs.h <<EOF
2820 #define GCC_SCANFLIKE(fmt,var) /* nothing */
2821 EOF
2822                                 else
2823                                         cat >>confdefs.h <<EOF
2824 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2825 EOF
2826                                 fi
2827                                 ;;
2828                         esac
2829                 fi
2830         done
2831 else
2832         fgrep define conftest.i >>confdefs.h
2833 fi
2834 rm -rf conftest*
2835 fi
2836
2837 cf_XOPEN_SOURCE=500
2838 cf_POSIX_C_SOURCE=199506L
2839 cf_xopen_source=
2840
2841 case $host_os in #(vi
2842 aix[456]*) #(vi
2843         cf_xopen_source="-D_ALL_SOURCE"
2844         ;;
2845 darwin[0-8].*) #(vi
2846         cf_xopen_source="-D_APPLE_C_SOURCE"
2847         ;;
2848 darwin*) #(vi
2849         cf_xopen_source="-D_DARWIN_C_SOURCE"
2850         ;;
2851 freebsd*|dragonfly*) #(vi
2852         # 5.x headers associate
2853         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2854         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2855         cf_POSIX_C_SOURCE=200112L
2856         cf_XOPEN_SOURCE=600
2857         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2858         ;;
2859 hpux11*) #(vi
2860         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2861         ;;
2862 hpux*) #(vi
2863         cf_xopen_source="-D_HPUX_SOURCE"
2864         ;;
2865 irix[56].*) #(vi
2866         cf_xopen_source="-D_SGI_SOURCE"
2867         ;;
2868 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2869
2870 echo "$as_me:2870: checking if we must define _GNU_SOURCE" >&5
2871 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2872 if test "${cf_cv_gnu_source+set}" = set; then
2873   echo $ECHO_N "(cached) $ECHO_C" >&6
2874 else
2875
2876 cat >conftest.$ac_ext <<_ACEOF
2877 #line 2877 "configure"
2878 #include "confdefs.h"
2879 #include <sys/types.h>
2880 int
2881 main ()
2882 {
2883
2884 #ifndef _XOPEN_SOURCE
2885 make an error
2886 #endif
2887   ;
2888   return 0;
2889 }
2890 _ACEOF
2891 rm -f conftest.$ac_objext
2892 if { (eval echo "$as_me:2892: \"$ac_compile\"") >&5
2893   (eval $ac_compile) 2>&5
2894   ac_status=$?
2895   echo "$as_me:2895: \$? = $ac_status" >&5
2896   (exit $ac_status); } &&
2897          { ac_try='test -s conftest.$ac_objext'
2898   { (eval echo "$as_me:2898: \"$ac_try\"") >&5
2899   (eval $ac_try) 2>&5
2900   ac_status=$?
2901   echo "$as_me:2901: \$? = $ac_status" >&5
2902   (exit $ac_status); }; }; then
2903   cf_cv_gnu_source=no
2904 else
2905   echo "$as_me: failed program was:" >&5
2906 cat conftest.$ac_ext >&5
2907 cf_save="$CPPFLAGS"
2908          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2909          cat >conftest.$ac_ext <<_ACEOF
2910 #line 2910 "configure"
2911 #include "confdefs.h"
2912 #include <sys/types.h>
2913 int
2914 main ()
2915 {
2916
2917 #ifdef _XOPEN_SOURCE
2918 make an error
2919 #endif
2920   ;
2921   return 0;
2922 }
2923 _ACEOF
2924 rm -f conftest.$ac_objext
2925 if { (eval echo "$as_me:2925: \"$ac_compile\"") >&5
2926   (eval $ac_compile) 2>&5
2927   ac_status=$?
2928   echo "$as_me:2928: \$? = $ac_status" >&5
2929   (exit $ac_status); } &&
2930          { ac_try='test -s conftest.$ac_objext'
2931   { (eval echo "$as_me:2931: \"$ac_try\"") >&5
2932   (eval $ac_try) 2>&5
2933   ac_status=$?
2934   echo "$as_me:2934: \$? = $ac_status" >&5
2935   (exit $ac_status); }; }; then
2936   cf_cv_gnu_source=no
2937 else
2938   echo "$as_me: failed program was:" >&5
2939 cat conftest.$ac_ext >&5
2940 cf_cv_gnu_source=yes
2941 fi
2942 rm -f conftest.$ac_objext conftest.$ac_ext
2943         CPPFLAGS="$cf_save"
2944
2945 fi
2946 rm -f conftest.$ac_objext conftest.$ac_ext
2947
2948 fi
2949 echo "$as_me:2949: result: $cf_cv_gnu_source" >&5
2950 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2951 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2952
2953         ;;
2954 mirbsd*) #(vi
2955         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
2956         ;;
2957 netbsd*) #(vi
2958         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
2959         ;;
2960 openbsd*) #(vi
2961         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
2962         ;;
2963 osf[45]*) #(vi
2964         cf_xopen_source="-D_OSF_SOURCE"
2965         ;;
2966 nto-qnx*) #(vi
2967         cf_xopen_source="-D_QNX_SOURCE"
2968         ;;
2969 sco*) #(vi
2970         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
2971         ;;
2972 solaris2.1[0-9]) #(vi
2973         cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2974         ;;
2975 solaris2.[1-9]) #(vi
2976         cf_xopen_source="-D__EXTENSIONS__"
2977         ;;
2978 *)
2979         echo "$as_me:2979: checking if we should define _XOPEN_SOURCE" >&5
2980 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
2981 if test "${cf_cv_xopen_source+set}" = set; then
2982   echo $ECHO_N "(cached) $ECHO_C" >&6
2983 else
2984
2985         cat >conftest.$ac_ext <<_ACEOF
2986 #line 2986 "configure"
2987 #include "confdefs.h"
2988 #include <sys/types.h>
2989 int
2990 main ()
2991 {
2992
2993 #ifndef _XOPEN_SOURCE
2994 make an error
2995 #endif
2996   ;
2997   return 0;
2998 }
2999 _ACEOF
3000 rm -f conftest.$ac_objext
3001 if { (eval echo "$as_me:3001: \"$ac_compile\"") >&5
3002   (eval $ac_compile) 2>&5
3003   ac_status=$?
3004   echo "$as_me:3004: \$? = $ac_status" >&5
3005   (exit $ac_status); } &&
3006          { ac_try='test -s conftest.$ac_objext'
3007   { (eval echo "$as_me:3007: \"$ac_try\"") >&5
3008   (eval $ac_try) 2>&5
3009   ac_status=$?
3010   echo "$as_me:3010: \$? = $ac_status" >&5
3011   (exit $ac_status); }; }; then
3012   cf_cv_xopen_source=no
3013 else
3014   echo "$as_me: failed program was:" >&5
3015 cat conftest.$ac_ext >&5
3016 cf_save="$CPPFLAGS"
3017          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3018          cat >conftest.$ac_ext <<_ACEOF
3019 #line 3019 "configure"
3020 #include "confdefs.h"
3021 #include <sys/types.h>
3022 int
3023 main ()
3024 {
3025
3026 #ifdef _XOPEN_SOURCE
3027 make an error
3028 #endif
3029   ;
3030   return 0;
3031 }
3032 _ACEOF
3033 rm -f conftest.$ac_objext
3034 if { (eval echo "$as_me:3034: \"$ac_compile\"") >&5
3035   (eval $ac_compile) 2>&5
3036   ac_status=$?
3037   echo "$as_me:3037: \$? = $ac_status" >&5
3038   (exit $ac_status); } &&
3039          { ac_try='test -s conftest.$ac_objext'
3040   { (eval echo "$as_me:3040: \"$ac_try\"") >&5
3041   (eval $ac_try) 2>&5
3042   ac_status=$?
3043   echo "$as_me:3043: \$? = $ac_status" >&5
3044   (exit $ac_status); }; }; then
3045   cf_cv_xopen_source=no
3046 else
3047   echo "$as_me: failed program was:" >&5
3048 cat conftest.$ac_ext >&5
3049 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3050 fi
3051 rm -f conftest.$ac_objext conftest.$ac_ext
3052         CPPFLAGS="$cf_save"
3053
3054 fi
3055 rm -f conftest.$ac_objext conftest.$ac_ext
3056
3057 fi
3058 echo "$as_me:3058: result: $cf_cv_xopen_source" >&5
3059 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3060         if test "$cf_cv_xopen_source" != no ; then
3061
3062 CFLAGS=`echo "$CFLAGS" | \
3063         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3064                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3065
3066 CPPFLAGS=`echo "$CPPFLAGS" | \
3067         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3068                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3069
3070                 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3071
3072 cf_fix_cppflags=no
3073 cf_new_cflags=
3074 cf_new_cppflags=
3075 cf_new_extra_cppflags=
3076
3077 for cf_add_cflags in $cf_temp_xopen_source
3078 do
3079 case $cf_fix_cppflags in
3080 no)
3081         case $cf_add_cflags in #(vi
3082         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3083                 case $cf_add_cflags in
3084                 -D*)
3085                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3086
3087                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3088                                 && test -z "${cf_tst_cflags}" \
3089                                 && cf_fix_cppflags=yes
3090
3091                         if test $cf_fix_cppflags = yes ; then
3092                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3093                                 continue
3094                         elif test "${cf_tst_cflags}" = "\"'" ; then
3095                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3096                                 continue
3097                         fi
3098                         ;;
3099                 esac
3100                 case "$CPPFLAGS" in
3101                 *$cf_add_cflags) #(vi
3102                         ;;
3103                 *) #(vi
3104                         case $cf_add_cflags in #(vi
3105                         -D*)
3106                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3107
3108 CPPFLAGS=`echo "$CPPFLAGS" | \
3109         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3110                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3111
3112                                 ;;
3113                         esac
3114                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3115                         ;;
3116                 esac
3117                 ;;
3118         *)
3119                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3120                 ;;
3121         esac
3122         ;;
3123 yes)
3124         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3125
3126         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3127
3128         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3129                 && test -z "${cf_tst_cflags}" \
3130                 && cf_fix_cppflags=no
3131         ;;
3132 esac
3133 done
3134
3135 if test -n "$cf_new_cflags" ; then
3136
3137         CFLAGS="$CFLAGS $cf_new_cflags"
3138 fi
3139
3140 if test -n "$cf_new_cppflags" ; then
3141
3142         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3143 fi
3144
3145 if test -n "$cf_new_extra_cppflags" ; then
3146
3147         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3148 fi
3149
3150         fi
3151
3152 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3153
3154 cf_save_CFLAGS="$CFLAGS"
3155 cf_save_CPPFLAGS="$CPPFLAGS"
3156
3157 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3158         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3159                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3160
3161 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3162         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3163                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3164
3165 echo "$as_me:3165: checking if we should define _POSIX_C_SOURCE" >&5
3166 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3167 if test "${cf_cv_posix_c_source+set}" = set; then
3168   echo $ECHO_N "(cached) $ECHO_C" >&6
3169 else
3170
3171 echo "${as_me:-configure}:3171: testing if the symbol is already defined go no further ..." 1>&5
3172
3173         cat >conftest.$ac_ext <<_ACEOF
3174 #line 3174 "configure"
3175 #include "confdefs.h"
3176 #include <sys/types.h>
3177 int
3178 main ()
3179 {
3180
3181 #ifndef _POSIX_C_SOURCE
3182 make an error
3183 #endif
3184   ;
3185   return 0;
3186 }
3187 _ACEOF
3188 rm -f conftest.$ac_objext
3189 if { (eval echo "$as_me:3189: \"$ac_compile\"") >&5
3190   (eval $ac_compile) 2>&5
3191   ac_status=$?
3192   echo "$as_me:3192: \$? = $ac_status" >&5
3193   (exit $ac_status); } &&
3194          { ac_try='test -s conftest.$ac_objext'
3195   { (eval echo "$as_me:3195: \"$ac_try\"") >&5
3196   (eval $ac_try) 2>&5
3197   ac_status=$?
3198   echo "$as_me:3198: \$? = $ac_status" >&5
3199   (exit $ac_status); }; }; then
3200   cf_cv_posix_c_source=no
3201 else
3202   echo "$as_me: failed program was:" >&5
3203 cat conftest.$ac_ext >&5
3204 cf_want_posix_source=no
3205          case .$cf_POSIX_C_SOURCE in #(vi
3206          .[12]??*) #(vi
3207                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3208                 ;;
3209          .2) #(vi
3210                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3211                 cf_want_posix_source=yes
3212                 ;;
3213          .*)
3214                 cf_want_posix_source=yes
3215                 ;;
3216          esac
3217          if test "$cf_want_posix_source" = yes ; then
3218                 cat >conftest.$ac_ext <<_ACEOF
3219 #line 3219 "configure"
3220 #include "confdefs.h"
3221 #include <sys/types.h>
3222 int
3223 main ()
3224 {
3225
3226 #ifdef _POSIX_SOURCE
3227 make an error
3228 #endif
3229   ;
3230   return 0;
3231 }
3232 _ACEOF
3233 rm -f conftest.$ac_objext
3234 if { (eval echo "$as_me:3234: \"$ac_compile\"") >&5
3235   (eval $ac_compile) 2>&5
3236   ac_status=$?
3237   echo "$as_me:3237: \$? = $ac_status" >&5
3238   (exit $ac_status); } &&
3239          { ac_try='test -s conftest.$ac_objext'
3240   { (eval echo "$as_me:3240: \"$ac_try\"") >&5
3241   (eval $ac_try) 2>&5
3242   ac_status=$?
3243   echo "$as_me:3243: \$? = $ac_status" >&5
3244   (exit $ac_status); }; }; then
3245   :
3246 else
3247   echo "$as_me: failed program was:" >&5
3248 cat conftest.$ac_ext >&5
3249 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3250 fi
3251 rm -f conftest.$ac_objext conftest.$ac_ext
3252          fi
3253
3254 echo "${as_me:-configure}:3254: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3255
3256          CFLAGS="$cf_trim_CFLAGS"
3257          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3258
3259 echo "${as_me:-configure}:3259: testing if the second compile does not leave our definition intact error ..." 1>&5
3260
3261          cat >conftest.$ac_ext <<_ACEOF
3262 #line 3262 "configure"
3263 #include "confdefs.h"
3264 #include <sys/types.h>
3265 int
3266 main ()
3267 {
3268
3269 #ifndef _POSIX_C_SOURCE
3270 make an error
3271 #endif
3272   ;
3273   return 0;
3274 }
3275 _ACEOF
3276 rm -f conftest.$ac_objext
3277 if { (eval echo "$as_me:3277: \"$ac_compile\"") >&5
3278   (eval $ac_compile) 2>&5
3279   ac_status=$?
3280   echo "$as_me:3280: \$? = $ac_status" >&5
3281   (exit $ac_status); } &&
3282          { ac_try='test -s conftest.$ac_objext'
3283   { (eval echo "$as_me:3283: \"$ac_try\"") >&5
3284   (eval $ac_try) 2>&5
3285   ac_status=$?
3286   echo "$as_me:3286: \$? = $ac_status" >&5
3287   (exit $ac_status); }; }; then
3288   :
3289 else
3290   echo "$as_me: failed program was:" >&5
3291 cat conftest.$ac_ext >&5
3292 cf_cv_posix_c_source=no
3293 fi
3294 rm -f conftest.$ac_objext conftest.$ac_ext
3295          CFLAGS="$cf_save_CFLAGS"
3296          CPPFLAGS="$cf_save_CPPFLAGS"
3297
3298 fi
3299 rm -f conftest.$ac_objext conftest.$ac_ext
3300
3301 fi
3302 echo "$as_me:3302: result: $cf_cv_posix_c_source" >&5
3303 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3304
3305 if test "$cf_cv_posix_c_source" != no ; then
3306         CFLAGS="$cf_trim_CFLAGS"
3307         CPPFLAGS="$cf_trim_CPPFLAGS"
3308
3309 cf_fix_cppflags=no
3310 cf_new_cflags=
3311 cf_new_cppflags=
3312 cf_new_extra_cppflags=
3313
3314 for cf_add_cflags in $cf_cv_posix_c_source
3315 do
3316 case $cf_fix_cppflags in
3317 no)
3318         case $cf_add_cflags in #(vi
3319         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3320                 case $cf_add_cflags in
3321                 -D*)
3322                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3323
3324                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3325                                 && test -z "${cf_tst_cflags}" \
3326                                 && cf_fix_cppflags=yes
3327
3328                         if test $cf_fix_cppflags = yes ; then
3329                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3330                                 continue
3331                         elif test "${cf_tst_cflags}" = "\"'" ; then
3332                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3333                                 continue
3334                         fi
3335                         ;;
3336                 esac
3337                 case "$CPPFLAGS" in
3338                 *$cf_add_cflags) #(vi
3339                         ;;
3340                 *) #(vi
3341                         case $cf_add_cflags in #(vi
3342                         -D*)
3343                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3344
3345 CPPFLAGS=`echo "$CPPFLAGS" | \
3346         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3347                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3348
3349                                 ;;
3350                         esac
3351                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3352                         ;;
3353                 esac
3354                 ;;
3355         *)
3356                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3357                 ;;
3358         esac
3359         ;;
3360 yes)
3361         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3362
3363         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3364
3365         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3366                 && test -z "${cf_tst_cflags}" \
3367                 && cf_fix_cppflags=no
3368         ;;
3369 esac
3370 done
3371
3372 if test -n "$cf_new_cflags" ; then
3373
3374         CFLAGS="$CFLAGS $cf_new_cflags"
3375 fi
3376
3377 if test -n "$cf_new_cppflags" ; then
3378
3379         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3380 fi
3381
3382 if test -n "$cf_new_extra_cppflags" ; then
3383
3384         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3385 fi
3386
3387 fi
3388
3389         ;;
3390 esac
3391
3392 if test -n "$cf_xopen_source" ; then
3393
3394 cf_fix_cppflags=no
3395 cf_new_cflags=
3396 cf_new_cppflags=
3397 cf_new_extra_cppflags=
3398
3399 for cf_add_cflags in $cf_xopen_source
3400 do
3401 case $cf_fix_cppflags in
3402 no)
3403         case $cf_add_cflags in #(vi
3404         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3405                 case $cf_add_cflags in
3406                 -D*)
3407                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3408
3409                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3410                                 && test -z "${cf_tst_cflags}" \
3411                                 && cf_fix_cppflags=yes
3412
3413                         if test $cf_fix_cppflags = yes ; then
3414                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3415                                 continue
3416                         elif test "${cf_tst_cflags}" = "\"'" ; then
3417                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3418                                 continue
3419                         fi
3420                         ;;
3421                 esac
3422                 case "$CPPFLAGS" in
3423                 *$cf_add_cflags) #(vi
3424                         ;;
3425                 *) #(vi
3426                         case $cf_add_cflags in #(vi
3427                         -D*)
3428                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3429
3430 CPPFLAGS=`echo "$CPPFLAGS" | \
3431         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3432                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3433
3434                                 ;;
3435                         esac
3436                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3437                         ;;
3438                 esac
3439                 ;;
3440         *)
3441                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3442                 ;;
3443         esac
3444         ;;
3445 yes)
3446         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3447
3448         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3449
3450         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3451                 && test -z "${cf_tst_cflags}" \
3452                 && cf_fix_cppflags=no
3453         ;;
3454 esac
3455 done
3456
3457 if test -n "$cf_new_cflags" ; then
3458
3459         CFLAGS="$CFLAGS $cf_new_cflags"
3460 fi
3461
3462 if test -n "$cf_new_cppflags" ; then
3463
3464         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3465 fi
3466
3467 if test -n "$cf_new_extra_cppflags" ; then
3468
3469         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3470 fi
3471
3472 fi
3473
3474 echo "$as_me:3474: checking for $CC option to accept ANSI C" >&5
3475 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
3476 if test "${ac_cv_prog_cc_stdc+set}" = set; then
3477   echo $ECHO_N "(cached) $ECHO_C" >&6
3478 else
3479   ac_cv_prog_cc_stdc=no
3480 ac_save_CC=$CC
3481 cat >conftest.$ac_ext <<_ACEOF
3482 #line 3482 "configure"
3483 #include "confdefs.h"
3484 #include <stdarg.h>
3485 #include <stdio.h>
3486 #include <sys/types.h>
3487 #include <sys/stat.h>
3488 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3489 struct buf { int x; };
3490 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3491 static char *e (p, i)
3492      char **p;
3493      int i;
3494 {
3495   return p[i];
3496 }
3497 static char *f (char * (*g) (char **, int), char **p, ...)
3498 {
3499   char *s;
3500   va_list v;
3501   va_start (v,p);
3502   s = g (p, va_arg (v,int));
3503   va_end (v);
3504   return s;
3505 }
3506 int test (int i, double x);
3507 struct s1 {int (*f) (int a);};
3508 struct s2 {int (*f) (double a);};
3509 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3510 int argc;
3511 char **argv;
3512 int
3513 main ()
3514 {
3515 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3516   ;
3517   return 0;
3518 }
3519 _ACEOF
3520 # Don't try gcc -ansi; that turns off useful extensions and
3521 # breaks some systems' header files.
3522 # AIX                   -qlanglvl=ansi
3523 # Ultrix and OSF/1      -std1
3524 # HP-UX 10.20 and later -Ae
3525 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3526 # SVR4                  -Xc -D__EXTENSIONS__
3527 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3528 do
3529   CC="$ac_save_CC $ac_arg"
3530   rm -f conftest.$ac_objext
3531 if { (eval echo "$as_me:3531: \"$ac_compile\"") >&5
3532   (eval $ac_compile) 2>&5
3533   ac_status=$?
3534   echo "$as_me:3534: \$? = $ac_status" >&5
3535   (exit $ac_status); } &&
3536          { ac_try='test -s conftest.$ac_objext'
3537   { (eval echo "$as_me:3537: \"$ac_try\"") >&5
3538   (eval $ac_try) 2>&5
3539   ac_status=$?
3540   echo "$as_me:3540: \$? = $ac_status" >&5
3541   (exit $ac_status); }; }; then
3542   ac_cv_prog_cc_stdc=$ac_arg
3543 break
3544 else
3545   echo "$as_me: failed program was:" >&5
3546 cat conftest.$ac_ext >&5
3547 fi
3548 rm -f conftest.$ac_objext
3549 done
3550 rm -f conftest.$ac_ext conftest.$ac_objext
3551 CC=$ac_save_CC
3552
3553 fi
3554
3555 case "x$ac_cv_prog_cc_stdc" in
3556   x|xno)
3557     echo "$as_me:3557: result: none needed" >&5
3558 echo "${ECHO_T}none needed" >&6 ;;
3559   *)
3560     echo "$as_me:3560: result: $ac_cv_prog_cc_stdc" >&5
3561 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
3562     CC="$CC $ac_cv_prog_cc_stdc" ;;
3563 esac
3564
3565 echo "$as_me:3565: checking for an ANSI C-conforming const" >&5
3566 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
3567 if test "${ac_cv_c_const+set}" = set; then
3568   echo $ECHO_N "(cached) $ECHO_C" >&6
3569 else
3570   cat >conftest.$ac_ext <<_ACEOF
3571 #line 3571 "configure"
3572 #include "confdefs.h"
3573
3574 int
3575 main ()
3576 {
3577 /* FIXME: Include the comments suggested by Paul. */
3578 #ifndef __cplusplus
3579   /* Ultrix mips cc rejects this.  */
3580   typedef int charset[2];
3581   const charset x;
3582   /* SunOS 4.1.1 cc rejects this.  */
3583   char const *const *ccp;
3584   char **p;
3585   /* NEC SVR4.0.2 mips cc rejects this.  */
3586   struct point {int x, y;};
3587   static struct point const zero = {0,0};
3588   /* AIX XL C 1.02.0.0 rejects this.
3589      It does not let you subtract one const X* pointer from another in
3590      an arm of an if-expression whose if-part is not a constant
3591      expression */
3592   const char *g = "string";
3593   ccp = &g + (g ? g-g : 0);
3594   /* HPUX 7.0 cc rejects these. */
3595   ++ccp;
3596   p = (char**) ccp;
3597   ccp = (char const *const *) p;
3598   { /* SCO 3.2v4 cc rejects this.  */
3599     char *t;
3600     char const *s = 0 ? (char *) 0 : (char const *) 0;
3601
3602     *t++ = 0;
3603   }
3604   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3605     int x[] = {25, 17};
3606     const int *foo = &x[0];
3607     ++foo;
3608   }
3609   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3610     typedef const int *iptr;
3611     iptr p = 0;
3612     ++p;
3613   }
3614   { /* AIX XL C 1.02.0.0 rejects this saying
3615        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3616     struct s { int j; const int *ap[3]; };
3617     struct s *b; b->j = 5;
3618   }
3619   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3620     const int foo = 10;
3621   }
3622 #endif
3623
3624   ;
3625   return 0;
3626 }
3627 _ACEOF
3628 rm -f conftest.$ac_objext
3629 if { (eval echo "$as_me:3629: \"$ac_compile\"") >&5
3630   (eval $ac_compile) 2>&5
3631   ac_status=$?
3632   echo "$as_me:3632: \$? = $ac_status" >&5
3633   (exit $ac_status); } &&
3634          { ac_try='test -s conftest.$ac_objext'
3635   { (eval echo "$as_me:3635: \"$ac_try\"") >&5
3636   (eval $ac_try) 2>&5
3637   ac_status=$?
3638   echo "$as_me:3638: \$? = $ac_status" >&5
3639   (exit $ac_status); }; }; then
3640   ac_cv_c_const=yes
3641 else
3642   echo "$as_me: failed program was:" >&5
3643 cat conftest.$ac_ext >&5
3644 ac_cv_c_const=no
3645 fi
3646 rm -f conftest.$ac_objext conftest.$ac_ext
3647 fi
3648 echo "$as_me:3648: result: $ac_cv_c_const" >&5
3649 echo "${ECHO_T}$ac_cv_c_const" >&6
3650 if test $ac_cv_c_const = no; then
3651
3652 cat >>confdefs.h <<\EOF
3653 #define const
3654 EOF
3655
3656 fi
3657
3658 echo "$as_me:3658: checking for signal global datatype" >&5
3659 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3660 if test "${cf_cv_sig_atomic_t+set}" = set; then
3661   echo $ECHO_N "(cached) $ECHO_C" >&6
3662 else
3663
3664         for cf_type in \
3665                 "volatile sig_atomic_t" \
3666                 "sig_atomic_t" \
3667                 "int"
3668         do
3669         cat >conftest.$ac_ext <<_ACEOF
3670 #line 3670 "configure"
3671 #include "confdefs.h"
3672
3673 #include <sys/types.h>
3674 #include <signal.h>
3675 #include <stdio.h>
3676
3677 extern $cf_type x;
3678 $cf_type x;
3679 static void handler(int sig)
3680 {
3681         x = 5;
3682 }
3683 int
3684 main ()
3685 {
3686 signal(SIGINT, handler);
3687                  x = 1
3688   ;
3689   return 0;
3690 }
3691 _ACEOF
3692 rm -f conftest.$ac_objext
3693 if { (eval echo "$as_me:3693: \"$ac_compile\"") >&5
3694   (eval $ac_compile) 2>&5
3695   ac_status=$?
3696   echo "$as_me:3696: \$? = $ac_status" >&5
3697   (exit $ac_status); } &&
3698          { ac_try='test -s conftest.$ac_objext'
3699   { (eval echo "$as_me:3699: \"$ac_try\"") >&5
3700   (eval $ac_try) 2>&5
3701   ac_status=$?
3702   echo "$as_me:3702: \$? = $ac_status" >&5
3703   (exit $ac_status); }; }; then
3704   cf_cv_sig_atomic_t=$cf_type
3705 else
3706   echo "$as_me: failed program was:" >&5
3707 cat conftest.$ac_ext >&5
3708 cf_cv_sig_atomic_t=no
3709 fi
3710 rm -f conftest.$ac_objext conftest.$ac_ext
3711                 test "$cf_cv_sig_atomic_t" != no && break
3712         done
3713
3714 fi
3715
3716 echo "$as_me:3716: result: $cf_cv_sig_atomic_t" >&5
3717 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
3718 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
3719 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
3720 EOF
3721
3722 echo "$as_me:3722: checking if you want to see long compiling messages" >&5
3723 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
3724
3725 # Check whether --enable-echo or --disable-echo was given.
3726 if test "${enable_echo+set}" = set; then
3727   enableval="$enable_echo"
3728   test "$enableval" != no && enableval=yes
3729   if test "$enableval" != "yes" ; then
3730
3731     ECHO_LT='--silent'
3732     ECHO_LD='@echo linking $@;'
3733     RULE_CC='@echo compiling $<'
3734     SHOW_CC='@echo compiling $@'
3735     ECHO_CC='@'
3736
3737   else
3738
3739     ECHO_LT=''
3740     ECHO_LD=''
3741     RULE_CC=''
3742     SHOW_CC=''
3743     ECHO_CC=''
3744
3745   fi
3746 else
3747   enableval=yes
3748
3749     ECHO_LT=''
3750     ECHO_LD=''
3751     RULE_CC=''
3752     SHOW_CC=''
3753     ECHO_CC=''
3754
3755 fi;
3756 echo "$as_me:3756: result: $enableval" >&5
3757 echo "${ECHO_T}$enableval" >&6
3758
3759 GCC_VERSION=none
3760 if test "$GCC" = yes ; then
3761         echo "$as_me:3761: checking version of $CC" >&5
3762 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
3763         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
3764         test -z "$GCC_VERSION" && GCC_VERSION=unknown
3765         echo "$as_me:3765: result: $GCC_VERSION" >&5
3766 echo "${ECHO_T}$GCC_VERSION" >&6
3767 fi
3768
3769 if ( test "$GCC" = yes || test "$GXX" = yes )
3770 then
3771 echo "$as_me:3771: checking if you want to turn on gcc warnings" >&5
3772 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
3773
3774 # Check whether --enable-warnings or --disable-warnings was given.
3775 if test "${enable_warnings+set}" = set; then
3776   enableval="$enable_warnings"
3777   test "$enableval" != yes && enableval=no
3778   if test "$enableval" != "no" ; then
3779     with_warnings=yes
3780   else
3781     with_warnings=no
3782   fi
3783 else
3784   enableval=no
3785   with_warnings=no
3786
3787 fi;
3788 echo "$as_me:3788: result: $with_warnings" >&5
3789 echo "${ECHO_T}$with_warnings" >&6
3790 if test "$with_warnings" = "yes"
3791 then
3792
3793 if test "$GCC" = yes
3794 then
3795 cat > conftest.i <<EOF
3796 #ifndef GCC_PRINTF
3797 #define GCC_PRINTF 0
3798 #endif
3799 #ifndef GCC_SCANF
3800 #define GCC_SCANF 0
3801 #endif
3802 #ifndef GCC_NORETURN
3803 #define GCC_NORETURN /* nothing */
3804 #endif
3805 #ifndef GCC_UNUSED
3806 #define GCC_UNUSED /* nothing */
3807 #endif
3808 EOF
3809 if test "$GCC" = yes
3810 then
3811         { echo "$as_me:3811: checking for $CC __attribute__ directives..." >&5
3812 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3813 cat > conftest.$ac_ext <<EOF
3814 #line 3814 "${as_me:-configure}"
3815 #include "confdefs.h"
3816 #include "conftest.h"
3817 #include "conftest.i"
3818 #if     GCC_PRINTF
3819 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3820 #else
3821 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3822 #endif
3823 #if     GCC_SCANF
3824 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3825 #else
3826 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3827 #endif
3828 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3829 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3830 extern void foo(void) GCC_NORETURN;
3831 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3832 EOF
3833         cf_printf_attribute=no
3834         cf_scanf_attribute=no
3835         for cf_attribute in scanf printf unused noreturn
3836         do
3837
3838 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3839
3840                 cf_directive="__attribute__(($cf_attribute))"
3841                 echo "checking for $CC $cf_directive" 1>&5
3842
3843                 case $cf_attribute in #(vi
3844                 printf) #(vi
3845                         cf_printf_attribute=yes
3846                         cat >conftest.h <<EOF
3847 #define GCC_$cf_ATTRIBUTE 1
3848 EOF
3849                         ;;
3850                 scanf) #(vi
3851                         cf_scanf_attribute=yes
3852                         cat >conftest.h <<EOF
3853 #define GCC_$cf_ATTRIBUTE 1
3854 EOF
3855                         ;;
3856                 *) #(vi
3857                         cat >conftest.h <<EOF
3858 #define GCC_$cf_ATTRIBUTE $cf_directive
3859 EOF
3860                         ;;
3861                 esac
3862
3863                 if { (eval echo "$as_me:3863: \"$ac_compile\"") >&5
3864   (eval $ac_compile) 2>&5
3865   ac_status=$?
3866   echo "$as_me:3866: \$? = $ac_status" >&5
3867   (exit $ac_status); }; then
3868                         test -n "$verbose" && echo "$as_me:3868: result: ... $cf_attribute" >&5
3869 echo "${ECHO_T}... $cf_attribute" >&6
3870                         cat conftest.h >>confdefs.h
3871                         case $cf_attribute in #(vi
3872                         printf) #(vi
3873                                 if test "$cf_printf_attribute" = no ; then
3874                                         cat >>confdefs.h <<EOF
3875 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
3876 EOF
3877                                 else
3878                                         cat >>confdefs.h <<EOF
3879 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3880 EOF
3881                                 fi
3882                                 ;;
3883                         scanf) #(vi
3884                                 if test "$cf_scanf_attribute" = no ; then
3885                                         cat >>confdefs.h <<EOF
3886 #define GCC_SCANFLIKE(fmt,var) /* nothing */
3887 EOF
3888                                 else
3889                                         cat >>confdefs.h <<EOF
3890 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3891 EOF
3892                                 fi
3893                                 ;;
3894                         esac
3895                 fi
3896         done
3897 else
3898         fgrep define conftest.i >>confdefs.h
3899 fi
3900 rm -rf conftest*
3901 fi
3902
3903 INTEL_COMPILER=no
3904
3905 if test "$GCC" = yes ; then
3906         case $host_os in
3907         linux*|gnu*)
3908                 echo "$as_me:3908: checking if this is really Intel C compiler" >&5
3909 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
3910                 cf_save_CFLAGS="$CFLAGS"
3911                 CFLAGS="$CFLAGS -no-gcc"
3912                 cat >conftest.$ac_ext <<_ACEOF
3913 #line 3913 "configure"
3914 #include "confdefs.h"
3915
3916 int
3917 main ()
3918 {
3919
3920 #ifdef __INTEL_COMPILER
3921 #else
3922 make an error
3923 #endif
3924
3925   ;
3926   return 0;
3927 }
3928 _ACEOF
3929 rm -f conftest.$ac_objext
3930 if { (eval echo "$as_me:3930: \"$ac_compile\"") >&5
3931   (eval $ac_compile) 2>&5
3932   ac_status=$?
3933   echo "$as_me:3933: \$? = $ac_status" >&5
3934   (exit $ac_status); } &&
3935          { ac_try='test -s conftest.$ac_objext'
3936   { (eval echo "$as_me:3936: \"$ac_try\"") >&5
3937   (eval $ac_try) 2>&5
3938   ac_status=$?
3939   echo "$as_me:3939: \$? = $ac_status" >&5
3940   (exit $ac_status); }; }; then
3941   INTEL_COMPILER=yes
3942 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
3943
3944 else
3945   echo "$as_me: failed program was:" >&5
3946 cat conftest.$ac_ext >&5
3947 fi
3948 rm -f conftest.$ac_objext conftest.$ac_ext
3949                 CFLAGS="$cf_save_CFLAGS"
3950                 echo "$as_me:3950: result: $INTEL_COMPILER" >&5
3951 echo "${ECHO_T}$INTEL_COMPILER" >&6
3952                 ;;
3953         esac
3954 fi
3955
3956 cat > conftest.$ac_ext <<EOF
3957 #line 3957 "${as_me:-configure}"
3958 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
3959 EOF
3960
3961 if test "$INTEL_COMPILER" = yes
3962 then
3963 # The "-wdXXX" options suppress warnings:
3964 # remark #1419: external declaration in primary source file
3965 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
3966 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
3967 # remark #193: zero used for undefined preprocessing identifier
3968 # remark #593: variable "curs_sb_left_arrow" was set but never used
3969 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
3970 # remark #869: parameter "tw" was never referenced
3971 # remark #981: operands are evaluated in unspecified order
3972 # warning #279: controlling expression is constant
3973
3974         { echo "$as_me:3974: checking for $CC warning options..." >&5
3975 echo "$as_me: checking for $CC warning options..." >&6;}
3976         cf_save_CFLAGS="$CFLAGS"
3977         EXTRA_CFLAGS="-Wall"
3978         for cf_opt in \
3979                 wd1419 \
3980                 wd1683 \
3981                 wd1684 \
3982                 wd193 \
3983                 wd593 \
3984                 wd279 \
3985                 wd810 \
3986                 wd869 \
3987                 wd981
3988         do
3989                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
3990                 if { (eval echo "$as_me:3990: \"$ac_compile\"") >&5
3991   (eval $ac_compile) 2>&5
3992   ac_status=$?
3993   echo "$as_me:3993: \$? = $ac_status" >&5
3994   (exit $ac_status); }; then
3995                         test -n "$verbose" && echo "$as_me:3995: result: ... -$cf_opt" >&5
3996 echo "${ECHO_T}... -$cf_opt" >&6
3997                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
3998                 fi
3999         done
4000         CFLAGS="$cf_save_CFLAGS"
4001
4002 elif test "$GCC" = yes
4003 then
4004         { echo "$as_me:4004: checking for $CC warning options..." >&5
4005 echo "$as_me: checking for $CC warning options..." >&6;}
4006         cf_save_CFLAGS="$CFLAGS"
4007         EXTRA_CFLAGS=
4008         cf_warn_CONST=""
4009         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4010         for cf_opt in W Wall \
4011                 Wbad-function-cast \
4012                 Wcast-align \
4013                 Wcast-qual \
4014                 Winline \
4015                 Wmissing-declarations \
4016                 Wmissing-prototypes \
4017                 Wnested-externs \
4018                 Wpointer-arith \
4019                 Wshadow \
4020                 Wstrict-prototypes \
4021                 Wundef $cf_warn_CONST
4022         do
4023                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4024                 if { (eval echo "$as_me:4024: \"$ac_compile\"") >&5
4025   (eval $ac_compile) 2>&5
4026   ac_status=$?
4027   echo "$as_me:4027: \$? = $ac_status" >&5
4028   (exit $ac_status); }; then
4029                         test -n "$verbose" && echo "$as_me:4029: result: ... -$cf_opt" >&5
4030 echo "${ECHO_T}... -$cf_opt" >&6
4031                         case $cf_opt in #(vi
4032                         Wcast-qual) #(vi
4033                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
4034                                 ;;
4035                         Winline) #(vi
4036                                 case $GCC_VERSION in
4037                                 [34].*)
4038                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4039
4040 echo "${as_me:-configure}:4040: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4041
4042                                         continue;;
4043                                 esac
4044                                 ;;
4045                         esac
4046                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4047                 fi
4048         done
4049         CFLAGS="$cf_save_CFLAGS"
4050 fi
4051 rm -rf conftest*
4052
4053 fi
4054 fi
4055
4056 echo "$as_me:4056: checking if you want to use dmalloc for testing" >&5
4057 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
4058
4059 # Check whether --with-dmalloc or --without-dmalloc was given.
4060 if test "${with_dmalloc+set}" = set; then
4061   withval="$with_dmalloc"
4062   cat >>confdefs.h <<\EOF
4063 #define USE_DMALLOC 1
4064 EOF
4065
4066         : ${with_cflags:=-g}
4067         : ${with_no_leaks:=yes}
4068          with_dmalloc=yes
4069 else
4070   with_dmalloc=
4071 fi;
4072 echo "$as_me:4072: result: ${with_dmalloc:-no}" >&5
4073 echo "${ECHO_T}${with_dmalloc:-no}" >&6
4074
4075 case .$with_cflags in #(vi
4076 .*-g*)
4077         case .$CFLAGS in #(vi
4078         .*-g*) #(vi
4079                 ;;
4080         *)
4081
4082 cf_fix_cppflags=no
4083 cf_new_cflags=
4084 cf_new_cppflags=
4085 cf_new_extra_cppflags=
4086
4087 for cf_add_cflags in -g
4088 do
4089 case $cf_fix_cppflags in
4090 no)
4091         case $cf_add_cflags in #(vi
4092         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4093                 case $cf_add_cflags in
4094                 -D*)
4095                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4096
4097                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4098                                 && test -z "${cf_tst_cflags}" \
4099                                 && cf_fix_cppflags=yes
4100
4101                         if test $cf_fix_cppflags = yes ; then
4102                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4103                                 continue
4104                         elif test "${cf_tst_cflags}" = "\"'" ; then
4105                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4106                                 continue
4107                         fi
4108                         ;;
4109                 esac
4110                 case "$CPPFLAGS" in
4111                 *$cf_add_cflags) #(vi
4112                         ;;
4113                 *) #(vi
4114                         case $cf_add_cflags in #(vi
4115                         -D*)
4116                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4117
4118 CPPFLAGS=`echo "$CPPFLAGS" | \
4119         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4120                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4121
4122                                 ;;
4123                         esac
4124                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4125                         ;;
4126                 esac
4127                 ;;
4128         *)
4129                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4130                 ;;
4131         esac
4132         ;;
4133 yes)
4134         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4135
4136         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4137
4138         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4139                 && test -z "${cf_tst_cflags}" \
4140                 && cf_fix_cppflags=no
4141         ;;
4142 esac
4143 done
4144
4145 if test -n "$cf_new_cflags" ; then
4146
4147         CFLAGS="$CFLAGS $cf_new_cflags"
4148 fi
4149
4150 if test -n "$cf_new_cppflags" ; then
4151
4152         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4153 fi
4154
4155 if test -n "$cf_new_extra_cppflags" ; then
4156
4157         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4158 fi
4159
4160                 ;;
4161         esac
4162         ;;
4163 esac
4164
4165 if test "$with_dmalloc" = yes ; then
4166         echo "$as_me:4166: checking for dmalloc.h" >&5
4167 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
4168 if test "${ac_cv_header_dmalloc_h+set}" = set; then
4169   echo $ECHO_N "(cached) $ECHO_C" >&6
4170 else
4171   cat >conftest.$ac_ext <<_ACEOF
4172 #line 4172 "configure"
4173 #include "confdefs.h"
4174 #include <dmalloc.h>
4175 _ACEOF
4176 if { (eval echo "$as_me:4176: \"$ac_cpp conftest.$ac_ext\"") >&5
4177   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4178   ac_status=$?
4179   egrep -v '^ *\+' conftest.er1 >conftest.err
4180   rm -f conftest.er1
4181   cat conftest.err >&5
4182   echo "$as_me:4182: \$? = $ac_status" >&5
4183   (exit $ac_status); } >/dev/null; then
4184   if test -s conftest.err; then
4185     ac_cpp_err=$ac_c_preproc_warn_flag
4186   else
4187     ac_cpp_err=
4188   fi
4189 else
4190   ac_cpp_err=yes
4191 fi
4192 if test -z "$ac_cpp_err"; then
4193   ac_cv_header_dmalloc_h=yes
4194 else
4195   echo "$as_me: failed program was:" >&5
4196   cat conftest.$ac_ext >&5
4197   ac_cv_header_dmalloc_h=no
4198 fi
4199 rm -f conftest.err conftest.$ac_ext
4200 fi
4201 echo "$as_me:4201: result: $ac_cv_header_dmalloc_h" >&5
4202 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
4203 if test $ac_cv_header_dmalloc_h = yes; then
4204
4205 echo "$as_me:4205: checking for dmalloc_debug in -ldmalloc" >&5
4206 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
4207 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
4208   echo $ECHO_N "(cached) $ECHO_C" >&6
4209 else
4210   ac_check_lib_save_LIBS=$LIBS
4211 LIBS="-ldmalloc  $LIBS"
4212 cat >conftest.$ac_ext <<_ACEOF
4213 #line 4213 "configure"
4214 #include "confdefs.h"
4215
4216 /* Override any gcc2 internal prototype to avoid an error.  */
4217 #ifdef __cplusplus
4218 extern "C"
4219 #endif
4220 /* We use char because int might match the return type of a gcc2
4221    builtin and then its argument prototype would still apply.  */
4222 char dmalloc_debug ();
4223 int
4224 main ()
4225 {
4226 dmalloc_debug ();
4227   ;
4228   return 0;
4229 }
4230 _ACEOF
4231 rm -f conftest.$ac_objext conftest$ac_exeext
4232 if { (eval echo "$as_me:4232: \"$ac_link\"") >&5
4233   (eval $ac_link) 2>&5
4234   ac_status=$?
4235   echo "$as_me:4235: \$? = $ac_status" >&5
4236   (exit $ac_status); } &&
4237          { ac_try='test -s conftest$ac_exeext'
4238   { (eval echo "$as_me:4238: \"$ac_try\"") >&5
4239   (eval $ac_try) 2>&5
4240   ac_status=$?
4241   echo "$as_me:4241: \$? = $ac_status" >&5
4242   (exit $ac_status); }; }; then
4243   ac_cv_lib_dmalloc_dmalloc_debug=yes
4244 else
4245   echo "$as_me: failed program was:" >&5
4246 cat conftest.$ac_ext >&5
4247 ac_cv_lib_dmalloc_dmalloc_debug=no
4248 fi
4249 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4250 LIBS=$ac_check_lib_save_LIBS
4251 fi
4252 echo "$as_me:4252: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
4253 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
4254 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
4255   cat >>confdefs.h <<EOF
4256 #define HAVE_LIBDMALLOC 1
4257 EOF
4258
4259   LIBS="-ldmalloc $LIBS"
4260
4261 fi
4262
4263 fi
4264
4265 fi
4266
4267 echo "$as_me:4267: checking if you want to use dbmalloc for testing" >&5
4268 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
4269
4270 # Check whether --with-dbmalloc or --without-dbmalloc was given.
4271 if test "${with_dbmalloc+set}" = set; then
4272   withval="$with_dbmalloc"
4273   cat >>confdefs.h <<\EOF
4274 #define USE_DBMALLOC 1
4275 EOF
4276
4277         : ${with_cflags:=-g}
4278         : ${with_no_leaks:=yes}
4279          with_dbmalloc=yes
4280 else
4281   with_dbmalloc=
4282 fi;
4283 echo "$as_me:4283: result: ${with_dbmalloc:-no}" >&5
4284 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
4285
4286 case .$with_cflags in #(vi
4287 .*-g*)
4288         case .$CFLAGS in #(vi
4289         .*-g*) #(vi
4290                 ;;
4291         *)
4292
4293 cf_fix_cppflags=no
4294 cf_new_cflags=
4295 cf_new_cppflags=
4296 cf_new_extra_cppflags=
4297
4298 for cf_add_cflags in -g
4299 do
4300 case $cf_fix_cppflags in
4301 no)
4302         case $cf_add_cflags in #(vi
4303         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4304                 case $cf_add_cflags in
4305                 -D*)
4306                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4307
4308                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4309                                 && test -z "${cf_tst_cflags}" \
4310                                 && cf_fix_cppflags=yes
4311
4312                         if test $cf_fix_cppflags = yes ; then
4313                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4314                                 continue
4315                         elif test "${cf_tst_cflags}" = "\"'" ; then
4316                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4317                                 continue
4318                         fi
4319                         ;;
4320                 esac
4321                 case "$CPPFLAGS" in
4322                 *$cf_add_cflags) #(vi
4323                         ;;
4324                 *) #(vi
4325                         case $cf_add_cflags in #(vi
4326                         -D*)
4327                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4328
4329 CPPFLAGS=`echo "$CPPFLAGS" | \
4330         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4331                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4332
4333                                 ;;
4334                         esac
4335                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4336                         ;;
4337                 esac
4338                 ;;
4339         *)
4340                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4341                 ;;
4342         esac
4343         ;;
4344 yes)
4345         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4346
4347         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4348
4349         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4350                 && test -z "${cf_tst_cflags}" \
4351                 && cf_fix_cppflags=no
4352         ;;
4353 esac
4354 done
4355
4356 if test -n "$cf_new_cflags" ; then
4357
4358         CFLAGS="$CFLAGS $cf_new_cflags"
4359 fi
4360
4361 if test -n "$cf_new_cppflags" ; then
4362
4363         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4364 fi
4365
4366 if test -n "$cf_new_extra_cppflags" ; then
4367
4368         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4369 fi
4370
4371                 ;;
4372         esac
4373         ;;
4374 esac
4375
4376 if test "$with_dbmalloc" = yes ; then
4377         echo "$as_me:4377: checking for dbmalloc.h" >&5
4378 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
4379 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
4380   echo $ECHO_N "(cached) $ECHO_C" >&6
4381 else
4382   cat >conftest.$ac_ext <<_ACEOF
4383 #line 4383 "configure"
4384 #include "confdefs.h"
4385 #include <dbmalloc.h>
4386 _ACEOF
4387 if { (eval echo "$as_me:4387: \"$ac_cpp conftest.$ac_ext\"") >&5
4388   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4389   ac_status=$?
4390   egrep -v '^ *\+' conftest.er1 >conftest.err
4391   rm -f conftest.er1
4392   cat conftest.err >&5
4393   echo "$as_me:4393: \$? = $ac_status" >&5
4394   (exit $ac_status); } >/dev/null; then
4395   if test -s conftest.err; then
4396     ac_cpp_err=$ac_c_preproc_warn_flag
4397   else
4398     ac_cpp_err=
4399   fi
4400 else
4401   ac_cpp_err=yes
4402 fi
4403 if test -z "$ac_cpp_err"; then
4404   ac_cv_header_dbmalloc_h=yes
4405 else
4406   echo "$as_me: failed program was:" >&5
4407   cat conftest.$ac_ext >&5
4408   ac_cv_header_dbmalloc_h=no
4409 fi
4410 rm -f conftest.err conftest.$ac_ext
4411 fi
4412 echo "$as_me:4412: result: $ac_cv_header_dbmalloc_h" >&5
4413 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
4414 if test $ac_cv_header_dbmalloc_h = yes; then
4415
4416 echo "$as_me:4416: checking for debug_malloc in -ldbmalloc" >&5
4417 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
4418 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
4419   echo $ECHO_N "(cached) $ECHO_C" >&6
4420 else
4421   ac_check_lib_save_LIBS=$LIBS
4422 LIBS="-ldbmalloc  $LIBS"
4423 cat >conftest.$ac_ext <<_ACEOF
4424 #line 4424 "configure"
4425 #include "confdefs.h"
4426
4427 /* Override any gcc2 internal prototype to avoid an error.  */
4428 #ifdef __cplusplus
4429 extern "C"
4430 #endif
4431 /* We use char because int might match the return type of a gcc2
4432    builtin and then its argument prototype would still apply.  */
4433 char debug_malloc ();
4434 int
4435 main ()
4436 {
4437 debug_malloc ();
4438   ;
4439   return 0;
4440 }
4441 _ACEOF
4442 rm -f conftest.$ac_objext conftest$ac_exeext
4443 if { (eval echo "$as_me:4443: \"$ac_link\"") >&5
4444   (eval $ac_link) 2>&5
4445   ac_status=$?
4446   echo "$as_me:4446: \$? = $ac_status" >&5
4447   (exit $ac_status); } &&
4448          { ac_try='test -s conftest$ac_exeext'
4449   { (eval echo "$as_me:4449: \"$ac_try\"") >&5
4450   (eval $ac_try) 2>&5
4451   ac_status=$?
4452   echo "$as_me:4452: \$? = $ac_status" >&5
4453   (exit $ac_status); }; }; then
4454   ac_cv_lib_dbmalloc_debug_malloc=yes
4455 else
4456   echo "$as_me: failed program was:" >&5
4457 cat conftest.$ac_ext >&5
4458 ac_cv_lib_dbmalloc_debug_malloc=no
4459 fi
4460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4461 LIBS=$ac_check_lib_save_LIBS
4462 fi
4463 echo "$as_me:4463: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
4464 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
4465 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
4466   cat >>confdefs.h <<EOF
4467 #define HAVE_LIBDBMALLOC 1
4468 EOF
4469
4470   LIBS="-ldbmalloc $LIBS"
4471
4472 fi
4473
4474 fi
4475
4476 fi
4477
4478 echo "$as_me:4478: checking if you want to use valgrind for testing" >&5
4479 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
4480
4481 # Check whether --with-valgrind or --without-valgrind was given.
4482 if test "${with_valgrind+set}" = set; then
4483   withval="$with_valgrind"
4484   cat >>confdefs.h <<\EOF
4485 #define USE_VALGRIND 1
4486 EOF
4487
4488         : ${with_cflags:=-g}
4489         : ${with_no_leaks:=yes}
4490          with_valgrind=yes
4491 else
4492   with_valgrind=
4493 fi;
4494 echo "$as_me:4494: result: ${with_valgrind:-no}" >&5
4495 echo "${ECHO_T}${with_valgrind:-no}" >&6
4496
4497 case .$with_cflags in #(vi
4498 .*-g*)
4499         case .$CFLAGS in #(vi
4500         .*-g*) #(vi
4501                 ;;
4502         *)
4503
4504 cf_fix_cppflags=no
4505 cf_new_cflags=
4506 cf_new_cppflags=
4507 cf_new_extra_cppflags=
4508
4509 for cf_add_cflags in -g
4510 do
4511 case $cf_fix_cppflags in
4512 no)
4513         case $cf_add_cflags in #(vi
4514         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4515                 case $cf_add_cflags in
4516                 -D*)
4517                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4518
4519                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4520                                 && test -z "${cf_tst_cflags}" \
4521                                 && cf_fix_cppflags=yes
4522
4523                         if test $cf_fix_cppflags = yes ; then
4524                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4525                                 continue
4526                         elif test "${cf_tst_cflags}" = "\"'" ; then
4527                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4528                                 continue
4529                         fi
4530                         ;;
4531                 esac
4532                 case "$CPPFLAGS" in
4533                 *$cf_add_cflags) #(vi
4534                         ;;
4535                 *) #(vi
4536                         case $cf_add_cflags in #(vi
4537                         -D*)
4538                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4539
4540 CPPFLAGS=`echo "$CPPFLAGS" | \
4541         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4542                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4543
4544                                 ;;
4545                         esac
4546                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4547                         ;;
4548                 esac
4549                 ;;
4550         *)
4551                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4552                 ;;
4553         esac
4554         ;;
4555 yes)
4556         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4557
4558         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4559
4560         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4561                 && test -z "${cf_tst_cflags}" \
4562                 && cf_fix_cppflags=no
4563         ;;
4564 esac
4565 done
4566
4567 if test -n "$cf_new_cflags" ; then
4568
4569         CFLAGS="$CFLAGS $cf_new_cflags"
4570 fi
4571
4572 if test -n "$cf_new_cppflags" ; then
4573
4574         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4575 fi
4576
4577 if test -n "$cf_new_extra_cppflags" ; then
4578
4579         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4580 fi
4581
4582                 ;;
4583         esac
4584         ;;
4585 esac
4586
4587 echo "$as_me:4587: checking if you want to perform memory-leak testing" >&5
4588 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
4589
4590 # Check whether --enable-leaks or --disable-leaks was given.
4591 if test "${enable_leaks+set}" = set; then
4592   enableval="$enable_leaks"
4593   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
4594 else
4595   : ${with_no_leaks:=no}
4596 fi;
4597 echo "$as_me:4597: result: $with_no_leaks" >&5
4598 echo "${ECHO_T}$with_no_leaks" >&6
4599
4600 if test "$with_no_leaks" = yes ; then
4601         cat >>confdefs.h <<\EOF
4602 #define NO_LEAKS 1
4603 EOF
4604
4605         cat >>confdefs.h <<\EOF
4606 #define YY_NO_LEAKS 1
4607 EOF
4608
4609 fi
4610
4611 echo "$as_me:4611: checking for specific curses-directory" >&5
4612 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4613
4614 # Check whether --with-curses-dir or --without-curses-dir was given.
4615 if test "${with_curses_dir+set}" = set; then
4616   withval="$with_curses_dir"
4617   cf_cv_curses_dir=$withval
4618 else
4619   cf_cv_curses_dir=no
4620 fi;
4621 echo "$as_me:4621: result: $cf_cv_curses_dir" >&5
4622 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4623
4624 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4625 then
4626
4627 if test "x$prefix" != xNONE; then
4628   cf_path_syntax="$prefix"
4629 else
4630   cf_path_syntax="$ac_default_prefix"
4631 fi
4632
4633 case ".$withval" in #(vi
4634 .\$\(*\)*|.\'*\'*) #(vi
4635   ;;
4636 ..|./*|.\\*) #(vi
4637   ;;
4638 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
4639   ;;
4640 .\${*prefix}*) #(vi
4641   eval withval="$withval"
4642   case ".$withval" in #(vi
4643   .NONE/*)
4644     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4645     ;;
4646   esac
4647   ;; #(vi
4648 .no|.NONE/*)
4649   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4650   ;;
4651 *)
4652   { { echo "$as_me:4652: error: expected a pathname, not \"$withval\"" >&5
4653 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4654    { (exit 1); exit 1; }; }
4655   ;;
4656 esac
4657
4658         if test -d "$cf_cv_curses_dir"
4659         then
4660
4661 if test -n "$cf_cv_curses_dir/include" ; then
4662   for cf_add_incdir in $cf_cv_curses_dir/include
4663   do
4664         while test $cf_add_incdir != /usr/include
4665         do
4666           if test -d $cf_add_incdir
4667           then
4668                 cf_have_incdir=no
4669                 if test -n "$CFLAGS$CPPFLAGS" ; then
4670                   # a loop is needed to ensure we can add subdirs of existing dirs
4671                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4672                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4673                           cf_have_incdir=yes; break
4674                         fi
4675                   done
4676                 fi
4677
4678                 if test "$cf_have_incdir" = no ; then
4679                   if test "$cf_add_incdir" = /usr/local/include ; then
4680                         if test "$GCC" = yes
4681                         then
4682                           cf_save_CPPFLAGS=$CPPFLAGS
4683                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4684                           cat >conftest.$ac_ext <<_ACEOF
4685 #line 4685 "configure"
4686 #include "confdefs.h"
4687 #include <stdio.h>
4688 int
4689 main ()
4690 {
4691 printf("Hello")
4692   ;
4693   return 0;
4694 }
4695 _ACEOF
4696 rm -f conftest.$ac_objext
4697 if { (eval echo "$as_me:4697: \"$ac_compile\"") >&5
4698   (eval $ac_compile) 2>&5
4699   ac_status=$?
4700   echo "$as_me:4700: \$? = $ac_status" >&5
4701   (exit $ac_status); } &&
4702          { ac_try='test -s conftest.$ac_objext'
4703   { (eval echo "$as_me:4703: \"$ac_try\"") >&5
4704   (eval $ac_try) 2>&5
4705   ac_status=$?
4706   echo "$as_me:4706: \$? = $ac_status" >&5
4707   (exit $ac_status); }; }; then
4708   :
4709 else
4710   echo "$as_me: failed program was:" >&5
4711 cat conftest.$ac_ext >&5
4712 cf_have_incdir=yes
4713 fi
4714 rm -f conftest.$ac_objext conftest.$ac_ext
4715                           CPPFLAGS=$cf_save_CPPFLAGS
4716                         fi
4717                   fi
4718                 fi
4719
4720                 if test "$cf_have_incdir" = no ; then
4721                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4722
4723 echo "${as_me:-configure}:4723: testing adding $cf_add_incdir to include-path ..." 1>&5
4724
4725                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4726
4727                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4728                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4729                   cf_add_incdir="$cf_top_incdir"
4730                 else
4731                   break
4732                 fi
4733           fi
4734         done
4735   done
4736 fi
4737
4738 if test -n "$cf_cv_curses_dir/lib" ; then
4739   for cf_add_libdir in $cf_cv_curses_dir/lib
4740   do
4741     if test $cf_add_libdir = /usr/lib ; then
4742       :
4743     elif test -d $cf_add_libdir
4744     then
4745       cf_have_libdir=no
4746       if test -n "$LDFLAGS$LIBS" ; then
4747         # a loop is needed to ensure we can add subdirs of existing dirs
4748         for cf_test_libdir in $LDFLAGS $LIBS ; do
4749           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4750             cf_have_libdir=yes; break
4751           fi
4752         done
4753       fi
4754       if test "$cf_have_libdir" = no ; then
4755         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4756
4757 echo "${as_me:-configure}:4757: testing adding $cf_add_libdir to library-path ..." 1>&5
4758
4759         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4760       fi
4761     fi
4762   done
4763 fi
4764
4765         fi
4766 fi
4767
4768 # Check whether --with-5lib or --without-5lib was given.
4769 if test "${with_5lib+set}" = set; then
4770   withval="$with_5lib"
4771   LIBS="-L/usr/5lib $LIBS"
4772          CPPFLAGS="$CPPFLAGS -I/usr/5include"
4773 fi;
4774
4775 # Check whether --with-ncursesw or --without-ncursesw was given.
4776 if test "${with_ncursesw+set}" = set; then
4777   withval="$with_ncursesw"
4778   cf_cv_screen=ncursesw
4779 else
4780
4781 # Check whether --with-ncurses or --without-ncurses was given.
4782 if test "${with_ncurses+set}" = set; then
4783   withval="$with_ncurses"
4784   cf_cv_screen=ncurses
4785 else
4786
4787 # Check whether --with-pdcurses or --without-pdcurses was given.
4788 if test "${with_pdcurses+set}" = set; then
4789   withval="$with_pdcurses"
4790   cf_cv_screen=pdcurses
4791 fi;
4792 fi;
4793 fi;
4794
4795 case $cf_cv_screen in
4796 curses)
4797
4798 echo "$as_me:4798: checking for extra include directories" >&5
4799 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4800 if test "${cf_cv_curses_incdir+set}" = set; then
4801   echo $ECHO_N "(cached) $ECHO_C" >&6
4802 else
4803
4804 cf_cv_curses_incdir=no
4805 case $host_os in #(vi
4806 hpux10.*) #(vi
4807         test -d /usr/include/curses_colr && \
4808         cf_cv_curses_incdir="-I/usr/include/curses_colr"
4809         ;;
4810 sunos3*|sunos4*)
4811         test -d /usr/5lib && \
4812         test -d /usr/5include && \
4813         cf_cv_curses_incdir="-I/usr/5include"
4814         ;;
4815 esac
4816
4817 fi
4818 echo "$as_me:4818: result: $cf_cv_curses_incdir" >&5
4819 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4820 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4821
4822 echo "$as_me:4822: checking if we have identified curses headers" >&5
4823 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4824 if test "${cf_cv_ncurses_header+set}" = set; then
4825   echo $ECHO_N "(cached) $ECHO_C" >&6
4826 else
4827
4828 cf_cv_ncurses_header=none
4829 for cf_header in  \
4830         curses.h \
4831         ncurses.h ncurses/curses.h ncurses/ncurses.h
4832 do
4833 cat >conftest.$ac_ext <<_ACEOF
4834 #line 4834 "configure"
4835 #include "confdefs.h"
4836 #include <${cf_header}>
4837 int
4838 main ()
4839 {
4840 initscr(); tgoto("?", 0,0)
4841   ;
4842   return 0;
4843 }
4844 _ACEOF
4845 rm -f conftest.$ac_objext
4846 if { (eval echo "$as_me:4846: \"$ac_compile\"") >&5
4847   (eval $ac_compile) 2>&5
4848   ac_status=$?
4849   echo "$as_me:4849: \$? = $ac_status" >&5
4850   (exit $ac_status); } &&
4851          { ac_try='test -s conftest.$ac_objext'
4852   { (eval echo "$as_me:4852: \"$ac_try\"") >&5
4853   (eval $ac_try) 2>&5
4854   ac_status=$?
4855   echo "$as_me:4855: \$? = $ac_status" >&5
4856   (exit $ac_status); }; }; then
4857   cf_cv_ncurses_header=$cf_header; break
4858 else
4859   echo "$as_me: failed program was:" >&5
4860 cat conftest.$ac_ext >&5
4861 fi
4862 rm -f conftest.$ac_objext conftest.$ac_ext
4863 done
4864
4865 fi
4866 echo "$as_me:4866: result: $cf_cv_ncurses_header" >&5
4867 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4868
4869 if test "$cf_cv_ncurses_header" = none ; then
4870         { { echo "$as_me:4870: error: No curses header-files found" >&5
4871 echo "$as_me: error: No curses header-files found" >&2;}
4872    { (exit 1); exit 1; }; }
4873 fi
4874
4875 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4876
4877 for ac_header in $cf_cv_ncurses_header
4878 do
4879 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4880 echo "$as_me:4880: checking for $ac_header" >&5
4881 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4882 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4883   echo $ECHO_N "(cached) $ECHO_C" >&6
4884 else
4885   cat >conftest.$ac_ext <<_ACEOF
4886 #line 4886 "configure"
4887 #include "confdefs.h"
4888 #include <$ac_header>
4889 _ACEOF
4890 if { (eval echo "$as_me:4890: \"$ac_cpp conftest.$ac_ext\"") >&5
4891   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4892   ac_status=$?
4893   egrep -v '^ *\+' conftest.er1 >conftest.err
4894   rm -f conftest.er1
4895   cat conftest.err >&5
4896   echo "$as_me:4896: \$? = $ac_status" >&5
4897   (exit $ac_status); } >/dev/null; then
4898   if test -s conftest.err; then
4899     ac_cpp_err=$ac_c_preproc_warn_flag
4900   else
4901     ac_cpp_err=
4902   fi
4903 else
4904   ac_cpp_err=yes
4905 fi
4906 if test -z "$ac_cpp_err"; then
4907   eval "$as_ac_Header=yes"
4908 else
4909   echo "$as_me: failed program was:" >&5
4910   cat conftest.$ac_ext >&5
4911   eval "$as_ac_Header=no"
4912 fi
4913 rm -f conftest.err conftest.$ac_ext
4914 fi
4915 echo "$as_me:4915: result: `eval echo '${'$as_ac_Header'}'`" >&5
4916 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4917 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4918   cat >>confdefs.h <<EOF
4919 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4920 EOF
4921
4922 fi
4923 done
4924
4925 echo "$as_me:4925: checking for terminfo header" >&5
4926 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4927 if test "${cf_cv_term_header+set}" = set; then
4928   echo $ECHO_N "(cached) $ECHO_C" >&6
4929 else
4930
4931 case ${cf_cv_ncurses_header} in #(vi
4932 */ncurses.h|*/ncursesw.h) #(vi
4933         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4934         ;;
4935 *)
4936         cf_term_header=term.h
4937         ;;
4938 esac
4939
4940 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4941 do
4942 cat >conftest.$ac_ext <<_ACEOF
4943 #line 4943 "configure"
4944 #include "confdefs.h"
4945 #include <stdio.h>
4946 #include <${cf_cv_ncurses_header:-curses.h}>
4947 #include <$cf_test>
4948
4949 int
4950 main ()
4951 {
4952 int x = auto_left_margin
4953   ;
4954   return 0;
4955 }
4956 _ACEOF
4957 rm -f conftest.$ac_objext
4958 if { (eval echo "$as_me:4958: \"$ac_compile\"") >&5
4959   (eval $ac_compile) 2>&5
4960   ac_status=$?
4961   echo "$as_me:4961: \$? = $ac_status" >&5
4962   (exit $ac_status); } &&
4963          { ac_try='test -s conftest.$ac_objext'
4964   { (eval echo "$as_me:4964: \"$ac_try\"") >&5
4965   (eval $ac_try) 2>&5
4966   ac_status=$?
4967   echo "$as_me:4967: \$? = $ac_status" >&5
4968   (exit $ac_status); }; }; then
4969
4970         cf_cv_term_header="$cf_test"
4971 else
4972   echo "$as_me: failed program was:" >&5
4973 cat conftest.$ac_ext >&5
4974
4975         cf_cv_term_header=unknown
4976
4977 fi
4978 rm -f conftest.$ac_objext conftest.$ac_ext
4979         test "$cf_cv_term_header" != unknown && break
4980 done
4981
4982 fi
4983 echo "$as_me:4983: result: $cf_cv_term_header" >&5
4984 echo "${ECHO_T}$cf_cv_term_header" >&6
4985
4986 # Set definitions to allow ifdef'ing to accommodate subdirectories
4987
4988 case $cf_cv_term_header in # (vi
4989 *term.h)
4990         cat >>confdefs.h <<\EOF
4991 #define HAVE_TERM_H 1
4992 EOF
4993
4994         ;;
4995 esac
4996
4997 case $cf_cv_term_header in # (vi
4998 ncurses/term.h) #(vi
4999         cat >>confdefs.h <<\EOF
5000 #define HAVE_NCURSES_TERM_H 1
5001 EOF
5002
5003         ;;
5004 ncursesw/term.h)
5005         cat >>confdefs.h <<\EOF
5006 #define HAVE_NCURSESW_TERM_H 1
5007 EOF
5008
5009         ;;
5010 esac
5011
5012 echo "$as_me:5012: checking for ncurses version" >&5
5013 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5014 if test "${cf_cv_ncurses_version+set}" = set; then
5015   echo $ECHO_N "(cached) $ECHO_C" >&6
5016 else
5017
5018         cf_cv_ncurses_version=no
5019         cf_tempfile=out$$
5020         rm -f $cf_tempfile
5021         if test "$cross_compiling" = yes; then
5022
5023         # This will not work if the preprocessor splits the line after the
5024         # Autoconf token.  The 'unproto' program does that.
5025         cat > conftest.$ac_ext <<EOF
5026 #include <${cf_cv_ncurses_header:-curses.h}>
5027 #undef Autoconf
5028 #ifdef NCURSES_VERSION
5029 Autoconf NCURSES_VERSION
5030 #else
5031 #ifdef __NCURSES_H
5032 Autoconf "old"
5033 #endif
5034 ;
5035 #endif
5036 EOF
5037         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5038         { (eval echo "$as_me:5038: \"$cf_try\"") >&5
5039   (eval $cf_try) 2>&5
5040   ac_status=$?
5041   echo "$as_me:5041: \$? = $ac_status" >&5
5042   (exit $ac_status); }
5043         if test -f conftest.out ; then
5044                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5045                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5046                 rm -f conftest.out
5047         fi
5048
5049 else
5050   cat >conftest.$ac_ext <<_ACEOF
5051 #line 5051 "configure"
5052 #include "confdefs.h"
5053
5054 #include <${cf_cv_ncurses_header:-curses.h}>
5055 #include <stdio.h>
5056 int main()
5057 {
5058         FILE *fp = fopen("$cf_tempfile", "w");
5059 #ifdef NCURSES_VERSION
5060 # ifdef NCURSES_VERSION_PATCH
5061         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5062 # else
5063         fprintf(fp, "%s\n", NCURSES_VERSION);
5064 # endif
5065 #else
5066 # ifdef __NCURSES_H
5067         fprintf(fp, "old\n");
5068 # else
5069         make an error
5070 # endif
5071 #endif
5072         ${cf_cv_main_return:-return}(0);
5073 }
5074 _ACEOF
5075 rm -f conftest$ac_exeext
5076 if { (eval echo "$as_me:5076: \"$ac_link\"") >&5
5077   (eval $ac_link) 2>&5
5078   ac_status=$?
5079   echo "$as_me:5079: \$? = $ac_status" >&5
5080   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5081   { (eval echo "$as_me:5081: \"$ac_try\"") >&5
5082   (eval $ac_try) 2>&5
5083   ac_status=$?
5084   echo "$as_me:5084: \$? = $ac_status" >&5
5085   (exit $ac_status); }; }; then
5086
5087         cf_cv_ncurses_version=`cat $cf_tempfile`
5088 else
5089   echo "$as_me: program exited with status $ac_status" >&5
5090 echo "$as_me: failed program was:" >&5
5091 cat conftest.$ac_ext >&5
5092 fi
5093 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5094 fi
5095         rm -f $cf_tempfile
5096
5097 fi
5098 echo "$as_me:5098: result: $cf_cv_ncurses_version" >&5
5099 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5100 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5101 #define NCURSES 1
5102 EOF
5103
5104 echo "$as_me:5104: checking if we have identified curses libraries" >&5
5105 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5106 cat >conftest.$ac_ext <<_ACEOF
5107 #line 5107 "configure"
5108 #include "confdefs.h"
5109 #include <${cf_cv_ncurses_header:-curses.h}>
5110 int
5111 main ()
5112 {
5113 initscr(); tgoto("?", 0,0)
5114   ;
5115   return 0;
5116 }
5117 _ACEOF
5118 rm -f conftest.$ac_objext conftest$ac_exeext
5119 if { (eval echo "$as_me:5119: \"$ac_link\"") >&5
5120   (eval $ac_link) 2>&5
5121   ac_status=$?
5122   echo "$as_me:5122: \$? = $ac_status" >&5
5123   (exit $ac_status); } &&
5124          { ac_try='test -s conftest$ac_exeext'
5125   { (eval echo "$as_me:5125: \"$ac_try\"") >&5
5126   (eval $ac_try) 2>&5
5127   ac_status=$?
5128   echo "$as_me:5128: \$? = $ac_status" >&5
5129   (exit $ac_status); }; }; then
5130   cf_result=yes
5131 else
5132   echo "$as_me: failed program was:" >&5
5133 cat conftest.$ac_ext >&5
5134 cf_result=no
5135 fi
5136 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5137 echo "$as_me:5137: result: $cf_result" >&5
5138 echo "${ECHO_T}$cf_result" >&6
5139
5140 if test "$cf_result" = no ; then
5141 case $host_os in #(vi
5142 freebsd*) #(vi
5143     echo "$as_me:5143: checking for tgoto in -lmytinfo" >&5
5144 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5145 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5146   echo $ECHO_N "(cached) $ECHO_C" >&6
5147 else
5148   ac_check_lib_save_LIBS=$LIBS
5149 LIBS="-lmytinfo  $LIBS"
5150 cat >conftest.$ac_ext <<_ACEOF
5151 #line 5151 "configure"
5152 #include "confdefs.h"
5153
5154 /* Override any gcc2 internal prototype to avoid an error.  */
5155 #ifdef __cplusplus
5156 extern "C"
5157 #endif
5158 /* We use char because int might match the return type of a gcc2
5159    builtin and then its argument prototype would still apply.  */
5160 char tgoto ();
5161 int
5162 main ()
5163 {
5164 tgoto ();
5165   ;
5166   return 0;
5167 }
5168 _ACEOF
5169 rm -f conftest.$ac_objext conftest$ac_exeext
5170 if { (eval echo "$as_me:5170: \"$ac_link\"") >&5
5171   (eval $ac_link) 2>&5
5172   ac_status=$?
5173   echo "$as_me:5173: \$? = $ac_status" >&5
5174   (exit $ac_status); } &&
5175          { ac_try='test -s conftest$ac_exeext'
5176   { (eval echo "$as_me:5176: \"$ac_try\"") >&5
5177   (eval $ac_try) 2>&5
5178   ac_status=$?
5179   echo "$as_me:5179: \$? = $ac_status" >&5
5180   (exit $ac_status); }; }; then
5181   ac_cv_lib_mytinfo_tgoto=yes
5182 else
5183   echo "$as_me: failed program was:" >&5
5184 cat conftest.$ac_ext >&5
5185 ac_cv_lib_mytinfo_tgoto=no
5186 fi
5187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5188 LIBS=$ac_check_lib_save_LIBS
5189 fi
5190 echo "$as_me:5190: result: $ac_cv_lib_mytinfo_tgoto" >&5
5191 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5192 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5193   LIBS="-lmytinfo $LIBS"
5194 fi
5195
5196     ;;
5197 hpux10.*) #(vi
5198     echo "$as_me:5198: checking for initscr in -lcur_colr" >&5
5199 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5200 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5201   echo $ECHO_N "(cached) $ECHO_C" >&6
5202 else
5203   ac_check_lib_save_LIBS=$LIBS
5204 LIBS="-lcur_colr  $LIBS"
5205 cat >conftest.$ac_ext <<_ACEOF
5206 #line 5206 "configure"
5207 #include "confdefs.h"
5208
5209 /* Override any gcc2 internal prototype to avoid an error.  */
5210 #ifdef __cplusplus
5211 extern "C"
5212 #endif
5213 /* We use char because int might match the return type of a gcc2
5214    builtin and then its argument prototype would still apply.  */
5215 char initscr ();
5216 int
5217 main ()
5218 {
5219 initscr ();
5220   ;
5221   return 0;
5222 }
5223 _ACEOF
5224 rm -f conftest.$ac_objext conftest$ac_exeext
5225 if { (eval echo "$as_me:5225: \"$ac_link\"") >&5
5226   (eval $ac_link) 2>&5
5227   ac_status=$?
5228   echo "$as_me:5228: \$? = $ac_status" >&5
5229   (exit $ac_status); } &&
5230          { ac_try='test -s conftest$ac_exeext'
5231   { (eval echo "$as_me:5231: \"$ac_try\"") >&5
5232   (eval $ac_try) 2>&5
5233   ac_status=$?
5234   echo "$as_me:5234: \$? = $ac_status" >&5
5235   (exit $ac_status); }; }; then
5236   ac_cv_lib_cur_colr_initscr=yes
5237 else
5238   echo "$as_me: failed program was:" >&5
5239 cat conftest.$ac_ext >&5
5240 ac_cv_lib_cur_colr_initscr=no
5241 fi
5242 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5243 LIBS=$ac_check_lib_save_LIBS
5244 fi
5245 echo "$as_me:5245: result: $ac_cv_lib_cur_colr_initscr" >&5
5246 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5247 if test $ac_cv_lib_cur_colr_initscr = yes; then
5248
5249         LIBS="-lcur_colr $LIBS"
5250         ac_cv_func_initscr=yes
5251
5252 else
5253
5254     echo "$as_me:5254: checking for initscr in -lHcurses" >&5
5255 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5256 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5257   echo $ECHO_N "(cached) $ECHO_C" >&6
5258 else
5259   ac_check_lib_save_LIBS=$LIBS
5260 LIBS="-lHcurses  $LIBS"
5261 cat >conftest.$ac_ext <<_ACEOF
5262 #line 5262 "configure"
5263 #include "confdefs.h"
5264
5265 /* Override any gcc2 internal prototype to avoid an error.  */
5266 #ifdef __cplusplus
5267 extern "C"
5268 #endif
5269 /* We use char because int might match the return type of a gcc2
5270    builtin and then its argument prototype would still apply.  */
5271 char initscr ();
5272 int
5273 main ()
5274 {
5275 initscr ();
5276   ;
5277   return 0;
5278 }
5279 _ACEOF
5280 rm -f conftest.$ac_objext conftest$ac_exeext
5281 if { (eval echo "$as_me:5281: \"$ac_link\"") >&5
5282   (eval $ac_link) 2>&5
5283   ac_status=$?
5284   echo "$as_me:5284: \$? = $ac_status" >&5
5285   (exit $ac_status); } &&
5286          { ac_try='test -s conftest$ac_exeext'
5287   { (eval echo "$as_me:5287: \"$ac_try\"") >&5
5288   (eval $ac_try) 2>&5
5289   ac_status=$?
5290   echo "$as_me:5290: \$? = $ac_status" >&5
5291   (exit $ac_status); }; }; then
5292   ac_cv_lib_Hcurses_initscr=yes
5293 else
5294   echo "$as_me: failed program was:" >&5
5295 cat conftest.$ac_ext >&5
5296 ac_cv_lib_Hcurses_initscr=no
5297 fi
5298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5299 LIBS=$ac_check_lib_save_LIBS
5300 fi
5301 echo "$as_me:5301: result: $ac_cv_lib_Hcurses_initscr" >&5
5302 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5303 if test $ac_cv_lib_Hcurses_initscr = yes; then
5304
5305         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5306         LIBS="-lHcurses $LIBS"
5307         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5308         ac_cv_func_initscr=yes
5309
5310 fi
5311
5312 fi
5313
5314     ;;
5315 linux*) # Suse Linux does not follow /usr/lib convention
5316
5317 if test -n "/lib" ; then
5318   for cf_add_libdir in /lib
5319   do
5320     if test $cf_add_libdir = /usr/lib ; then
5321       :
5322     elif test -d $cf_add_libdir
5323     then
5324       cf_have_libdir=no
5325       if test -n "$LDFLAGS$LIBS" ; then
5326         # a loop is needed to ensure we can add subdirs of existing dirs
5327         for cf_test_libdir in $LDFLAGS $LIBS ; do
5328           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5329             cf_have_libdir=yes; break
5330           fi
5331         done
5332       fi
5333       if test "$cf_have_libdir" = no ; then
5334         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5335
5336 echo "${as_me:-configure}:5336: testing adding $cf_add_libdir to library-path ..." 1>&5
5337
5338         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5339       fi
5340     fi
5341   done
5342 fi
5343
5344     ;;
5345 sunos3*|sunos4*)
5346     if test -d /usr/5lib ; then
5347
5348 if test -n "/usr/5lib" ; then
5349   for cf_add_libdir in /usr/5lib
5350   do
5351     if test $cf_add_libdir = /usr/lib ; then
5352       :
5353     elif test -d $cf_add_libdir
5354     then
5355       cf_have_libdir=no
5356       if test -n "$LDFLAGS$LIBS" ; then
5357         # a loop is needed to ensure we can add subdirs of existing dirs
5358         for cf_test_libdir in $LDFLAGS $LIBS ; do
5359           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5360             cf_have_libdir=yes; break
5361           fi
5362         done
5363       fi
5364       if test "$cf_have_libdir" = no ; then
5365         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5366
5367 echo "${as_me:-configure}:5367: testing adding $cf_add_libdir to library-path ..." 1>&5
5368
5369         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5370       fi
5371     fi
5372   done
5373 fi
5374
5375       LIBS="-lcurses -ltermcap $LIBS"
5376     fi
5377     ac_cv_func_initscr=yes
5378     ;;
5379 esac
5380
5381 if test ".$ac_cv_func_initscr" != .yes ; then
5382     cf_save_LIBS="$LIBS"
5383     cf_term_lib=""
5384     cf_curs_lib=""
5385
5386     if test ".${cf_cv_ncurses_version:-no}" != .no
5387     then
5388         cf_check_list="ncurses curses cursesX"
5389     else
5390         cf_check_list="cursesX curses ncurses"
5391     fi
5392
5393     # Check for library containing tgoto.  Do this before curses library
5394     # because it may be needed to link the test-case for initscr.
5395     echo "$as_me:5395: checking for tgoto" >&5
5396 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5397 if test "${ac_cv_func_tgoto+set}" = set; then
5398   echo $ECHO_N "(cached) $ECHO_C" >&6
5399 else
5400   cat >conftest.$ac_ext <<_ACEOF
5401 #line 5401 "configure"
5402 #include "confdefs.h"
5403 /* System header to define __stub macros and hopefully few prototypes,
5404     which can conflict with char tgoto (); below.  */
5405 #include <assert.h>
5406 /* Override any gcc2 internal prototype to avoid an error.  */
5407 #ifdef __cplusplus
5408 extern "C"
5409 #endif
5410 /* We use char because int might match the return type of a gcc2
5411    builtin and then its argument prototype would still apply.  */
5412 char tgoto ();
5413 char (*f) ();
5414
5415 int
5416 main ()
5417 {
5418 /* The GNU C library defines this for functions which it implements
5419     to always fail with ENOSYS.  Some functions are actually named
5420     something starting with __ and the normal name is an alias.  */
5421 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5422 choke me
5423 #else
5424 f = tgoto;
5425 #endif
5426
5427   ;
5428   return 0;
5429 }
5430 _ACEOF
5431 rm -f conftest.$ac_objext conftest$ac_exeext
5432 if { (eval echo "$as_me:5432: \"$ac_link\"") >&5
5433   (eval $ac_link) 2>&5
5434   ac_status=$?
5435   echo "$as_me:5435: \$? = $ac_status" >&5
5436   (exit $ac_status); } &&
5437          { ac_try='test -s conftest$ac_exeext'
5438   { (eval echo "$as_me:5438: \"$ac_try\"") >&5
5439   (eval $ac_try) 2>&5
5440   ac_status=$?
5441   echo "$as_me:5441: \$? = $ac_status" >&5
5442   (exit $ac_status); }; }; then
5443   ac_cv_func_tgoto=yes
5444 else
5445   echo "$as_me: failed program was:" >&5
5446 cat conftest.$ac_ext >&5
5447 ac_cv_func_tgoto=no
5448 fi
5449 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5450 fi
5451 echo "$as_me:5451: result: $ac_cv_func_tgoto" >&5
5452 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5453 if test $ac_cv_func_tgoto = yes; then
5454   cf_term_lib=predefined
5455 else
5456
5457         for cf_term_lib in $cf_check_list termcap termlib unknown
5458         do
5459             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5460 echo "$as_me:5460: checking for tgoto in -l$cf_term_lib" >&5
5461 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5462 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5463   echo $ECHO_N "(cached) $ECHO_C" >&6
5464 else
5465   ac_check_lib_save_LIBS=$LIBS
5466 LIBS="-l$cf_term_lib  $LIBS"
5467 cat >conftest.$ac_ext <<_ACEOF
5468 #line 5468 "configure"
5469 #include "confdefs.h"
5470
5471 /* Override any gcc2 internal prototype to avoid an error.  */
5472 #ifdef __cplusplus
5473 extern "C"
5474 #endif
5475 /* We use char because int might match the return type of a gcc2
5476    builtin and then its argument prototype would still apply.  */
5477 char tgoto ();
5478 int
5479 main ()
5480 {
5481 tgoto ();
5482   ;
5483   return 0;
5484 }
5485 _ACEOF
5486 rm -f conftest.$ac_objext conftest$ac_exeext
5487 if { (eval echo "$as_me:5487: \"$ac_link\"") >&5
5488   (eval $ac_link) 2>&5
5489   ac_status=$?
5490   echo "$as_me:5490: \$? = $ac_status" >&5
5491   (exit $ac_status); } &&
5492          { ac_try='test -s conftest$ac_exeext'
5493   { (eval echo "$as_me:5493: \"$ac_try\"") >&5
5494   (eval $ac_try) 2>&5
5495   ac_status=$?
5496   echo "$as_me:5496: \$? = $ac_status" >&5
5497   (exit $ac_status); }; }; then
5498   eval "$as_ac_Lib=yes"
5499 else
5500   echo "$as_me: failed program was:" >&5
5501 cat conftest.$ac_ext >&5
5502 eval "$as_ac_Lib=no"
5503 fi
5504 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5505 LIBS=$ac_check_lib_save_LIBS
5506 fi
5507 echo "$as_me:5507: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5508 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5509 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5510   break
5511 fi
5512
5513         done
5514
5515 fi
5516
5517     # Check for library containing initscr
5518     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5519         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5520     do
5521         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5522 echo "$as_me:5522: checking for initscr in -l$cf_curs_lib" >&5
5523 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5524 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5525   echo $ECHO_N "(cached) $ECHO_C" >&6
5526 else
5527   ac_check_lib_save_LIBS=$LIBS
5528 LIBS="-l$cf_curs_lib  $LIBS"
5529 cat >conftest.$ac_ext <<_ACEOF
5530 #line 5530 "configure"
5531 #include "confdefs.h"
5532
5533 /* Override any gcc2 internal prototype to avoid an error.  */
5534 #ifdef __cplusplus
5535 extern "C"
5536 #endif
5537 /* We use char because int might match the return type of a gcc2
5538    builtin and then its argument prototype would still apply.  */
5539 char initscr ();
5540 int
5541 main ()
5542 {
5543 initscr ();
5544   ;
5545   return 0;
5546 }
5547 _ACEOF
5548 rm -f conftest.$ac_objext conftest$ac_exeext
5549 if { (eval echo "$as_me:5549: \"$ac_link\"") >&5
5550   (eval $ac_link) 2>&5
5551   ac_status=$?
5552   echo "$as_me:5552: \$? = $ac_status" >&5
5553   (exit $ac_status); } &&
5554          { ac_try='test -s conftest$ac_exeext'
5555   { (eval echo "$as_me:5555: \"$ac_try\"") >&5
5556   (eval $ac_try) 2>&5
5557   ac_status=$?
5558   echo "$as_me:5558: \$? = $ac_status" >&5
5559   (exit $ac_status); }; }; then
5560   eval "$as_ac_Lib=yes"
5561 else
5562   echo "$as_me: failed program was:" >&5
5563 cat conftest.$ac_ext >&5
5564 eval "$as_ac_Lib=no"
5565 fi
5566 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5567 LIBS=$ac_check_lib_save_LIBS
5568 fi
5569 echo "$as_me:5569: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5570 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5571 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5572   break
5573 fi
5574
5575     done
5576     test $cf_curs_lib = unknown && { { echo "$as_me:5576: error: no curses library found" >&5
5577 echo "$as_me: error: no curses library found" >&2;}
5578    { (exit 1); exit 1; }; }
5579
5580     LIBS="-l$cf_curs_lib $cf_save_LIBS"
5581     if test "$cf_term_lib" = unknown ; then
5582         echo "$as_me:5582: checking if we can link with $cf_curs_lib library" >&5
5583 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5584         cat >conftest.$ac_ext <<_ACEOF
5585 #line 5585 "configure"
5586 #include "confdefs.h"
5587 #include <${cf_cv_ncurses_header:-curses.h}>
5588 int
5589 main ()
5590 {
5591 initscr()
5592   ;
5593   return 0;
5594 }
5595 _ACEOF
5596 rm -f conftest.$ac_objext conftest$ac_exeext
5597 if { (eval echo "$as_me:5597: \"$ac_link\"") >&5
5598   (eval $ac_link) 2>&5
5599   ac_status=$?
5600   echo "$as_me:5600: \$? = $ac_status" >&5
5601   (exit $ac_status); } &&
5602          { ac_try='test -s conftest$ac_exeext'
5603   { (eval echo "$as_me:5603: \"$ac_try\"") >&5
5604   (eval $ac_try) 2>&5
5605   ac_status=$?
5606   echo "$as_me:5606: \$? = $ac_status" >&5
5607   (exit $ac_status); }; }; then
5608   cf_result=yes
5609 else
5610   echo "$as_me: failed program was:" >&5
5611 cat conftest.$ac_ext >&5
5612 cf_result=no
5613 fi
5614 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5615         echo "$as_me:5615: result: $cf_result" >&5
5616 echo "${ECHO_T}$cf_result" >&6
5617         test $cf_result = no && { { echo "$as_me:5617: error: Cannot link curses library" >&5
5618 echo "$as_me: error: Cannot link curses library" >&2;}
5619    { (exit 1); exit 1; }; }
5620     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5621         :
5622     elif test "$cf_term_lib" != predefined ; then
5623         echo "$as_me:5623: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5624 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5625         cat >conftest.$ac_ext <<_ACEOF
5626 #line 5626 "configure"
5627 #include "confdefs.h"
5628 #include <${cf_cv_ncurses_header:-curses.h}>
5629 int
5630 main ()
5631 {
5632 initscr(); tgoto((char *)0, 0, 0);
5633   ;
5634   return 0;
5635 }
5636 _ACEOF
5637 rm -f conftest.$ac_objext conftest$ac_exeext
5638 if { (eval echo "$as_me:5638: \"$ac_link\"") >&5
5639   (eval $ac_link) 2>&5
5640   ac_status=$?
5641   echo "$as_me:5641: \$? = $ac_status" >&5
5642   (exit $ac_status); } &&
5643          { ac_try='test -s conftest$ac_exeext'
5644   { (eval echo "$as_me:5644: \"$ac_try\"") >&5
5645   (eval $ac_try) 2>&5
5646   ac_status=$?
5647   echo "$as_me:5647: \$? = $ac_status" >&5
5648   (exit $ac_status); }; }; then
5649   cf_result=no
5650 else
5651   echo "$as_me: failed program was:" >&5
5652 cat conftest.$ac_ext >&5
5653
5654             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5655             cat >conftest.$ac_ext <<_ACEOF
5656 #line 5656 "configure"
5657 #include "confdefs.h"
5658 #include <${cf_cv_ncurses_header:-curses.h}>
5659 int
5660 main ()
5661 {
5662 initscr()
5663   ;
5664   return 0;
5665 }
5666 _ACEOF
5667 rm -f conftest.$ac_objext conftest$ac_exeext
5668 if { (eval echo "$as_me:5668: \"$ac_link\"") >&5
5669   (eval $ac_link) 2>&5
5670   ac_status=$?
5671   echo "$as_me:5671: \$? = $ac_status" >&5
5672   (exit $ac_status); } &&
5673          { ac_try='test -s conftest$ac_exeext'
5674   { (eval echo "$as_me:5674: \"$ac_try\"") >&5
5675   (eval $ac_try) 2>&5
5676   ac_status=$?
5677   echo "$as_me:5677: \$? = $ac_status" >&5
5678   (exit $ac_status); }; }; then
5679   cf_result=yes
5680 else
5681   echo "$as_me: failed program was:" >&5
5682 cat conftest.$ac_ext >&5
5683 cf_result=error
5684 fi
5685 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5686
5687 fi
5688 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5689         echo "$as_me:5689: result: $cf_result" >&5
5690 echo "${ECHO_T}$cf_result" >&6
5691     fi
5692 fi
5693 fi
5694
5695         ;;
5696 ncurses)
5697
5698 cf_ncuconfig_root=ncurses
5699
5700 echo "Looking for ${cf_ncuconfig_root}-config"
5701 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5702 do
5703   # Extract the first word of "$ac_prog", so it can be a program name with args.
5704 set dummy $ac_prog; ac_word=$2
5705 echo "$as_me:5705: checking for $ac_word" >&5
5706 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5707 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
5708   echo $ECHO_N "(cached) $ECHO_C" >&6
5709 else
5710   case $NCURSES_CONFIG in
5711   [\\/]* | ?:[\\/]*)
5712   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
5713   ;;
5714   *)
5715   ac_save_IFS=$IFS; IFS=$ac_path_separator
5716 ac_dummy="$PATH"
5717 for ac_dir in $ac_dummy; do
5718   IFS=$ac_save_IFS
5719   test -z "$ac_dir" && ac_dir=.
5720   if $as_executable_p "$ac_dir/$ac_word"; then
5721    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
5722    echo "$as_me:5722: found $ac_dir/$ac_word" >&5
5723    break
5724 fi
5725 done
5726
5727   ;;
5728 esac
5729 fi
5730 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
5731
5732 if test -n "$NCURSES_CONFIG"; then
5733   echo "$as_me:5733: result: $NCURSES_CONFIG" >&5
5734 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5735 else
5736   echo "$as_me:5736: result: no" >&5
5737 echo "${ECHO_T}no" >&6
5738 fi
5739
5740   test -n "$NCURSES_CONFIG" && break
5741 done
5742 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
5743
5744 if test "$NCURSES_CONFIG" != none ; then
5745
5746 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5747 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5748
5749 # even with config script, some packages use no-override for curses.h
5750
5751 echo "$as_me:5751: checking if we have identified curses headers" >&5
5752 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5753 if test "${cf_cv_ncurses_header+set}" = set; then
5754   echo $ECHO_N "(cached) $ECHO_C" >&6
5755 else
5756
5757 cf_cv_ncurses_header=none
5758 for cf_header in  \
5759     ncurses/curses.h \
5760         ncurses/ncurses.h \
5761         curses.h \
5762         ncurses.h
5763 do
5764 cat >conftest.$ac_ext <<_ACEOF
5765 #line 5765 "configure"
5766 #include "confdefs.h"
5767 #include <${cf_header}>
5768 int
5769 main ()
5770 {
5771 initscr(); tgoto("?", 0,0)
5772   ;
5773   return 0;
5774 }
5775 _ACEOF
5776 rm -f conftest.$ac_objext
5777 if { (eval echo "$as_me:5777: \"$ac_compile\"") >&5
5778   (eval $ac_compile) 2>&5
5779   ac_status=$?
5780   echo "$as_me:5780: \$? = $ac_status" >&5
5781   (exit $ac_status); } &&
5782          { ac_try='test -s conftest.$ac_objext'
5783   { (eval echo "$as_me:5783: \"$ac_try\"") >&5
5784   (eval $ac_try) 2>&5
5785   ac_status=$?
5786   echo "$as_me:5786: \$? = $ac_status" >&5
5787   (exit $ac_status); }; }; then
5788   cf_cv_ncurses_header=$cf_header; break
5789 else
5790   echo "$as_me: failed program was:" >&5
5791 cat conftest.$ac_ext >&5
5792 fi
5793 rm -f conftest.$ac_objext conftest.$ac_ext
5794 done
5795
5796 fi
5797 echo "$as_me:5797: result: $cf_cv_ncurses_header" >&5
5798 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5799
5800 if test "$cf_cv_ncurses_header" = none ; then
5801         { { echo "$as_me:5801: error: No curses header-files found" >&5
5802 echo "$as_me: error: No curses header-files found" >&2;}
5803    { (exit 1); exit 1; }; }
5804 fi
5805
5806 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5807
5808 for ac_header in $cf_cv_ncurses_header
5809 do
5810 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5811 echo "$as_me:5811: checking for $ac_header" >&5
5812 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5813 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5814   echo $ECHO_N "(cached) $ECHO_C" >&6
5815 else
5816   cat >conftest.$ac_ext <<_ACEOF
5817 #line 5817 "configure"
5818 #include "confdefs.h"
5819 #include <$ac_header>
5820 _ACEOF
5821 if { (eval echo "$as_me:5821: \"$ac_cpp conftest.$ac_ext\"") >&5
5822   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5823   ac_status=$?
5824   egrep -v '^ *\+' conftest.er1 >conftest.err
5825   rm -f conftest.er1
5826   cat conftest.err >&5
5827   echo "$as_me:5827: \$? = $ac_status" >&5
5828   (exit $ac_status); } >/dev/null; then
5829   if test -s conftest.err; then
5830     ac_cpp_err=$ac_c_preproc_warn_flag
5831   else
5832     ac_cpp_err=
5833   fi
5834 else
5835   ac_cpp_err=yes
5836 fi
5837 if test -z "$ac_cpp_err"; then
5838   eval "$as_ac_Header=yes"
5839 else
5840   echo "$as_me: failed program was:" >&5
5841   cat conftest.$ac_ext >&5
5842   eval "$as_ac_Header=no"
5843 fi
5844 rm -f conftest.err conftest.$ac_ext
5845 fi
5846 echo "$as_me:5846: result: `eval echo '${'$as_ac_Header'}'`" >&5
5847 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5848 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5849   cat >>confdefs.h <<EOF
5850 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5851 EOF
5852
5853 fi
5854 done
5855
5856 cat >>confdefs.h <<\EOF
5857 #define NCURSES 1
5858 EOF
5859
5860 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5861
5862 cat >>confdefs.h <<EOF
5863 #define $cf_nculib_ROOT 1
5864 EOF
5865
5866 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5867
5868 else
5869
5870 cf_ncuhdr_root=ncurses
5871
5872 test -n "$cf_cv_curses_dir" && \
5873 test "$cf_cv_curses_dir" != "no" && { \
5874
5875 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5876   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5877   do
5878         while test $cf_add_incdir != /usr/include
5879         do
5880           if test -d $cf_add_incdir
5881           then
5882                 cf_have_incdir=no
5883                 if test -n "$CFLAGS$CPPFLAGS" ; then
5884                   # a loop is needed to ensure we can add subdirs of existing dirs
5885                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5886                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5887                           cf_have_incdir=yes; break
5888                         fi
5889                   done
5890                 fi
5891
5892                 if test "$cf_have_incdir" = no ; then
5893                   if test "$cf_add_incdir" = /usr/local/include ; then
5894                         if test "$GCC" = yes
5895                         then
5896                           cf_save_CPPFLAGS=$CPPFLAGS
5897                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5898                           cat >conftest.$ac_ext <<_ACEOF
5899 #line 5899 "configure"
5900 #include "confdefs.h"
5901 #include <stdio.h>
5902 int
5903 main ()
5904 {
5905 printf("Hello")
5906   ;
5907   return 0;
5908 }
5909 _ACEOF
5910 rm -f conftest.$ac_objext
5911 if { (eval echo "$as_me:5911: \"$ac_compile\"") >&5
5912   (eval $ac_compile) 2>&5
5913   ac_status=$?
5914   echo "$as_me:5914: \$? = $ac_status" >&5
5915   (exit $ac_status); } &&
5916          { ac_try='test -s conftest.$ac_objext'
5917   { (eval echo "$as_me:5917: \"$ac_try\"") >&5
5918   (eval $ac_try) 2>&5
5919   ac_status=$?
5920   echo "$as_me:5920: \$? = $ac_status" >&5
5921   (exit $ac_status); }; }; then
5922   :
5923 else
5924   echo "$as_me: failed program was:" >&5
5925 cat conftest.$ac_ext >&5
5926 cf_have_incdir=yes
5927 fi
5928 rm -f conftest.$ac_objext conftest.$ac_ext
5929                           CPPFLAGS=$cf_save_CPPFLAGS
5930                         fi
5931                   fi
5932                 fi
5933
5934                 if test "$cf_have_incdir" = no ; then
5935                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5936
5937 echo "${as_me:-configure}:5937: testing adding $cf_add_incdir to include-path ..." 1>&5
5938
5939                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5940
5941                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5942                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5943                   cf_add_incdir="$cf_top_incdir"
5944                 else
5945                   break
5946                 fi
5947           fi
5948         done
5949   done
5950 fi
5951
5952 }
5953
5954 echo "$as_me:5954: checking for $cf_ncuhdr_root header in include-path" >&5
5955 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5956 if test "${cf_cv_ncurses_h+set}" = set; then
5957   echo $ECHO_N "(cached) $ECHO_C" >&6
5958 else
5959
5960         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5961         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5962         for cf_header in $cf_header_list
5963         do
5964
5965         cat >conftest.$ac_ext <<_ACEOF
5966 #line 5966 "configure"
5967 #include "confdefs.h"
5968
5969 #include <$cf_header>
5970 int
5971 main ()
5972 {
5973
5974 #ifdef NCURSES_VERSION
5975
5976 printf("%s\n", NCURSES_VERSION);
5977 #else
5978 #ifdef __NCURSES_H
5979 printf("old\n");
5980 #else
5981         make an error
5982 #endif
5983 #endif
5984
5985   ;
5986   return 0;
5987 }
5988 _ACEOF
5989 rm -f conftest.$ac_objext
5990 if { (eval echo "$as_me:5990: \"$ac_compile\"") >&5
5991   (eval $ac_compile) 2>&5
5992   ac_status=$?
5993   echo "$as_me:5993: \$? = $ac_status" >&5
5994   (exit $ac_status); } &&
5995          { ac_try='test -s conftest.$ac_objext'
5996   { (eval echo "$as_me:5996: \"$ac_try\"") >&5
5997   (eval $ac_try) 2>&5
5998   ac_status=$?
5999   echo "$as_me:5999: \$? = $ac_status" >&5
6000   (exit $ac_status); }; }; then
6001   cf_cv_ncurses_h=$cf_header
6002
6003 else
6004   echo "$as_me: failed program was:" >&5
6005 cat conftest.$ac_ext >&5
6006 cf_cv_ncurses_h=no
6007 fi
6008 rm -f conftest.$ac_objext conftest.$ac_ext
6009
6010                 test "$cf_cv_ncurses_h" != no && break
6011         done
6012
6013 fi
6014 echo "$as_me:6014: result: $cf_cv_ncurses_h" >&5
6015 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6016
6017 if test "$cf_cv_ncurses_h" != no ; then
6018         cf_cv_ncurses_header=$cf_cv_ncurses_h
6019 else
6020
6021 echo "$as_me:6021: checking for $cf_ncuhdr_root include-path" >&5
6022 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6023 if test "${cf_cv_ncurses_h2+set}" = set; then
6024   echo $ECHO_N "(cached) $ECHO_C" >&6
6025 else
6026
6027         test -n "$verbose" && echo
6028
6029 cf_search=
6030
6031 # collect the current set of include-directories from compiler flags
6032 cf_header_path_list=""
6033 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6034         for cf_header_path in $CPPFLAGS $CFLAGS
6035         do
6036                 case $cf_header_path in #(vi
6037                 -I*)
6038                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6039
6040 test "$cf_header_path" != "NONE" && \
6041 test -d "$cf_header_path" && \
6042  {
6043         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6044         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6045         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6046         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6047         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6048         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"
6049 }
6050
6051                         cf_header_path_list="$cf_header_path_list $cf_search"
6052                         ;;
6053                 esac
6054         done
6055 fi
6056
6057 # add the variations for the package we are looking for
6058
6059 cf_search=
6060
6061 test "/usr" != "$prefix" && \
6062 test -d "/usr" && \
6063 (test $prefix = NONE || test "/usr" != "$prefix") && {
6064         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6065         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6066         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6067         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6068         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6069         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6070 }
6071
6072 test "$prefix" != "NONE" && \
6073 test -d "$prefix" && \
6074  {
6075         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6076         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6077         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6078         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6079         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6080         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6081 }
6082
6083 test "/usr/local" != "$prefix" && \
6084 test -d "/usr/local" && \
6085 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6086         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6087         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6088         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6089         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6090         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6091         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6092 }
6093
6094 test "/opt" != "$prefix" && \
6095 test -d "/opt" && \
6096 (test $prefix = NONE || test "/opt" != "$prefix") && {
6097         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6098         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6099         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6100         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6101         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6102         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6103 }
6104
6105 test "$HOME" != "$prefix" && \
6106 test -d "$HOME" && \
6107 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6108         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6109         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6110         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6111         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6112         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6113         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6114 }
6115
6116 test "$includedir" != NONE && \
6117 test "$includedir" != "/usr/include" && \
6118 test -d "$includedir" && {
6119         test -d $includedir &&    cf_search="$cf_search $includedir"
6120         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6121 }
6122
6123 test "$oldincludedir" != NONE && \
6124 test "$oldincludedir" != "/usr/include" && \
6125 test -d "$oldincludedir" && {
6126         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6127         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6128 }
6129
6130 cf_search="$cf_search $cf_header_path_list"
6131
6132         test -n "$verbose" && echo search path $cf_search
6133         cf_save2_CPPFLAGS="$CPPFLAGS"
6134         for cf_incdir in $cf_search
6135         do
6136
6137 if test -n "$cf_incdir" ; then
6138   for cf_add_incdir in $cf_incdir
6139   do
6140         while test $cf_add_incdir != /usr/include
6141         do
6142           if test -d $cf_add_incdir
6143           then
6144                 cf_have_incdir=no
6145                 if test -n "$CFLAGS$CPPFLAGS" ; then
6146                   # a loop is needed to ensure we can add subdirs of existing dirs
6147                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6148                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6149                           cf_have_incdir=yes; break
6150                         fi
6151                   done
6152                 fi
6153
6154                 if test "$cf_have_incdir" = no ; then
6155                   if test "$cf_add_incdir" = /usr/local/include ; then
6156                         if test "$GCC" = yes
6157                         then
6158                           cf_save_CPPFLAGS=$CPPFLAGS
6159                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6160                           cat >conftest.$ac_ext <<_ACEOF
6161 #line 6161 "configure"
6162 #include "confdefs.h"
6163 #include <stdio.h>
6164 int
6165 main ()
6166 {
6167 printf("Hello")
6168   ;
6169   return 0;
6170 }
6171 _ACEOF
6172 rm -f conftest.$ac_objext
6173 if { (eval echo "$as_me:6173: \"$ac_compile\"") >&5
6174   (eval $ac_compile) 2>&5
6175   ac_status=$?
6176   echo "$as_me:6176: \$? = $ac_status" >&5
6177   (exit $ac_status); } &&
6178          { ac_try='test -s conftest.$ac_objext'
6179   { (eval echo "$as_me:6179: \"$ac_try\"") >&5
6180   (eval $ac_try) 2>&5
6181   ac_status=$?
6182   echo "$as_me:6182: \$? = $ac_status" >&5
6183   (exit $ac_status); }; }; then
6184   :
6185 else
6186   echo "$as_me: failed program was:" >&5
6187 cat conftest.$ac_ext >&5
6188 cf_have_incdir=yes
6189 fi
6190 rm -f conftest.$ac_objext conftest.$ac_ext
6191                           CPPFLAGS=$cf_save_CPPFLAGS
6192                         fi
6193                   fi
6194                 fi
6195
6196                 if test "$cf_have_incdir" = no ; then
6197                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6198
6199 echo "${as_me:-configure}:6199: testing adding $cf_add_incdir to include-path ..." 1>&5
6200
6201                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6202
6203                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6204                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6205                   cf_add_incdir="$cf_top_incdir"
6206                 else
6207                   break
6208                 fi
6209           fi
6210         done
6211   done
6212 fi
6213
6214                 for cf_header in \
6215                         ncurses.h \
6216                         curses.h
6217                 do
6218
6219         cat >conftest.$ac_ext <<_ACEOF
6220 #line 6220 "configure"
6221 #include "confdefs.h"
6222
6223 #include <$cf_header>
6224 int
6225 main ()
6226 {
6227
6228 #ifdef NCURSES_VERSION
6229
6230 printf("%s\n", NCURSES_VERSION);
6231 #else
6232 #ifdef __NCURSES_H
6233 printf("old\n");
6234 #else
6235         make an error
6236 #endif
6237 #endif
6238
6239   ;
6240   return 0;
6241 }
6242 _ACEOF
6243 rm -f conftest.$ac_objext
6244 if { (eval echo "$as_me:6244: \"$ac_compile\"") >&5
6245   (eval $ac_compile) 2>&5
6246   ac_status=$?
6247   echo "$as_me:6247: \$? = $ac_status" >&5
6248   (exit $ac_status); } &&
6249          { ac_try='test -s conftest.$ac_objext'
6250   { (eval echo "$as_me:6250: \"$ac_try\"") >&5
6251   (eval $ac_try) 2>&5
6252   ac_status=$?
6253   echo "$as_me:6253: \$? = $ac_status" >&5
6254   (exit $ac_status); }; }; then
6255   cf_cv_ncurses_h2=$cf_header
6256
6257 else
6258   echo "$as_me: failed program was:" >&5
6259 cat conftest.$ac_ext >&5
6260 cf_cv_ncurses_h2=no
6261 fi
6262 rm -f conftest.$ac_objext conftest.$ac_ext
6263
6264                         if test "$cf_cv_ncurses_h2" != no ; then
6265                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6266                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6267                                 break
6268                         fi
6269                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6270                 done
6271                 CPPFLAGS="$cf_save2_CPPFLAGS"
6272                 test "$cf_cv_ncurses_h2" != no && break
6273         done
6274         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6274: error: not found" >&5
6275 echo "$as_me: error: not found" >&2;}
6276    { (exit 1); exit 1; }; }
6277
6278 fi
6279 echo "$as_me:6279: result: $cf_cv_ncurses_h2" >&5
6280 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6281
6282         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6283         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6284         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6285                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6286         fi
6287
6288 if test -n "$cf_1st_incdir" ; then
6289   for cf_add_incdir in $cf_1st_incdir
6290   do
6291         while test $cf_add_incdir != /usr/include
6292         do
6293           if test -d $cf_add_incdir
6294           then
6295                 cf_have_incdir=no
6296                 if test -n "$CFLAGS$CPPFLAGS" ; then
6297                   # a loop is needed to ensure we can add subdirs of existing dirs
6298                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6299                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6300                           cf_have_incdir=yes; break
6301                         fi
6302                   done
6303                 fi
6304
6305                 if test "$cf_have_incdir" = no ; then
6306                   if test "$cf_add_incdir" = /usr/local/include ; then
6307                         if test "$GCC" = yes
6308                         then
6309                           cf_save_CPPFLAGS=$CPPFLAGS
6310                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6311                           cat >conftest.$ac_ext <<_ACEOF
6312 #line 6312 "configure"
6313 #include "confdefs.h"
6314 #include <stdio.h>
6315 int
6316 main ()
6317 {
6318 printf("Hello")
6319   ;
6320   return 0;
6321 }
6322 _ACEOF
6323 rm -f conftest.$ac_objext
6324 if { (eval echo "$as_me:6324: \"$ac_compile\"") >&5
6325   (eval $ac_compile) 2>&5
6326   ac_status=$?
6327   echo "$as_me:6327: \$? = $ac_status" >&5
6328   (exit $ac_status); } &&
6329          { ac_try='test -s conftest.$ac_objext'
6330   { (eval echo "$as_me:6330: \"$ac_try\"") >&5
6331   (eval $ac_try) 2>&5
6332   ac_status=$?
6333   echo "$as_me:6333: \$? = $ac_status" >&5
6334   (exit $ac_status); }; }; then
6335   :
6336 else
6337   echo "$as_me: failed program was:" >&5
6338 cat conftest.$ac_ext >&5
6339 cf_have_incdir=yes
6340 fi
6341 rm -f conftest.$ac_objext conftest.$ac_ext
6342                           CPPFLAGS=$cf_save_CPPFLAGS
6343                         fi
6344                   fi
6345                 fi
6346
6347                 if test "$cf_have_incdir" = no ; then
6348                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6349
6350 echo "${as_me:-configure}:6350: testing adding $cf_add_incdir to include-path ..." 1>&5
6351
6352                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6353
6354                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6355                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6356                   cf_add_incdir="$cf_top_incdir"
6357                 else
6358                   break
6359                 fi
6360           fi
6361         done
6362   done
6363 fi
6364
6365 fi
6366
6367 # Set definitions to allow ifdef'ing for ncurses.h
6368
6369 case $cf_cv_ncurses_header in # (vi
6370 *ncurses.h)
6371         cat >>confdefs.h <<\EOF
6372 #define HAVE_NCURSES_H 1
6373 EOF
6374
6375         ;;
6376 esac
6377
6378 case $cf_cv_ncurses_header in # (vi
6379 ncurses/curses.h|ncurses/ncurses.h)
6380         cat >>confdefs.h <<\EOF
6381 #define HAVE_NCURSES_NCURSES_H 1
6382 EOF
6383
6384         ;;
6385 ncursesw/curses.h|ncursesw/ncurses.h)
6386         cat >>confdefs.h <<\EOF
6387 #define HAVE_NCURSESW_NCURSES_H 1
6388 EOF
6389
6390         ;;
6391 esac
6392
6393 echo "$as_me:6393: checking for terminfo header" >&5
6394 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6395 if test "${cf_cv_term_header+set}" = set; then
6396   echo $ECHO_N "(cached) $ECHO_C" >&6
6397 else
6398
6399 case ${cf_cv_ncurses_header} in #(vi
6400 */ncurses.h|*/ncursesw.h) #(vi
6401         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6402         ;;
6403 *)
6404         cf_term_header=term.h
6405         ;;
6406 esac
6407
6408 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6409 do
6410 cat >conftest.$ac_ext <<_ACEOF
6411 #line 6411 "configure"
6412 #include "confdefs.h"
6413 #include <stdio.h>
6414 #include <${cf_cv_ncurses_header:-curses.h}>
6415 #include <$cf_test>
6416
6417 int
6418 main ()
6419 {
6420 int x = auto_left_margin
6421   ;
6422   return 0;
6423 }
6424 _ACEOF
6425 rm -f conftest.$ac_objext
6426 if { (eval echo "$as_me:6426: \"$ac_compile\"") >&5
6427   (eval $ac_compile) 2>&5
6428   ac_status=$?
6429   echo "$as_me:6429: \$? = $ac_status" >&5
6430   (exit $ac_status); } &&
6431          { ac_try='test -s conftest.$ac_objext'
6432   { (eval echo "$as_me:6432: \"$ac_try\"") >&5
6433   (eval $ac_try) 2>&5
6434   ac_status=$?
6435   echo "$as_me:6435: \$? = $ac_status" >&5
6436   (exit $ac_status); }; }; then
6437
6438         cf_cv_term_header="$cf_test"
6439 else
6440   echo "$as_me: failed program was:" >&5
6441 cat conftest.$ac_ext >&5
6442
6443         cf_cv_term_header=unknown
6444
6445 fi
6446 rm -f conftest.$ac_objext conftest.$ac_ext
6447         test "$cf_cv_term_header" != unknown && break
6448 done
6449
6450 fi
6451 echo "$as_me:6451: result: $cf_cv_term_header" >&5
6452 echo "${ECHO_T}$cf_cv_term_header" >&6
6453
6454 # Set definitions to allow ifdef'ing to accommodate subdirectories
6455
6456 case $cf_cv_term_header in # (vi
6457 *term.h)
6458         cat >>confdefs.h <<\EOF
6459 #define HAVE_TERM_H 1
6460 EOF
6461
6462         ;;
6463 esac
6464
6465 case $cf_cv_term_header in # (vi
6466 ncurses/term.h) #(vi
6467         cat >>confdefs.h <<\EOF
6468 #define HAVE_NCURSES_TERM_H 1
6469 EOF
6470
6471         ;;
6472 ncursesw/term.h)
6473         cat >>confdefs.h <<\EOF
6474 #define HAVE_NCURSESW_TERM_H 1
6475 EOF
6476
6477         ;;
6478 esac
6479
6480 # some applications need this, but should check for NCURSES_VERSION
6481 cat >>confdefs.h <<\EOF
6482 #define NCURSES 1
6483 EOF
6484
6485 echo "$as_me:6485: checking for ncurses version" >&5
6486 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6487 if test "${cf_cv_ncurses_version+set}" = set; then
6488   echo $ECHO_N "(cached) $ECHO_C" >&6
6489 else
6490
6491         cf_cv_ncurses_version=no
6492         cf_tempfile=out$$
6493         rm -f $cf_tempfile
6494         if test "$cross_compiling" = yes; then
6495
6496         # This will not work if the preprocessor splits the line after the
6497         # Autoconf token.  The 'unproto' program does that.
6498         cat > conftest.$ac_ext <<EOF
6499 #include <${cf_cv_ncurses_header:-curses.h}>
6500 #undef Autoconf
6501 #ifdef NCURSES_VERSION
6502 Autoconf NCURSES_VERSION
6503 #else
6504 #ifdef __NCURSES_H
6505 Autoconf "old"
6506 #endif
6507 ;
6508 #endif
6509 EOF
6510         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6511         { (eval echo "$as_me:6511: \"$cf_try\"") >&5
6512   (eval $cf_try) 2>&5
6513   ac_status=$?
6514   echo "$as_me:6514: \$? = $ac_status" >&5
6515   (exit $ac_status); }
6516         if test -f conftest.out ; then
6517                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6518                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6519                 rm -f conftest.out
6520         fi
6521
6522 else
6523   cat >conftest.$ac_ext <<_ACEOF
6524 #line 6524 "configure"
6525 #include "confdefs.h"
6526
6527 #include <${cf_cv_ncurses_header:-curses.h}>
6528 #include <stdio.h>
6529 int main()
6530 {
6531         FILE *fp = fopen("$cf_tempfile", "w");
6532 #ifdef NCURSES_VERSION
6533 # ifdef NCURSES_VERSION_PATCH
6534         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6535 # else
6536         fprintf(fp, "%s\n", NCURSES_VERSION);
6537 # endif
6538 #else
6539 # ifdef __NCURSES_H
6540         fprintf(fp, "old\n");
6541 # else
6542         make an error
6543 # endif
6544 #endif
6545         ${cf_cv_main_return:-return}(0);
6546 }
6547 _ACEOF
6548 rm -f conftest$ac_exeext
6549 if { (eval echo "$as_me:6549: \"$ac_link\"") >&5
6550   (eval $ac_link) 2>&5
6551   ac_status=$?
6552   echo "$as_me:6552: \$? = $ac_status" >&5
6553   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6554   { (eval echo "$as_me:6554: \"$ac_try\"") >&5
6555   (eval $ac_try) 2>&5
6556   ac_status=$?
6557   echo "$as_me:6557: \$? = $ac_status" >&5
6558   (exit $ac_status); }; }; then
6559
6560         cf_cv_ncurses_version=`cat $cf_tempfile`
6561 else
6562   echo "$as_me: program exited with status $ac_status" >&5
6563 echo "$as_me: failed program was:" >&5
6564 cat conftest.$ac_ext >&5
6565 fi
6566 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6567 fi
6568         rm -f $cf_tempfile
6569
6570 fi
6571 echo "$as_me:6571: result: $cf_cv_ncurses_version" >&5
6572 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6573 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
6574 #define NCURSES 1
6575 EOF
6576
6577 cf_nculib_root=ncurses
6578         # This works, except for the special case where we find gpm, but
6579         # ncurses is in a nonstandard location via $LIBS, and we really want
6580         # to link gpm.
6581 cf_ncurses_LIBS=""
6582 cf_ncurses_SAVE="$LIBS"
6583 echo "$as_me:6583: checking for Gpm_Open in -lgpm" >&5
6584 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6585 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6586   echo $ECHO_N "(cached) $ECHO_C" >&6
6587 else
6588   ac_check_lib_save_LIBS=$LIBS
6589 LIBS="-lgpm  $LIBS"
6590 cat >conftest.$ac_ext <<_ACEOF
6591 #line 6591 "configure"
6592 #include "confdefs.h"
6593
6594 /* Override any gcc2 internal prototype to avoid an error.  */
6595 #ifdef __cplusplus
6596 extern "C"
6597 #endif
6598 /* We use char because int might match the return type of a gcc2
6599    builtin and then its argument prototype would still apply.  */
6600 char Gpm_Open ();
6601 int
6602 main ()
6603 {
6604 Gpm_Open ();
6605   ;
6606   return 0;
6607 }
6608 _ACEOF
6609 rm -f conftest.$ac_objext conftest$ac_exeext
6610 if { (eval echo "$as_me:6610: \"$ac_link\"") >&5
6611   (eval $ac_link) 2>&5
6612   ac_status=$?
6613   echo "$as_me:6613: \$? = $ac_status" >&5
6614   (exit $ac_status); } &&
6615          { ac_try='test -s conftest$ac_exeext'
6616   { (eval echo "$as_me:6616: \"$ac_try\"") >&5
6617   (eval $ac_try) 2>&5
6618   ac_status=$?
6619   echo "$as_me:6619: \$? = $ac_status" >&5
6620   (exit $ac_status); }; }; then
6621   ac_cv_lib_gpm_Gpm_Open=yes
6622 else
6623   echo "$as_me: failed program was:" >&5
6624 cat conftest.$ac_ext >&5
6625 ac_cv_lib_gpm_Gpm_Open=no
6626 fi
6627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6628 LIBS=$ac_check_lib_save_LIBS
6629 fi
6630 echo "$as_me:6630: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6631 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6632 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6633   echo "$as_me:6633: checking for initscr in -lgpm" >&5
6634 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6635 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6636   echo $ECHO_N "(cached) $ECHO_C" >&6
6637 else
6638   ac_check_lib_save_LIBS=$LIBS
6639 LIBS="-lgpm  $LIBS"
6640 cat >conftest.$ac_ext <<_ACEOF
6641 #line 6641 "configure"
6642 #include "confdefs.h"
6643
6644 /* Override any gcc2 internal prototype to avoid an error.  */
6645 #ifdef __cplusplus
6646 extern "C"
6647 #endif
6648 /* We use char because int might match the return type of a gcc2
6649    builtin and then its argument prototype would still apply.  */
6650 char initscr ();
6651 int
6652 main ()
6653 {
6654 initscr ();
6655   ;
6656   return 0;
6657 }
6658 _ACEOF
6659 rm -f conftest.$ac_objext conftest$ac_exeext
6660 if { (eval echo "$as_me:6660: \"$ac_link\"") >&5
6661   (eval $ac_link) 2>&5
6662   ac_status=$?
6663   echo "$as_me:6663: \$? = $ac_status" >&5
6664   (exit $ac_status); } &&
6665          { ac_try='test -s conftest$ac_exeext'
6666   { (eval echo "$as_me:6666: \"$ac_try\"") >&5
6667   (eval $ac_try) 2>&5
6668   ac_status=$?
6669   echo "$as_me:6669: \$? = $ac_status" >&5
6670   (exit $ac_status); }; }; then
6671   ac_cv_lib_gpm_initscr=yes
6672 else
6673   echo "$as_me: failed program was:" >&5
6674 cat conftest.$ac_ext >&5
6675 ac_cv_lib_gpm_initscr=no
6676 fi
6677 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6678 LIBS=$ac_check_lib_save_LIBS
6679 fi
6680 echo "$as_me:6680: result: $ac_cv_lib_gpm_initscr" >&5
6681 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6682 if test $ac_cv_lib_gpm_initscr = yes; then
6683   LIBS="$cf_ncurses_SAVE"
6684 else
6685   cf_ncurses_LIBS="-lgpm"
6686 fi
6687
6688 fi
6689
6690 case $host_os in #(vi
6691 freebsd*)
6692         # This is only necessary if you are linking against an obsolete
6693         # version of ncurses (but it should do no harm, since it's static).
6694         if test "$cf_nculib_root" = ncurses ; then
6695                 echo "$as_me:6695: checking for tgoto in -lmytinfo" >&5
6696 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6697 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6698   echo $ECHO_N "(cached) $ECHO_C" >&6
6699 else
6700   ac_check_lib_save_LIBS=$LIBS
6701 LIBS="-lmytinfo  $LIBS"
6702 cat >conftest.$ac_ext <<_ACEOF
6703 #line 6703 "configure"
6704 #include "confdefs.h"
6705
6706 /* Override any gcc2 internal prototype to avoid an error.  */
6707 #ifdef __cplusplus
6708 extern "C"
6709 #endif
6710 /* We use char because int might match the return type of a gcc2
6711    builtin and then its argument prototype would still apply.  */
6712 char tgoto ();
6713 int
6714 main ()
6715 {
6716 tgoto ();
6717   ;
6718   return 0;
6719 }
6720 _ACEOF
6721 rm -f conftest.$ac_objext conftest$ac_exeext
6722 if { (eval echo "$as_me:6722: \"$ac_link\"") >&5
6723   (eval $ac_link) 2>&5
6724   ac_status=$?
6725   echo "$as_me:6725: \$? = $ac_status" >&5
6726   (exit $ac_status); } &&
6727          { ac_try='test -s conftest$ac_exeext'
6728   { (eval echo "$as_me:6728: \"$ac_try\"") >&5
6729   (eval $ac_try) 2>&5
6730   ac_status=$?
6731   echo "$as_me:6731: \$? = $ac_status" >&5
6732   (exit $ac_status); }; }; then
6733   ac_cv_lib_mytinfo_tgoto=yes
6734 else
6735   echo "$as_me: failed program was:" >&5
6736 cat conftest.$ac_ext >&5
6737 ac_cv_lib_mytinfo_tgoto=no
6738 fi
6739 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6740 LIBS=$ac_check_lib_save_LIBS
6741 fi
6742 echo "$as_me:6742: result: $ac_cv_lib_mytinfo_tgoto" >&5
6743 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6744 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6745   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6746 fi
6747
6748         fi
6749         ;;
6750 esac
6751
6752 LIBS="$cf_ncurses_LIBS $LIBS"
6753
6754 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6755 then
6756         LIBS="-l$cf_nculib_root $LIBS"
6757 else
6758
6759         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6760         cf_libdir=""
6761         echo "$as_me:6761: checking for initscr" >&5
6762 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6763 if test "${ac_cv_func_initscr+set}" = set; then
6764   echo $ECHO_N "(cached) $ECHO_C" >&6
6765 else
6766   cat >conftest.$ac_ext <<_ACEOF
6767 #line 6767 "configure"
6768 #include "confdefs.h"
6769 /* System header to define __stub macros and hopefully few prototypes,
6770     which can conflict with char initscr (); below.  */
6771 #include <assert.h>
6772 /* Override any gcc2 internal prototype to avoid an error.  */
6773 #ifdef __cplusplus
6774 extern "C"
6775 #endif
6776 /* We use char because int might match the return type of a gcc2
6777    builtin and then its argument prototype would still apply.  */
6778 char initscr ();
6779 char (*f) ();
6780
6781 int
6782 main ()
6783 {
6784 /* The GNU C library defines this for functions which it implements
6785     to always fail with ENOSYS.  Some functions are actually named
6786     something starting with __ and the normal name is an alias.  */
6787 #if defined (__stub_initscr) || defined (__stub___initscr)
6788 choke me
6789 #else
6790 f = initscr;
6791 #endif
6792
6793   ;
6794   return 0;
6795 }
6796 _ACEOF
6797 rm -f conftest.$ac_objext conftest$ac_exeext
6798 if { (eval echo "$as_me:6798: \"$ac_link\"") >&5
6799   (eval $ac_link) 2>&5
6800   ac_status=$?
6801   echo "$as_me:6801: \$? = $ac_status" >&5
6802   (exit $ac_status); } &&
6803          { ac_try='test -s conftest$ac_exeext'
6804   { (eval echo "$as_me:6804: \"$ac_try\"") >&5
6805   (eval $ac_try) 2>&5
6806   ac_status=$?
6807   echo "$as_me:6807: \$? = $ac_status" >&5
6808   (exit $ac_status); }; }; then
6809   ac_cv_func_initscr=yes
6810 else
6811   echo "$as_me: failed program was:" >&5
6812 cat conftest.$ac_ext >&5
6813 ac_cv_func_initscr=no
6814 fi
6815 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6816 fi
6817 echo "$as_me:6817: result: $ac_cv_func_initscr" >&5
6818 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6819 if test $ac_cv_func_initscr = yes; then
6820   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6821 else
6822
6823                 cf_save_LIBS="$LIBS"
6824                 echo "$as_me:6824: checking for initscr in -l$cf_nculib_root" >&5
6825 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6826                 LIBS="-l$cf_nculib_root $LIBS"
6827                 cat >conftest.$ac_ext <<_ACEOF
6828 #line 6828 "configure"
6829 #include "confdefs.h"
6830 #include <${cf_cv_ncurses_header:-curses.h}>
6831 int
6832 main ()
6833 {
6834 initscr()
6835   ;
6836   return 0;
6837 }
6838 _ACEOF
6839 rm -f conftest.$ac_objext conftest$ac_exeext
6840 if { (eval echo "$as_me:6840: \"$ac_link\"") >&5
6841   (eval $ac_link) 2>&5
6842   ac_status=$?
6843   echo "$as_me:6843: \$? = $ac_status" >&5
6844   (exit $ac_status); } &&
6845          { ac_try='test -s conftest$ac_exeext'
6846   { (eval echo "$as_me:6846: \"$ac_try\"") >&5
6847   (eval $ac_try) 2>&5
6848   ac_status=$?
6849   echo "$as_me:6849: \$? = $ac_status" >&5
6850   (exit $ac_status); }; }; then
6851   echo "$as_me:6851: result: yes" >&5
6852 echo "${ECHO_T}yes" >&6
6853                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6854
6855 else
6856   echo "$as_me: failed program was:" >&5
6857 cat conftest.$ac_ext >&5
6858 echo "$as_me:6858: result: no" >&5
6859 echo "${ECHO_T}no" >&6
6860
6861 cf_search=
6862 cf_library_path_list=""
6863 if test -n "${LDFLAGS}${LIBS}" ; then
6864         for cf_library_path in $LDFLAGS $LIBS
6865         do
6866                 case $cf_library_path in #(vi
6867                 -L*)
6868                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6869
6870 test "$cf_library_path" != "NONE" && \
6871 test -d "$cf_library_path" && \
6872  {
6873         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6874         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6875         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6876         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6877         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6878         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"
6879 }
6880
6881                         cf_library_path_list="$cf_library_path_list $cf_search"
6882                         ;;
6883                 esac
6884         done
6885 fi
6886
6887 cf_search=
6888
6889 test "/usr" != "$prefix" && \
6890 test -d "/usr" && \
6891 (test $prefix = NONE || test "/usr" != "$prefix") && {
6892         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6893         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6894         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6895         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6896         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6897         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6898 }
6899
6900 test "$prefix" != "NONE" && \
6901 test -d "$prefix" && \
6902  {
6903         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6904         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6905         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6906         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6907         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6908         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6909 }
6910
6911 test "/usr/local" != "$prefix" && \
6912 test -d "/usr/local" && \
6913 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6914         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6915         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6916         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6917         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6918         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6919         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6920 }
6921
6922 test "/opt" != "$prefix" && \
6923 test -d "/opt" && \
6924 (test $prefix = NONE || test "/opt" != "$prefix") && {
6925         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6926         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6927         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6928         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6929         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6930         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6931 }
6932
6933 test "$HOME" != "$prefix" && \
6934 test -d "$HOME" && \
6935 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6936         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6937         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6938         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6939         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6940         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6941         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6942 }
6943
6944 cf_search="$cf_library_path_list $cf_search"
6945
6946                         for cf_libdir in $cf_search
6947                         do
6948                                 echo "$as_me:6948: checking for -l$cf_nculib_root in $cf_libdir" >&5
6949 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6950                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6951                                 cat >conftest.$ac_ext <<_ACEOF
6952 #line 6952 "configure"
6953 #include "confdefs.h"
6954 #include <${cf_cv_ncurses_header:-curses.h}>
6955 int
6956 main ()
6957 {
6958 initscr()
6959   ;
6960   return 0;
6961 }
6962 _ACEOF
6963 rm -f conftest.$ac_objext conftest$ac_exeext
6964 if { (eval echo "$as_me:6964: \"$ac_link\"") >&5
6965   (eval $ac_link) 2>&5
6966   ac_status=$?
6967   echo "$as_me:6967: \$? = $ac_status" >&5
6968   (exit $ac_status); } &&
6969          { ac_try='test -s conftest$ac_exeext'
6970   { (eval echo "$as_me:6970: \"$ac_try\"") >&5
6971   (eval $ac_try) 2>&5
6972   ac_status=$?
6973   echo "$as_me:6973: \$? = $ac_status" >&5
6974   (exit $ac_status); }; }; then
6975   echo "$as_me:6975: result: yes" >&5
6976 echo "${ECHO_T}yes" >&6
6977                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6978                                          break
6979 else
6980   echo "$as_me: failed program was:" >&5
6981 cat conftest.$ac_ext >&5
6982 echo "$as_me:6982: result: no" >&5
6983 echo "${ECHO_T}no" >&6
6984                                          LIBS="$cf_save_LIBS"
6985 fi
6986 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6987                         done
6988
6989 fi
6990 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6991
6992 fi
6993
6994 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6995
6996 if test $cf_found_library = no ; then
6997         { { echo "$as_me:6997: error: Cannot link $cf_nculib_root library" >&5
6998 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6999    { (exit 1); exit 1; }; }
7000 fi
7001
7002 fi
7003
7004 if test -n "$cf_ncurses_LIBS" ; then
7005         echo "$as_me:7005: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7006 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7007         cf_ncurses_SAVE="$LIBS"
7008         for p in $cf_ncurses_LIBS ; do
7009                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7010                 if test "$q" != "$LIBS" ; then
7011                         LIBS="$q"
7012                 fi
7013         done
7014         cat >conftest.$ac_ext <<_ACEOF
7015 #line 7015 "configure"
7016 #include "confdefs.h"
7017 #include <${cf_cv_ncurses_header:-curses.h}>
7018 int
7019 main ()
7020 {
7021 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7022   ;
7023   return 0;
7024 }
7025 _ACEOF
7026 rm -f conftest.$ac_objext conftest$ac_exeext
7027 if { (eval echo "$as_me:7027: \"$ac_link\"") >&5
7028   (eval $ac_link) 2>&5
7029   ac_status=$?
7030   echo "$as_me:7030: \$? = $ac_status" >&5
7031   (exit $ac_status); } &&
7032          { ac_try='test -s conftest$ac_exeext'
7033   { (eval echo "$as_me:7033: \"$ac_try\"") >&5
7034   (eval $ac_try) 2>&5
7035   ac_status=$?
7036   echo "$as_me:7036: \$? = $ac_status" >&5
7037   (exit $ac_status); }; }; then
7038   echo "$as_me:7038: result: yes" >&5
7039 echo "${ECHO_T}yes" >&6
7040 else
7041   echo "$as_me: failed program was:" >&5
7042 cat conftest.$ac_ext >&5
7043 echo "$as_me:7043: result: no" >&5
7044 echo "${ECHO_T}no" >&6
7045                  LIBS="$cf_ncurses_SAVE"
7046 fi
7047 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7048 fi
7049
7050 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7051
7052 cat >>confdefs.h <<EOF
7053 #define $cf_nculib_ROOT 1
7054 EOF
7055
7056 fi
7057
7058         ;;
7059 ncursesw)
7060         cf_cv_libtype=w
7061
7062 echo "$as_me:7062: checking for multibyte character support" >&5
7063 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7064 if test "${cf_cv_utf8_lib+set}" = set; then
7065   echo $ECHO_N "(cached) $ECHO_C" >&6
7066 else
7067
7068         cf_save_LIBS="$LIBS"
7069         cat >conftest.$ac_ext <<_ACEOF
7070 #line 7070 "configure"
7071 #include "confdefs.h"
7072
7073 #include <stdlib.h>
7074 int
7075 main ()
7076 {
7077 putwc(0,0);
7078   ;
7079   return 0;
7080 }
7081 _ACEOF
7082 rm -f conftest.$ac_objext conftest$ac_exeext
7083 if { (eval echo "$as_me:7083: \"$ac_link\"") >&5
7084   (eval $ac_link) 2>&5
7085   ac_status=$?
7086   echo "$as_me:7086: \$? = $ac_status" >&5
7087   (exit $ac_status); } &&
7088          { ac_try='test -s conftest$ac_exeext'
7089   { (eval echo "$as_me:7089: \"$ac_try\"") >&5
7090   (eval $ac_try) 2>&5
7091   ac_status=$?
7092   echo "$as_me:7092: \$? = $ac_status" >&5
7093   (exit $ac_status); }; }; then
7094   cf_cv_utf8_lib=yes
7095 else
7096   echo "$as_me: failed program was:" >&5
7097 cat conftest.$ac_ext >&5
7098
7099 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7100 # will be set on completion of the AC_TRY_LINK below.
7101 cf_cv_header_path_utf8=
7102 cf_cv_library_path_utf8=
7103
7104 echo "${as_me:-configure}:7104: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7105
7106 cf_save_LIBS="$LIBS"
7107
7108 cat >conftest.$ac_ext <<_ACEOF
7109 #line 7109 "configure"
7110 #include "confdefs.h"
7111
7112 #include <libutf8.h>
7113 int
7114 main ()
7115 {
7116 putwc(0,0);
7117   ;
7118   return 0;
7119 }
7120 _ACEOF
7121 rm -f conftest.$ac_objext conftest$ac_exeext
7122 if { (eval echo "$as_me:7122: \"$ac_link\"") >&5
7123   (eval $ac_link) 2>&5
7124   ac_status=$?
7125   echo "$as_me:7125: \$? = $ac_status" >&5
7126   (exit $ac_status); } &&
7127          { ac_try='test -s conftest$ac_exeext'
7128   { (eval echo "$as_me:7128: \"$ac_try\"") >&5
7129   (eval $ac_try) 2>&5
7130   ac_status=$?
7131   echo "$as_me:7131: \$? = $ac_status" >&5
7132   (exit $ac_status); }; }; then
7133
7134         cf_cv_find_linkage_utf8=yes
7135         cf_cv_header_path_utf8=/usr/include
7136         cf_cv_library_path_utf8=/usr/lib
7137
7138 else
7139   echo "$as_me: failed program was:" >&5
7140 cat conftest.$ac_ext >&5
7141
7142 LIBS="-lutf8  $cf_save_LIBS"
7143
7144 cat >conftest.$ac_ext <<_ACEOF
7145 #line 7145 "configure"
7146 #include "confdefs.h"
7147
7148 #include <libutf8.h>
7149 int
7150 main ()
7151 {
7152 putwc(0,0);
7153   ;
7154   return 0;
7155 }
7156 _ACEOF
7157 rm -f conftest.$ac_objext conftest$ac_exeext
7158 if { (eval echo "$as_me:7158: \"$ac_link\"") >&5
7159   (eval $ac_link) 2>&5
7160   ac_status=$?
7161   echo "$as_me:7161: \$? = $ac_status" >&5
7162   (exit $ac_status); } &&
7163          { ac_try='test -s conftest$ac_exeext'
7164   { (eval echo "$as_me:7164: \"$ac_try\"") >&5
7165   (eval $ac_try) 2>&5
7166   ac_status=$?
7167   echo "$as_me:7167: \$? = $ac_status" >&5
7168   (exit $ac_status); }; }; then
7169
7170         cf_cv_find_linkage_utf8=yes
7171         cf_cv_header_path_utf8=/usr/include
7172         cf_cv_library_path_utf8=/usr/lib
7173         cf_cv_library_file_utf8="-lutf8"
7174
7175 else
7176   echo "$as_me: failed program was:" >&5
7177 cat conftest.$ac_ext >&5
7178
7179         cf_cv_find_linkage_utf8=no
7180         LIBS="$cf_save_LIBS"
7181
7182     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
7183
7184 echo "${as_me:-configure}:7184: testing find linkage for utf8 library ..." 1>&5
7185
7186 echo "${as_me:-configure}:7186: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7187
7188     cf_save_CPPFLAGS="$CPPFLAGS"
7189     cf_test_CPPFLAGS="$CPPFLAGS"
7190
7191 cf_search=
7192
7193 # collect the current set of include-directories from compiler flags
7194 cf_header_path_list=""
7195 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7196         for cf_header_path in $CPPFLAGS $CFLAGS
7197         do
7198                 case $cf_header_path in #(vi
7199                 -I*)
7200                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7201
7202 test "$cf_header_path" != "NONE" && \
7203 test -d "$cf_header_path" && \
7204  {
7205         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7206         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7207         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7208         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7209         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7210         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7211 }
7212
7213                         cf_header_path_list="$cf_header_path_list $cf_search"
7214                         ;;
7215                 esac
7216         done
7217 fi
7218
7219 # add the variations for the package we are looking for
7220
7221 cf_search=
7222
7223 test "/usr" != "$prefix" && \
7224 test -d "/usr" && \
7225 (test $prefix = NONE || test "/usr" != "$prefix") && {
7226         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7227         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7228         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7229         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7230         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7231         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7232 }
7233
7234 test "$prefix" != "NONE" && \
7235 test -d "$prefix" && \
7236  {
7237         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7238         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7239         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7240         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7241         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7242         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7243 }
7244
7245 test "/usr/local" != "$prefix" && \
7246 test -d "/usr/local" && \
7247 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7248         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
7249         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
7250         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
7251         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
7252         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
7253         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
7254 }
7255
7256 test "/opt" != "$prefix" && \
7257 test -d "/opt" && \
7258 (test $prefix = NONE || test "/opt" != "$prefix") && {
7259         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
7260         test -d /opt/include &&          cf_search="$cf_search /opt/include"
7261         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
7262         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
7263         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
7264         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
7265 }
7266
7267 test "$HOME" != "$prefix" && \
7268 test -d "$HOME" && \
7269 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7270         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
7271         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
7272         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
7273         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
7274         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
7275         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
7276 }
7277
7278 test "$includedir" != NONE && \
7279 test "$includedir" != "/usr/include" && \
7280 test -d "$includedir" && {
7281         test -d $includedir &&    cf_search="$cf_search $includedir"
7282         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7283 }
7284
7285 test "$oldincludedir" != NONE && \
7286 test "$oldincludedir" != "/usr/include" && \
7287 test -d "$oldincludedir" && {
7288         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7289         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7290 }
7291
7292 cf_search="$cf_search $cf_header_path_list"
7293
7294     for cf_cv_header_path_utf8 in $cf_search
7295     do
7296       if test -d $cf_cv_header_path_utf8 ; then
7297         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7298
7299 echo "${as_me:-configure}:7299: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7300
7301         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
7302         cat >conftest.$ac_ext <<_ACEOF
7303 #line 7303 "configure"
7304 #include "confdefs.h"
7305
7306 #include <libutf8.h>
7307 int
7308 main ()
7309 {
7310 putwc(0,0);
7311   ;
7312   return 0;
7313 }
7314 _ACEOF
7315 rm -f conftest.$ac_objext
7316 if { (eval echo "$as_me:7316: \"$ac_compile\"") >&5
7317   (eval $ac_compile) 2>&5
7318   ac_status=$?
7319   echo "$as_me:7319: \$? = $ac_status" >&5
7320   (exit $ac_status); } &&
7321          { ac_try='test -s conftest.$ac_objext'
7322   { (eval echo "$as_me:7322: \"$ac_try\"") >&5
7323   (eval $ac_try) 2>&5
7324   ac_status=$?
7325   echo "$as_me:7325: \$? = $ac_status" >&5
7326   (exit $ac_status); }; }; then
7327
7328             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7329
7330 echo "${as_me:-configure}:7330: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7331
7332             cf_cv_find_linkage_utf8=maybe
7333             cf_test_CPPFLAGS="$CPPFLAGS"
7334             break
7335 else
7336   echo "$as_me: failed program was:" >&5
7337 cat conftest.$ac_ext >&5
7338
7339             CPPFLAGS="$cf_save_CPPFLAGS"
7340
7341 fi
7342 rm -f conftest.$ac_objext conftest.$ac_ext
7343       fi
7344     done
7345
7346     if test "$cf_cv_find_linkage_utf8" = maybe ; then
7347
7348 echo "${as_me:-configure}:7348: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7349
7350       cf_save_LIBS="$LIBS"
7351       cf_save_LDFLAGS="$LDFLAGS"
7352
7353       if test "$cf_cv_find_linkage_utf8" != yes ; then
7354
7355 cf_search=
7356 cf_library_path_list=""
7357 if test -n "${LDFLAGS}${LIBS}" ; then
7358         for cf_library_path in $LDFLAGS $LIBS
7359         do
7360                 case $cf_library_path in #(vi
7361                 -L*)
7362                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7363
7364 test "$cf_library_path" != "NONE" && \
7365 test -d "$cf_library_path" && \
7366  {
7367         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7368         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7369         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7370         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7371         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7372         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7373 }
7374
7375                         cf_library_path_list="$cf_library_path_list $cf_search"
7376                         ;;
7377                 esac
7378         done
7379 fi
7380
7381 cf_search=
7382
7383 test "/usr" != "$prefix" && \
7384 test -d "/usr" && \
7385 (test $prefix = NONE || test "/usr" != "$prefix") && {
7386         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7387         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7388         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
7389         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
7390         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
7391         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
7392 }
7393
7394 test "$prefix" != "NONE" && \
7395 test -d "$prefix" && \
7396  {
7397         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7398         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7399         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7400         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7401         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7402         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7403 }
7404
7405 test "/usr/local" != "$prefix" && \
7406 test -d "/usr/local" && \
7407 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7408         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7409         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7410         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
7411         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
7412         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
7413         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
7414 }
7415
7416 test "/opt" != "$prefix" && \
7417 test -d "/opt" && \
7418 (test $prefix = NONE || test "/opt" != "$prefix") && {
7419         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7420         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7421         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
7422         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
7423         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
7424         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
7425 }
7426
7427 test "$HOME" != "$prefix" && \
7428 test -d "$HOME" && \
7429 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7430         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7431         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7432         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
7433         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
7434         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
7435         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
7436 }
7437
7438 cf_search="$cf_library_path_list $cf_search"
7439
7440         for cf_cv_library_path_utf8 in $cf_search
7441         do
7442           if test -d $cf_cv_library_path_utf8 ; then
7443             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
7444
7445 echo "${as_me:-configure}:7445: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7446
7447             CPPFLAGS="$cf_test_CPPFLAGS"
7448             LIBS="-lutf8  $cf_save_LIBS"
7449             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7450             cat >conftest.$ac_ext <<_ACEOF
7451 #line 7451 "configure"
7452 #include "confdefs.h"
7453
7454 #include <libutf8.h>
7455 int
7456 main ()
7457 {
7458 putwc(0,0);
7459   ;
7460   return 0;
7461 }
7462 _ACEOF
7463 rm -f conftest.$ac_objext conftest$ac_exeext
7464 if { (eval echo "$as_me:7464: \"$ac_link\"") >&5
7465   (eval $ac_link) 2>&5
7466   ac_status=$?
7467   echo "$as_me:7467: \$? = $ac_status" >&5
7468   (exit $ac_status); } &&
7469          { ac_try='test -s conftest$ac_exeext'
7470   { (eval echo "$as_me:7470: \"$ac_try\"") >&5
7471   (eval $ac_try) 2>&5
7472   ac_status=$?
7473   echo "$as_me:7473: \$? = $ac_status" >&5
7474   (exit $ac_status); }; }; then
7475
7476                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7477
7478 echo "${as_me:-configure}:7478: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7479
7480                 cf_cv_find_linkage_utf8=yes
7481                 cf_cv_library_file_utf8="-lutf8"
7482                 break
7483 else
7484   echo "$as_me: failed program was:" >&5
7485 cat conftest.$ac_ext >&5
7486
7487                 CPPFLAGS="$cf_save_CPPFLAGS"
7488                 LIBS="$cf_save_LIBS"
7489                 LDFLAGS="$cf_save_LDFLAGS"
7490
7491 fi
7492 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7493           fi
7494         done
7495         CPPFLAGS="$cf_save_CPPFLAGS"
7496         LDFLAGS="$cf_save_LDFLAGS"
7497       fi
7498
7499     else
7500       cf_cv_find_linkage_utf8=no
7501     fi
7502
7503 fi
7504 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7505
7506 fi
7507 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7508
7509 LIBS="$cf_save_LIBS"
7510
7511 if test "$cf_cv_find_linkage_utf8" = yes ; then
7512 cf_cv_utf8_lib=add-on
7513 else
7514 cf_cv_utf8_lib=no
7515 fi
7516
7517 fi
7518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7519 fi
7520 echo "$as_me:7520: result: $cf_cv_utf8_lib" >&5
7521 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7522
7523 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7524 # ncurses/ncursesw:
7525 if test "$cf_cv_utf8_lib" = "add-on" ; then
7526         cat >>confdefs.h <<\EOF
7527 #define HAVE_LIBUTF8_H 1
7528 EOF
7529
7530 if test -n "$cf_cv_header_path_utf8" ; then
7531   for cf_add_incdir in $cf_cv_header_path_utf8
7532   do
7533         while test $cf_add_incdir != /usr/include
7534         do
7535           if test -d $cf_add_incdir
7536           then
7537                 cf_have_incdir=no
7538                 if test -n "$CFLAGS$CPPFLAGS" ; then
7539                   # a loop is needed to ensure we can add subdirs of existing dirs
7540                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7541                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7542                           cf_have_incdir=yes; break
7543                         fi
7544                   done
7545                 fi
7546
7547                 if test "$cf_have_incdir" = no ; then
7548                   if test "$cf_add_incdir" = /usr/local/include ; then
7549                         if test "$GCC" = yes
7550                         then
7551                           cf_save_CPPFLAGS=$CPPFLAGS
7552                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7553                           cat >conftest.$ac_ext <<_ACEOF
7554 #line 7554 "configure"
7555 #include "confdefs.h"
7556 #include <stdio.h>
7557 int
7558 main ()
7559 {
7560 printf("Hello")
7561   ;
7562   return 0;
7563 }
7564 _ACEOF
7565 rm -f conftest.$ac_objext
7566 if { (eval echo "$as_me:7566: \"$ac_compile\"") >&5
7567   (eval $ac_compile) 2>&5
7568   ac_status=$?
7569   echo "$as_me:7569: \$? = $ac_status" >&5
7570   (exit $ac_status); } &&
7571          { ac_try='test -s conftest.$ac_objext'
7572   { (eval echo "$as_me:7572: \"$ac_try\"") >&5
7573   (eval $ac_try) 2>&5
7574   ac_status=$?
7575   echo "$as_me:7575: \$? = $ac_status" >&5
7576   (exit $ac_status); }; }; then
7577   :
7578 else
7579   echo "$as_me: failed program was:" >&5
7580 cat conftest.$ac_ext >&5
7581 cf_have_incdir=yes
7582 fi
7583 rm -f conftest.$ac_objext conftest.$ac_ext
7584                           CPPFLAGS=$cf_save_CPPFLAGS
7585                         fi
7586                   fi
7587                 fi
7588
7589                 if test "$cf_have_incdir" = no ; then
7590                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7591
7592 echo "${as_me:-configure}:7592: testing adding $cf_add_incdir to include-path ..." 1>&5
7593
7594                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7595
7596                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7597                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7598                   cf_add_incdir="$cf_top_incdir"
7599                 else
7600                   break
7601                 fi
7602           fi
7603         done
7604   done
7605 fi
7606
7607 if test -n "$cf_cv_library_path_utf8" ; then
7608   for cf_add_libdir in $cf_cv_library_path_utf8
7609   do
7610     if test $cf_add_libdir = /usr/lib ; then
7611       :
7612     elif test -d $cf_add_libdir
7613     then
7614       cf_have_libdir=no
7615       if test -n "$LDFLAGS$LIBS" ; then
7616         # a loop is needed to ensure we can add subdirs of existing dirs
7617         for cf_test_libdir in $LDFLAGS $LIBS ; do
7618           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7619             cf_have_libdir=yes; break
7620           fi
7621         done
7622       fi
7623       if test "$cf_have_libdir" = no ; then
7624         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7625
7626 echo "${as_me:-configure}:7626: testing adding $cf_add_libdir to library-path ..." 1>&5
7627
7628         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7629       fi
7630     fi
7631   done
7632 fi
7633
7634         LIBS="$cf_cv_library_file_utf8 $LIBS"
7635 fi
7636
7637 cf_ncuconfig_root=ncursesw
7638
7639 echo "Looking for ${cf_ncuconfig_root}-config"
7640 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7641 do
7642   # Extract the first word of "$ac_prog", so it can be a program name with args.
7643 set dummy $ac_prog; ac_word=$2
7644 echo "$as_me:7644: checking for $ac_word" >&5
7645 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7646 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
7647   echo $ECHO_N "(cached) $ECHO_C" >&6
7648 else
7649   case $NCURSES_CONFIG in
7650   [\\/]* | ?:[\\/]*)
7651   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
7652   ;;
7653   *)
7654   ac_save_IFS=$IFS; IFS=$ac_path_separator
7655 ac_dummy="$PATH"
7656 for ac_dir in $ac_dummy; do
7657   IFS=$ac_save_IFS
7658   test -z "$ac_dir" && ac_dir=.
7659   if $as_executable_p "$ac_dir/$ac_word"; then
7660    ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
7661    echo "$as_me:7661: found $ac_dir/$ac_word" >&5
7662    break
7663 fi
7664 done
7665
7666   ;;
7667 esac
7668 fi
7669 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
7670
7671 if test -n "$NCURSES_CONFIG"; then
7672   echo "$as_me:7672: result: $NCURSES_CONFIG" >&5
7673 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7674 else
7675   echo "$as_me:7675: result: no" >&5
7676 echo "${ECHO_T}no" >&6
7677 fi
7678
7679   test -n "$NCURSES_CONFIG" && break
7680 done
7681 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
7682
7683 if test "$NCURSES_CONFIG" != none ; then
7684
7685 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7686 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
7687
7688 # even with config script, some packages use no-override for curses.h
7689
7690 echo "$as_me:7690: checking if we have identified curses headers" >&5
7691 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7692 if test "${cf_cv_ncurses_header+set}" = set; then
7693   echo $ECHO_N "(cached) $ECHO_C" >&6
7694 else
7695
7696 cf_cv_ncurses_header=none
7697 for cf_header in  \
7698     ncursesw/curses.h \
7699         ncursesw/ncurses.h \
7700         curses.h \
7701         ncurses.h
7702 do
7703 cat >conftest.$ac_ext <<_ACEOF
7704 #line 7704 "configure"
7705 #include "confdefs.h"
7706 #include <${cf_header}>
7707 int
7708 main ()
7709 {
7710 initscr(); tgoto("?", 0,0)
7711   ;
7712   return 0;
7713 }
7714 _ACEOF
7715 rm -f conftest.$ac_objext
7716 if { (eval echo "$as_me:7716: \"$ac_compile\"") >&5
7717   (eval $ac_compile) 2>&5
7718   ac_status=$?
7719   echo "$as_me:7719: \$? = $ac_status" >&5
7720   (exit $ac_status); } &&
7721          { ac_try='test -s conftest.$ac_objext'
7722   { (eval echo "$as_me:7722: \"$ac_try\"") >&5
7723   (eval $ac_try) 2>&5
7724   ac_status=$?
7725   echo "$as_me:7725: \$? = $ac_status" >&5
7726   (exit $ac_status); }; }; then
7727   cf_cv_ncurses_header=$cf_header; break
7728 else
7729   echo "$as_me: failed program was:" >&5
7730 cat conftest.$ac_ext >&5
7731 fi
7732 rm -f conftest.$ac_objext conftest.$ac_ext
7733 done
7734
7735 fi
7736 echo "$as_me:7736: result: $cf_cv_ncurses_header" >&5
7737 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7738
7739 if test "$cf_cv_ncurses_header" = none ; then
7740         { { echo "$as_me:7740: error: No curses header-files found" >&5
7741 echo "$as_me: error: No curses header-files found" >&2;}
7742    { (exit 1); exit 1; }; }
7743 fi
7744
7745 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7746
7747 for ac_header in $cf_cv_ncurses_header
7748 do
7749 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7750 echo "$as_me:7750: checking for $ac_header" >&5
7751 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7752 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7753   echo $ECHO_N "(cached) $ECHO_C" >&6
7754 else
7755   cat >conftest.$ac_ext <<_ACEOF
7756 #line 7756 "configure"
7757 #include "confdefs.h"
7758 #include <$ac_header>
7759 _ACEOF
7760 if { (eval echo "$as_me:7760: \"$ac_cpp conftest.$ac_ext\"") >&5
7761   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7762   ac_status=$?
7763   egrep -v '^ *\+' conftest.er1 >conftest.err
7764   rm -f conftest.er1
7765   cat conftest.err >&5
7766   echo "$as_me:7766: \$? = $ac_status" >&5
7767   (exit $ac_status); } >/dev/null; then
7768   if test -s conftest.err; then
7769     ac_cpp_err=$ac_c_preproc_warn_flag
7770   else
7771     ac_cpp_err=
7772   fi
7773 else
7774   ac_cpp_err=yes
7775 fi
7776 if test -z "$ac_cpp_err"; then
7777   eval "$as_ac_Header=yes"
7778 else
7779   echo "$as_me: failed program was:" >&5
7780   cat conftest.$ac_ext >&5
7781   eval "$as_ac_Header=no"
7782 fi
7783 rm -f conftest.err conftest.$ac_ext
7784 fi
7785 echo "$as_me:7785: result: `eval echo '${'$as_ac_Header'}'`" >&5
7786 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7787 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7788   cat >>confdefs.h <<EOF
7789 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7790 EOF
7791
7792 fi
7793 done
7794
7795 cat >>confdefs.h <<\EOF
7796 #define NCURSES 1
7797 EOF
7798
7799 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7800
7801 cat >>confdefs.h <<EOF
7802 #define $cf_nculib_ROOT 1
7803 EOF
7804
7805 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7806
7807 else
7808
7809 cf_ncuhdr_root=ncursesw
7810
7811 test -n "$cf_cv_curses_dir" && \
7812 test "$cf_cv_curses_dir" != "no" && { \
7813
7814 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7815   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7816   do
7817         while test $cf_add_incdir != /usr/include
7818         do
7819           if test -d $cf_add_incdir
7820           then
7821                 cf_have_incdir=no
7822                 if test -n "$CFLAGS$CPPFLAGS" ; then
7823                   # a loop is needed to ensure we can add subdirs of existing dirs
7824                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7825                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7826                           cf_have_incdir=yes; break
7827                         fi
7828                   done
7829                 fi
7830
7831                 if test "$cf_have_incdir" = no ; then
7832                   if test "$cf_add_incdir" = /usr/local/include ; then
7833                         if test "$GCC" = yes
7834                         then
7835                           cf_save_CPPFLAGS=$CPPFLAGS
7836                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7837                           cat >conftest.$ac_ext <<_ACEOF
7838 #line 7838 "configure"
7839 #include "confdefs.h"
7840 #include <stdio.h>
7841 int
7842 main ()
7843 {
7844 printf("Hello")
7845   ;
7846   return 0;
7847 }
7848 _ACEOF
7849 rm -f conftest.$ac_objext
7850 if { (eval echo "$as_me:7850: \"$ac_compile\"") >&5
7851   (eval $ac_compile) 2>&5
7852   ac_status=$?
7853   echo "$as_me:7853: \$? = $ac_status" >&5
7854   (exit $ac_status); } &&
7855          { ac_try='test -s conftest.$ac_objext'
7856   { (eval echo "$as_me:7856: \"$ac_try\"") >&5
7857   (eval $ac_try) 2>&5
7858   ac_status=$?
7859   echo "$as_me:7859: \$? = $ac_status" >&5
7860   (exit $ac_status); }; }; then
7861   :
7862 else
7863   echo "$as_me: failed program was:" >&5
7864 cat conftest.$ac_ext >&5
7865 cf_have_incdir=yes
7866 fi
7867 rm -f conftest.$ac_objext conftest.$ac_ext
7868                           CPPFLAGS=$cf_save_CPPFLAGS
7869                         fi
7870                   fi
7871                 fi
7872
7873                 if test "$cf_have_incdir" = no ; then
7874                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7875
7876 echo "${as_me:-configure}:7876: testing adding $cf_add_incdir to include-path ..." 1>&5
7877
7878                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7879
7880                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7881                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7882                   cf_add_incdir="$cf_top_incdir"
7883                 else
7884                   break
7885                 fi
7886           fi
7887         done
7888   done
7889 fi
7890
7891 }
7892
7893 echo "$as_me:7893: checking for $cf_ncuhdr_root header in include-path" >&5
7894 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7895 if test "${cf_cv_ncurses_h+set}" = set; then
7896   echo $ECHO_N "(cached) $ECHO_C" >&6
7897 else
7898
7899         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7900         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7901         for cf_header in $cf_header_list
7902         do
7903
7904         cat >conftest.$ac_ext <<_ACEOF
7905 #line 7905 "configure"
7906 #include "confdefs.h"
7907
7908 #define _XOPEN_SOURCE_EXTENDED
7909 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7910 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7911
7912 #include <$cf_header>
7913 int
7914 main ()
7915 {
7916
7917 #ifdef NCURSES_VERSION
7918
7919 #ifndef WACS_BSSB
7920         make an error
7921 #endif
7922
7923 printf("%s\n", NCURSES_VERSION);
7924 #else
7925 #ifdef __NCURSES_H
7926 printf("old\n");
7927 #else
7928         make an error
7929 #endif
7930 #endif
7931
7932   ;
7933   return 0;
7934 }
7935 _ACEOF
7936 rm -f conftest.$ac_objext
7937 if { (eval echo "$as_me:7937: \"$ac_compile\"") >&5
7938   (eval $ac_compile) 2>&5
7939   ac_status=$?
7940   echo "$as_me:7940: \$? = $ac_status" >&5
7941   (exit $ac_status); } &&
7942          { ac_try='test -s conftest.$ac_objext'
7943   { (eval echo "$as_me:7943: \"$ac_try\"") >&5
7944   (eval $ac_try) 2>&5
7945   ac_status=$?
7946   echo "$as_me:7946: \$? = $ac_status" >&5
7947   (exit $ac_status); }; }; then
7948   cf_cv_ncurses_h=$cf_header
7949
7950 else
7951   echo "$as_me: failed program was:" >&5
7952 cat conftest.$ac_ext >&5
7953 cf_cv_ncurses_h=no
7954 fi
7955 rm -f conftest.$ac_objext conftest.$ac_ext
7956
7957                 test "$cf_cv_ncurses_h" != no && break
7958         done
7959
7960 fi
7961 echo "$as_me:7961: result: $cf_cv_ncurses_h" >&5
7962 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7963
7964 if test "$cf_cv_ncurses_h" != no ; then
7965         cf_cv_ncurses_header=$cf_cv_ncurses_h
7966 else
7967
7968 echo "$as_me:7968: checking for $cf_ncuhdr_root include-path" >&5
7969 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7970 if test "${cf_cv_ncurses_h2+set}" = set; then
7971   echo $ECHO_N "(cached) $ECHO_C" >&6
7972 else
7973
7974         test -n "$verbose" && echo
7975
7976 cf_search=
7977
7978 # collect the current set of include-directories from compiler flags
7979 cf_header_path_list=""
7980 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7981         for cf_header_path in $CPPFLAGS $CFLAGS
7982         do
7983                 case $cf_header_path in #(vi
7984                 -I*)
7985                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7986
7987 test "$cf_header_path" != "NONE" && \
7988 test -d "$cf_header_path" && \
7989  {
7990         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7991         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7992         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7993         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7994         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7995         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"
7996 }
7997
7998                         cf_header_path_list="$cf_header_path_list $cf_search"
7999                         ;;
8000                 esac
8001         done
8002 fi
8003
8004 # add the variations for the package we are looking for
8005
8006 cf_search=
8007
8008 test "/usr" != "$prefix" && \
8009 test -d "/usr" && \
8010 (test $prefix = NONE || test "/usr" != "$prefix") && {
8011         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8012         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8013         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
8014         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
8015         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
8016         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8017 }
8018
8019 test "$prefix" != "NONE" && \
8020 test -d "$prefix" && \
8021  {
8022         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8023         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8024         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8025         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8026         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8027         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8028 }
8029
8030 test "/usr/local" != "$prefix" && \
8031 test -d "/usr/local" && \
8032 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8033         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8034         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8035         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8036         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8037         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8038         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8039 }
8040
8041 test "/opt" != "$prefix" && \
8042 test -d "/opt" && \
8043 (test $prefix = NONE || test "/opt" != "$prefix") && {
8044         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8045         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8046         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8047         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8048         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8049         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8050 }
8051
8052 test "$HOME" != "$prefix" && \
8053 test -d "$HOME" && \
8054 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8055         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8056         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8057         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8058         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8059         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8060         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8061 }
8062
8063 test "$includedir" != NONE && \
8064 test "$includedir" != "/usr/include" && \
8065 test -d "$includedir" && {
8066         test -d $includedir &&    cf_search="$cf_search $includedir"
8067         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8068 }
8069
8070 test "$oldincludedir" != NONE && \
8071 test "$oldincludedir" != "/usr/include" && \
8072 test -d "$oldincludedir" && {
8073         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8074         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8075 }
8076
8077 cf_search="$cf_search $cf_header_path_list"
8078
8079         test -n "$verbose" && echo search path $cf_search
8080         cf_save2_CPPFLAGS="$CPPFLAGS"
8081         for cf_incdir in $cf_search
8082         do
8083
8084 if test -n "$cf_incdir" ; then
8085   for cf_add_incdir in $cf_incdir
8086   do
8087         while test $cf_add_incdir != /usr/include
8088         do
8089           if test -d $cf_add_incdir
8090           then
8091                 cf_have_incdir=no
8092                 if test -n "$CFLAGS$CPPFLAGS" ; then
8093                   # a loop is needed to ensure we can add subdirs of existing dirs
8094                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8095                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8096                           cf_have_incdir=yes; break
8097                         fi
8098                   done
8099                 fi
8100
8101                 if test "$cf_have_incdir" = no ; then
8102                   if test "$cf_add_incdir" = /usr/local/include ; then
8103                         if test "$GCC" = yes
8104                         then
8105                           cf_save_CPPFLAGS=$CPPFLAGS
8106                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8107                           cat >conftest.$ac_ext <<_ACEOF
8108 #line 8108 "configure"
8109 #include "confdefs.h"
8110 #include <stdio.h>
8111 int
8112 main ()
8113 {
8114 printf("Hello")
8115   ;
8116   return 0;
8117 }
8118 _ACEOF
8119 rm -f conftest.$ac_objext
8120 if { (eval echo "$as_me:8120: \"$ac_compile\"") >&5
8121   (eval $ac_compile) 2>&5
8122   ac_status=$?
8123   echo "$as_me:8123: \$? = $ac_status" >&5
8124   (exit $ac_status); } &&
8125          { ac_try='test -s conftest.$ac_objext'
8126   { (eval echo "$as_me:8126: \"$ac_try\"") >&5
8127   (eval $ac_try) 2>&5
8128   ac_status=$?
8129   echo "$as_me:8129: \$? = $ac_status" >&5
8130   (exit $ac_status); }; }; then
8131   :
8132 else
8133   echo "$as_me: failed program was:" >&5
8134 cat conftest.$ac_ext >&5
8135 cf_have_incdir=yes
8136 fi
8137 rm -f conftest.$ac_objext conftest.$ac_ext
8138                           CPPFLAGS=$cf_save_CPPFLAGS
8139                         fi
8140                   fi
8141                 fi
8142
8143                 if test "$cf_have_incdir" = no ; then
8144                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8145
8146 echo "${as_me:-configure}:8146: testing adding $cf_add_incdir to include-path ..." 1>&5
8147
8148                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8149
8150                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8151                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8152                   cf_add_incdir="$cf_top_incdir"
8153                 else
8154                   break
8155                 fi
8156           fi
8157         done
8158   done
8159 fi
8160
8161                 for cf_header in \
8162                         ncurses.h \
8163                         curses.h
8164                 do
8165
8166         cat >conftest.$ac_ext <<_ACEOF
8167 #line 8167 "configure"
8168 #include "confdefs.h"
8169
8170 #include <$cf_header>
8171 int
8172 main ()
8173 {
8174
8175 #ifdef NCURSES_VERSION
8176
8177 printf("%s\n", NCURSES_VERSION);
8178 #else
8179 #ifdef __NCURSES_H
8180 printf("old\n");
8181 #else
8182         make an error
8183 #endif
8184 #endif
8185
8186   ;
8187   return 0;
8188 }
8189 _ACEOF
8190 rm -f conftest.$ac_objext
8191 if { (eval echo "$as_me:8191: \"$ac_compile\"") >&5
8192   (eval $ac_compile) 2>&5
8193   ac_status=$?
8194   echo "$as_me:8194: \$? = $ac_status" >&5
8195   (exit $ac_status); } &&
8196          { ac_try='test -s conftest.$ac_objext'
8197   { (eval echo "$as_me:8197: \"$ac_try\"") >&5
8198   (eval $ac_try) 2>&5
8199   ac_status=$?
8200   echo "$as_me:8200: \$? = $ac_status" >&5
8201   (exit $ac_status); }; }; then
8202   cf_cv_ncurses_h2=$cf_header
8203
8204 else
8205   echo "$as_me: failed program was:" >&5
8206 cat conftest.$ac_ext >&5
8207 cf_cv_ncurses_h2=no
8208 fi
8209 rm -f conftest.$ac_objext conftest.$ac_ext
8210
8211                         if test "$cf_cv_ncurses_h2" != no ; then
8212                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8213                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8214                                 break
8215                         fi
8216                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8217                 done
8218                 CPPFLAGS="$cf_save2_CPPFLAGS"
8219                 test "$cf_cv_ncurses_h2" != no && break
8220         done
8221         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8221: error: not found" >&5
8222 echo "$as_me: error: not found" >&2;}
8223    { (exit 1); exit 1; }; }
8224
8225 fi
8226 echo "$as_me:8226: result: $cf_cv_ncurses_h2" >&5
8227 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8228
8229         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8230         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8231         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8232                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8233         fi
8234
8235 if test -n "$cf_1st_incdir" ; then
8236   for cf_add_incdir in $cf_1st_incdir
8237   do
8238         while test $cf_add_incdir != /usr/include
8239         do
8240           if test -d $cf_add_incdir
8241           then
8242                 cf_have_incdir=no
8243                 if test -n "$CFLAGS$CPPFLAGS" ; then
8244                   # a loop is needed to ensure we can add subdirs of existing dirs
8245                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8246                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8247                           cf_have_incdir=yes; break
8248                         fi
8249                   done
8250                 fi
8251
8252                 if test "$cf_have_incdir" = no ; then
8253                   if test "$cf_add_incdir" = /usr/local/include ; then
8254                         if test "$GCC" = yes
8255                         then
8256                           cf_save_CPPFLAGS=$CPPFLAGS
8257                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8258                           cat >conftest.$ac_ext <<_ACEOF
8259 #line 8259 "configure"
8260 #include "confdefs.h"
8261 #include <stdio.h>
8262 int
8263 main ()
8264 {
8265 printf("Hello")
8266   ;
8267   return 0;
8268 }
8269 _ACEOF
8270 rm -f conftest.$ac_objext
8271 if { (eval echo "$as_me:8271: \"$ac_compile\"") >&5
8272   (eval $ac_compile) 2>&5
8273   ac_status=$?
8274   echo "$as_me:8274: \$? = $ac_status" >&5
8275   (exit $ac_status); } &&
8276          { ac_try='test -s conftest.$ac_objext'
8277   { (eval echo "$as_me:8277: \"$ac_try\"") >&5
8278   (eval $ac_try) 2>&5
8279   ac_status=$?
8280   echo "$as_me:8280: \$? = $ac_status" >&5
8281   (exit $ac_status); }; }; then
8282   :
8283 else
8284   echo "$as_me: failed program was:" >&5
8285 cat conftest.$ac_ext >&5
8286 cf_have_incdir=yes
8287 fi
8288 rm -f conftest.$ac_objext conftest.$ac_ext
8289                           CPPFLAGS=$cf_save_CPPFLAGS
8290                         fi
8291                   fi
8292                 fi
8293
8294                 if test "$cf_have_incdir" = no ; then
8295                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8296
8297 echo "${as_me:-configure}:8297: testing adding $cf_add_incdir to include-path ..." 1>&5
8298
8299                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8300
8301                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8302                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8303                   cf_add_incdir="$cf_top_incdir"
8304                 else
8305                   break
8306                 fi
8307           fi
8308         done
8309   done
8310 fi
8311
8312 fi
8313
8314 # Set definitions to allow ifdef'ing for ncurses.h
8315
8316 case $cf_cv_ncurses_header in # (vi
8317 *ncurses.h)
8318         cat >>confdefs.h <<\EOF
8319 #define HAVE_NCURSES_H 1
8320 EOF
8321
8322         ;;
8323 esac
8324
8325 case $cf_cv_ncurses_header in # (vi
8326 ncurses/curses.h|ncurses/ncurses.h)
8327         cat >>confdefs.h <<\EOF
8328 #define HAVE_NCURSES_NCURSES_H 1
8329 EOF
8330
8331         ;;
8332 ncursesw/curses.h|ncursesw/ncurses.h)
8333         cat >>confdefs.h <<\EOF
8334 #define HAVE_NCURSESW_NCURSES_H 1
8335 EOF
8336
8337         ;;
8338 esac
8339
8340 echo "$as_me:8340: checking for terminfo header" >&5
8341 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8342 if test "${cf_cv_term_header+set}" = set; then
8343   echo $ECHO_N "(cached) $ECHO_C" >&6
8344 else
8345
8346 case ${cf_cv_ncurses_header} in #(vi
8347 */ncurses.h|*/ncursesw.h) #(vi
8348         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8349         ;;
8350 *)
8351         cf_term_header=term.h
8352         ;;
8353 esac
8354
8355 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8356 do
8357 cat >conftest.$ac_ext <<_ACEOF
8358 #line 8358 "configure"
8359 #include "confdefs.h"
8360 #include <stdio.h>
8361 #include <${cf_cv_ncurses_header:-curses.h}>
8362 #include <$cf_test>
8363
8364 int
8365 main ()
8366 {
8367 int x = auto_left_margin
8368   ;
8369   return 0;
8370 }
8371 _ACEOF
8372 rm -f conftest.$ac_objext
8373 if { (eval echo "$as_me:8373: \"$ac_compile\"") >&5
8374   (eval $ac_compile) 2>&5
8375   ac_status=$?
8376   echo "$as_me:8376: \$? = $ac_status" >&5
8377   (exit $ac_status); } &&
8378          { ac_try='test -s conftest.$ac_objext'
8379   { (eval echo "$as_me:8379: \"$ac_try\"") >&5
8380   (eval $ac_try) 2>&5
8381   ac_status=$?
8382   echo "$as_me:8382: \$? = $ac_status" >&5
8383   (exit $ac_status); }; }; then
8384
8385         cf_cv_term_header="$cf_test"
8386 else
8387   echo "$as_me: failed program was:" >&5
8388 cat conftest.$ac_ext >&5
8389
8390         cf_cv_term_header=unknown
8391
8392 fi
8393 rm -f conftest.$ac_objext conftest.$ac_ext
8394         test "$cf_cv_term_header" != unknown && break
8395 done
8396
8397 fi
8398 echo "$as_me:8398: result: $cf_cv_term_header" >&5
8399 echo "${ECHO_T}$cf_cv_term_header" >&6
8400
8401 # Set definitions to allow ifdef'ing to accommodate subdirectories
8402
8403 case $cf_cv_term_header in # (vi
8404 *term.h)
8405         cat >>confdefs.h <<\EOF
8406 #define HAVE_TERM_H 1
8407 EOF
8408
8409         ;;
8410 esac
8411
8412 case $cf_cv_term_header in # (vi
8413 ncurses/term.h) #(vi
8414         cat >>confdefs.h <<\EOF
8415 #define HAVE_NCURSES_TERM_H 1
8416 EOF
8417
8418         ;;
8419 ncursesw/term.h)
8420         cat >>confdefs.h <<\EOF
8421 #define HAVE_NCURSESW_TERM_H 1
8422 EOF
8423
8424         ;;
8425 esac
8426
8427 # some applications need this, but should check for NCURSES_VERSION
8428 cat >>confdefs.h <<\EOF
8429 #define NCURSES 1
8430 EOF
8431
8432 echo "$as_me:8432: checking for ncurses version" >&5
8433 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8434 if test "${cf_cv_ncurses_version+set}" = set; then
8435   echo $ECHO_N "(cached) $ECHO_C" >&6
8436 else
8437
8438         cf_cv_ncurses_version=no
8439         cf_tempfile=out$$
8440         rm -f $cf_tempfile
8441         if test "$cross_compiling" = yes; then
8442
8443         # This will not work if the preprocessor splits the line after the
8444         # Autoconf token.  The 'unproto' program does that.
8445         cat > conftest.$ac_ext <<EOF
8446 #include <${cf_cv_ncurses_header:-curses.h}>
8447 #undef Autoconf
8448 #ifdef NCURSES_VERSION
8449 Autoconf NCURSES_VERSION
8450 #else
8451 #ifdef __NCURSES_H
8452 Autoconf "old"
8453 #endif
8454 ;
8455 #endif
8456 EOF
8457         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8458         { (eval echo "$as_me:8458: \"$cf_try\"") >&5
8459   (eval $cf_try) 2>&5
8460   ac_status=$?
8461   echo "$as_me:8461: \$? = $ac_status" >&5
8462   (exit $ac_status); }
8463         if test -f conftest.out ; then
8464                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8465                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8466                 rm -f conftest.out
8467         fi
8468
8469 else
8470   cat >conftest.$ac_ext <<_ACEOF
8471 #line 8471 "configure"
8472 #include "confdefs.h"
8473
8474 #include <${cf_cv_ncurses_header:-curses.h}>
8475 #include <stdio.h>
8476 int main()
8477 {
8478         FILE *fp = fopen("$cf_tempfile", "w");
8479 #ifdef NCURSES_VERSION
8480 # ifdef NCURSES_VERSION_PATCH
8481         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8482 # else
8483         fprintf(fp, "%s\n", NCURSES_VERSION);
8484 # endif
8485 #else
8486 # ifdef __NCURSES_H
8487         fprintf(fp, "old\n");
8488 # else
8489         make an error
8490 # endif
8491 #endif
8492         ${cf_cv_main_return:-return}(0);
8493 }
8494 _ACEOF
8495 rm -f conftest$ac_exeext
8496 if { (eval echo "$as_me:8496: \"$ac_link\"") >&5
8497   (eval $ac_link) 2>&5
8498   ac_status=$?
8499   echo "$as_me:8499: \$? = $ac_status" >&5
8500   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8501   { (eval echo "$as_me:8501: \"$ac_try\"") >&5
8502   (eval $ac_try) 2>&5
8503   ac_status=$?
8504   echo "$as_me:8504: \$? = $ac_status" >&5
8505   (exit $ac_status); }; }; then
8506
8507         cf_cv_ncurses_version=`cat $cf_tempfile`
8508 else
8509   echo "$as_me: program exited with status $ac_status" >&5
8510 echo "$as_me: failed program was:" >&5
8511 cat conftest.$ac_ext >&5
8512 fi
8513 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8514 fi
8515         rm -f $cf_tempfile
8516
8517 fi
8518 echo "$as_me:8518: result: $cf_cv_ncurses_version" >&5
8519 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8520 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
8521 #define NCURSES 1
8522 EOF
8523
8524 cf_nculib_root=ncursesw
8525         # This works, except for the special case where we find gpm, but
8526         # ncurses is in a nonstandard location via $LIBS, and we really want
8527         # to link gpm.
8528 cf_ncurses_LIBS=""
8529 cf_ncurses_SAVE="$LIBS"
8530 echo "$as_me:8530: checking for Gpm_Open in -lgpm" >&5
8531 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8532 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8533   echo $ECHO_N "(cached) $ECHO_C" >&6
8534 else
8535   ac_check_lib_save_LIBS=$LIBS
8536 LIBS="-lgpm  $LIBS"
8537 cat >conftest.$ac_ext <<_ACEOF
8538 #line 8538 "configure"
8539 #include "confdefs.h"
8540
8541 /* Override any gcc2 internal prototype to avoid an error.  */
8542 #ifdef __cplusplus
8543 extern "C"
8544 #endif
8545 /* We use char because int might match the return type of a gcc2
8546    builtin and then its argument prototype would still apply.  */
8547 char Gpm_Open ();
8548 int
8549 main ()
8550 {
8551 Gpm_Open ();
8552   ;
8553   return 0;
8554 }
8555 _ACEOF
8556 rm -f conftest.$ac_objext conftest$ac_exeext
8557 if { (eval echo "$as_me:8557: \"$ac_link\"") >&5
8558   (eval $ac_link) 2>&5
8559   ac_status=$?
8560   echo "$as_me:8560: \$? = $ac_status" >&5
8561   (exit $ac_status); } &&
8562          { ac_try='test -s conftest$ac_exeext'
8563   { (eval echo "$as_me:8563: \"$ac_try\"") >&5
8564   (eval $ac_try) 2>&5
8565   ac_status=$?
8566   echo "$as_me:8566: \$? = $ac_status" >&5
8567   (exit $ac_status); }; }; then
8568   ac_cv_lib_gpm_Gpm_Open=yes
8569 else
8570   echo "$as_me: failed program was:" >&5
8571 cat conftest.$ac_ext >&5
8572 ac_cv_lib_gpm_Gpm_Open=no
8573 fi
8574 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8575 LIBS=$ac_check_lib_save_LIBS
8576 fi
8577 echo "$as_me:8577: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8578 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8579 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8580   echo "$as_me:8580: checking for initscr in -lgpm" >&5
8581 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8582 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8583   echo $ECHO_N "(cached) $ECHO_C" >&6
8584 else
8585   ac_check_lib_save_LIBS=$LIBS
8586 LIBS="-lgpm  $LIBS"
8587 cat >conftest.$ac_ext <<_ACEOF
8588 #line 8588 "configure"
8589 #include "confdefs.h"
8590
8591 /* Override any gcc2 internal prototype to avoid an error.  */
8592 #ifdef __cplusplus
8593 extern "C"
8594 #endif
8595 /* We use char because int might match the return type of a gcc2
8596    builtin and then its argument prototype would still apply.  */
8597 char initscr ();
8598 int
8599 main ()
8600 {
8601 initscr ();
8602   ;
8603   return 0;
8604 }
8605 _ACEOF
8606 rm -f conftest.$ac_objext conftest$ac_exeext
8607 if { (eval echo "$as_me:8607: \"$ac_link\"") >&5
8608   (eval $ac_link) 2>&5
8609   ac_status=$?
8610   echo "$as_me:8610: \$? = $ac_status" >&5
8611   (exit $ac_status); } &&
8612          { ac_try='test -s conftest$ac_exeext'
8613   { (eval echo "$as_me:8613: \"$ac_try\"") >&5
8614   (eval $ac_try) 2>&5
8615   ac_status=$?
8616   echo "$as_me:8616: \$? = $ac_status" >&5
8617   (exit $ac_status); }; }; then
8618   ac_cv_lib_gpm_initscr=yes
8619 else
8620   echo "$as_me: failed program was:" >&5
8621 cat conftest.$ac_ext >&5
8622 ac_cv_lib_gpm_initscr=no
8623 fi
8624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8625 LIBS=$ac_check_lib_save_LIBS
8626 fi
8627 echo "$as_me:8627: result: $ac_cv_lib_gpm_initscr" >&5
8628 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8629 if test $ac_cv_lib_gpm_initscr = yes; then
8630   LIBS="$cf_ncurses_SAVE"
8631 else
8632   cf_ncurses_LIBS="-lgpm"
8633 fi
8634
8635 fi
8636
8637 case $host_os in #(vi
8638 freebsd*)
8639         # This is only necessary if you are linking against an obsolete
8640         # version of ncurses (but it should do no harm, since it's static).
8641         if test "$cf_nculib_root" = ncurses ; then
8642                 echo "$as_me:8642: checking for tgoto in -lmytinfo" >&5
8643 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8644 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8645   echo $ECHO_N "(cached) $ECHO_C" >&6
8646 else
8647   ac_check_lib_save_LIBS=$LIBS
8648 LIBS="-lmytinfo  $LIBS"
8649 cat >conftest.$ac_ext <<_ACEOF
8650 #line 8650 "configure"
8651 #include "confdefs.h"
8652
8653 /* Override any gcc2 internal prototype to avoid an error.  */
8654 #ifdef __cplusplus
8655 extern "C"
8656 #endif
8657 /* We use char because int might match the return type of a gcc2
8658    builtin and then its argument prototype would still apply.  */
8659 char tgoto ();
8660 int
8661 main ()
8662 {
8663 tgoto ();
8664   ;
8665   return 0;
8666 }
8667 _ACEOF
8668 rm -f conftest.$ac_objext conftest$ac_exeext
8669 if { (eval echo "$as_me:8669: \"$ac_link\"") >&5
8670   (eval $ac_link) 2>&5
8671   ac_status=$?
8672   echo "$as_me:8672: \$? = $ac_status" >&5
8673   (exit $ac_status); } &&
8674          { ac_try='test -s conftest$ac_exeext'
8675   { (eval echo "$as_me:8675: \"$ac_try\"") >&5
8676   (eval $ac_try) 2>&5
8677   ac_status=$?
8678   echo "$as_me:8678: \$? = $ac_status" >&5
8679   (exit $ac_status); }; }; then
8680   ac_cv_lib_mytinfo_tgoto=yes
8681 else
8682   echo "$as_me: failed program was:" >&5
8683 cat conftest.$ac_ext >&5
8684 ac_cv_lib_mytinfo_tgoto=no
8685 fi
8686 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8687 LIBS=$ac_check_lib_save_LIBS
8688 fi
8689 echo "$as_me:8689: result: $ac_cv_lib_mytinfo_tgoto" >&5
8690 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8691 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8692   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8693 fi
8694
8695         fi
8696         ;;
8697 esac
8698
8699 LIBS="$cf_ncurses_LIBS $LIBS"
8700
8701 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8702 then
8703         LIBS="-l$cf_nculib_root $LIBS"
8704 else
8705
8706         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8707         cf_libdir=""
8708         echo "$as_me:8708: checking for initscr" >&5
8709 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8710 if test "${ac_cv_func_initscr+set}" = set; then
8711   echo $ECHO_N "(cached) $ECHO_C" >&6
8712 else
8713   cat >conftest.$ac_ext <<_ACEOF
8714 #line 8714 "configure"
8715 #include "confdefs.h"
8716 /* System header to define __stub macros and hopefully few prototypes,
8717     which can conflict with char initscr (); below.  */
8718 #include <assert.h>
8719 /* Override any gcc2 internal prototype to avoid an error.  */
8720 #ifdef __cplusplus
8721 extern "C"
8722 #endif
8723 /* We use char because int might match the return type of a gcc2
8724    builtin and then its argument prototype would still apply.  */
8725 char initscr ();
8726 char (*f) ();
8727
8728 int
8729 main ()
8730 {
8731 /* The GNU C library defines this for functions which it implements
8732     to always fail with ENOSYS.  Some functions are actually named
8733     something starting with __ and the normal name is an alias.  */
8734 #if defined (__stub_initscr) || defined (__stub___initscr)
8735 choke me
8736 #else
8737 f = initscr;
8738 #endif
8739
8740   ;
8741   return 0;
8742 }
8743 _ACEOF
8744 rm -f conftest.$ac_objext conftest$ac_exeext
8745 if { (eval echo "$as_me:8745: \"$ac_link\"") >&5
8746   (eval $ac_link) 2>&5
8747   ac_status=$?
8748   echo "$as_me:8748: \$? = $ac_status" >&5
8749   (exit $ac_status); } &&
8750          { ac_try='test -s conftest$ac_exeext'
8751   { (eval echo "$as_me:8751: \"$ac_try\"") >&5
8752   (eval $ac_try) 2>&5
8753   ac_status=$?
8754   echo "$as_me:8754: \$? = $ac_status" >&5
8755   (exit $ac_status); }; }; then
8756   ac_cv_func_initscr=yes
8757 else
8758   echo "$as_me: failed program was:" >&5
8759 cat conftest.$ac_ext >&5
8760 ac_cv_func_initscr=no
8761 fi
8762 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8763 fi
8764 echo "$as_me:8764: result: $ac_cv_func_initscr" >&5
8765 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8766 if test $ac_cv_func_initscr = yes; then
8767   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8768 else
8769
8770                 cf_save_LIBS="$LIBS"
8771                 echo "$as_me:8771: checking for initscr in -l$cf_nculib_root" >&5
8772 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8773                 LIBS="-l$cf_nculib_root $LIBS"
8774                 cat >conftest.$ac_ext <<_ACEOF
8775 #line 8775 "configure"
8776 #include "confdefs.h"
8777 #include <${cf_cv_ncurses_header:-curses.h}>
8778 int
8779 main ()
8780 {
8781 initscr()
8782   ;
8783   return 0;
8784 }
8785 _ACEOF
8786 rm -f conftest.$ac_objext conftest$ac_exeext
8787 if { (eval echo "$as_me:8787: \"$ac_link\"") >&5
8788   (eval $ac_link) 2>&5
8789   ac_status=$?
8790   echo "$as_me:8790: \$? = $ac_status" >&5
8791   (exit $ac_status); } &&
8792          { ac_try='test -s conftest$ac_exeext'
8793   { (eval echo "$as_me:8793: \"$ac_try\"") >&5
8794   (eval $ac_try) 2>&5
8795   ac_status=$?
8796   echo "$as_me:8796: \$? = $ac_status" >&5
8797   (exit $ac_status); }; }; then
8798   echo "$as_me:8798: result: yes" >&5
8799 echo "${ECHO_T}yes" >&6
8800                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8801
8802 else
8803   echo "$as_me: failed program was:" >&5
8804 cat conftest.$ac_ext >&5
8805 echo "$as_me:8805: result: no" >&5
8806 echo "${ECHO_T}no" >&6
8807
8808 cf_search=
8809 cf_library_path_list=""
8810 if test -n "${LDFLAGS}${LIBS}" ; then
8811         for cf_library_path in $LDFLAGS $LIBS
8812         do
8813                 case $cf_library_path in #(vi
8814                 -L*)
8815                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8816
8817 test "$cf_library_path" != "NONE" && \
8818 test -d "$cf_library_path" && \
8819  {
8820         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8821         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8822         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8823         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8824         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8825         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"
8826 }
8827
8828                         cf_library_path_list="$cf_library_path_list $cf_search"
8829                         ;;
8830                 esac
8831         done
8832 fi
8833
8834 cf_search=
8835
8836 test "/usr" != "$prefix" && \
8837 test -d "/usr" && \
8838 (test $prefix = NONE || test "/usr" != "$prefix") && {
8839         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8840         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8841         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
8842         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
8843         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
8844         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
8845 }
8846
8847 test "$prefix" != "NONE" && \
8848 test -d "$prefix" && \
8849  {
8850         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8851         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8852         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8853         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8854         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8855         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8856 }
8857
8858 test "/usr/local" != "$prefix" && \
8859 test -d "/usr/local" && \
8860 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8861         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8862         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8863         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
8864         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
8865         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
8866         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
8867 }
8868
8869 test "/opt" != "$prefix" && \
8870 test -d "/opt" && \
8871 (test $prefix = NONE || test "/opt" != "$prefix") && {
8872         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8873         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8874         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
8875         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
8876         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
8877         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
8878 }
8879
8880 test "$HOME" != "$prefix" && \
8881 test -d "$HOME" && \
8882 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8883         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8884         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8885         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
8886         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
8887         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
8888         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
8889 }
8890
8891 cf_search="$cf_library_path_list $cf_search"
8892
8893                         for cf_libdir in $cf_search
8894                         do
8895                                 echo "$as_me:8895: checking for -l$cf_nculib_root in $cf_libdir" >&5
8896 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8897                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8898                                 cat >conftest.$ac_ext <<_ACEOF
8899 #line 8899 "configure"
8900 #include "confdefs.h"
8901 #include <${cf_cv_ncurses_header:-curses.h}>
8902 int
8903 main ()
8904 {
8905 initscr()
8906   ;
8907   return 0;
8908 }
8909 _ACEOF
8910 rm -f conftest.$ac_objext conftest$ac_exeext
8911 if { (eval echo "$as_me:8911: \"$ac_link\"") >&5
8912   (eval $ac_link) 2>&5
8913   ac_status=$?
8914   echo "$as_me:8914: \$? = $ac_status" >&5
8915   (exit $ac_status); } &&
8916          { ac_try='test -s conftest$ac_exeext'
8917   { (eval echo "$as_me:8917: \"$ac_try\"") >&5
8918   (eval $ac_try) 2>&5
8919   ac_status=$?
8920   echo "$as_me:8920: \$? = $ac_status" >&5
8921   (exit $ac_status); }; }; then
8922   echo "$as_me:8922: result: yes" >&5
8923 echo "${ECHO_T}yes" >&6
8924                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8925                                          break
8926 else
8927   echo "$as_me: failed program was:" >&5
8928 cat conftest.$ac_ext >&5
8929 echo "$as_me:8929: result: no" >&5
8930 echo "${ECHO_T}no" >&6
8931                                          LIBS="$cf_save_LIBS"
8932 fi
8933 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8934                         done
8935
8936 fi
8937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8938
8939 fi
8940
8941 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8942
8943 if test $cf_found_library = no ; then
8944         { { echo "$as_me:8944: error: Cannot link $cf_nculib_root library" >&5
8945 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8946    { (exit 1); exit 1; }; }
8947 fi
8948
8949 fi
8950
8951 if test -n "$cf_ncurses_LIBS" ; then
8952         echo "$as_me:8952: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8953 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8954         cf_ncurses_SAVE="$LIBS"
8955         for p in $cf_ncurses_LIBS ; do
8956                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8957                 if test "$q" != "$LIBS" ; then
8958                         LIBS="$q"
8959                 fi
8960         done
8961         cat >conftest.$ac_ext <<_ACEOF
8962 #line 8962 "configure"
8963 #include "confdefs.h"
8964 #include <${cf_cv_ncurses_header:-curses.h}>
8965 int
8966 main ()
8967 {
8968 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8969   ;
8970   return 0;
8971 }
8972 _ACEOF
8973 rm -f conftest.$ac_objext conftest$ac_exeext
8974 if { (eval echo "$as_me:8974: \"$ac_link\"") >&5
8975   (eval $ac_link) 2>&5
8976   ac_status=$?
8977   echo "$as_me:8977: \$? = $ac_status" >&5
8978   (exit $ac_status); } &&
8979          { ac_try='test -s conftest$ac_exeext'
8980   { (eval echo "$as_me:8980: \"$ac_try\"") >&5
8981   (eval $ac_try) 2>&5
8982   ac_status=$?
8983   echo "$as_me:8983: \$? = $ac_status" >&5
8984   (exit $ac_status); }; }; then
8985   echo "$as_me:8985: result: yes" >&5
8986 echo "${ECHO_T}yes" >&6
8987 else
8988   echo "$as_me: failed program was:" >&5
8989 cat conftest.$ac_ext >&5
8990 echo "$as_me:8990: result: no" >&5
8991 echo "${ECHO_T}no" >&6
8992                  LIBS="$cf_ncurses_SAVE"
8993 fi
8994 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8995 fi
8996
8997 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8998
8999 cat >>confdefs.h <<EOF
9000 #define $cf_nculib_ROOT 1
9001 EOF
9002
9003 fi
9004
9005         ;;
9006 pdcurses) #(vi
9007
9008 echo "$as_me:9008: checking if you want to use pkg-config" >&5
9009 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
9010
9011 # Check whether --with-pkg-config or --without-pkg-config was given.
9012 if test "${with_pkg_config+set}" = set; then
9013   withval="$with_pkg_config"
9014   cf_pkg_config=$withval
9015 else
9016   cf_pkg_config=yes
9017 fi;
9018 echo "$as_me:9018: result: $cf_pkg_config" >&5
9019 echo "${ECHO_T}$cf_pkg_config" >&6
9020
9021 case $cf_pkg_config in #(vi
9022 no) #(vi
9023         PKG_CONFIG=none
9024         ;;
9025 yes) #(vi
9026         # Extract the first word of "pkg-config", so it can be a program name with args.
9027 set dummy pkg-config; ac_word=$2
9028 echo "$as_me:9028: checking for $ac_word" >&5
9029 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9030 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
9031   echo $ECHO_N "(cached) $ECHO_C" >&6
9032 else
9033   case $PKG_CONFIG in
9034   [\\/]* | ?:[\\/]*)
9035   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9036   ;;
9037   *)
9038   ac_save_IFS=$IFS; IFS=$ac_path_separator
9039 ac_dummy="$PATH"
9040 for ac_dir in $ac_dummy; do
9041   IFS=$ac_save_IFS
9042   test -z "$ac_dir" && ac_dir=.
9043   if $as_executable_p "$ac_dir/$ac_word"; then
9044    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
9045    echo "$as_me:9045: found $ac_dir/$ac_word" >&5
9046    break
9047 fi
9048 done
9049
9050   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
9051   ;;
9052 esac
9053 fi
9054 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9055
9056 if test -n "$PKG_CONFIG"; then
9057   echo "$as_me:9057: result: $PKG_CONFIG" >&5
9058 echo "${ECHO_T}$PKG_CONFIG" >&6
9059 else
9060   echo "$as_me:9060: result: no" >&5
9061 echo "${ECHO_T}no" >&6
9062 fi
9063
9064         ;;
9065 *)
9066         PKG_CONFIG=$withval
9067         ;;
9068 esac
9069
9070 test -z "$PKG_CONFIG" && PKG_CONFIG=none
9071 if test "$PKG_CONFIG" != none ; then
9072
9073 if test "x$prefix" != xNONE; then
9074   cf_path_syntax="$prefix"
9075 else
9076   cf_path_syntax="$ac_default_prefix"
9077 fi
9078
9079 case ".$PKG_CONFIG" in #(vi
9080 .\$\(*\)*|.\'*\'*) #(vi
9081   ;;
9082 ..|./*|.\\*) #(vi
9083   ;;
9084 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
9085   ;;
9086 .\${*prefix}*) #(vi
9087   eval PKG_CONFIG="$PKG_CONFIG"
9088   case ".$PKG_CONFIG" in #(vi
9089   .NONE/*)
9090     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9091     ;;
9092   esac
9093   ;; #(vi
9094 .no|.NONE/*)
9095   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9096   ;;
9097 *)
9098   { { echo "$as_me:9098: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
9099 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
9100    { (exit 1); exit 1; }; }
9101   ;;
9102 esac
9103
9104 fi
9105
9106 echo "$as_me:9106: checking for X" >&5
9107 echo $ECHO_N "checking for X... $ECHO_C" >&6
9108
9109 # Check whether --with-x or --without-x was given.
9110 if test "${with_x+set}" = set; then
9111   withval="$with_x"
9112
9113 fi;
9114 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9115 if test "x$with_x" = xno; then
9116   # The user explicitly disabled X.
9117   have_x=disabled
9118 else
9119   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9120     # Both variables are already set.
9121     have_x=yes
9122   else
9123     if test "${ac_cv_have_x+set}" = set; then
9124   echo $ECHO_N "(cached) $ECHO_C" >&6
9125 else
9126   # One or both of the vars are not set, and there is no cached value.
9127 ac_x_includes=no ac_x_libraries=no
9128 rm -fr conftest.dir
9129 if mkdir conftest.dir; then
9130   cd conftest.dir
9131   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9132   cat >Imakefile <<'EOF'
9133 acfindx:
9134         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9135 EOF
9136   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9137     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9138     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9139     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9140     for ac_extension in a so sl dylib dll; do
9141       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9142          test -f $ac_im_libdir/libX11.$ac_extension; then
9143         ac_im_usrlibdir=$ac_im_libdir; break
9144       fi
9145     done
9146     # Screen out bogus values from the imake configuration.  They are
9147     # bogus both because they are the default anyway, and because
9148     # using them would break gcc on systems where it needs fixed includes.
9149     case $ac_im_incroot in
9150         /usr/include) ;;
9151         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9152     esac
9153     case $ac_im_usrlibdir in
9154         /usr/lib | /lib) ;;
9155         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9156     esac
9157   fi
9158   cd ..
9159   rm -fr conftest.dir
9160 fi
9161
9162 # Standard set of common directories for X headers.
9163 # Check X11 before X11Rn because it is often a symlink to the current release.
9164 ac_x_header_dirs='
9165 /usr/X11/include
9166 /usr/X11R6/include
9167 /usr/X11R5/include
9168 /usr/X11R4/include
9169
9170 /usr/include/X11
9171 /usr/include/X11R6
9172 /usr/include/X11R5
9173 /usr/include/X11R4
9174
9175 /usr/local/X11/include
9176 /usr/local/X11R6/include
9177 /usr/local/X11R5/include
9178 /usr/local/X11R4/include
9179
9180 /usr/local/include/X11
9181 /usr/local/include/X11R6
9182 /usr/local/include/X11R5
9183 /usr/local/include/X11R4
9184
9185 /usr/X386/include
9186 /usr/x386/include
9187 /usr/XFree86/include/X11
9188
9189 /usr/include
9190 /usr/local/include
9191 /usr/unsupported/include
9192 /usr/athena/include
9193 /usr/local/x11r5/include
9194 /usr/lpp/Xamples/include
9195
9196 /usr/openwin/include
9197 /usr/openwin/share/include'
9198
9199 if test "$ac_x_includes" = no; then
9200   # Guess where to find include files, by looking for Intrinsic.h.
9201   # First, try using that file with no special directory specified.
9202   cat >conftest.$ac_ext <<_ACEOF
9203 #line 9203 "configure"
9204 #include "confdefs.h"
9205 #include <X11/Intrinsic.h>
9206 _ACEOF
9207 if { (eval echo "$as_me:9207: \"$ac_cpp conftest.$ac_ext\"") >&5
9208   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9209   ac_status=$?
9210   egrep -v '^ *\+' conftest.er1 >conftest.err
9211   rm -f conftest.er1
9212   cat conftest.err >&5
9213   echo "$as_me:9213: \$? = $ac_status" >&5
9214   (exit $ac_status); } >/dev/null; then
9215   if test -s conftest.err; then
9216     ac_cpp_err=$ac_c_preproc_warn_flag
9217   else
9218     ac_cpp_err=
9219   fi
9220 else
9221   ac_cpp_err=yes
9222 fi
9223 if test -z "$ac_cpp_err"; then
9224   # We can compile using X headers with no special include directory.
9225 ac_x_includes=
9226 else
9227   echo "$as_me: failed program was:" >&5
9228   cat conftest.$ac_ext >&5
9229   for ac_dir in $ac_x_header_dirs; do
9230   if test -r "$ac_dir/X11/Intrinsic.h"; then
9231     ac_x_includes=$ac_dir
9232     break
9233   fi
9234 done
9235 fi
9236 rm -f conftest.err conftest.$ac_ext
9237 fi # $ac_x_includes = no
9238
9239 if test "$ac_x_libraries" = no; then
9240   # Check for the libraries.
9241   # See if we find them without any special options.
9242   # Don't add to $LIBS permanently.
9243   ac_save_LIBS=$LIBS
9244   LIBS="-lXt $LIBS"
9245   cat >conftest.$ac_ext <<_ACEOF
9246 #line 9246 "configure"
9247 #include "confdefs.h"
9248 #include <X11/Intrinsic.h>
9249 int
9250 main ()
9251 {
9252 XtMalloc (0)
9253   ;
9254   return 0;
9255 }
9256 _ACEOF
9257 rm -f conftest.$ac_objext conftest$ac_exeext
9258 if { (eval echo "$as_me:9258: \"$ac_link\"") >&5
9259   (eval $ac_link) 2>&5
9260   ac_status=$?
9261   echo "$as_me:9261: \$? = $ac_status" >&5
9262   (exit $ac_status); } &&
9263          { ac_try='test -s conftest$ac_exeext'
9264   { (eval echo "$as_me:9264: \"$ac_try\"") >&5
9265   (eval $ac_try) 2>&5
9266   ac_status=$?
9267   echo "$as_me:9267: \$? = $ac_status" >&5
9268   (exit $ac_status); }; }; then
9269   LIBS=$ac_save_LIBS
9270 # We can link X programs with no special library path.
9271 ac_x_libraries=
9272 else
9273   echo "$as_me: failed program was:" >&5
9274 cat conftest.$ac_ext >&5
9275 LIBS=$ac_save_LIBS
9276 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9277 do
9278   # Don't even attempt the hair of trying to link an X program!
9279   for ac_extension in a so sl dylib dll; do
9280     if test -r $ac_dir/libXt.$ac_extension; then
9281       ac_x_libraries=$ac_dir
9282       break 2
9283     fi
9284   done
9285 done
9286 fi
9287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9288 fi # $ac_x_libraries = no
9289
9290 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9291   # Didn't find X anywhere.  Cache the known absence of X.
9292   ac_cv_have_x="have_x=no"
9293 else
9294   # Record where we found X for the cache.
9295   ac_cv_have_x="have_x=yes \
9296                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9297 fi
9298 fi
9299
9300   fi
9301   eval "$ac_cv_have_x"
9302 fi # $with_x != no
9303
9304 if test "$have_x" != yes; then
9305   echo "$as_me:9305: result: $have_x" >&5
9306 echo "${ECHO_T}$have_x" >&6
9307   no_x=yes
9308 else
9309   # If each of the values was on the command line, it overrides each guess.
9310   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9311   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9312   # Update the cache value to reflect the command line values.
9313   ac_cv_have_x="have_x=yes \
9314                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9315   echo "$as_me:9315: result: libraries $x_libraries, headers $x_includes" >&5
9316 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9317 fi
9318
9319 if test "$no_x" = yes; then
9320   # Not all programs may use this symbol, but it does not hurt to define it.
9321
9322 cat >>confdefs.h <<\EOF
9323 #define X_DISPLAY_MISSING 1
9324 EOF
9325
9326   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9327 else
9328   if test -n "$x_includes"; then
9329     X_CFLAGS="$X_CFLAGS -I$x_includes"
9330   fi
9331
9332   # It would also be nice to do this for all -L options, not just this one.
9333   if test -n "$x_libraries"; then
9334     X_LIBS="$X_LIBS -L$x_libraries"
9335     # For Solaris; some versions of Sun CC require a space after -R and
9336     # others require no space.  Words are not sufficient . . . .
9337     case `(uname -sr) 2>/dev/null` in
9338     "SunOS 5"*)
9339       echo "$as_me:9339: checking whether -R must be followed by a space" >&5
9340 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9341       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9342       cat >conftest.$ac_ext <<_ACEOF
9343 #line 9343 "configure"
9344 #include "confdefs.h"
9345
9346 int
9347 main ()
9348 {
9349
9350   ;
9351   return 0;
9352 }
9353 _ACEOF
9354 rm -f conftest.$ac_objext conftest$ac_exeext
9355 if { (eval echo "$as_me:9355: \"$ac_link\"") >&5
9356   (eval $ac_link) 2>&5
9357   ac_status=$?
9358   echo "$as_me:9358: \$? = $ac_status" >&5
9359   (exit $ac_status); } &&
9360          { ac_try='test -s conftest$ac_exeext'
9361   { (eval echo "$as_me:9361: \"$ac_try\"") >&5
9362   (eval $ac_try) 2>&5
9363   ac_status=$?
9364   echo "$as_me:9364: \$? = $ac_status" >&5
9365   (exit $ac_status); }; }; then
9366   ac_R_nospace=yes
9367 else
9368   echo "$as_me: failed program was:" >&5
9369 cat conftest.$ac_ext >&5
9370 ac_R_nospace=no
9371 fi
9372 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9373       if test $ac_R_nospace = yes; then
9374         echo "$as_me:9374: result: no" >&5
9375 echo "${ECHO_T}no" >&6
9376         X_LIBS="$X_LIBS -R$x_libraries"
9377       else
9378         LIBS="$ac_xsave_LIBS -R $x_libraries"
9379         cat >conftest.$ac_ext <<_ACEOF
9380 #line 9380 "configure"
9381 #include "confdefs.h"
9382
9383 int
9384 main ()
9385 {
9386
9387   ;
9388   return 0;
9389 }
9390 _ACEOF
9391 rm -f conftest.$ac_objext conftest$ac_exeext
9392 if { (eval echo "$as_me:9392: \"$ac_link\"") >&5
9393   (eval $ac_link) 2>&5
9394   ac_status=$?
9395   echo "$as_me:9395: \$? = $ac_status" >&5
9396   (exit $ac_status); } &&
9397          { ac_try='test -s conftest$ac_exeext'
9398   { (eval echo "$as_me:9398: \"$ac_try\"") >&5
9399   (eval $ac_try) 2>&5
9400   ac_status=$?
9401   echo "$as_me:9401: \$? = $ac_status" >&5
9402   (exit $ac_status); }; }; then
9403   ac_R_space=yes
9404 else
9405   echo "$as_me: failed program was:" >&5
9406 cat conftest.$ac_ext >&5
9407 ac_R_space=no
9408 fi
9409 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9410         if test $ac_R_space = yes; then
9411           echo "$as_me:9411: result: yes" >&5
9412 echo "${ECHO_T}yes" >&6
9413           X_LIBS="$X_LIBS -R $x_libraries"
9414         else
9415           echo "$as_me:9415: result: neither works" >&5
9416 echo "${ECHO_T}neither works" >&6
9417         fi
9418       fi
9419       LIBS=$ac_xsave_LIBS
9420     esac
9421   fi
9422
9423   # Check for system-dependent libraries X programs must link with.
9424   # Do this before checking for the system-independent R6 libraries
9425   # (-lICE), since we may need -lsocket or whatever for X linking.
9426
9427   if test "$ISC" = yes; then
9428     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9429   else
9430     # Martyn Johnson says this is needed for Ultrix, if the X
9431     # libraries were built with DECnet support.  And Karl Berry says
9432     # the Alpha needs dnet_stub (dnet does not exist).
9433     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9434     cat >conftest.$ac_ext <<_ACEOF
9435 #line 9435 "configure"
9436 #include "confdefs.h"
9437
9438 /* Override any gcc2 internal prototype to avoid an error.  */
9439 #ifdef __cplusplus
9440 extern "C"
9441 #endif
9442 /* We use char because int might match the return type of a gcc2
9443    builtin and then its argument prototype would still apply.  */
9444 char XOpenDisplay ();
9445 int
9446 main ()
9447 {
9448 XOpenDisplay ();
9449   ;
9450   return 0;
9451 }
9452 _ACEOF
9453 rm -f conftest.$ac_objext conftest$ac_exeext
9454 if { (eval echo "$as_me:9454: \"$ac_link\"") >&5
9455   (eval $ac_link) 2>&5
9456   ac_status=$?
9457   echo "$as_me:9457: \$? = $ac_status" >&5
9458   (exit $ac_status); } &&
9459          { ac_try='test -s conftest$ac_exeext'
9460   { (eval echo "$as_me:9460: \"$ac_try\"") >&5
9461   (eval $ac_try) 2>&5
9462   ac_status=$?
9463   echo "$as_me:9463: \$? = $ac_status" >&5
9464   (exit $ac_status); }; }; then
9465   :
9466 else
9467   echo "$as_me: failed program was:" >&5
9468 cat conftest.$ac_ext >&5
9469 echo "$as_me:9469: checking for dnet_ntoa in -ldnet" >&5
9470 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9471 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9472   echo $ECHO_N "(cached) $ECHO_C" >&6
9473 else
9474   ac_check_lib_save_LIBS=$LIBS
9475 LIBS="-ldnet  $LIBS"
9476 cat >conftest.$ac_ext <<_ACEOF
9477 #line 9477 "configure"
9478 #include "confdefs.h"
9479
9480 /* Override any gcc2 internal prototype to avoid an error.  */
9481 #ifdef __cplusplus
9482 extern "C"
9483 #endif
9484 /* We use char because int might match the return type of a gcc2
9485    builtin and then its argument prototype would still apply.  */
9486 char dnet_ntoa ();
9487 int
9488 main ()
9489 {
9490 dnet_ntoa ();
9491   ;
9492   return 0;
9493 }
9494 _ACEOF
9495 rm -f conftest.$ac_objext conftest$ac_exeext
9496 if { (eval echo "$as_me:9496: \"$ac_link\"") >&5
9497   (eval $ac_link) 2>&5
9498   ac_status=$?
9499   echo "$as_me:9499: \$? = $ac_status" >&5
9500   (exit $ac_status); } &&
9501          { ac_try='test -s conftest$ac_exeext'
9502   { (eval echo "$as_me:9502: \"$ac_try\"") >&5
9503   (eval $ac_try) 2>&5
9504   ac_status=$?
9505   echo "$as_me:9505: \$? = $ac_status" >&5
9506   (exit $ac_status); }; }; then
9507   ac_cv_lib_dnet_dnet_ntoa=yes
9508 else
9509   echo "$as_me: failed program was:" >&5
9510 cat conftest.$ac_ext >&5
9511 ac_cv_lib_dnet_dnet_ntoa=no
9512 fi
9513 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9514 LIBS=$ac_check_lib_save_LIBS
9515 fi
9516 echo "$as_me:9516: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9517 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9518 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9519   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9520 fi
9521
9522     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9523       echo "$as_me:9523: checking for dnet_ntoa in -ldnet_stub" >&5
9524 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9525 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9526   echo $ECHO_N "(cached) $ECHO_C" >&6
9527 else
9528   ac_check_lib_save_LIBS=$LIBS
9529 LIBS="-ldnet_stub  $LIBS"
9530 cat >conftest.$ac_ext <<_ACEOF
9531 #line 9531 "configure"
9532 #include "confdefs.h"
9533
9534 /* Override any gcc2 internal prototype to avoid an error.  */
9535 #ifdef __cplusplus
9536 extern "C"
9537 #endif
9538 /* We use char because int might match the return type of a gcc2
9539    builtin and then its argument prototype would still apply.  */
9540 char dnet_ntoa ();
9541 int
9542 main ()
9543 {
9544 dnet_ntoa ();
9545   ;
9546   return 0;
9547 }
9548 _ACEOF
9549 rm -f conftest.$ac_objext conftest$ac_exeext
9550 if { (eval echo "$as_me:9550: \"$ac_link\"") >&5
9551   (eval $ac_link) 2>&5
9552   ac_status=$?
9553   echo "$as_me:9553: \$? = $ac_status" >&5
9554   (exit $ac_status); } &&
9555          { ac_try='test -s conftest$ac_exeext'
9556   { (eval echo "$as_me:9556: \"$ac_try\"") >&5
9557   (eval $ac_try) 2>&5
9558   ac_status=$?
9559   echo "$as_me:9559: \$? = $ac_status" >&5
9560   (exit $ac_status); }; }; then
9561   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9562 else
9563   echo "$as_me: failed program was:" >&5
9564 cat conftest.$ac_ext >&5
9565 ac_cv_lib_dnet_stub_dnet_ntoa=no
9566 fi
9567 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9568 LIBS=$ac_check_lib_save_LIBS
9569 fi
9570 echo "$as_me:9570: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9571 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9572 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9573   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9574 fi
9575
9576     fi
9577 fi
9578 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9579     LIBS="$ac_xsave_LIBS"
9580
9581     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9582     # to get the SysV transport functions.
9583     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9584     # needs -lnsl.
9585     # The nsl library prevents programs from opening the X display
9586     # on Irix 5.2, according to T.E. Dickey.
9587     # The functions gethostbyname, getservbyname, and inet_addr are
9588     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9589     echo "$as_me:9589: checking for gethostbyname" >&5
9590 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9591 if test "${ac_cv_func_gethostbyname+set}" = set; then
9592   echo $ECHO_N "(cached) $ECHO_C" >&6
9593 else
9594   cat >conftest.$ac_ext <<_ACEOF
9595 #line 9595 "configure"
9596 #include "confdefs.h"
9597 /* System header to define __stub macros and hopefully few prototypes,
9598     which can conflict with char gethostbyname (); below.  */
9599 #include <assert.h>
9600 /* Override any gcc2 internal prototype to avoid an error.  */
9601 #ifdef __cplusplus
9602 extern "C"
9603 #endif
9604 /* We use char because int might match the return type of a gcc2
9605    builtin and then its argument prototype would still apply.  */
9606 char gethostbyname ();
9607 char (*f) ();
9608
9609 int
9610 main ()
9611 {
9612 /* The GNU C library defines this for functions which it implements
9613     to always fail with ENOSYS.  Some functions are actually named
9614     something starting with __ and the normal name is an alias.  */
9615 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9616 choke me
9617 #else
9618 f = gethostbyname;
9619 #endif
9620
9621   ;
9622   return 0;
9623 }
9624 _ACEOF
9625 rm -f conftest.$ac_objext conftest$ac_exeext
9626 if { (eval echo "$as_me:9626: \"$ac_link\"") >&5
9627   (eval $ac_link) 2>&5
9628   ac_status=$?
9629   echo "$as_me:9629: \$? = $ac_status" >&5
9630   (exit $ac_status); } &&
9631          { ac_try='test -s conftest$ac_exeext'
9632   { (eval echo "$as_me:9632: \"$ac_try\"") >&5
9633   (eval $ac_try) 2>&5
9634   ac_status=$?
9635   echo "$as_me:9635: \$? = $ac_status" >&5
9636   (exit $ac_status); }; }; then
9637   ac_cv_func_gethostbyname=yes
9638 else
9639   echo "$as_me: failed program was:" >&5
9640 cat conftest.$ac_ext >&5
9641 ac_cv_func_gethostbyname=no
9642 fi
9643 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9644 fi
9645 echo "$as_me:9645: result: $ac_cv_func_gethostbyname" >&5
9646 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9647
9648     if test $ac_cv_func_gethostbyname = no; then
9649       echo "$as_me:9649: checking for gethostbyname in -lnsl" >&5
9650 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9651 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9652   echo $ECHO_N "(cached) $ECHO_C" >&6
9653 else
9654   ac_check_lib_save_LIBS=$LIBS
9655 LIBS="-lnsl  $LIBS"
9656 cat >conftest.$ac_ext <<_ACEOF
9657 #line 9657 "configure"
9658 #include "confdefs.h"
9659
9660 /* Override any gcc2 internal prototype to avoid an error.  */
9661 #ifdef __cplusplus
9662 extern "C"
9663 #endif
9664 /* We use char because int might match the return type of a gcc2
9665    builtin and then its argument prototype would still apply.  */
9666 char gethostbyname ();
9667 int
9668 main ()
9669 {
9670 gethostbyname ();
9671   ;
9672   return 0;
9673 }
9674 _ACEOF
9675 rm -f conftest.$ac_objext conftest$ac_exeext
9676 if { (eval echo "$as_me:9676: \"$ac_link\"") >&5
9677   (eval $ac_link) 2>&5
9678   ac_status=$?
9679   echo "$as_me:9679: \$? = $ac_status" >&5
9680   (exit $ac_status); } &&
9681          { ac_try='test -s conftest$ac_exeext'
9682   { (eval echo "$as_me:9682: \"$ac_try\"") >&5
9683   (eval $ac_try) 2>&5
9684   ac_status=$?
9685   echo "$as_me:9685: \$? = $ac_status" >&5
9686   (exit $ac_status); }; }; then
9687   ac_cv_lib_nsl_gethostbyname=yes
9688 else
9689   echo "$as_me: failed program was:" >&5
9690 cat conftest.$ac_ext >&5
9691 ac_cv_lib_nsl_gethostbyname=no
9692 fi
9693 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9694 LIBS=$ac_check_lib_save_LIBS
9695 fi
9696 echo "$as_me:9696: result: $ac_cv_lib_nsl_gethostbyname" >&5
9697 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9698 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9699   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9700 fi
9701
9702       if test $ac_cv_lib_nsl_gethostbyname = no; then
9703         echo "$as_me:9703: checking for gethostbyname in -lbsd" >&5
9704 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9705 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9706   echo $ECHO_N "(cached) $ECHO_C" >&6
9707 else
9708   ac_check_lib_save_LIBS=$LIBS
9709 LIBS="-lbsd  $LIBS"
9710 cat >conftest.$ac_ext <<_ACEOF
9711 #line 9711 "configure"
9712 #include "confdefs.h"
9713
9714 /* Override any gcc2 internal prototype to avoid an error.  */
9715 #ifdef __cplusplus
9716 extern "C"
9717 #endif
9718 /* We use char because int might match the return type of a gcc2
9719    builtin and then its argument prototype would still apply.  */
9720 char gethostbyname ();
9721 int
9722 main ()
9723 {
9724 gethostbyname ();
9725   ;
9726   return 0;
9727 }
9728 _ACEOF
9729 rm -f conftest.$ac_objext conftest$ac_exeext
9730 if { (eval echo "$as_me:9730: \"$ac_link\"") >&5
9731   (eval $ac_link) 2>&5
9732   ac_status=$?
9733   echo "$as_me:9733: \$? = $ac_status" >&5
9734   (exit $ac_status); } &&
9735          { ac_try='test -s conftest$ac_exeext'
9736   { (eval echo "$as_me:9736: \"$ac_try\"") >&5
9737   (eval $ac_try) 2>&5
9738   ac_status=$?
9739   echo "$as_me:9739: \$? = $ac_status" >&5
9740   (exit $ac_status); }; }; then
9741   ac_cv_lib_bsd_gethostbyname=yes
9742 else
9743   echo "$as_me: failed program was:" >&5
9744 cat conftest.$ac_ext >&5
9745 ac_cv_lib_bsd_gethostbyname=no
9746 fi
9747 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9748 LIBS=$ac_check_lib_save_LIBS
9749 fi
9750 echo "$as_me:9750: result: $ac_cv_lib_bsd_gethostbyname" >&5
9751 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9752 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9753   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9754 fi
9755
9756       fi
9757     fi
9758
9759     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9760     # socket/setsockopt and other routines are undefined under SCO ODT
9761     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9762     # on later versions), says Simon Leinen: it contains gethostby*
9763     # variants that don't use the nameserver (or something).  -lsocket
9764     # must be given before -lnsl if both are needed.  We assume that
9765     # if connect needs -lnsl, so does gethostbyname.
9766     echo "$as_me:9766: checking for connect" >&5
9767 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9768 if test "${ac_cv_func_connect+set}" = set; then
9769   echo $ECHO_N "(cached) $ECHO_C" >&6
9770 else
9771   cat >conftest.$ac_ext <<_ACEOF
9772 #line 9772 "configure"
9773 #include "confdefs.h"
9774 /* System header to define __stub macros and hopefully few prototypes,
9775     which can conflict with char connect (); below.  */
9776 #include <assert.h>
9777 /* Override any gcc2 internal prototype to avoid an error.  */
9778 #ifdef __cplusplus
9779 extern "C"
9780 #endif
9781 /* We use char because int might match the return type of a gcc2
9782    builtin and then its argument prototype would still apply.  */
9783 char connect ();
9784 char (*f) ();
9785
9786 int
9787 main ()
9788 {
9789 /* The GNU C library defines this for functions which it implements
9790     to always fail with ENOSYS.  Some functions are actually named
9791     something starting with __ and the normal name is an alias.  */
9792 #if defined (__stub_connect) || defined (__stub___connect)
9793 choke me
9794 #else
9795 f = connect;
9796 #endif
9797
9798   ;
9799   return 0;
9800 }
9801 _ACEOF
9802 rm -f conftest.$ac_objext conftest$ac_exeext
9803 if { (eval echo "$as_me:9803: \"$ac_link\"") >&5
9804   (eval $ac_link) 2>&5
9805   ac_status=$?
9806   echo "$as_me:9806: \$? = $ac_status" >&5
9807   (exit $ac_status); } &&
9808          { ac_try='test -s conftest$ac_exeext'
9809   { (eval echo "$as_me:9809: \"$ac_try\"") >&5
9810   (eval $ac_try) 2>&5
9811   ac_status=$?
9812   echo "$as_me:9812: \$? = $ac_status" >&5
9813   (exit $ac_status); }; }; then
9814   ac_cv_func_connect=yes
9815 else
9816   echo "$as_me: failed program was:" >&5
9817 cat conftest.$ac_ext >&5
9818 ac_cv_func_connect=no
9819 fi
9820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9821 fi
9822 echo "$as_me:9822: result: $ac_cv_func_connect" >&5
9823 echo "${ECHO_T}$ac_cv_func_connect" >&6
9824
9825     if test $ac_cv_func_connect = no; then
9826       echo "$as_me:9826: checking for connect in -lsocket" >&5
9827 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9828 if test "${ac_cv_lib_socket_connect+set}" = set; then
9829   echo $ECHO_N "(cached) $ECHO_C" >&6
9830 else
9831   ac_check_lib_save_LIBS=$LIBS
9832 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9833 cat >conftest.$ac_ext <<_ACEOF
9834 #line 9834 "configure"
9835 #include "confdefs.h"
9836
9837 /* Override any gcc2 internal prototype to avoid an error.  */
9838 #ifdef __cplusplus
9839 extern "C"
9840 #endif
9841 /* We use char because int might match the return type of a gcc2
9842    builtin and then its argument prototype would still apply.  */
9843 char connect ();
9844 int
9845 main ()
9846 {
9847 connect ();
9848   ;
9849   return 0;
9850 }
9851 _ACEOF
9852 rm -f conftest.$ac_objext conftest$ac_exeext
9853 if { (eval echo "$as_me:9853: \"$ac_link\"") >&5
9854   (eval $ac_link) 2>&5
9855   ac_status=$?
9856   echo "$as_me:9856: \$? = $ac_status" >&5
9857   (exit $ac_status); } &&
9858          { ac_try='test -s conftest$ac_exeext'
9859   { (eval echo "$as_me:9859: \"$ac_try\"") >&5
9860   (eval $ac_try) 2>&5
9861   ac_status=$?
9862   echo "$as_me:9862: \$? = $ac_status" >&5
9863   (exit $ac_status); }; }; then
9864   ac_cv_lib_socket_connect=yes
9865 else
9866   echo "$as_me: failed program was:" >&5
9867 cat conftest.$ac_ext >&5
9868 ac_cv_lib_socket_connect=no
9869 fi
9870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9871 LIBS=$ac_check_lib_save_LIBS
9872 fi
9873 echo "$as_me:9873: result: $ac_cv_lib_socket_connect" >&5
9874 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9875 if test $ac_cv_lib_socket_connect = yes; then
9876   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9877 fi
9878
9879     fi
9880
9881     # Guillermo Gomez says -lposix is necessary on A/UX.
9882     echo "$as_me:9882: checking for remove" >&5
9883 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9884 if test "${ac_cv_func_remove+set}" = set; then
9885   echo $ECHO_N "(cached) $ECHO_C" >&6
9886 else
9887   cat >conftest.$ac_ext <<_ACEOF
9888 #line 9888 "configure"
9889 #include "confdefs.h"
9890 /* System header to define __stub macros and hopefully few prototypes,
9891     which can conflict with char remove (); below.  */
9892 #include <assert.h>
9893 /* Override any gcc2 internal prototype to avoid an error.  */
9894 #ifdef __cplusplus
9895 extern "C"
9896 #endif
9897 /* We use char because int might match the return type of a gcc2
9898    builtin and then its argument prototype would still apply.  */
9899 char remove ();
9900 char (*f) ();
9901
9902 int
9903 main ()
9904 {
9905 /* The GNU C library defines this for functions which it implements
9906     to always fail with ENOSYS.  Some functions are actually named
9907     something starting with __ and the normal name is an alias.  */
9908 #if defined (__stub_remove) || defined (__stub___remove)
9909 choke me
9910 #else
9911 f = remove;
9912 #endif
9913
9914   ;
9915   return 0;
9916 }
9917 _ACEOF
9918 rm -f conftest.$ac_objext conftest$ac_exeext
9919 if { (eval echo "$as_me:9919: \"$ac_link\"") >&5
9920   (eval $ac_link) 2>&5
9921   ac_status=$?
9922   echo "$as_me:9922: \$? = $ac_status" >&5
9923   (exit $ac_status); } &&
9924          { ac_try='test -s conftest$ac_exeext'
9925   { (eval echo "$as_me:9925: \"$ac_try\"") >&5
9926   (eval $ac_try) 2>&5
9927   ac_status=$?
9928   echo "$as_me:9928: \$? = $ac_status" >&5
9929   (exit $ac_status); }; }; then
9930   ac_cv_func_remove=yes
9931 else
9932   echo "$as_me: failed program was:" >&5
9933 cat conftest.$ac_ext >&5
9934 ac_cv_func_remove=no
9935 fi
9936 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9937 fi
9938 echo "$as_me:9938: result: $ac_cv_func_remove" >&5
9939 echo "${ECHO_T}$ac_cv_func_remove" >&6
9940
9941     if test $ac_cv_func_remove = no; then
9942       echo "$as_me:9942: checking for remove in -lposix" >&5
9943 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9944 if test "${ac_cv_lib_posix_remove+set}" = set; then
9945   echo $ECHO_N "(cached) $ECHO_C" >&6
9946 else
9947   ac_check_lib_save_LIBS=$LIBS
9948 LIBS="-lposix  $LIBS"
9949 cat >conftest.$ac_ext <<_ACEOF
9950 #line 9950 "configure"
9951 #include "confdefs.h"
9952
9953 /* Override any gcc2 internal prototype to avoid an error.  */
9954 #ifdef __cplusplus
9955 extern "C"
9956 #endif
9957 /* We use char because int might match the return type of a gcc2
9958    builtin and then its argument prototype would still apply.  */
9959 char remove ();
9960 int
9961 main ()
9962 {
9963 remove ();
9964   ;
9965   return 0;
9966 }
9967 _ACEOF
9968 rm -f conftest.$ac_objext conftest$ac_exeext
9969 if { (eval echo "$as_me:9969: \"$ac_link\"") >&5
9970   (eval $ac_link) 2>&5
9971   ac_status=$?
9972   echo "$as_me:9972: \$? = $ac_status" >&5
9973   (exit $ac_status); } &&
9974          { ac_try='test -s conftest$ac_exeext'
9975   { (eval echo "$as_me:9975: \"$ac_try\"") >&5
9976   (eval $ac_try) 2>&5
9977   ac_status=$?
9978   echo "$as_me:9978: \$? = $ac_status" >&5
9979   (exit $ac_status); }; }; then
9980   ac_cv_lib_posix_remove=yes
9981 else
9982   echo "$as_me: failed program was:" >&5
9983 cat conftest.$ac_ext >&5
9984 ac_cv_lib_posix_remove=no
9985 fi
9986 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9987 LIBS=$ac_check_lib_save_LIBS
9988 fi
9989 echo "$as_me:9989: result: $ac_cv_lib_posix_remove" >&5
9990 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
9991 if test $ac_cv_lib_posix_remove = yes; then
9992   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
9993 fi
9994
9995     fi
9996
9997     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
9998     echo "$as_me:9998: checking for shmat" >&5
9999 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10000 if test "${ac_cv_func_shmat+set}" = set; then
10001   echo $ECHO_N "(cached) $ECHO_C" >&6
10002 else
10003   cat >conftest.$ac_ext <<_ACEOF
10004 #line 10004 "configure"
10005 #include "confdefs.h"
10006 /* System header to define __stub macros and hopefully few prototypes,
10007     which can conflict with char shmat (); below.  */
10008 #include <assert.h>
10009 /* Override any gcc2 internal prototype to avoid an error.  */
10010 #ifdef __cplusplus
10011 extern "C"
10012 #endif
10013 /* We use char because int might match the return type of a gcc2
10014    builtin and then its argument prototype would still apply.  */
10015 char shmat ();
10016 char (*f) ();
10017
10018 int
10019 main ()
10020 {
10021 /* The GNU C library defines this for functions which it implements
10022     to always fail with ENOSYS.  Some functions are actually named
10023     something starting with __ and the normal name is an alias.  */
10024 #if defined (__stub_shmat) || defined (__stub___shmat)
10025 choke me
10026 #else
10027 f = shmat;
10028 #endif
10029
10030   ;
10031   return 0;
10032 }
10033 _ACEOF
10034 rm -f conftest.$ac_objext conftest$ac_exeext
10035 if { (eval echo "$as_me:10035: \"$ac_link\"") >&5
10036   (eval $ac_link) 2>&5
10037   ac_status=$?
10038   echo "$as_me:10038: \$? = $ac_status" >&5
10039   (exit $ac_status); } &&
10040          { ac_try='test -s conftest$ac_exeext'
10041   { (eval echo "$as_me:10041: \"$ac_try\"") >&5
10042   (eval $ac_try) 2>&5
10043   ac_status=$?
10044   echo "$as_me:10044: \$? = $ac_status" >&5
10045   (exit $ac_status); }; }; then
10046   ac_cv_func_shmat=yes
10047 else
10048   echo "$as_me: failed program was:" >&5
10049 cat conftest.$ac_ext >&5
10050 ac_cv_func_shmat=no
10051 fi
10052 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10053 fi
10054 echo "$as_me:10054: result: $ac_cv_func_shmat" >&5
10055 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10056
10057     if test $ac_cv_func_shmat = no; then
10058       echo "$as_me:10058: checking for shmat in -lipc" >&5
10059 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10060 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10061   echo $ECHO_N "(cached) $ECHO_C" >&6
10062 else
10063   ac_check_lib_save_LIBS=$LIBS
10064 LIBS="-lipc  $LIBS"
10065 cat >conftest.$ac_ext <<_ACEOF
10066 #line 10066 "configure"
10067 #include "confdefs.h"
10068
10069 /* Override any gcc2 internal prototype to avoid an error.  */
10070 #ifdef __cplusplus
10071 extern "C"
10072 #endif
10073 /* We use char because int might match the return type of a gcc2
10074    builtin and then its argument prototype would still apply.  */
10075 char shmat ();
10076 int
10077 main ()
10078 {
10079 shmat ();
10080   ;
10081   return 0;
10082 }
10083 _ACEOF
10084 rm -f conftest.$ac_objext conftest$ac_exeext
10085 if { (eval echo "$as_me:10085: \"$ac_link\"") >&5
10086   (eval $ac_link) 2>&5
10087   ac_status=$?
10088   echo "$as_me:10088: \$? = $ac_status" >&5
10089   (exit $ac_status); } &&
10090          { ac_try='test -s conftest$ac_exeext'
10091   { (eval echo "$as_me:10091: \"$ac_try\"") >&5
10092   (eval $ac_try) 2>&5
10093   ac_status=$?
10094   echo "$as_me:10094: \$? = $ac_status" >&5
10095   (exit $ac_status); }; }; then
10096   ac_cv_lib_ipc_shmat=yes
10097 else
10098   echo "$as_me: failed program was:" >&5
10099 cat conftest.$ac_ext >&5
10100 ac_cv_lib_ipc_shmat=no
10101 fi
10102 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10103 LIBS=$ac_check_lib_save_LIBS
10104 fi
10105 echo "$as_me:10105: result: $ac_cv_lib_ipc_shmat" >&5
10106 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10107 if test $ac_cv_lib_ipc_shmat = yes; then
10108   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10109 fi
10110
10111     fi
10112   fi
10113
10114   # Check for libraries that X11R6 Xt/Xaw programs need.
10115   ac_save_LDFLAGS=$LDFLAGS
10116   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10117   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10118   # check for ICE first), but we must link in the order -lSM -lICE or
10119   # we get undefined symbols.  So assume we have SM if we have ICE.
10120   # These have to be linked with before -lX11, unlike the other
10121   # libraries we check for below, so use a different variable.
10122   # John Interrante, Karl Berry
10123   echo "$as_me:10123: checking for IceConnectionNumber in -lICE" >&5
10124 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10125 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10126   echo $ECHO_N "(cached) $ECHO_C" >&6
10127 else
10128   ac_check_lib_save_LIBS=$LIBS
10129 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10130 cat >conftest.$ac_ext <<_ACEOF
10131 #line 10131 "configure"
10132 #include "confdefs.h"
10133
10134 /* Override any gcc2 internal prototype to avoid an error.  */
10135 #ifdef __cplusplus
10136 extern "C"
10137 #endif
10138 /* We use char because int might match the return type of a gcc2
10139    builtin and then its argument prototype would still apply.  */
10140 char IceConnectionNumber ();
10141 int
10142 main ()
10143 {
10144 IceConnectionNumber ();
10145   ;
10146   return 0;
10147 }
10148 _ACEOF
10149 rm -f conftest.$ac_objext conftest$ac_exeext
10150 if { (eval echo "$as_me:10150: \"$ac_link\"") >&5
10151   (eval $ac_link) 2>&5
10152   ac_status=$?
10153   echo "$as_me:10153: \$? = $ac_status" >&5
10154   (exit $ac_status); } &&
10155          { ac_try='test -s conftest$ac_exeext'
10156   { (eval echo "$as_me:10156: \"$ac_try\"") >&5
10157   (eval $ac_try) 2>&5
10158   ac_status=$?
10159   echo "$as_me:10159: \$? = $ac_status" >&5
10160   (exit $ac_status); }; }; then
10161   ac_cv_lib_ICE_IceConnectionNumber=yes
10162 else
10163   echo "$as_me: failed program was:" >&5
10164 cat conftest.$ac_ext >&5
10165 ac_cv_lib_ICE_IceConnectionNumber=no
10166 fi
10167 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10168 LIBS=$ac_check_lib_save_LIBS
10169 fi
10170 echo "$as_me:10170: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10171 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10172 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10173   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10174 fi
10175
10176   LDFLAGS=$ac_save_LDFLAGS
10177
10178 fi
10179
10180 cf_x_athena=${cf_x_athena:-Xaw}
10181
10182 echo "$as_me:10182: checking if you want to link with Xaw 3d library" >&5
10183 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10184 withval=
10185
10186 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10187 if test "${with_Xaw3d+set}" = set; then
10188   withval="$with_Xaw3d"
10189
10190 fi;
10191 if test "$withval" = yes ; then
10192         cf_x_athena=Xaw3d
10193         echo "$as_me:10193: result: yes" >&5
10194 echo "${ECHO_T}yes" >&6
10195 else
10196         echo "$as_me:10196: result: no" >&5
10197 echo "${ECHO_T}no" >&6
10198 fi
10199
10200 echo "$as_me:10200: checking if you want to link with neXT Athena library" >&5
10201 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10202 withval=
10203
10204 # Check whether --with-neXtaw or --without-neXtaw was given.
10205 if test "${with_neXtaw+set}" = set; then
10206   withval="$with_neXtaw"
10207
10208 fi;
10209 if test "$withval" = yes ; then
10210         cf_x_athena=neXtaw
10211         echo "$as_me:10211: result: yes" >&5
10212 echo "${ECHO_T}yes" >&6
10213 else
10214         echo "$as_me:10214: result: no" >&5
10215 echo "${ECHO_T}no" >&6
10216 fi
10217
10218 echo "$as_me:10218: checking if you want to link with Athena-Plus library" >&5
10219 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10220 withval=
10221
10222 # Check whether --with-XawPlus or --without-XawPlus was given.
10223 if test "${with_XawPlus+set}" = set; then
10224   withval="$with_XawPlus"
10225
10226 fi;
10227 if test "$withval" = yes ; then
10228         cf_x_athena=XawPlus
10229         echo "$as_me:10229: result: yes" >&5
10230 echo "${ECHO_T}yes" >&6
10231 else
10232         echo "$as_me:10232: result: no" >&5
10233 echo "${ECHO_T}no" >&6
10234 fi
10235
10236 cf_x_athena_lib=""
10237
10238 if test "$PKG_CONFIG" != none ; then
10239         cf_athena_list=
10240         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10241         for cf_athena_pkg in \
10242                 $cf_athena_list \
10243                 ${cf_x_athena} \
10244                 ${cf_x_athena}-devel \
10245                 lib${cf_x_athena} \
10246                 lib${cf_x_athena}-devel
10247         do
10248
10249 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10250         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10251
10252 echo "${as_me:-configure}:10252: testing found package $cf_athena_pkg ..." 1>&5
10253
10254         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10255         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10256         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10257
10258 echo "${as_me:-configure}:10258: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10259
10260         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10261
10262 echo "${as_me:-configure}:10262: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10263
10264 cf_fix_cppflags=no
10265 cf_new_cflags=
10266 cf_new_cppflags=
10267 cf_new_extra_cppflags=
10268
10269 for cf_add_cflags in $cf_pkgconfig_incs
10270 do
10271 case $cf_fix_cppflags in
10272 no)
10273         case $cf_add_cflags in #(vi
10274         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10275                 case $cf_add_cflags in
10276                 -D*)
10277                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10278
10279                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10280                                 && test -z "${cf_tst_cflags}" \
10281                                 && cf_fix_cppflags=yes
10282
10283                         if test $cf_fix_cppflags = yes ; then
10284                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10285                                 continue
10286                         elif test "${cf_tst_cflags}" = "\"'" ; then
10287                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10288                                 continue
10289                         fi
10290                         ;;
10291                 esac
10292                 case "$CPPFLAGS" in
10293                 *$cf_add_cflags) #(vi
10294                         ;;
10295                 *) #(vi
10296                         case $cf_add_cflags in #(vi
10297                         -D*)
10298                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10299
10300 CPPFLAGS=`echo "$CPPFLAGS" | \
10301         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10302                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10303
10304                                 ;;
10305                         esac
10306                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10307                         ;;
10308                 esac
10309                 ;;
10310         *)
10311                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10312                 ;;
10313         esac
10314         ;;
10315 yes)
10316         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10317
10318         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10319
10320         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10321                 && test -z "${cf_tst_cflags}" \
10322                 && cf_fix_cppflags=no
10323         ;;
10324 esac
10325 done
10326
10327 if test -n "$cf_new_cflags" ; then
10328
10329         CFLAGS="$CFLAGS $cf_new_cflags"
10330 fi
10331
10332 if test -n "$cf_new_cppflags" ; then
10333
10334         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10335 fi
10336
10337 if test -n "$cf_new_extra_cppflags" ; then
10338
10339         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10340 fi
10341
10342         LIBS="$cf_pkgconfig_libs $LIBS"
10343
10344                         cf_x_athena_lib="$cf_pkgconfig_libs"
10345
10346 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10347
10348                         cat >>confdefs.h <<EOF
10349 #define $cf_x_athena_LIBS 1
10350 EOF
10351
10352 echo "$as_me:10352: checking for usable $cf_x_athena/Xmu package" >&5
10353 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10354 if test "${cf_cv_xaw_compat+set}" = set; then
10355   echo $ECHO_N "(cached) $ECHO_C" >&6
10356 else
10357
10358 cat >conftest.$ac_ext <<_ACEOF
10359 #line 10359 "configure"
10360 #include "confdefs.h"
10361
10362 #include <X11/Xmu/CharSet.h>
10363
10364 int
10365 main ()
10366 {
10367
10368 int check = XmuCompareISOLatin1("big", "small")
10369
10370   ;
10371   return 0;
10372 }
10373 _ACEOF
10374 rm -f conftest.$ac_objext conftest$ac_exeext
10375 if { (eval echo "$as_me:10375: \"$ac_link\"") >&5
10376   (eval $ac_link) 2>&5
10377   ac_status=$?
10378   echo "$as_me:10378: \$? = $ac_status" >&5
10379   (exit $ac_status); } &&
10380          { ac_try='test -s conftest$ac_exeext'
10381   { (eval echo "$as_me:10381: \"$ac_try\"") >&5
10382   (eval $ac_try) 2>&5
10383   ac_status=$?
10384   echo "$as_me:10384: \$? = $ac_status" >&5
10385   (exit $ac_status); }; }; then
10386   cf_cv_xaw_compat=yes
10387 else
10388   echo "$as_me: failed program was:" >&5
10389 cat conftest.$ac_ext >&5
10390 cf_cv_xaw_compat=no
10391 fi
10392 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10393 fi
10394 echo "$as_me:10394: result: $cf_cv_xaw_compat" >&5
10395 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10396
10397                         if test "$cf_cv_xaw_compat" = no
10398                         then
10399                                 # workaround for broken ".pc" files...
10400                                 case "$cf_x_athena_lib" in #(vi
10401                                 *-lXmu*) #(vi
10402                                         ;;
10403                                 *)
10404                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10405
10406 echo "${as_me:-configure}:10406: testing work around broken package ..." 1>&5
10407
10408 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10409         test -n "$verbose" && echo "    found package xmu" 1>&6
10410
10411 echo "${as_me:-configure}:10411: testing found package xmu ..." 1>&5
10412
10413         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10414         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10415         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10416
10417 echo "${as_me:-configure}:10417: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10418
10419         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10420
10421 echo "${as_me:-configure}:10421: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10422
10423 cf_fix_cppflags=no
10424 cf_new_cflags=
10425 cf_new_cppflags=
10426 cf_new_extra_cppflags=
10427
10428 for cf_add_cflags in $cf_pkgconfig_incs
10429 do
10430 case $cf_fix_cppflags in
10431 no)
10432         case $cf_add_cflags in #(vi
10433         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10434                 case $cf_add_cflags in
10435                 -D*)
10436                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10437
10438                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10439                                 && test -z "${cf_tst_cflags}" \
10440                                 && cf_fix_cppflags=yes
10441
10442                         if test $cf_fix_cppflags = yes ; then
10443                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10444                                 continue
10445                         elif test "${cf_tst_cflags}" = "\"'" ; then
10446                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10447                                 continue
10448                         fi
10449                         ;;
10450                 esac
10451                 case "$CPPFLAGS" in
10452                 *$cf_add_cflags) #(vi
10453                         ;;
10454                 *) #(vi
10455                         case $cf_add_cflags in #(vi
10456                         -D*)
10457                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10458
10459 CPPFLAGS=`echo "$CPPFLAGS" | \
10460         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10461                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10462
10463                                 ;;
10464                         esac
10465                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10466                         ;;
10467                 esac
10468                 ;;
10469         *)
10470                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10471                 ;;
10472         esac
10473         ;;
10474 yes)
10475         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10476
10477         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10478
10479         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10480                 && test -z "${cf_tst_cflags}" \
10481                 && cf_fix_cppflags=no
10482         ;;
10483 esac
10484 done
10485
10486 if test -n "$cf_new_cflags" ; then
10487
10488         CFLAGS="$CFLAGS $cf_new_cflags"
10489 fi
10490
10491 if test -n "$cf_new_cppflags" ; then
10492
10493         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10494 fi
10495
10496 if test -n "$cf_new_extra_cppflags" ; then
10497
10498         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10499 fi
10500
10501         LIBS="$cf_pkgconfig_libs $LIBS"
10502         :
10503 else
10504
10505 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10506
10507 echo "${as_me:-configure}:10507: testing ...before $LIBS ..." 1>&5
10508
10509 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
10510 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10511
10512 echo "${as_me:-configure}:10512: testing ...after  $LIBS ..." 1>&5
10513
10514 fi
10515
10516                                         ;;
10517                                 esac
10518                         fi
10519
10520                         break
10521 else
10522         :
10523 fi
10524
10525         done
10526 fi
10527
10528 if test -z "$cf_x_athena_lib" ; then
10529
10530 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10531         test -n "$verbose" && echo "    found package Xext" 1>&6
10532
10533 echo "${as_me:-configure}:10533: testing found package Xext ..." 1>&5
10534
10535         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10536         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10537         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10538
10539 echo "${as_me:-configure}:10539: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10540
10541         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10542
10543 echo "${as_me:-configure}:10543: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10544
10545 cf_fix_cppflags=no
10546 cf_new_cflags=
10547 cf_new_cppflags=
10548 cf_new_extra_cppflags=
10549
10550 for cf_add_cflags in $cf_pkgconfig_incs
10551 do
10552 case $cf_fix_cppflags in
10553 no)
10554         case $cf_add_cflags in #(vi
10555         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10556                 case $cf_add_cflags in
10557                 -D*)
10558                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10559
10560                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10561                                 && test -z "${cf_tst_cflags}" \
10562                                 && cf_fix_cppflags=yes
10563
10564                         if test $cf_fix_cppflags = yes ; then
10565                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10566                                 continue
10567                         elif test "${cf_tst_cflags}" = "\"'" ; then
10568                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10569                                 continue
10570                         fi
10571                         ;;
10572                 esac
10573                 case "$CPPFLAGS" in
10574                 *$cf_add_cflags) #(vi
10575                         ;;
10576                 *) #(vi
10577                         case $cf_add_cflags in #(vi
10578                         -D*)
10579                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10580
10581 CPPFLAGS=`echo "$CPPFLAGS" | \
10582         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10583                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10584
10585                                 ;;
10586                         esac
10587                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10588                         ;;
10589                 esac
10590                 ;;
10591         *)
10592                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10593                 ;;
10594         esac
10595         ;;
10596 yes)
10597         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10598
10599         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10600
10601         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10602                 && test -z "${cf_tst_cflags}" \
10603                 && cf_fix_cppflags=no
10604         ;;
10605 esac
10606 done
10607
10608 if test -n "$cf_new_cflags" ; then
10609
10610         CFLAGS="$CFLAGS $cf_new_cflags"
10611 fi
10612
10613 if test -n "$cf_new_cppflags" ; then
10614
10615         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10616 fi
10617
10618 if test -n "$cf_new_extra_cppflags" ; then
10619
10620         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10621 fi
10622
10623         LIBS="$cf_pkgconfig_libs $LIBS"
10624         :
10625 else
10626
10627         echo "$as_me:10627: checking for XextCreateExtension in -lXext" >&5
10628 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10629 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10630   echo $ECHO_N "(cached) $ECHO_C" >&6
10631 else
10632   ac_check_lib_save_LIBS=$LIBS
10633 LIBS="-lXext  $LIBS"
10634 cat >conftest.$ac_ext <<_ACEOF
10635 #line 10635 "configure"
10636 #include "confdefs.h"
10637
10638 /* Override any gcc2 internal prototype to avoid an error.  */
10639 #ifdef __cplusplus
10640 extern "C"
10641 #endif
10642 /* We use char because int might match the return type of a gcc2
10643    builtin and then its argument prototype would still apply.  */
10644 char XextCreateExtension ();
10645 int
10646 main ()
10647 {
10648 XextCreateExtension ();
10649   ;
10650   return 0;
10651 }
10652 _ACEOF
10653 rm -f conftest.$ac_objext conftest$ac_exeext
10654 if { (eval echo "$as_me:10654: \"$ac_link\"") >&5
10655   (eval $ac_link) 2>&5
10656   ac_status=$?
10657   echo "$as_me:10657: \$? = $ac_status" >&5
10658   (exit $ac_status); } &&
10659          { ac_try='test -s conftest$ac_exeext'
10660   { (eval echo "$as_me:10660: \"$ac_try\"") >&5
10661   (eval $ac_try) 2>&5
10662   ac_status=$?
10663   echo "$as_me:10663: \$? = $ac_status" >&5
10664   (exit $ac_status); }; }; then
10665   ac_cv_lib_Xext_XextCreateExtension=yes
10666 else
10667   echo "$as_me: failed program was:" >&5
10668 cat conftest.$ac_ext >&5
10669 ac_cv_lib_Xext_XextCreateExtension=no
10670 fi
10671 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10672 LIBS=$ac_check_lib_save_LIBS
10673 fi
10674 echo "$as_me:10674: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10675 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10676 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10677   LIBS="-lXext $LIBS"
10678 fi
10679
10680 fi
10681
10682 cf_have_X_LIBS=no
10683
10684 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
10685         test -n "$verbose" && echo "    found package xt" 1>&6
10686
10687 echo "${as_me:-configure}:10687: testing found package xt ..." 1>&5
10688
10689         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
10690         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
10691         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
10692
10693 echo "${as_me:-configure}:10693: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10694
10695         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
10696
10697 echo "${as_me:-configure}:10697: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
10698
10699 cf_fix_cppflags=no
10700 cf_new_cflags=
10701 cf_new_cppflags=
10702 cf_new_extra_cppflags=
10703
10704 for cf_add_cflags in $cf_pkgconfig_incs
10705 do
10706 case $cf_fix_cppflags in
10707 no)
10708         case $cf_add_cflags in #(vi
10709         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10710                 case $cf_add_cflags in
10711                 -D*)
10712                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10713
10714                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10715                                 && test -z "${cf_tst_cflags}" \
10716                                 && cf_fix_cppflags=yes
10717
10718                         if test $cf_fix_cppflags = yes ; then
10719                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10720                                 continue
10721                         elif test "${cf_tst_cflags}" = "\"'" ; then
10722                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10723                                 continue
10724                         fi
10725                         ;;
10726                 esac
10727                 case "$CPPFLAGS" in
10728                 *$cf_add_cflags) #(vi
10729                         ;;
10730                 *) #(vi
10731                         case $cf_add_cflags in #(vi
10732                         -D*)
10733                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10734
10735 CPPFLAGS=`echo "$CPPFLAGS" | \
10736         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10737                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10738
10739                                 ;;
10740                         esac
10741                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10742                         ;;
10743                 esac
10744                 ;;
10745         *)
10746                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10747                 ;;
10748         esac
10749         ;;
10750 yes)
10751         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10752
10753         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10754
10755         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10756                 && test -z "${cf_tst_cflags}" \
10757                 && cf_fix_cppflags=no
10758         ;;
10759 esac
10760 done
10761
10762 if test -n "$cf_new_cflags" ; then
10763
10764         CFLAGS="$CFLAGS $cf_new_cflags"
10765 fi
10766
10767 if test -n "$cf_new_cppflags" ; then
10768
10769         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10770 fi
10771
10772 if test -n "$cf_new_extra_cppflags" ; then
10773
10774         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10775 fi
10776
10777         LIBS="$cf_pkgconfig_libs $LIBS"
10778
10779         case "x$LIBS" in #(vi
10780         *-lX11*) #(vi
10781                 ;;
10782         *)
10783 # we have an "xt" package, but it may omit Xt's dependency on X11
10784 echo "$as_me:10784: checking for usable X dependency" >&5
10785 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
10786 if test "${cf_cv_xt_x11_compat+set}" = set; then
10787   echo $ECHO_N "(cached) $ECHO_C" >&6
10788 else
10789
10790 cat >conftest.$ac_ext <<_ACEOF
10791 #line 10791 "configure"
10792 #include "confdefs.h"
10793
10794 #include <X11/Xlib.h>
10795
10796 int
10797 main ()
10798 {
10799
10800         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
10801         int rc2 = XClearWindow((Display*) 0, (Window) 0);
10802         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
10803         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
10804
10805   ;
10806   return 0;
10807 }
10808 _ACEOF
10809 rm -f conftest.$ac_objext conftest$ac_exeext
10810 if { (eval echo "$as_me:10810: \"$ac_link\"") >&5
10811   (eval $ac_link) 2>&5
10812   ac_status=$?
10813   echo "$as_me:10813: \$? = $ac_status" >&5
10814   (exit $ac_status); } &&
10815          { ac_try='test -s conftest$ac_exeext'
10816   { (eval echo "$as_me:10816: \"$ac_try\"") >&5
10817   (eval $ac_try) 2>&5
10818   ac_status=$?
10819   echo "$as_me:10819: \$? = $ac_status" >&5
10820   (exit $ac_status); }; }; then
10821   cf_cv_xt_x11_compat=yes
10822 else
10823   echo "$as_me: failed program was:" >&5
10824 cat conftest.$ac_ext >&5
10825 cf_cv_xt_x11_compat=no
10826 fi
10827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10828 fi
10829 echo "$as_me:10829: result: $cf_cv_xt_x11_compat" >&5
10830 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
10831                 if test "$cf_cv_xt_x11_compat" = no
10832                 then
10833                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
10834
10835 echo "${as_me:-configure}:10835: testing work around broken X11 dependency ..." 1>&5
10836
10837                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
10838
10839 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10840         test -n "$verbose" && echo "    found package x11" 1>&6
10841
10842 echo "${as_me:-configure}:10842: testing found package x11 ..." 1>&5
10843
10844         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10845         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10846         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10847
10848 echo "${as_me:-configure}:10848: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10849
10850         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10851
10852 echo "${as_me:-configure}:10852: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10853
10854 cf_fix_cppflags=no
10855 cf_new_cflags=
10856 cf_new_cppflags=
10857 cf_new_extra_cppflags=
10858
10859 for cf_add_cflags in $cf_pkgconfig_incs
10860 do
10861 case $cf_fix_cppflags in
10862 no)
10863         case $cf_add_cflags in #(vi
10864         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
10865                 case $cf_add_cflags in
10866                 -D*)
10867                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10868
10869                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10870                                 && test -z "${cf_tst_cflags}" \
10871                                 && cf_fix_cppflags=yes
10872
10873                         if test $cf_fix_cppflags = yes ; then
10874                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10875                                 continue
10876                         elif test "${cf_tst_cflags}" = "\"'" ; then
10877                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10878                                 continue
10879                         fi
10880                         ;;
10881                 esac
10882                 case "$CPPFLAGS" in
10883                 *$cf_add_cflags) #(vi
10884                         ;;
10885                 *) #(vi
10886                         case $cf_add_cflags in #(vi
10887                         -D*)
10888                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10889
10890 CPPFLAGS=`echo "$CPPFLAGS" | \
10891         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10892                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10893
10894                                 ;;
10895                         esac
10896                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10897                         ;;
10898                 esac
10899                 ;;
10900         *)
10901                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10902                 ;;
10903         esac
10904         ;;
10905 yes)
10906         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10907
10908         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10909
10910         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
10911                 && test -z "${cf_tst_cflags}" \
10912                 && cf_fix_cppflags=no
10913         ;;
10914 esac
10915 done
10916
10917 if test -n "$cf_new_cflags" ; then
10918
10919         CFLAGS="$CFLAGS $cf_new_cflags"
10920 fi
10921
10922 if test -n "$cf_new_cppflags" ; then
10923
10924         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10925 fi
10926
10927 if test -n "$cf_new_extra_cppflags" ; then
10928
10929         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10930 fi
10931
10932         LIBS="$cf_pkgconfig_libs $LIBS"
10933         :
10934 else
10935
10936 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10937
10938 echo "${as_me:-configure}:10938: testing ...before $LIBS ..." 1>&5
10939
10940 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
10941 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10942
10943 echo "${as_me:-configure}:10943: testing ...after  $LIBS ..." 1>&5
10944
10945 fi
10946
10947                 fi
10948                 ;;
10949         esac
10950
10951 echo "$as_me:10951: checking for usable X Toolkit package" >&5
10952 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
10953 if test "${cf_cv_xt_ice_compat+set}" = set; then
10954   echo $ECHO_N "(cached) $ECHO_C" >&6
10955 else
10956
10957 cat >conftest.$ac_ext <<_ACEOF
10958 #line 10958 "configure"
10959 #include "confdefs.h"
10960
10961 #include <X11/Shell.h>
10962
10963 int
10964 main ()
10965 {
10966 int num = IceConnectionNumber(0)
10967
10968   ;
10969   return 0;
10970 }
10971 _ACEOF
10972 rm -f conftest.$ac_objext conftest$ac_exeext
10973 if { (eval echo "$as_me:10973: \"$ac_link\"") >&5
10974   (eval $ac_link) 2>&5
10975   ac_status=$?
10976   echo "$as_me:10976: \$? = $ac_status" >&5
10977   (exit $ac_status); } &&
10978          { ac_try='test -s conftest$ac_exeext'
10979   { (eval echo "$as_me:10979: \"$ac_try\"") >&5
10980   (eval $ac_try) 2>&5
10981   ac_status=$?
10982   echo "$as_me:10982: \$? = $ac_status" >&5
10983   (exit $ac_status); }; }; then
10984   cf_cv_xt_ice_compat=yes
10985 else
10986   echo "$as_me: failed program was:" >&5
10987 cat conftest.$ac_ext >&5
10988 cf_cv_xt_ice_compat=no
10989 fi
10990 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10991 fi
10992 echo "$as_me:10992: result: $cf_cv_xt_ice_compat" >&5
10993 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
10994
10995         if test "$cf_cv_xt_ice_compat" = no
10996         then
10997                 # workaround for broken ".pc" files used for X Toolkit.
10998                 case "x$X_PRE_LIBS" in #(vi
10999                 *-lICE*)
11000                         case "x$LIBS" in #(vi
11001                         *-lICE*) #(vi
11002                                 ;;
11003                         *)
11004                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11005
11006 echo "${as_me:-configure}:11006: testing work around broken ICE dependency ..." 1>&5
11007
11008 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11009         test -n "$verbose" && echo "    found package ice" 1>&6
11010
11011 echo "${as_me:-configure}:11011: testing found package ice ..." 1>&5
11012
11013         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11014         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11015         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11016
11017 echo "${as_me:-configure}:11017: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11018
11019         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11020
11021 echo "${as_me:-configure}:11021: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11022
11023 cf_fix_cppflags=no
11024 cf_new_cflags=
11025 cf_new_cppflags=
11026 cf_new_extra_cppflags=
11027
11028 for cf_add_cflags in $cf_pkgconfig_incs
11029 do
11030 case $cf_fix_cppflags in
11031 no)
11032         case $cf_add_cflags in #(vi
11033         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11034                 case $cf_add_cflags in
11035                 -D*)
11036                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11037
11038                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11039                                 && test -z "${cf_tst_cflags}" \
11040                                 && cf_fix_cppflags=yes
11041
11042                         if test $cf_fix_cppflags = yes ; then
11043                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11044                                 continue
11045                         elif test "${cf_tst_cflags}" = "\"'" ; then
11046                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11047                                 continue
11048                         fi
11049                         ;;
11050                 esac
11051                 case "$CPPFLAGS" in
11052                 *$cf_add_cflags) #(vi
11053                         ;;
11054                 *) #(vi
11055                         case $cf_add_cflags in #(vi
11056                         -D*)
11057                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11058
11059 CPPFLAGS=`echo "$CPPFLAGS" | \
11060         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11061                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11062
11063                                 ;;
11064                         esac
11065                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11066                         ;;
11067                 esac
11068                 ;;
11069         *)
11070                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11071                 ;;
11072         esac
11073         ;;
11074 yes)
11075         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11076
11077         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11078
11079         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11080                 && test -z "${cf_tst_cflags}" \
11081                 && cf_fix_cppflags=no
11082         ;;
11083 esac
11084 done
11085
11086 if test -n "$cf_new_cflags" ; then
11087
11088         CFLAGS="$CFLAGS $cf_new_cflags"
11089 fi
11090
11091 if test -n "$cf_new_cppflags" ; then
11092
11093         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11094 fi
11095
11096 if test -n "$cf_new_extra_cppflags" ; then
11097
11098         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11099 fi
11100
11101         LIBS="$cf_pkgconfig_libs $LIBS"
11102
11103 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11104         test -n "$verbose" && echo "    found package sm" 1>&6
11105
11106 echo "${as_me:-configure}:11106: testing found package sm ..." 1>&5
11107
11108         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11109         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11110         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11111
11112 echo "${as_me:-configure}:11112: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11113
11114         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11115
11116 echo "${as_me:-configure}:11116: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11117
11118 cf_fix_cppflags=no
11119 cf_new_cflags=
11120 cf_new_cppflags=
11121 cf_new_extra_cppflags=
11122
11123 for cf_add_cflags in $cf_pkgconfig_incs
11124 do
11125 case $cf_fix_cppflags in
11126 no)
11127         case $cf_add_cflags in #(vi
11128         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11129                 case $cf_add_cflags in
11130                 -D*)
11131                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11132
11133                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11134                                 && test -z "${cf_tst_cflags}" \
11135                                 && cf_fix_cppflags=yes
11136
11137                         if test $cf_fix_cppflags = yes ; then
11138                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11139                                 continue
11140                         elif test "${cf_tst_cflags}" = "\"'" ; then
11141                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11142                                 continue
11143                         fi
11144                         ;;
11145                 esac
11146                 case "$CPPFLAGS" in
11147                 *$cf_add_cflags) #(vi
11148                         ;;
11149                 *) #(vi
11150                         case $cf_add_cflags in #(vi
11151                         -D*)
11152                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11153
11154 CPPFLAGS=`echo "$CPPFLAGS" | \
11155         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11156                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11157
11158                                 ;;
11159                         esac
11160                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11161                         ;;
11162                 esac
11163                 ;;
11164         *)
11165                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11166                 ;;
11167         esac
11168         ;;
11169 yes)
11170         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11171
11172         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11173
11174         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11175                 && test -z "${cf_tst_cflags}" \
11176                 && cf_fix_cppflags=no
11177         ;;
11178 esac
11179 done
11180
11181 if test -n "$cf_new_cflags" ; then
11182
11183         CFLAGS="$CFLAGS $cf_new_cflags"
11184 fi
11185
11186 if test -n "$cf_new_cppflags" ; then
11187
11188         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11189 fi
11190
11191 if test -n "$cf_new_extra_cppflags" ; then
11192
11193         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11194 fi
11195
11196         LIBS="$cf_pkgconfig_libs $LIBS"
11197         :
11198 else
11199         :
11200 fi
11201
11202 else
11203
11204 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11205
11206 echo "${as_me:-configure}:11206: testing ...before $LIBS ..." 1>&5
11207
11208 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
11209 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11210
11211 echo "${as_me:-configure}:11211: testing ...after  $LIBS ..." 1>&5
11212
11213 fi
11214
11215                                 ;;
11216                         esac
11217                         ;;
11218                 esac
11219         fi
11220
11221         cf_have_X_LIBS=yes
11222
11223 else
11224
11225         LDFLAGS="$X_LIBS $LDFLAGS"
11226
11227 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11228
11229 echo "${as_me:-configure}:11229: testing checking additions to CFLAGS ..." 1>&5
11230
11231 cf_check_cflags="$CFLAGS"
11232 cf_check_cppflags="$CPPFLAGS"
11233
11234 cf_fix_cppflags=no
11235 cf_new_cflags=
11236 cf_new_cppflags=
11237 cf_new_extra_cppflags=
11238
11239 for cf_add_cflags in $X_CFLAGS
11240 do
11241 case $cf_fix_cppflags in
11242 no)
11243         case $cf_add_cflags in #(vi
11244         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11245                 case $cf_add_cflags in
11246                 -D*)
11247                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11248
11249                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11250                                 && test -z "${cf_tst_cflags}" \
11251                                 && cf_fix_cppflags=yes
11252
11253                         if test $cf_fix_cppflags = yes ; then
11254                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11255                                 continue
11256                         elif test "${cf_tst_cflags}" = "\"'" ; then
11257                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11258                                 continue
11259                         fi
11260                         ;;
11261                 esac
11262                 case "$CPPFLAGS" in
11263                 *$cf_add_cflags) #(vi
11264                         ;;
11265                 *) #(vi
11266                         case $cf_add_cflags in #(vi
11267                         -D*)
11268                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11269
11270 CPPFLAGS=`echo "$CPPFLAGS" | \
11271         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11272                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11273
11274                                 ;;
11275                         esac
11276                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11277                         ;;
11278                 esac
11279                 ;;
11280         *)
11281                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11282                 ;;
11283         esac
11284         ;;
11285 yes)
11286         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11287
11288         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11289
11290         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11291                 && test -z "${cf_tst_cflags}" \
11292                 && cf_fix_cppflags=no
11293         ;;
11294 esac
11295 done
11296
11297 if test -n "$cf_new_cflags" ; then
11298         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11299
11300 echo "${as_me:-configure}:11300: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11301
11302         CFLAGS="$CFLAGS $cf_new_cflags"
11303 fi
11304
11305 if test -n "$cf_new_cppflags" ; then
11306         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11307
11308 echo "${as_me:-configure}:11308: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11309
11310         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11311 fi
11312
11313 if test -n "$cf_new_extra_cppflags" ; then
11314         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11315
11316 echo "${as_me:-configure}:11316: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11317
11318         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11319 fi
11320
11321 if test "$cf_check_cflags" != "$CFLAGS" ; then
11322 cat >conftest.$ac_ext <<_ACEOF
11323 #line 11323 "configure"
11324 #include "confdefs.h"
11325 #include <stdio.h>
11326 int
11327 main ()
11328 {
11329 printf("Hello world");
11330   ;
11331   return 0;
11332 }
11333 _ACEOF
11334 rm -f conftest.$ac_objext conftest$ac_exeext
11335 if { (eval echo "$as_me:11335: \"$ac_link\"") >&5
11336   (eval $ac_link) 2>&5
11337   ac_status=$?
11338   echo "$as_me:11338: \$? = $ac_status" >&5
11339   (exit $ac_status); } &&
11340          { ac_try='test -s conftest$ac_exeext'
11341   { (eval echo "$as_me:11341: \"$ac_try\"") >&5
11342   (eval $ac_try) 2>&5
11343   ac_status=$?
11344   echo "$as_me:11344: \$? = $ac_status" >&5
11345   (exit $ac_status); }; }; then
11346   :
11347 else
11348   echo "$as_me: failed program was:" >&5
11349 cat conftest.$ac_ext >&5
11350 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11351
11352 echo "${as_me:-configure}:11352: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11353
11354          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11355                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11356
11357 echo "${as_me:-configure}:11357: testing but keeping change to \$CPPFLAGS ..." 1>&5
11358
11359          fi
11360          CFLAGS="$cf_check_flags"
11361 fi
11362 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11363 fi
11364
11365         echo "$as_me:11365: checking for XOpenDisplay" >&5
11366 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
11367 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
11368   echo $ECHO_N "(cached) $ECHO_C" >&6
11369 else
11370   cat >conftest.$ac_ext <<_ACEOF
11371 #line 11371 "configure"
11372 #include "confdefs.h"
11373 /* System header to define __stub macros and hopefully few prototypes,
11374     which can conflict with char XOpenDisplay (); below.  */
11375 #include <assert.h>
11376 /* Override any gcc2 internal prototype to avoid an error.  */
11377 #ifdef __cplusplus
11378 extern "C"
11379 #endif
11380 /* We use char because int might match the return type of a gcc2
11381    builtin and then its argument prototype would still apply.  */
11382 char XOpenDisplay ();
11383 char (*f) ();
11384
11385 int
11386 main ()
11387 {
11388 /* The GNU C library defines this for functions which it implements
11389     to always fail with ENOSYS.  Some functions are actually named
11390     something starting with __ and the normal name is an alias.  */
11391 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
11392 choke me
11393 #else
11394 f = XOpenDisplay;
11395 #endif
11396
11397   ;
11398   return 0;
11399 }
11400 _ACEOF
11401 rm -f conftest.$ac_objext conftest$ac_exeext
11402 if { (eval echo "$as_me:11402: \"$ac_link\"") >&5
11403   (eval $ac_link) 2>&5
11404   ac_status=$?
11405   echo "$as_me:11405: \$? = $ac_status" >&5
11406   (exit $ac_status); } &&
11407          { ac_try='test -s conftest$ac_exeext'
11408   { (eval echo "$as_me:11408: \"$ac_try\"") >&5
11409   (eval $ac_try) 2>&5
11410   ac_status=$?
11411   echo "$as_me:11411: \$? = $ac_status" >&5
11412   (exit $ac_status); }; }; then
11413   ac_cv_func_XOpenDisplay=yes
11414 else
11415   echo "$as_me: failed program was:" >&5
11416 cat conftest.$ac_ext >&5
11417 ac_cv_func_XOpenDisplay=no
11418 fi
11419 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11420 fi
11421 echo "$as_me:11421: result: $ac_cv_func_XOpenDisplay" >&5
11422 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
11423 if test $ac_cv_func_XOpenDisplay = yes; then
11424   :
11425 else
11426
11427         echo "$as_me:11427: checking for XOpenDisplay in -lX11" >&5
11428 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11429 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11430   echo $ECHO_N "(cached) $ECHO_C" >&6
11431 else
11432   ac_check_lib_save_LIBS=$LIBS
11433 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11434 cat >conftest.$ac_ext <<_ACEOF
11435 #line 11435 "configure"
11436 #include "confdefs.h"
11437
11438 /* Override any gcc2 internal prototype to avoid an error.  */
11439 #ifdef __cplusplus
11440 extern "C"
11441 #endif
11442 /* We use char because int might match the return type of a gcc2
11443    builtin and then its argument prototype would still apply.  */
11444 char XOpenDisplay ();
11445 int
11446 main ()
11447 {
11448 XOpenDisplay ();
11449   ;
11450   return 0;
11451 }
11452 _ACEOF
11453 rm -f conftest.$ac_objext conftest$ac_exeext
11454 if { (eval echo "$as_me:11454: \"$ac_link\"") >&5
11455   (eval $ac_link) 2>&5
11456   ac_status=$?
11457   echo "$as_me:11457: \$? = $ac_status" >&5
11458   (exit $ac_status); } &&
11459          { ac_try='test -s conftest$ac_exeext'
11460   { (eval echo "$as_me:11460: \"$ac_try\"") >&5
11461   (eval $ac_try) 2>&5
11462   ac_status=$?
11463   echo "$as_me:11463: \$? = $ac_status" >&5
11464   (exit $ac_status); }; }; then
11465   ac_cv_lib_X11_XOpenDisplay=yes
11466 else
11467   echo "$as_me: failed program was:" >&5
11468 cat conftest.$ac_ext >&5
11469 ac_cv_lib_X11_XOpenDisplay=no
11470 fi
11471 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11472 LIBS=$ac_check_lib_save_LIBS
11473 fi
11474 echo "$as_me:11474: result: $ac_cv_lib_X11_XOpenDisplay" >&5
11475 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
11476 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
11477   LIBS="-lX11 $LIBS"
11478 fi
11479
11480 fi
11481
11482         echo "$as_me:11482: checking for XtAppInitialize" >&5
11483 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
11484 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
11485   echo $ECHO_N "(cached) $ECHO_C" >&6
11486 else
11487   cat >conftest.$ac_ext <<_ACEOF
11488 #line 11488 "configure"
11489 #include "confdefs.h"
11490 /* System header to define __stub macros and hopefully few prototypes,
11491     which can conflict with char XtAppInitialize (); below.  */
11492 #include <assert.h>
11493 /* Override any gcc2 internal prototype to avoid an error.  */
11494 #ifdef __cplusplus
11495 extern "C"
11496 #endif
11497 /* We use char because int might match the return type of a gcc2
11498    builtin and then its argument prototype would still apply.  */
11499 char XtAppInitialize ();
11500 char (*f) ();
11501
11502 int
11503 main ()
11504 {
11505 /* The GNU C library defines this for functions which it implements
11506     to always fail with ENOSYS.  Some functions are actually named
11507     something starting with __ and the normal name is an alias.  */
11508 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
11509 choke me
11510 #else
11511 f = XtAppInitialize;
11512 #endif
11513
11514   ;
11515   return 0;
11516 }
11517 _ACEOF
11518 rm -f conftest.$ac_objext conftest$ac_exeext
11519 if { (eval echo "$as_me:11519: \"$ac_link\"") >&5
11520   (eval $ac_link) 2>&5
11521   ac_status=$?
11522   echo "$as_me:11522: \$? = $ac_status" >&5
11523   (exit $ac_status); } &&
11524          { ac_try='test -s conftest$ac_exeext'
11525   { (eval echo "$as_me:11525: \"$ac_try\"") >&5
11526   (eval $ac_try) 2>&5
11527   ac_status=$?
11528   echo "$as_me:11528: \$? = $ac_status" >&5
11529   (exit $ac_status); }; }; then
11530   ac_cv_func_XtAppInitialize=yes
11531 else
11532   echo "$as_me: failed program was:" >&5
11533 cat conftest.$ac_ext >&5
11534 ac_cv_func_XtAppInitialize=no
11535 fi
11536 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11537 fi
11538 echo "$as_me:11538: result: $ac_cv_func_XtAppInitialize" >&5
11539 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
11540 if test $ac_cv_func_XtAppInitialize = yes; then
11541   :
11542 else
11543
11544         echo "$as_me:11544: checking for XtAppInitialize in -lXt" >&5
11545 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
11546 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
11547   echo $ECHO_N "(cached) $ECHO_C" >&6
11548 else
11549   ac_check_lib_save_LIBS=$LIBS
11550 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11551 cat >conftest.$ac_ext <<_ACEOF
11552 #line 11552 "configure"
11553 #include "confdefs.h"
11554
11555 /* Override any gcc2 internal prototype to avoid an error.  */
11556 #ifdef __cplusplus
11557 extern "C"
11558 #endif
11559 /* We use char because int might match the return type of a gcc2
11560    builtin and then its argument prototype would still apply.  */
11561 char XtAppInitialize ();
11562 int
11563 main ()
11564 {
11565 XtAppInitialize ();
11566   ;
11567   return 0;
11568 }
11569 _ACEOF
11570 rm -f conftest.$ac_objext conftest$ac_exeext
11571 if { (eval echo "$as_me:11571: \"$ac_link\"") >&5
11572   (eval $ac_link) 2>&5
11573   ac_status=$?
11574   echo "$as_me:11574: \$? = $ac_status" >&5
11575   (exit $ac_status); } &&
11576          { ac_try='test -s conftest$ac_exeext'
11577   { (eval echo "$as_me:11577: \"$ac_try\"") >&5
11578   (eval $ac_try) 2>&5
11579   ac_status=$?
11580   echo "$as_me:11580: \$? = $ac_status" >&5
11581   (exit $ac_status); }; }; then
11582   ac_cv_lib_Xt_XtAppInitialize=yes
11583 else
11584   echo "$as_me: failed program was:" >&5
11585 cat conftest.$ac_ext >&5
11586 ac_cv_lib_Xt_XtAppInitialize=no
11587 fi
11588 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11589 LIBS=$ac_check_lib_save_LIBS
11590 fi
11591 echo "$as_me:11591: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
11592 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
11593 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
11594   cat >>confdefs.h <<\EOF
11595 #define HAVE_LIBXT 1
11596 EOF
11597
11598                  cf_have_X_LIBS=Xt
11599                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
11600 fi
11601
11602 fi
11603
11604 fi
11605
11606 if test $cf_have_X_LIBS = no ; then
11607         { echo "$as_me:11607: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11608 test program.  You will have to check and add the proper libraries by hand
11609 to makefile." >&5
11610 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
11611 test program.  You will have to check and add the proper libraries by hand
11612 to makefile." >&2;}
11613 fi
11614
11615 cf_x_athena_root=$cf_x_athena
11616 cf_x_athena_inc=""
11617
11618 for cf_path in default \
11619         /usr/contrib/X11R6 \
11620         /usr/contrib/X11R5 \
11621         /usr/lib/X11R5 \
11622         /usr/local
11623 do
11624         if test -z "$cf_x_athena_inc" ; then
11625                 cf_save="$CPPFLAGS"
11626                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
11627                 if test $cf_path != default ; then
11628                         CPPFLAGS="$cf_save -I$cf_path/include"
11629                         echo "$as_me:11629: checking for $cf_test in $cf_path" >&5
11630 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
11631                 else
11632                         echo "$as_me:11632: checking for $cf_test" >&5
11633 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
11634                 fi
11635                 cat >conftest.$ac_ext <<_ACEOF
11636 #line 11636 "configure"
11637 #include "confdefs.h"
11638
11639 #include <X11/Intrinsic.h>
11640 #include <$cf_test>
11641 int
11642 main ()
11643 {
11644
11645   ;
11646   return 0;
11647 }
11648 _ACEOF
11649 rm -f conftest.$ac_objext
11650 if { (eval echo "$as_me:11650: \"$ac_compile\"") >&5
11651   (eval $ac_compile) 2>&5
11652   ac_status=$?
11653   echo "$as_me:11653: \$? = $ac_status" >&5
11654   (exit $ac_status); } &&
11655          { ac_try='test -s conftest.$ac_objext'
11656   { (eval echo "$as_me:11656: \"$ac_try\"") >&5
11657   (eval $ac_try) 2>&5
11658   ac_status=$?
11659   echo "$as_me:11659: \$? = $ac_status" >&5
11660   (exit $ac_status); }; }; then
11661   cf_result=yes
11662 else
11663   echo "$as_me: failed program was:" >&5
11664 cat conftest.$ac_ext >&5
11665 cf_result=no
11666 fi
11667 rm -f conftest.$ac_objext conftest.$ac_ext
11668                 echo "$as_me:11668: result: $cf_result" >&5
11669 echo "${ECHO_T}$cf_result" >&6
11670                 if test "$cf_result" = yes ; then
11671                         cf_x_athena_inc=$cf_path
11672                         break
11673                 else
11674                         CPPFLAGS="$cf_save"
11675                 fi
11676         fi
11677 done
11678
11679 if test -z "$cf_x_athena_inc" ; then
11680         { echo "$as_me:11680: WARNING: Unable to successfully find Athena header files with test program" >&5
11681 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
11682 elif test "$cf_x_athena_inc" != default ; then
11683         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
11684 fi
11685
11686 cf_x_athena_root=$cf_x_athena
11687 cf_x_athena_lib=""
11688
11689 for cf_path in default \
11690         /usr/contrib/X11R6 \
11691         /usr/contrib/X11R5 \
11692         /usr/lib/X11R5 \
11693         /usr/local
11694 do
11695         for cf_lib in \
11696                 "-l$cf_x_athena_root -lXmu" \
11697                 "-l$cf_x_athena_root -lXpm -lXmu" \
11698                 "-l${cf_x_athena_root}_s -lXmu_s"
11699         do
11700                 if test -z "$cf_x_athena_lib" ; then
11701                         cf_save="$LIBS"
11702                         cf_test=XawSimpleMenuAddGlobalActions
11703                         if test $cf_path != default ; then
11704                                 LIBS="-L$cf_path/lib $cf_lib $LIBS"
11705                                 echo "$as_me:11705: checking for $cf_lib in $cf_path" >&5
11706 echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6
11707                         else
11708                                 LIBS="$cf_lib $LIBS"
11709                                 echo "$as_me:11709: checking for $cf_test in $cf_lib" >&5
11710 echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6
11711                         fi
11712                         cat >conftest.$ac_ext <<_ACEOF
11713 #line 11713 "configure"
11714 #include "confdefs.h"
11715
11716 int
11717 main ()
11718 {
11719 $cf_test()
11720   ;
11721   return 0;
11722 }
11723 _ACEOF
11724 rm -f conftest.$ac_objext conftest$ac_exeext
11725 if { (eval echo "$as_me:11725: \"$ac_link\"") >&5
11726   (eval $ac_link) 2>&5
11727   ac_status=$?
11728   echo "$as_me:11728: \$? = $ac_status" >&5
11729   (exit $ac_status); } &&
11730          { ac_try='test -s conftest$ac_exeext'
11731   { (eval echo "$as_me:11731: \"$ac_try\"") >&5
11732   (eval $ac_try) 2>&5
11733   ac_status=$?
11734   echo "$as_me:11734: \$? = $ac_status" >&5
11735   (exit $ac_status); }; }; then
11736   cf_result=yes
11737 else
11738   echo "$as_me: failed program was:" >&5
11739 cat conftest.$ac_ext >&5
11740 cf_result=no
11741 fi
11742 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11743                         echo "$as_me:11743: result: $cf_result" >&5
11744 echo "${ECHO_T}$cf_result" >&6
11745                         if test "$cf_result" = yes ; then
11746                                 cf_x_athena_lib="$cf_lib"
11747                                 break
11748                         fi
11749                         LIBS="$cf_save"
11750                 fi
11751         done
11752 done
11753
11754 if test -z "$cf_x_athena_lib" ; then
11755         { { echo "$as_me:11755: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
11756 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
11757    { (exit 1); exit 1; }; }
11758 fi
11759
11760 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11761
11762 cat >>confdefs.h <<EOF
11763 #define $cf_x_athena_LIBS 1
11764 EOF
11765
11766 fi
11767
11768 for ac_prog in xcurses-config
11769 do
11770   # Extract the first word of "$ac_prog", so it can be a program name with args.
11771 set dummy $ac_prog; ac_word=$2
11772 echo "$as_me:11772: checking for $ac_word" >&5
11773 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11774 if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
11775   echo $ECHO_N "(cached) $ECHO_C" >&6
11776 else
11777   case $XCURSES_CONFIG in
11778   [\\/]* | ?:[\\/]*)
11779   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
11780   ;;
11781   *)
11782   ac_save_IFS=$IFS; IFS=$ac_path_separator
11783 ac_dummy="$PATH"
11784 for ac_dir in $ac_dummy; do
11785   IFS=$ac_save_IFS
11786   test -z "$ac_dir" && ac_dir=.
11787   if $as_executable_p "$ac_dir/$ac_word"; then
11788    ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
11789    echo "$as_me:11789: found $ac_dir/$ac_word" >&5
11790    break
11791 fi
11792 done
11793
11794   ;;
11795 esac
11796 fi
11797 XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
11798
11799 if test -n "$XCURSES_CONFIG"; then
11800   echo "$as_me:11800: result: $XCURSES_CONFIG" >&5
11801 echo "${ECHO_T}$XCURSES_CONFIG" >&6
11802 else
11803   echo "$as_me:11803: result: no" >&5
11804 echo "${ECHO_T}no" >&6
11805 fi
11806
11807   test -n "$XCURSES_CONFIG" && break
11808 done
11809 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
11810
11811 if test "$XCURSES_CONFIG" != none ; then
11812
11813 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
11814 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
11815
11816 cf_cv_lib_XCurses=yes
11817
11818 else
11819
11820 LDFLAGS="$LDFLAGS $X_LIBS"
11821
11822 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11823
11824 echo "${as_me:-configure}:11824: testing checking additions to CFLAGS ..." 1>&5
11825
11826 cf_check_cflags="$CFLAGS"
11827 cf_check_cppflags="$CPPFLAGS"
11828
11829 cf_fix_cppflags=no
11830 cf_new_cflags=
11831 cf_new_cppflags=
11832 cf_new_extra_cppflags=
11833
11834 for cf_add_cflags in $X_CFLAGS
11835 do
11836 case $cf_fix_cppflags in
11837 no)
11838         case $cf_add_cflags in #(vi
11839         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11840                 case $cf_add_cflags in
11841                 -D*)
11842                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11843
11844                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11845                                 && test -z "${cf_tst_cflags}" \
11846                                 && cf_fix_cppflags=yes
11847
11848                         if test $cf_fix_cppflags = yes ; then
11849                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11850                                 continue
11851                         elif test "${cf_tst_cflags}" = "\"'" ; then
11852                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11853                                 continue
11854                         fi
11855                         ;;
11856                 esac
11857                 case "$CPPFLAGS" in
11858                 *$cf_add_cflags) #(vi
11859                         ;;
11860                 *) #(vi
11861                         case $cf_add_cflags in #(vi
11862                         -D*)
11863                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11864
11865 CPPFLAGS=`echo "$CPPFLAGS" | \
11866         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11867                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11868
11869                                 ;;
11870                         esac
11871                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11872                         ;;
11873                 esac
11874                 ;;
11875         *)
11876                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11877                 ;;
11878         esac
11879         ;;
11880 yes)
11881         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11882
11883         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11884
11885         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11886                 && test -z "${cf_tst_cflags}" \
11887                 && cf_fix_cppflags=no
11888         ;;
11889 esac
11890 done
11891
11892 if test -n "$cf_new_cflags" ; then
11893         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11894
11895 echo "${as_me:-configure}:11895: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11896
11897         CFLAGS="$CFLAGS $cf_new_cflags"
11898 fi
11899
11900 if test -n "$cf_new_cppflags" ; then
11901         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11902
11903 echo "${as_me:-configure}:11903: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11904
11905         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11906 fi
11907
11908 if test -n "$cf_new_extra_cppflags" ; then
11909         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11910
11911 echo "${as_me:-configure}:11911: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11912
11913         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11914 fi
11915
11916 if test "$cf_check_cflags" != "$CFLAGS" ; then
11917 cat >conftest.$ac_ext <<_ACEOF
11918 #line 11918 "configure"
11919 #include "confdefs.h"
11920 #include <stdio.h>
11921 int
11922 main ()
11923 {
11924 printf("Hello world");
11925   ;
11926   return 0;
11927 }
11928 _ACEOF
11929 rm -f conftest.$ac_objext conftest$ac_exeext
11930 if { (eval echo "$as_me:11930: \"$ac_link\"") >&5
11931   (eval $ac_link) 2>&5
11932   ac_status=$?
11933   echo "$as_me:11933: \$? = $ac_status" >&5
11934   (exit $ac_status); } &&
11935          { ac_try='test -s conftest$ac_exeext'
11936   { (eval echo "$as_me:11936: \"$ac_try\"") >&5
11937   (eval $ac_try) 2>&5
11938   ac_status=$?
11939   echo "$as_me:11939: \$? = $ac_status" >&5
11940   (exit $ac_status); }; }; then
11941   :
11942 else
11943   echo "$as_me: failed program was:" >&5
11944 cat conftest.$ac_ext >&5
11945 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
11946
11947 echo "${as_me:-configure}:11947: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
11948
11949          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
11950                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
11951
11952 echo "${as_me:-configure}:11952: testing but keeping change to \$CPPFLAGS ..." 1>&5
11953
11954          fi
11955          CFLAGS="$cf_check_flags"
11956 fi
11957 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11958 fi
11959
11960 echo "$as_me:11960: checking for XOpenDisplay in -lX11" >&5
11961 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
11962 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
11963   echo $ECHO_N "(cached) $ECHO_C" >&6
11964 else
11965   ac_check_lib_save_LIBS=$LIBS
11966 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
11967 cat >conftest.$ac_ext <<_ACEOF
11968 #line 11968 "configure"
11969 #include "confdefs.h"
11970
11971 /* Override any gcc2 internal prototype to avoid an error.  */
11972 #ifdef __cplusplus
11973 extern "C"
11974 #endif
11975 /* We use char because int might match the return type of a gcc2
11976    builtin and then its argument prototype would still apply.  */
11977 char XOpenDisplay ();
11978 int
11979 main ()
11980 {
11981 XOpenDisplay ();
11982   ;
11983   return 0;
11984 }
11985 _ACEOF
11986 rm -f conftest.$ac_objext conftest$ac_exeext
11987 if { (eval echo "$as_me:11987: \"$ac_link\"") >&5
11988   (eval $ac_link) 2>&5
11989   ac_status=$?
11990   echo "$as_me:11990: \$? = $ac_status" >&5
11991   (exit $ac_status); } &&
11992          { ac_try='test -s conftest$ac_exeext'
11993   { (eval echo "$as_me:11993: \"$ac_try\"") >&5
11994   (eval $ac_try) 2>&5
11995   ac_status=$?
11996   echo "$as_me:11996: \$? = $ac_status" >&5
11997   (exit $ac_status); }; }; then
11998   ac_cv_lib_X11_XOpenDisplay=yes
11999 else
12000   echo "$as_me: failed program was:" >&5
12001 cat conftest.$ac_ext >&5
12002 ac_cv_lib_X11_XOpenDisplay=no
12003 fi
12004 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12005 LIBS=$ac_check_lib_save_LIBS
12006 fi
12007 echo "$as_me:12007: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12008 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12009 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12010   LIBS="-lX11 $LIBS"
12011 fi
12012
12013 echo "$as_me:12013: checking for XCurses library" >&5
12014 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12015 if test "${cf_cv_lib_XCurses+set}" = set; then
12016   echo $ECHO_N "(cached) $ECHO_C" >&6
12017 else
12018
12019 LIBS="-lXCurses $LIBS"
12020 cat >conftest.$ac_ext <<_ACEOF
12021 #line 12021 "configure"
12022 #include "confdefs.h"
12023
12024 #include <xcurses.h>
12025 char *XCursesProgramName = "test";
12026
12027 int
12028 main ()
12029 {
12030 XCursesExit();
12031   ;
12032   return 0;
12033 }
12034 _ACEOF
12035 rm -f conftest.$ac_objext conftest$ac_exeext
12036 if { (eval echo "$as_me:12036: \"$ac_link\"") >&5
12037   (eval $ac_link) 2>&5
12038   ac_status=$?
12039   echo "$as_me:12039: \$? = $ac_status" >&5
12040   (exit $ac_status); } &&
12041          { ac_try='test -s 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   cf_cv_lib_XCurses=yes
12048 else
12049   echo "$as_me: failed program was:" >&5
12050 cat conftest.$ac_ext >&5
12051 cf_cv_lib_XCurses=no
12052 fi
12053 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12054
12055 fi
12056 echo "$as_me:12056: result: $cf_cv_lib_XCurses" >&5
12057 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12058
12059 fi
12060
12061 if test $cf_cv_lib_XCurses = yes ; then
12062         cat >>confdefs.h <<\EOF
12063 #define UNIX 1
12064 EOF
12065
12066         cat >>confdefs.h <<\EOF
12067 #define XCURSES 1
12068 EOF
12069
12070         cat >>confdefs.h <<\EOF
12071 #define HAVE_XCURSES 1
12072 EOF
12073
12074 else
12075         { { echo "$as_me:12075: error: Cannot link with XCurses" >&5
12076 echo "$as_me: error: Cannot link with XCurses" >&2;}
12077    { (exit 1); exit 1; }; }
12078 fi
12079
12080         ;;
12081 esac
12082
12083 case $cf_cv_screen in #(vi
12084 pdcurses) #(vi
12085         ;;
12086 *)
12087         # look for curses-related libraries
12088
12089 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
12090 echo "$as_me:12090: checking for new_panel in -lpanel$cf_cv_libtype" >&5
12091 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
12092 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12093   echo $ECHO_N "(cached) $ECHO_C" >&6
12094 else
12095   ac_check_lib_save_LIBS=$LIBS
12096 LIBS="-lpanel$cf_cv_libtype  $LIBS"
12097 cat >conftest.$ac_ext <<_ACEOF
12098 #line 12098 "configure"
12099 #include "confdefs.h"
12100
12101 /* Override any gcc2 internal prototype to avoid an error.  */
12102 #ifdef __cplusplus
12103 extern "C"
12104 #endif
12105 /* We use char because int might match the return type of a gcc2
12106    builtin and then its argument prototype would still apply.  */
12107 char new_panel ();
12108 int
12109 main ()
12110 {
12111 new_panel ();
12112   ;
12113   return 0;
12114 }
12115 _ACEOF
12116 rm -f conftest.$ac_objext conftest$ac_exeext
12117 if { (eval echo "$as_me:12117: \"$ac_link\"") >&5
12118   (eval $ac_link) 2>&5
12119   ac_status=$?
12120   echo "$as_me:12120: \$? = $ac_status" >&5
12121   (exit $ac_status); } &&
12122          { ac_try='test -s conftest$ac_exeext'
12123   { (eval echo "$as_me:12123: \"$ac_try\"") >&5
12124   (eval $ac_try) 2>&5
12125   ac_status=$?
12126   echo "$as_me:12126: \$? = $ac_status" >&5
12127   (exit $ac_status); }; }; then
12128   eval "$as_ac_Lib=yes"
12129 else
12130   echo "$as_me: failed program was:" >&5
12131 cat conftest.$ac_ext >&5
12132 eval "$as_ac_Lib=no"
12133 fi
12134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12135 LIBS=$ac_check_lib_save_LIBS
12136 fi
12137 echo "$as_me:12137: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12138 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12139 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12140   cat >>confdefs.h <<EOF
12141 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
12142 EOF
12143
12144   LIBS="-lpanel$cf_cv_libtype $LIBS"
12145
12146 fi
12147
12148 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
12149 echo "$as_me:12149: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
12150 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
12151 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12152   echo $ECHO_N "(cached) $ECHO_C" >&6
12153 else
12154   ac_check_lib_save_LIBS=$LIBS
12155 LIBS="-lmenu$cf_cv_libtype  $LIBS"
12156 cat >conftest.$ac_ext <<_ACEOF
12157 #line 12157 "configure"
12158 #include "confdefs.h"
12159
12160 /* Override any gcc2 internal prototype to avoid an error.  */
12161 #ifdef __cplusplus
12162 extern "C"
12163 #endif
12164 /* We use char because int might match the return type of a gcc2
12165    builtin and then its argument prototype would still apply.  */
12166 char menu_driver ();
12167 int
12168 main ()
12169 {
12170 menu_driver ();
12171   ;
12172   return 0;
12173 }
12174 _ACEOF
12175 rm -f conftest.$ac_objext conftest$ac_exeext
12176 if { (eval echo "$as_me:12176: \"$ac_link\"") >&5
12177   (eval $ac_link) 2>&5
12178   ac_status=$?
12179   echo "$as_me:12179: \$? = $ac_status" >&5
12180   (exit $ac_status); } &&
12181          { ac_try='test -s conftest$ac_exeext'
12182   { (eval echo "$as_me:12182: \"$ac_try\"") >&5
12183   (eval $ac_try) 2>&5
12184   ac_status=$?
12185   echo "$as_me:12185: \$? = $ac_status" >&5
12186   (exit $ac_status); }; }; then
12187   eval "$as_ac_Lib=yes"
12188 else
12189   echo "$as_me: failed program was:" >&5
12190 cat conftest.$ac_ext >&5
12191 eval "$as_ac_Lib=no"
12192 fi
12193 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12194 LIBS=$ac_check_lib_save_LIBS
12195 fi
12196 echo "$as_me:12196: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12197 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12198 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12199   cat >>confdefs.h <<EOF
12200 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
12201 EOF
12202
12203   LIBS="-lmenu$cf_cv_libtype $LIBS"
12204
12205 fi
12206
12207 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
12208 echo "$as_me:12208: checking for form_driver in -lform$cf_cv_libtype" >&5
12209 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
12210 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12211   echo $ECHO_N "(cached) $ECHO_C" >&6
12212 else
12213   ac_check_lib_save_LIBS=$LIBS
12214 LIBS="-lform$cf_cv_libtype  $LIBS"
12215 cat >conftest.$ac_ext <<_ACEOF
12216 #line 12216 "configure"
12217 #include "confdefs.h"
12218
12219 /* Override any gcc2 internal prototype to avoid an error.  */
12220 #ifdef __cplusplus
12221 extern "C"
12222 #endif
12223 /* We use char because int might match the return type of a gcc2
12224    builtin and then its argument prototype would still apply.  */
12225 char form_driver ();
12226 int
12227 main ()
12228 {
12229 form_driver ();
12230   ;
12231   return 0;
12232 }
12233 _ACEOF
12234 rm -f conftest.$ac_objext conftest$ac_exeext
12235 if { (eval echo "$as_me:12235: \"$ac_link\"") >&5
12236   (eval $ac_link) 2>&5
12237   ac_status=$?
12238   echo "$as_me:12238: \$? = $ac_status" >&5
12239   (exit $ac_status); } &&
12240          { ac_try='test -s conftest$ac_exeext'
12241   { (eval echo "$as_me:12241: \"$ac_try\"") >&5
12242   (eval $ac_try) 2>&5
12243   ac_status=$?
12244   echo "$as_me:12244: \$? = $ac_status" >&5
12245   (exit $ac_status); }; }; then
12246   eval "$as_ac_Lib=yes"
12247 else
12248   echo "$as_me: failed program was:" >&5
12249 cat conftest.$ac_ext >&5
12250 eval "$as_ac_Lib=no"
12251 fi
12252 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12253 LIBS=$ac_check_lib_save_LIBS
12254 fi
12255 echo "$as_me:12255: result: `eval echo '${'$as_ac_Lib'}'`" >&5
12256 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
12257 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
12258   cat >>confdefs.h <<EOF
12259 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
12260 EOF
12261
12262   LIBS="-lform$cf_cv_libtype $LIBS"
12263
12264 fi
12265
12266         # look for curses-related headers
12267
12268 for ac_header in \
12269                 nc_alloc.h \
12270                 nomacros.h \
12271                 form.h \
12272                 menu.h \
12273                 panel.h \
12274                 term_entry.h \
12275
12276 do
12277 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12278 echo "$as_me:12278: checking for $ac_header" >&5
12279 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12280 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12281   echo $ECHO_N "(cached) $ECHO_C" >&6
12282 else
12283   cat >conftest.$ac_ext <<_ACEOF
12284 #line 12284 "configure"
12285 #include "confdefs.h"
12286 #include <$ac_header>
12287 _ACEOF
12288 if { (eval echo "$as_me:12288: \"$ac_cpp conftest.$ac_ext\"") >&5
12289   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12290   ac_status=$?
12291   egrep -v '^ *\+' conftest.er1 >conftest.err
12292   rm -f conftest.er1
12293   cat conftest.err >&5
12294   echo "$as_me:12294: \$? = $ac_status" >&5
12295   (exit $ac_status); } >/dev/null; then
12296   if test -s conftest.err; then
12297     ac_cpp_err=$ac_c_preproc_warn_flag
12298   else
12299     ac_cpp_err=
12300   fi
12301 else
12302   ac_cpp_err=yes
12303 fi
12304 if test -z "$ac_cpp_err"; then
12305   eval "$as_ac_Header=yes"
12306 else
12307   echo "$as_me: failed program was:" >&5
12308   cat conftest.$ac_ext >&5
12309   eval "$as_ac_Header=no"
12310 fi
12311 rm -f conftest.err conftest.$ac_ext
12312 fi
12313 echo "$as_me:12313: result: `eval echo '${'$as_ac_Header'}'`" >&5
12314 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12315 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12316   cat >>confdefs.h <<EOF
12317 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12318 EOF
12319
12320 fi
12321 done
12322
12323         ;;
12324 esac
12325
12326 echo "$as_me:12326: checking return type of signal handlers" >&5
12327 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
12328 if test "${ac_cv_type_signal+set}" = set; then
12329   echo $ECHO_N "(cached) $ECHO_C" >&6
12330 else
12331   cat >conftest.$ac_ext <<_ACEOF
12332 #line 12332 "configure"
12333 #include "confdefs.h"
12334 #include <sys/types.h>
12335 #include <signal.h>
12336 #ifdef signal
12337 # undef signal
12338 #endif
12339 #ifdef __cplusplus
12340 extern "C" void (*signal (int, void (*)(int)))(int);
12341 #else
12342 void (*signal ()) ();
12343 #endif
12344
12345 int
12346 main ()
12347 {
12348 int i;
12349   ;
12350   return 0;
12351 }
12352 _ACEOF
12353 rm -f conftest.$ac_objext
12354 if { (eval echo "$as_me:12354: \"$ac_compile\"") >&5
12355   (eval $ac_compile) 2>&5
12356   ac_status=$?
12357   echo "$as_me:12357: \$? = $ac_status" >&5
12358   (exit $ac_status); } &&
12359          { ac_try='test -s conftest.$ac_objext'
12360   { (eval echo "$as_me:12360: \"$ac_try\"") >&5
12361   (eval $ac_try) 2>&5
12362   ac_status=$?
12363   echo "$as_me:12363: \$? = $ac_status" >&5
12364   (exit $ac_status); }; }; then
12365   ac_cv_type_signal=void
12366 else
12367   echo "$as_me: failed program was:" >&5
12368 cat conftest.$ac_ext >&5
12369 ac_cv_type_signal=int
12370 fi
12371 rm -f conftest.$ac_objext conftest.$ac_ext
12372 fi
12373 echo "$as_me:12373: result: $ac_cv_type_signal" >&5
12374 echo "${ECHO_T}$ac_cv_type_signal" >&6
12375
12376 cat >>confdefs.h <<EOF
12377 #define RETSIGTYPE $ac_cv_type_signal
12378 EOF
12379
12380 echo "$as_me:12380: checking for ANSI C header files" >&5
12381 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12382 if test "${ac_cv_header_stdc+set}" = set; then
12383   echo $ECHO_N "(cached) $ECHO_C" >&6
12384 else
12385   cat >conftest.$ac_ext <<_ACEOF
12386 #line 12386 "configure"
12387 #include "confdefs.h"
12388 #include <stdlib.h>
12389 #include <stdarg.h>
12390 #include <string.h>
12391 #include <float.h>
12392
12393 _ACEOF
12394 if { (eval echo "$as_me:12394: \"$ac_cpp conftest.$ac_ext\"") >&5
12395   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12396   ac_status=$?
12397   egrep -v '^ *\+' conftest.er1 >conftest.err
12398   rm -f conftest.er1
12399   cat conftest.err >&5
12400   echo "$as_me:12400: \$? = $ac_status" >&5
12401   (exit $ac_status); } >/dev/null; then
12402   if test -s conftest.err; then
12403     ac_cpp_err=$ac_c_preproc_warn_flag
12404   else
12405     ac_cpp_err=
12406   fi
12407 else
12408   ac_cpp_err=yes
12409 fi
12410 if test -z "$ac_cpp_err"; then
12411   ac_cv_header_stdc=yes
12412 else
12413   echo "$as_me: failed program was:" >&5
12414   cat conftest.$ac_ext >&5
12415   ac_cv_header_stdc=no
12416 fi
12417 rm -f conftest.err conftest.$ac_ext
12418
12419 if test $ac_cv_header_stdc = yes; then
12420   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12421   cat >conftest.$ac_ext <<_ACEOF
12422 #line 12422 "configure"
12423 #include "confdefs.h"
12424 #include <string.h>
12425
12426 _ACEOF
12427 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12428   egrep "memchr" >/dev/null 2>&1; then
12429   :
12430 else
12431   ac_cv_header_stdc=no
12432 fi
12433 rm -rf conftest*
12434
12435 fi
12436
12437 if test $ac_cv_header_stdc = yes; then
12438   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12439   cat >conftest.$ac_ext <<_ACEOF
12440 #line 12440 "configure"
12441 #include "confdefs.h"
12442 #include <stdlib.h>
12443
12444 _ACEOF
12445 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12446   egrep "free" >/dev/null 2>&1; then
12447   :
12448 else
12449   ac_cv_header_stdc=no
12450 fi
12451 rm -rf conftest*
12452
12453 fi
12454
12455 if test $ac_cv_header_stdc = yes; then
12456   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12457   if test "$cross_compiling" = yes; then
12458   :
12459 else
12460   cat >conftest.$ac_ext <<_ACEOF
12461 #line 12461 "configure"
12462 #include "confdefs.h"
12463 #include <ctype.h>
12464 #if ((' ' & 0x0FF) == 0x020)
12465 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12466 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12467 #else
12468 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12469                      || ('j' <= (c) && (c) <= 'r') \
12470                      || ('s' <= (c) && (c) <= 'z'))
12471 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12472 #endif
12473
12474 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12475 int
12476 main ()
12477 {
12478   int i;
12479   for (i = 0; i < 256; i++)
12480     if (XOR (islower (i), ISLOWER (i))
12481         || toupper (i) != TOUPPER (i))
12482       $ac_main_return(2);
12483   $ac_main_return (0);
12484 }
12485 _ACEOF
12486 rm -f conftest$ac_exeext
12487 if { (eval echo "$as_me:12487: \"$ac_link\"") >&5
12488   (eval $ac_link) 2>&5
12489   ac_status=$?
12490   echo "$as_me:12490: \$? = $ac_status" >&5
12491   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12492   { (eval echo "$as_me:12492: \"$ac_try\"") >&5
12493   (eval $ac_try) 2>&5
12494   ac_status=$?
12495   echo "$as_me:12495: \$? = $ac_status" >&5
12496   (exit $ac_status); }; }; then
12497   :
12498 else
12499   echo "$as_me: program exited with status $ac_status" >&5
12500 echo "$as_me: failed program was:" >&5
12501 cat conftest.$ac_ext >&5
12502 ac_cv_header_stdc=no
12503 fi
12504 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12505 fi
12506 fi
12507 fi
12508 echo "$as_me:12508: result: $ac_cv_header_stdc" >&5
12509 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12510 if test $ac_cv_header_stdc = yes; then
12511
12512 cat >>confdefs.h <<\EOF
12513 #define STDC_HEADERS 1
12514 EOF
12515
12516 fi
12517
12518 echo "$as_me:12518: checking whether time.h and sys/time.h may both be included" >&5
12519 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
12520 if test "${ac_cv_header_time+set}" = set; then
12521   echo $ECHO_N "(cached) $ECHO_C" >&6
12522 else
12523   cat >conftest.$ac_ext <<_ACEOF
12524 #line 12524 "configure"
12525 #include "confdefs.h"
12526 #include <sys/types.h>
12527 #include <sys/time.h>
12528 #include <time.h>
12529
12530 int
12531 main ()
12532 {
12533 if ((struct tm *) 0)
12534 return 0;
12535   ;
12536   return 0;
12537 }
12538 _ACEOF
12539 rm -f conftest.$ac_objext
12540 if { (eval echo "$as_me:12540: \"$ac_compile\"") >&5
12541   (eval $ac_compile) 2>&5
12542   ac_status=$?
12543   echo "$as_me:12543: \$? = $ac_status" >&5
12544   (exit $ac_status); } &&
12545          { ac_try='test -s conftest.$ac_objext'
12546   { (eval echo "$as_me:12546: \"$ac_try\"") >&5
12547   (eval $ac_try) 2>&5
12548   ac_status=$?
12549   echo "$as_me:12549: \$? = $ac_status" >&5
12550   (exit $ac_status); }; }; then
12551   ac_cv_header_time=yes
12552 else
12553   echo "$as_me: failed program was:" >&5
12554 cat conftest.$ac_ext >&5
12555 ac_cv_header_time=no
12556 fi
12557 rm -f conftest.$ac_objext conftest.$ac_ext
12558 fi
12559 echo "$as_me:12559: result: $ac_cv_header_time" >&5
12560 echo "${ECHO_T}$ac_cv_header_time" >&6
12561 if test $ac_cv_header_time = yes; then
12562
12563 cat >>confdefs.h <<\EOF
12564 #define TIME_WITH_SYS_TIME 1
12565 EOF
12566
12567 fi
12568
12569 for ac_header in \
12570 getopt.h \
12571 locale.h \
12572 stdarg.h \
12573 sys/ioctl.h \
12574 sys/select.h \
12575 sys/time.h \
12576 termios.h \
12577 unistd.h \
12578
12579 do
12580 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12581 echo "$as_me:12581: checking for $ac_header" >&5
12582 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12583 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12584   echo $ECHO_N "(cached) $ECHO_C" >&6
12585 else
12586   cat >conftest.$ac_ext <<_ACEOF
12587 #line 12587 "configure"
12588 #include "confdefs.h"
12589 #include <$ac_header>
12590 _ACEOF
12591 if { (eval echo "$as_me:12591: \"$ac_cpp conftest.$ac_ext\"") >&5
12592   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12593   ac_status=$?
12594   egrep -v '^ *\+' conftest.er1 >conftest.err
12595   rm -f conftest.er1
12596   cat conftest.err >&5
12597   echo "$as_me:12597: \$? = $ac_status" >&5
12598   (exit $ac_status); } >/dev/null; then
12599   if test -s conftest.err; then
12600     ac_cpp_err=$ac_c_preproc_warn_flag
12601   else
12602     ac_cpp_err=
12603   fi
12604 else
12605   ac_cpp_err=yes
12606 fi
12607 if test -z "$ac_cpp_err"; then
12608   eval "$as_ac_Header=yes"
12609 else
12610   echo "$as_me: failed program was:" >&5
12611   cat conftest.$ac_ext >&5
12612   eval "$as_ac_Header=no"
12613 fi
12614 rm -f conftest.err conftest.$ac_ext
12615 fi
12616 echo "$as_me:12616: result: `eval echo '${'$as_ac_Header'}'`" >&5
12617 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12618 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12619   cat >>confdefs.h <<EOF
12620 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12621 EOF
12622
12623 fi
12624 done
12625
12626 for ac_func in \
12627 gettimeofday \
12628 mblen \
12629 mbrlen \
12630 mbrtowc \
12631 mbsrtowcs \
12632 mbstowcs \
12633 mbtowc \
12634 strdup \
12635 wcsrtombs \
12636 wcstombs \
12637
12638 do
12639 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
12640 echo "$as_me:12640: checking for $ac_func" >&5
12641 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
12642 if eval "test \"\${$as_ac_var+set}\" = set"; then
12643   echo $ECHO_N "(cached) $ECHO_C" >&6
12644 else
12645   cat >conftest.$ac_ext <<_ACEOF
12646 #line 12646 "configure"
12647 #include "confdefs.h"
12648 /* System header to define __stub macros and hopefully few prototypes,
12649     which can conflict with char $ac_func (); below.  */
12650 #include <assert.h>
12651 /* Override any gcc2 internal prototype to avoid an error.  */
12652 #ifdef __cplusplus
12653 extern "C"
12654 #endif
12655 /* We use char because int might match the return type of a gcc2
12656    builtin and then its argument prototype would still apply.  */
12657 char $ac_func ();
12658 char (*f) ();
12659
12660 int
12661 main ()
12662 {
12663 /* The GNU C library defines this for functions which it implements
12664     to always fail with ENOSYS.  Some functions are actually named
12665     something starting with __ and the normal name is an alias.  */
12666 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12667 choke me
12668 #else
12669 f = $ac_func;
12670 #endif
12671
12672   ;
12673   return 0;
12674 }
12675 _ACEOF
12676 rm -f conftest.$ac_objext conftest$ac_exeext
12677 if { (eval echo "$as_me:12677: \"$ac_link\"") >&5
12678   (eval $ac_link) 2>&5
12679   ac_status=$?
12680   echo "$as_me:12680: \$? = $ac_status" >&5
12681   (exit $ac_status); } &&
12682          { ac_try='test -s conftest$ac_exeext'
12683   { (eval echo "$as_me:12683: \"$ac_try\"") >&5
12684   (eval $ac_try) 2>&5
12685   ac_status=$?
12686   echo "$as_me:12686: \$? = $ac_status" >&5
12687   (exit $ac_status); }; }; then
12688   eval "$as_ac_var=yes"
12689 else
12690   echo "$as_me: failed program was:" >&5
12691 cat conftest.$ac_ext >&5
12692 eval "$as_ac_var=no"
12693 fi
12694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12695 fi
12696 echo "$as_me:12696: result: `eval echo '${'$as_ac_var'}'`" >&5
12697 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
12698 if test `eval echo '${'$as_ac_var'}'` = yes; then
12699   cat >>confdefs.h <<EOF
12700 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
12701 EOF
12702
12703 fi
12704 done
12705
12706 echo "$as_me:12706: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
12707 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
12708 if test "${cf_cv_need_xopen_extension+set}" = set; then
12709   echo $ECHO_N "(cached) $ECHO_C" >&6
12710 else
12711
12712 cat >conftest.$ac_ext <<_ACEOF
12713 #line 12713 "configure"
12714 #include "confdefs.h"
12715
12716 #include <stdlib.h>
12717 #include <${cf_cv_ncurses_header:-curses.h}>
12718 int
12719 main ()
12720 {
12721
12722 #if defined(NCURSES_VERSION_PATCH)
12723 if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
12724         make an error
12725 #endif
12726 #endif
12727         long x = winnstr(stdscr, "", 0);
12728         int x1, y1;
12729         getbegyx(stdscr, y1, x1)
12730   ;
12731   return 0;
12732 }
12733 _ACEOF
12734 rm -f conftest.$ac_objext conftest$ac_exeext
12735 if { (eval echo "$as_me:12735: \"$ac_link\"") >&5
12736   (eval $ac_link) 2>&5
12737   ac_status=$?
12738   echo "$as_me:12738: \$? = $ac_status" >&5
12739   (exit $ac_status); } &&
12740          { ac_try='test -s conftest$ac_exeext'
12741   { (eval echo "$as_me:12741: \"$ac_try\"") >&5
12742   (eval $ac_try) 2>&5
12743   ac_status=$?
12744   echo "$as_me:12744: \$? = $ac_status" >&5
12745   (exit $ac_status); }; }; then
12746   cf_cv_need_xopen_extension=no
12747 else
12748   echo "$as_me: failed program was:" >&5
12749 cat conftest.$ac_ext >&5
12750 cat >conftest.$ac_ext <<_ACEOF
12751 #line 12751 "configure"
12752 #include "confdefs.h"
12753
12754 #define _XOPEN_SOURCE_EXTENDED
12755 #include <stdlib.h>
12756 #include <${cf_cv_ncurses_header:-curses.h}>
12757 int
12758 main ()
12759 {
12760
12761 #ifdef NCURSES_VERSION
12762         cchar_t check;
12763         int check2 = curs_set((int)sizeof(check));
12764 #endif
12765         long x = winnstr(stdscr, "", 0);
12766         int x1, y1;
12767         getbegyx(stdscr, y1, x1)
12768   ;
12769   return 0;
12770 }
12771 _ACEOF
12772 rm -f conftest.$ac_objext conftest$ac_exeext
12773 if { (eval echo "$as_me:12773: \"$ac_link\"") >&5
12774   (eval $ac_link) 2>&5
12775   ac_status=$?
12776   echo "$as_me:12776: \$? = $ac_status" >&5
12777   (exit $ac_status); } &&
12778          { ac_try='test -s conftest$ac_exeext'
12779   { (eval echo "$as_me:12779: \"$ac_try\"") >&5
12780   (eval $ac_try) 2>&5
12781   ac_status=$?
12782   echo "$as_me:12782: \$? = $ac_status" >&5
12783   (exit $ac_status); }; }; then
12784   cf_cv_need_xopen_extension=yes
12785 else
12786   echo "$as_me: failed program was:" >&5
12787 cat conftest.$ac_ext >&5
12788 cf_cv_need_xopen_extension=unknown
12789 fi
12790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12791 fi
12792 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12793 fi
12794 echo "$as_me:12794: result: $cf_cv_need_xopen_extension" >&5
12795 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
12796 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
12797
12798 echo "$as_me:12798: checking for term.h" >&5
12799 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
12800 if test "${cf_cv_term_header+set}" = set; then
12801   echo $ECHO_N "(cached) $ECHO_C" >&6
12802 else
12803
12804 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
12805 # for <term.h> if we do not find the variant.
12806 for cf_header in \
12807         `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
12808         term.h
12809 do
12810         cat >conftest.$ac_ext <<_ACEOF
12811 #line 12811 "configure"
12812 #include "confdefs.h"
12813
12814 #include <${cf_cv_ncurses_header:-curses.h}>
12815 #include <${cf_header}>
12816 int
12817 main ()
12818 {
12819 WINDOW *x
12820   ;
12821   return 0;
12822 }
12823 _ACEOF
12824 rm -f conftest.$ac_objext
12825 if { (eval echo "$as_me:12825: \"$ac_compile\"") >&5
12826   (eval $ac_compile) 2>&5
12827   ac_status=$?
12828   echo "$as_me:12828: \$? = $ac_status" >&5
12829   (exit $ac_status); } &&
12830          { ac_try='test -s conftest.$ac_objext'
12831   { (eval echo "$as_me:12831: \"$ac_try\"") >&5
12832   (eval $ac_try) 2>&5
12833   ac_status=$?
12834   echo "$as_me:12834: \$? = $ac_status" >&5
12835   (exit $ac_status); }; }; then
12836   cf_cv_term_header=$cf_header
12837          break
12838 else
12839   echo "$as_me: failed program was:" >&5
12840 cat conftest.$ac_ext >&5
12841 cf_cv_term_header=no
12842 fi
12843 rm -f conftest.$ac_objext conftest.$ac_ext
12844 done
12845
12846 case $cf_cv_term_header in #(vi
12847 no)
12848         # If curses is ncurses, some packagers still mess it up by trying to make
12849         # us use GNU termcap.  This handles the most common case.
12850         for cf_header in ncurses/term.h ncursesw/term.h
12851         do
12852                 cat >conftest.$ac_ext <<_ACEOF
12853 #line 12853 "configure"
12854 #include "confdefs.h"
12855
12856 #include <${cf_cv_ncurses_header:-curses.h}>
12857 #ifdef NCURSES_VERSION
12858 #include <${cf_header}>
12859 #else
12860 make an error
12861 #endif
12862 int
12863 main ()
12864 {
12865 WINDOW *x
12866   ;
12867   return 0;
12868 }
12869 _ACEOF
12870 rm -f conftest.$ac_objext
12871 if { (eval echo "$as_me:12871: \"$ac_compile\"") >&5
12872   (eval $ac_compile) 2>&5
12873   ac_status=$?
12874   echo "$as_me:12874: \$? = $ac_status" >&5
12875   (exit $ac_status); } &&
12876          { ac_try='test -s conftest.$ac_objext'
12877   { (eval echo "$as_me:12877: \"$ac_try\"") >&5
12878   (eval $ac_try) 2>&5
12879   ac_status=$?
12880   echo "$as_me:12880: \$? = $ac_status" >&5
12881   (exit $ac_status); }; }; then
12882   cf_cv_term_header=$cf_header
12883                          break
12884 else
12885   echo "$as_me: failed program was:" >&5
12886 cat conftest.$ac_ext >&5
12887 cf_cv_term_header=no
12888 fi
12889 rm -f conftest.$ac_objext conftest.$ac_ext
12890         done
12891         ;;
12892 esac
12893
12894 fi
12895 echo "$as_me:12895: result: $cf_cv_term_header" >&5
12896 echo "${ECHO_T}$cf_cv_term_header" >&6
12897
12898 case $cf_cv_term_header in #(vi
12899 term.h) #(vi
12900         cat >>confdefs.h <<\EOF
12901 #define HAVE_TERM_H 1
12902 EOF
12903
12904         ;;
12905 ncurses/term.h) #(vi
12906         cat >>confdefs.h <<\EOF
12907 #define HAVE_NCURSES_TERM_H 1
12908 EOF
12909
12910         ;;
12911 ncursesw/term.h)
12912         cat >>confdefs.h <<\EOF
12913 #define HAVE_NCURSESW_TERM_H 1
12914 EOF
12915
12916         ;;
12917 esac
12918
12919 for cf_func in \
12920 chgat \
12921 color_set \
12922 filter \
12923 getbegx \
12924 getcurx \
12925 getmaxx \
12926 getnstr \
12927 getparx \
12928 getwin \
12929 mvvline \
12930 mvwvline \
12931 napms \
12932 putwin \
12933 resize_term \
12934 resizeterm \
12935 ripoffline \
12936 setupterm \
12937 slk_color \
12938 slk_init \
12939 termattrs \
12940 tgetent \
12941 tigetnum \
12942 tigetstr \
12943 typeahead \
12944 use_default_colors \
12945 vw_printw \
12946 vsscanf \
12947 wchgat \
12948 winsstr \
12949 wresize \
12950
12951 do
12952
12953 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12954
12955         echo "$as_me:12955: checking for ${cf_func}" >&5
12956 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
12957
12958 echo "${as_me:-configure}:12958: testing ${cf_func} ..." 1>&5
12959
12960         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
12961   echo $ECHO_N "(cached) $ECHO_C" >&6
12962 else
12963
12964                 eval cf_result='$ac_cv_func_'$cf_func
12965                 if test ".$cf_result" != ".no"; then
12966                         cat >conftest.$ac_ext <<_ACEOF
12967 #line 12967 "configure"
12968 #include "confdefs.h"
12969
12970 #ifdef HAVE_XCURSES
12971 #include <xcurses.h>
12972 char * XCursesProgramName = "test";
12973 #else
12974 #include <${cf_cv_ncurses_header:-curses.h}>
12975 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
12976 #include <ncursesw/term.h>
12977 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
12978 #include <ncurses/term.h>
12979 #elif defined(HAVE_TERM_H)
12980 #include <term.h>
12981 #endif
12982 #endif
12983
12984 int
12985 main ()
12986 {
12987
12988 #ifndef ${cf_func}
12989 long foo = (long)(&${cf_func});
12990 ${cf_cv_main_return:-return}(foo == 0);
12991 #endif
12992
12993   ;
12994   return 0;
12995 }
12996 _ACEOF
12997 rm -f conftest.$ac_objext conftest$ac_exeext
12998 if { (eval echo "$as_me:12998: \"$ac_link\"") >&5
12999   (eval $ac_link) 2>&5
13000   ac_status=$?
13001   echo "$as_me:13001: \$? = $ac_status" >&5
13002   (exit $ac_status); } &&
13003          { ac_try='test -s conftest$ac_exeext'
13004   { (eval echo "$as_me:13004: \"$ac_try\"") >&5
13005   (eval $ac_try) 2>&5
13006   ac_status=$?
13007   echo "$as_me:13007: \$? = $ac_status" >&5
13008   (exit $ac_status); }; }; then
13009   cf_result=yes
13010 else
13011   echo "$as_me: failed program was:" >&5
13012 cat conftest.$ac_ext >&5
13013 cf_result=no
13014 fi
13015 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13016                 fi
13017                 eval 'cf_cv_func_'$cf_func'=$cf_result'
13018
13019 fi
13020
13021         # use the computed/retrieved cache-value:
13022         eval 'cf_result=$cf_cv_func_'$cf_func
13023         echo "$as_me:13023: result: $cf_result" >&5
13024 echo "${ECHO_T}$cf_result" >&6
13025         if test $cf_result != no; then
13026                 cat >>confdefs.h <<EOF
13027 #define HAVE_${cf_tr_func} 1
13028 EOF
13029
13030         fi
13031 done
13032
13033 echo "$as_me:13033: checking for ncurses extended functions" >&5
13034 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
13035 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
13036   echo $ECHO_N "(cached) $ECHO_C" >&6
13037 else
13038
13039 cat >conftest.$ac_ext <<_ACEOF
13040 #line 13040 "configure"
13041 #include "confdefs.h"
13042
13043 #include <${cf_cv_ncurses_header:-curses.h}>
13044 int
13045 main ()
13046 {
13047
13048 int x = NCURSES_EXT_FUNCS
13049
13050   ;
13051   return 0;
13052 }
13053 _ACEOF
13054 rm -f conftest.$ac_objext
13055 if { (eval echo "$as_me:13055: \"$ac_compile\"") >&5
13056   (eval $ac_compile) 2>&5
13057   ac_status=$?
13058   echo "$as_me:13058: \$? = $ac_status" >&5
13059   (exit $ac_status); } &&
13060          { ac_try='test -s conftest.$ac_objext'
13061   { (eval echo "$as_me:13061: \"$ac_try\"") >&5
13062   (eval $ac_try) 2>&5
13063   ac_status=$?
13064   echo "$as_me:13064: \$? = $ac_status" >&5
13065   (exit $ac_status); }; }; then
13066   cf_cv_ncurses_ext_funcs=defined
13067 else
13068   echo "$as_me: failed program was:" >&5
13069 cat conftest.$ac_ext >&5
13070
13071 cat >conftest.$ac_ext <<_ACEOF
13072 #line 13072 "configure"
13073 #include "confdefs.h"
13074
13075 #include <${cf_cv_ncurses_header:-curses.h}>
13076 int
13077 main ()
13078 {
13079
13080         (void) assume_default_colors (0, 0);
13081         (void) curses_version ();
13082         (void) define_key (0, 0);
13083         (void) is_term_resized (0, 0);
13084         (void) key_defined (0);
13085         (void) keybound (0, 0);
13086         (void) keyok (0, 0);
13087         (void) resize_term (0, 0);
13088         (void) resizeterm (0, 0);
13089         (void) use_default_colors ();
13090         (void) use_extended_names (0);
13091         (void) wresize (0, 0, 0);
13092   ;
13093   return 0;
13094 }
13095 _ACEOF
13096 rm -f conftest.$ac_objext conftest$ac_exeext
13097 if { (eval echo "$as_me:13097: \"$ac_link\"") >&5
13098   (eval $ac_link) 2>&5
13099   ac_status=$?
13100   echo "$as_me:13100: \$? = $ac_status" >&5
13101   (exit $ac_status); } &&
13102          { ac_try='test -s conftest$ac_exeext'
13103   { (eval echo "$as_me:13103: \"$ac_try\"") >&5
13104   (eval $ac_try) 2>&5
13105   ac_status=$?
13106   echo "$as_me:13106: \$? = $ac_status" >&5
13107   (exit $ac_status); }; }; then
13108   cf_cv_ncurses_ext_funcs=yes
13109 else
13110   echo "$as_me: failed program was:" >&5
13111 cat conftest.$ac_ext >&5
13112 cf_cv_ncurses_ext_funcs=no
13113 fi
13114 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13115
13116 fi
13117 rm -f conftest.$ac_objext conftest.$ac_ext
13118
13119 fi
13120 echo "$as_me:13120: result: $cf_cv_ncurses_ext_funcs" >&5
13121 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
13122 test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
13123 #define NCURSES_EXT_FUNCS 1
13124 EOF
13125
13126 echo "$as_me:13126: checking for wide-character functions" >&5
13127 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
13128 if test "${cf_cv_widechar_funcs+set}" = set; then
13129   echo $ECHO_N "(cached) $ECHO_C" >&6
13130 else
13131
13132 cat >conftest.$ac_ext <<_ACEOF
13133 #line 13133 "configure"
13134 #include "confdefs.h"
13135
13136 #include <${cf_cv_ncurses_header:-curses.h}>
13137 int
13138 main ()
13139 {
13140
13141         static wchar_t src_wchar[2];
13142         static cchar_t dst_cchar;
13143         setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
13144
13145   ;
13146   return 0;
13147 }
13148 _ACEOF
13149 rm -f conftest.$ac_objext conftest$ac_exeext
13150 if { (eval echo "$as_me:13150: \"$ac_link\"") >&5
13151   (eval $ac_link) 2>&5
13152   ac_status=$?
13153   echo "$as_me:13153: \$? = $ac_status" >&5
13154   (exit $ac_status); } &&
13155          { ac_try='test -s conftest$ac_exeext'
13156   { (eval echo "$as_me:13156: \"$ac_try\"") >&5
13157   (eval $ac_try) 2>&5
13158   ac_status=$?
13159   echo "$as_me:13159: \$? = $ac_status" >&5
13160   (exit $ac_status); }; }; then
13161   cf_cv_widechar_funcs=yes
13162 else
13163   echo "$as_me: failed program was:" >&5
13164 cat conftest.$ac_ext >&5
13165 cf_cv_widechar_funcs=no
13166 fi
13167 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13168
13169 fi
13170 echo "$as_me:13170: result: $cf_cv_widechar_funcs" >&5
13171 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
13172 if test "$cf_cv_widechar_funcs" != no ; then
13173         cat >>confdefs.h <<\EOF
13174 #define USE_WIDEC_SUPPORT 1
13175 EOF
13176
13177 else
13178         cat >>confdefs.h <<\EOF
13179 #define USE_WIDEC_SUPPORT 0
13180 EOF
13181
13182 fi
13183
13184 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
13185
13186 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
13187                   inttypes.h stdint.h unistd.h
13188 do
13189 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13190 echo "$as_me:13190: checking for $ac_header" >&5
13191 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13192 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13193   echo $ECHO_N "(cached) $ECHO_C" >&6
13194 else
13195   cat >conftest.$ac_ext <<_ACEOF
13196 #line 13196 "configure"
13197 #include "confdefs.h"
13198 $ac_includes_default
13199 #include <$ac_header>
13200 _ACEOF
13201 rm -f conftest.$ac_objext
13202 if { (eval echo "$as_me:13202: \"$ac_compile\"") >&5
13203   (eval $ac_compile) 2>&5
13204   ac_status=$?
13205   echo "$as_me:13205: \$? = $ac_status" >&5
13206   (exit $ac_status); } &&
13207          { ac_try='test -s conftest.$ac_objext'
13208   { (eval echo "$as_me:13208: \"$ac_try\"") >&5
13209   (eval $ac_try) 2>&5
13210   ac_status=$?
13211   echo "$as_me:13211: \$? = $ac_status" >&5
13212   (exit $ac_status); }; }; then
13213   eval "$as_ac_Header=yes"
13214 else
13215   echo "$as_me: failed program was:" >&5
13216 cat conftest.$ac_ext >&5
13217 eval "$as_ac_Header=no"
13218 fi
13219 rm -f conftest.$ac_objext conftest.$ac_ext
13220 fi
13221 echo "$as_me:13221: result: `eval echo '${'$as_ac_Header'}'`" >&5
13222 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13223 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13224   cat >>confdefs.h <<EOF
13225 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13226 EOF
13227
13228 fi
13229 done
13230
13231 echo "$as_me:13231: checking for pid_t" >&5
13232 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
13233 if test "${ac_cv_type_pid_t+set}" = set; then
13234   echo $ECHO_N "(cached) $ECHO_C" >&6
13235 else
13236   cat >conftest.$ac_ext <<_ACEOF
13237 #line 13237 "configure"
13238 #include "confdefs.h"
13239 $ac_includes_default
13240 int
13241 main ()
13242 {
13243 if ((pid_t *) 0)
13244   return 0;
13245 if (sizeof (pid_t))
13246   return 0;
13247   ;
13248   return 0;
13249 }
13250 _ACEOF
13251 rm -f conftest.$ac_objext
13252 if { (eval echo "$as_me:13252: \"$ac_compile\"") >&5
13253   (eval $ac_compile) 2>&5
13254   ac_status=$?
13255   echo "$as_me:13255: \$? = $ac_status" >&5
13256   (exit $ac_status); } &&
13257          { ac_try='test -s conftest.$ac_objext'
13258   { (eval echo "$as_me:13258: \"$ac_try\"") >&5
13259   (eval $ac_try) 2>&5
13260   ac_status=$?
13261   echo "$as_me:13261: \$? = $ac_status" >&5
13262   (exit $ac_status); }; }; then
13263   ac_cv_type_pid_t=yes
13264 else
13265   echo "$as_me: failed program was:" >&5
13266 cat conftest.$ac_ext >&5
13267 ac_cv_type_pid_t=no
13268 fi
13269 rm -f conftest.$ac_objext conftest.$ac_ext
13270 fi
13271 echo "$as_me:13271: result: $ac_cv_type_pid_t" >&5
13272 echo "${ECHO_T}$ac_cv_type_pid_t" >&6
13273 if test $ac_cv_type_pid_t = yes; then
13274   :
13275 else
13276
13277 cat >>confdefs.h <<EOF
13278 #define pid_t int
13279 EOF
13280
13281 fi
13282
13283 for ac_header in unistd.h vfork.h
13284 do
13285 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13286 echo "$as_me:13286: checking for $ac_header" >&5
13287 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13288 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13289   echo $ECHO_N "(cached) $ECHO_C" >&6
13290 else
13291   cat >conftest.$ac_ext <<_ACEOF
13292 #line 13292 "configure"
13293 #include "confdefs.h"
13294 #include <$ac_header>
13295 _ACEOF
13296 if { (eval echo "$as_me:13296: \"$ac_cpp conftest.$ac_ext\"") >&5
13297   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13298   ac_status=$?
13299   egrep -v '^ *\+' conftest.er1 >conftest.err
13300   rm -f conftest.er1
13301   cat conftest.err >&5
13302   echo "$as_me:13302: \$? = $ac_status" >&5
13303   (exit $ac_status); } >/dev/null; then
13304   if test -s conftest.err; then
13305     ac_cpp_err=$ac_c_preproc_warn_flag
13306   else
13307     ac_cpp_err=
13308   fi
13309 else
13310   ac_cpp_err=yes
13311 fi
13312 if test -z "$ac_cpp_err"; then
13313   eval "$as_ac_Header=yes"
13314 else
13315   echo "$as_me: failed program was:" >&5
13316   cat conftest.$ac_ext >&5
13317   eval "$as_ac_Header=no"
13318 fi
13319 rm -f conftest.err conftest.$ac_ext
13320 fi
13321 echo "$as_me:13321: result: `eval echo '${'$as_ac_Header'}'`" >&5
13322 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13323 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13324   cat >>confdefs.h <<EOF
13325 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13326 EOF
13327
13328 fi
13329 done
13330
13331 for ac_func in fork vfork
13332 do
13333 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13334 echo "$as_me:13334: checking for $ac_func" >&5
13335 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13336 if eval "test \"\${$as_ac_var+set}\" = set"; then
13337   echo $ECHO_N "(cached) $ECHO_C" >&6
13338 else
13339   cat >conftest.$ac_ext <<_ACEOF
13340 #line 13340 "configure"
13341 #include "confdefs.h"
13342 /* System header to define __stub macros and hopefully few prototypes,
13343     which can conflict with char $ac_func (); below.  */
13344 #include <assert.h>
13345 /* Override any gcc2 internal prototype to avoid an error.  */
13346 #ifdef __cplusplus
13347 extern "C"
13348 #endif
13349 /* We use char because int might match the return type of a gcc2
13350    builtin and then its argument prototype would still apply.  */
13351 char $ac_func ();
13352 char (*f) ();
13353
13354 int
13355 main ()
13356 {
13357 /* The GNU C library defines this for functions which it implements
13358     to always fail with ENOSYS.  Some functions are actually named
13359     something starting with __ and the normal name is an alias.  */
13360 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13361 choke me
13362 #else
13363 f = $ac_func;
13364 #endif
13365
13366   ;
13367   return 0;
13368 }
13369 _ACEOF
13370 rm -f conftest.$ac_objext conftest$ac_exeext
13371 if { (eval echo "$as_me:13371: \"$ac_link\"") >&5
13372   (eval $ac_link) 2>&5
13373   ac_status=$?
13374   echo "$as_me:13374: \$? = $ac_status" >&5
13375   (exit $ac_status); } &&
13376          { ac_try='test -s conftest$ac_exeext'
13377   { (eval echo "$as_me:13377: \"$ac_try\"") >&5
13378   (eval $ac_try) 2>&5
13379   ac_status=$?
13380   echo "$as_me:13380: \$? = $ac_status" >&5
13381   (exit $ac_status); }; }; then
13382   eval "$as_ac_var=yes"
13383 else
13384   echo "$as_me: failed program was:" >&5
13385 cat conftest.$ac_ext >&5
13386 eval "$as_ac_var=no"
13387 fi
13388 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13389 fi
13390 echo "$as_me:13390: result: `eval echo '${'$as_ac_var'}'`" >&5
13391 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13392 if test `eval echo '${'$as_ac_var'}'` = yes; then
13393   cat >>confdefs.h <<EOF
13394 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13395 EOF
13396
13397 fi
13398 done
13399
13400 ac_cv_func_fork_works=$ac_cv_func_fork
13401 if test "x$ac_cv_func_fork" = xyes; then
13402   echo "$as_me:13402: checking for working fork" >&5
13403 echo $ECHO_N "checking for working fork... $ECHO_C" >&6
13404 if test "${ac_cv_func_fork_works+set}" = set; then
13405   echo $ECHO_N "(cached) $ECHO_C" >&6
13406 else
13407   if test "$cross_compiling" = yes; then
13408   ac_cv_func_fork_works=cross
13409 else
13410   cat >conftest.$ac_ext <<_ACEOF
13411 /* By Rüdiger Kuhlmann. */
13412       #include <sys/types.h>
13413       #if HAVE_UNISTD_H
13414       # include <unistd.h>
13415       #endif
13416       /* Some systems only have a dummy stub for fork() */
13417       int main ()
13418       {
13419         if (fork() < 0)
13420           $ac_main_return (1);
13421         $ac_main_return (0);
13422       }
13423 _ACEOF
13424 rm -f conftest$ac_exeext
13425 if { (eval echo "$as_me:13425: \"$ac_link\"") >&5
13426   (eval $ac_link) 2>&5
13427   ac_status=$?
13428   echo "$as_me:13428: \$? = $ac_status" >&5
13429   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13430   { (eval echo "$as_me:13430: \"$ac_try\"") >&5
13431   (eval $ac_try) 2>&5
13432   ac_status=$?
13433   echo "$as_me:13433: \$? = $ac_status" >&5
13434   (exit $ac_status); }; }; then
13435   ac_cv_func_fork_works=yes
13436 else
13437   echo "$as_me: program exited with status $ac_status" >&5
13438 echo "$as_me: failed program was:" >&5
13439 cat conftest.$ac_ext >&5
13440 ac_cv_func_fork_works=no
13441 fi
13442 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13443 fi
13444 fi
13445 echo "$as_me:13445: result: $ac_cv_func_fork_works" >&5
13446 echo "${ECHO_T}$ac_cv_func_fork_works" >&6
13447
13448 fi
13449 if test "x$ac_cv_func_fork_works" = xcross; then
13450   case $host in
13451     *-*-amigaos* | *-*-msdosdjgpp*)
13452       # Override, as these systems have only a dummy fork() stub
13453       ac_cv_func_fork_works=no
13454       ;;
13455     *)
13456       ac_cv_func_fork_works=yes
13457       ;;
13458   esac
13459   { echo "$as_me:13459: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
13460 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
13461 fi
13462 ac_cv_func_vfork_works=$ac_cv_func_vfork
13463 if test "x$ac_cv_func_vfork" = xyes; then
13464   echo "$as_me:13464: checking for working vfork" >&5
13465 echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
13466 if test "${ac_cv_func_vfork_works+set}" = set; then
13467   echo $ECHO_N "(cached) $ECHO_C" >&6
13468 else
13469   if test "$cross_compiling" = yes; then
13470   ac_cv_func_vfork_works=cross
13471 else
13472   cat >conftest.$ac_ext <<_ACEOF
13473 #line 13473 "configure"
13474 #include "confdefs.h"
13475 /* Thanks to Paul Eggert for this test.  */
13476 #include <stdio.h>
13477 #include <sys/types.h>
13478 #include <sys/stat.h>
13479 #if HAVE_UNISTD_H
13480 # include <unistd.h>
13481 #endif
13482 #if HAVE_VFORK_H
13483 # include <vfork.h>
13484 #endif
13485 /* On some sparc systems, changes by the child to local and incoming
13486    argument registers are propagated back to the parent.  The compiler
13487    is told about this with #include <vfork.h>, but some compilers
13488    (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
13489    static variable whose address is put into a register that is
13490    clobbered by the vfork.  */
13491 static
13492 #ifdef __cplusplus
13493 sparc_address_test (int arg)
13494 # else
13495 sparc_address_test (arg) int arg;
13496 #endif
13497 {
13498   static pid_t child;
13499   if (!child) {
13500     child = vfork ();
13501     if (child < 0) {
13502       perror ("vfork");
13503       _exit(2);
13504     }
13505     if (!child) {
13506       arg = getpid();
13507       write(-1, "", 0);
13508       _exit (arg);
13509     }
13510   }
13511 }
13512
13513 int
13514 main ()
13515 {
13516   pid_t parent = getpid ();
13517   pid_t child;
13518
13519   sparc_address_test ();
13520
13521   child = vfork ();
13522
13523   if (child == 0) {
13524     /* Here is another test for sparc vfork register problems.  This
13525        test uses lots of local variables, at least as many local
13526        variables as main has allocated so far including compiler
13527        temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
13528        4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
13529        reuse the register of parent for one of the local variables,
13530        since it will think that parent can't possibly be used any more
13531        in this routine.  Assigning to the local variable will thus
13532        munge parent in the parent process.  */
13533     pid_t
13534       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
13535       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
13536     /* Convince the compiler that p..p7 are live; otherwise, it might
13537        use the same hardware register for all 8 local variables.  */
13538     if (p != p1 || p != p2 || p != p3 || p != p4
13539         || p != p5 || p != p6 || p != p7)
13540       _exit(1);
13541
13542     /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
13543        from child file descriptors.  If the child closes a descriptor
13544        before it execs or exits, this munges the parent's descriptor
13545        as well.  Test for this by closing stdout in the child.  */
13546     _exit(close(fileno(stdout)) != 0);
13547   } else {
13548     int status;
13549     struct stat st;
13550
13551     while (wait(&status) != child)
13552       ;
13553     $ac_main_return(
13554          /* Was there some problem with vforking?  */
13555          child < 0
13556
13557          /* Did the child fail?  (This shouldn't happen.)  */
13558          || status
13559
13560          /* Did the vfork/compiler bug occur?  */
13561          || parent != getpid()
13562
13563          /* Did the file descriptor bug occur?  */
13564          || fstat(fileno(stdout), &st) != 0
13565          );
13566   }
13567 }
13568 _ACEOF
13569 rm -f conftest$ac_exeext
13570 if { (eval echo "$as_me:13570: \"$ac_link\"") >&5
13571   (eval $ac_link) 2>&5
13572   ac_status=$?
13573   echo "$as_me:13573: \$? = $ac_status" >&5
13574   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13575   { (eval echo "$as_me:13575: \"$ac_try\"") >&5
13576   (eval $ac_try) 2>&5
13577   ac_status=$?
13578   echo "$as_me:13578: \$? = $ac_status" >&5
13579   (exit $ac_status); }; }; then
13580   ac_cv_func_vfork_works=yes
13581 else
13582   echo "$as_me: program exited with status $ac_status" >&5
13583 echo "$as_me: failed program was:" >&5
13584 cat conftest.$ac_ext >&5
13585 ac_cv_func_vfork_works=no
13586 fi
13587 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13588 fi
13589 fi
13590 echo "$as_me:13590: result: $ac_cv_func_vfork_works" >&5
13591 echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
13592
13593 fi;
13594 if test "x$ac_cv_func_fork_works" = xcross; then
13595   ac_cv_func_vfork_works=ac_cv_func_vfork
13596   { echo "$as_me:13596: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
13597 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
13598 fi
13599
13600 if test "x$ac_cv_func_vfork_works" = xyes; then
13601
13602 cat >>confdefs.h <<\EOF
13603 #define HAVE_WORKING_VFORK 1
13604 EOF
13605
13606 else
13607
13608 cat >>confdefs.h <<\EOF
13609 #define vfork fork
13610 EOF
13611
13612 fi
13613 if test "x$ac_cv_func_fork_works" = xyes; then
13614
13615 cat >>confdefs.h <<\EOF
13616 #define HAVE_WORKING_FORK 1
13617 EOF
13618
13619 fi
13620
13621 echo "$as_me:13621: checking if sys/time.h works with sys/select.h" >&5
13622 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
13623 if test "${cf_cv_sys_time_select+set}" = set; then
13624   echo $ECHO_N "(cached) $ECHO_C" >&6
13625 else
13626
13627 cat >conftest.$ac_ext <<_ACEOF
13628 #line 13628 "configure"
13629 #include "confdefs.h"
13630
13631 #include <sys/types.h>
13632 #ifdef HAVE_SYS_TIME_H
13633 #include <sys/time.h>
13634 #endif
13635 #ifdef HAVE_SYS_SELECT_H
13636 #include <sys/select.h>
13637 #endif
13638
13639 int
13640 main ()
13641 {
13642
13643   ;
13644   return 0;
13645 }
13646 _ACEOF
13647 rm -f conftest.$ac_objext
13648 if { (eval echo "$as_me:13648: \"$ac_compile\"") >&5
13649   (eval $ac_compile) 2>&5
13650   ac_status=$?
13651   echo "$as_me:13651: \$? = $ac_status" >&5
13652   (exit $ac_status); } &&
13653          { ac_try='test -s conftest.$ac_objext'
13654   { (eval echo "$as_me:13654: \"$ac_try\"") >&5
13655   (eval $ac_try) 2>&5
13656   ac_status=$?
13657   echo "$as_me:13657: \$? = $ac_status" >&5
13658   (exit $ac_status); }; }; then
13659   cf_cv_sys_time_select=yes
13660 else
13661   echo "$as_me: failed program was:" >&5
13662 cat conftest.$ac_ext >&5
13663 cf_cv_sys_time_select=no
13664 fi
13665 rm -f conftest.$ac_objext conftest.$ac_ext
13666
13667 fi
13668
13669 echo "$as_me:13669: result: $cf_cv_sys_time_select" >&5
13670 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
13671 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
13672 #define HAVE_SYS_TIME_SELECT 1
13673 EOF
13674
13675 echo "$as_me:13675: checking for function curses_version" >&5
13676 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
13677 if test "${cf_cv_func_curses_version+set}" = set; then
13678   echo $ECHO_N "(cached) $ECHO_C" >&6
13679 else
13680
13681 if test "$cross_compiling" = yes; then
13682   cf_cv_func_curses_version=unknown
13683 else
13684   cat >conftest.$ac_ext <<_ACEOF
13685 #line 13685 "configure"
13686 #include "confdefs.h"
13687
13688 #include <${cf_cv_ncurses_header:-curses.h}>
13689 int main()
13690 {
13691         char temp[1024];
13692         sprintf(temp, "%s\n", curses_version());
13693         ${cf_cv_main_return:-return}(0);
13694 }
13695
13696 _ACEOF
13697 rm -f conftest$ac_exeext
13698 if { (eval echo "$as_me:13698: \"$ac_link\"") >&5
13699   (eval $ac_link) 2>&5
13700   ac_status=$?
13701   echo "$as_me:13701: \$? = $ac_status" >&5
13702   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13703   { (eval echo "$as_me:13703: \"$ac_try\"") >&5
13704   (eval $ac_try) 2>&5
13705   ac_status=$?
13706   echo "$as_me:13706: \$? = $ac_status" >&5
13707   (exit $ac_status); }; }; then
13708   cf_cv_func_curses_version=yes
13709
13710 else
13711   echo "$as_me: program exited with status $ac_status" >&5
13712 echo "$as_me: failed program was:" >&5
13713 cat conftest.$ac_ext >&5
13714 cf_cv_func_curses_version=no
13715
13716 fi
13717 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13718 fi
13719 rm -f core
13720 fi
13721 echo "$as_me:13721: result: $cf_cv_func_curses_version" >&5
13722 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
13723 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
13724 #define HAVE_CURSES_VERSION 1
13725 EOF
13726
13727 echo "$as_me:13727: checking for ncurses wrap-prefix" >&5
13728 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
13729
13730 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
13731 if test "${with_ncurses_wrap_prefix+set}" = set; then
13732   withval="$with_ncurses_wrap_prefix"
13733   NCURSES_WRAP_PREFIX=$withval
13734 else
13735   NCURSES_WRAP_PREFIX=_nc_
13736 fi;
13737 echo "$as_me:13737: result: $NCURSES_WRAP_PREFIX" >&5
13738 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
13739
13740 echo "$as_me:13740: checking for alternate character set array" >&5
13741 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
13742 if test "${cf_cv_curses_acs_map+set}" = set; then
13743   echo $ECHO_N "(cached) $ECHO_C" >&6
13744 else
13745
13746 cf_cv_curses_acs_map=unknown
13747 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
13748 do
13749 cat >conftest.$ac_ext <<_ACEOF
13750 #line 13750 "configure"
13751 #include "confdefs.h"
13752
13753 #include <${cf_cv_ncurses_header:-curses.h}>
13754
13755 int
13756 main ()
13757 {
13758
13759 $name['k'] = ACS_PLUS
13760
13761   ;
13762   return 0;
13763 }
13764 _ACEOF
13765 rm -f conftest.$ac_objext conftest$ac_exeext
13766 if { (eval echo "$as_me:13766: \"$ac_link\"") >&5
13767   (eval $ac_link) 2>&5
13768   ac_status=$?
13769   echo "$as_me:13769: \$? = $ac_status" >&5
13770   (exit $ac_status); } &&
13771          { ac_try='test -s conftest$ac_exeext'
13772   { (eval echo "$as_me:13772: \"$ac_try\"") >&5
13773   (eval $ac_try) 2>&5
13774   ac_status=$?
13775   echo "$as_me:13775: \$? = $ac_status" >&5
13776   (exit $ac_status); }; }; then
13777   cf_cv_curses_acs_map=$name; break
13778 else
13779   echo "$as_me: failed program was:" >&5
13780 cat conftest.$ac_ext >&5
13781 fi
13782 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13783 done
13784
13785 fi
13786 echo "$as_me:13786: result: $cf_cv_curses_acs_map" >&5
13787 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
13788
13789 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
13790 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
13791 EOF
13792
13793 echo "$as_me:13793: checking for wide alternate character set array" >&5
13794 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
13795 if test "${cf_cv_curses_wacs_map+set}" = set; then
13796   echo $ECHO_N "(cached) $ECHO_C" >&6
13797 else
13798
13799         cf_cv_curses_wacs_map=unknown
13800         for name in wacs_map _wacs_map __wacs_map _nc_wacs
13801         do
13802         cat >conftest.$ac_ext <<_ACEOF
13803 #line 13803 "configure"
13804 #include "confdefs.h"
13805
13806 #ifndef _XOPEN_SOURCE_EXTENDED
13807 #define _XOPEN_SOURCE_EXTENDED
13808 #endif
13809 #include <${cf_cv_ncurses_header:-curses.h}>
13810 int
13811 main ()
13812 {
13813 $name['k'] = *WACS_PLUS
13814   ;
13815   return 0;
13816 }
13817 _ACEOF
13818 rm -f conftest.$ac_objext conftest$ac_exeext
13819 if { (eval echo "$as_me:13819: \"$ac_link\"") >&5
13820   (eval $ac_link) 2>&5
13821   ac_status=$?
13822   echo "$as_me:13822: \$? = $ac_status" >&5
13823   (exit $ac_status); } &&
13824          { ac_try='test -s conftest$ac_exeext'
13825   { (eval echo "$as_me:13825: \"$ac_try\"") >&5
13826   (eval $ac_try) 2>&5
13827   ac_status=$?
13828   echo "$as_me:13828: \$? = $ac_status" >&5
13829   (exit $ac_status); }; }; then
13830   cf_cv_curses_wacs_map=$name
13831          break
13832 else
13833   echo "$as_me: failed program was:" >&5
13834 cat conftest.$ac_ext >&5
13835 fi
13836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13837         done
13838 fi
13839 echo "$as_me:13839: result: $cf_cv_curses_wacs_map" >&5
13840 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
13841
13842 echo "$as_me:13842: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
13843 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
13844 cat >conftest.$ac_ext <<_ACEOF
13845 #line 13845 "configure"
13846 #include "confdefs.h"
13847
13848 #ifndef _XOPEN_SOURCE_EXTENDED
13849 #define _XOPEN_SOURCE_EXTENDED
13850 #endif
13851 #include <${cf_cv_ncurses_header:-curses.h}>
13852 int
13853 main ()
13854 {
13855
13856 attr_t foo
13857
13858   ;
13859   return 0;
13860 }
13861 _ACEOF
13862 rm -f conftest.$ac_objext
13863 if { (eval echo "$as_me:13863: \"$ac_compile\"") >&5
13864   (eval $ac_compile) 2>&5
13865   ac_status=$?
13866   echo "$as_me:13866: \$? = $ac_status" >&5
13867   (exit $ac_status); } &&
13868          { ac_try='test -s conftest.$ac_objext'
13869   { (eval echo "$as_me:13869: \"$ac_try\"") >&5
13870   (eval $ac_try) 2>&5
13871   ac_status=$?
13872   echo "$as_me:13872: \$? = $ac_status" >&5
13873   (exit $ac_status); }; }; then
13874   cf_result=yes
13875 else
13876   echo "$as_me: failed program was:" >&5
13877 cat conftest.$ac_ext >&5
13878 cf_result=no
13879 fi
13880 rm -f conftest.$ac_objext conftest.$ac_ext
13881 echo "$as_me:13881: result: $cf_result" >&5
13882 echo "${ECHO_T}$cf_result" >&6
13883 if test $cf_result = yes ; then
13884
13885 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13886
13887         cat >>confdefs.h <<EOF
13888 #define $cf_result 1
13889 EOF
13890
13891 else
13892         cat >>confdefs.h <<EOF
13893 #define attr_t long
13894 EOF
13895
13896 fi
13897
13898 # This is needed on Tru64 5.0 to declare mbstate_t
13899 echo "$as_me:13899: checking if we must include wchar.h to declare mbstate_t" >&5
13900 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
13901 if test "${cf_cv_mbstate_t+set}" = set; then
13902   echo $ECHO_N "(cached) $ECHO_C" >&6
13903 else
13904
13905 cat >conftest.$ac_ext <<_ACEOF
13906 #line 13906 "configure"
13907 #include "confdefs.h"
13908
13909 #include <stdlib.h>
13910 #include <stdarg.h>
13911 #include <stdio.h>
13912 #ifdef HAVE_LIBUTF8_H
13913 #include <libutf8.h>
13914 #endif
13915 int
13916 main ()
13917 {
13918 mbstate_t state
13919   ;
13920   return 0;
13921 }
13922 _ACEOF
13923 rm -f conftest.$ac_objext
13924 if { (eval echo "$as_me:13924: \"$ac_compile\"") >&5
13925   (eval $ac_compile) 2>&5
13926   ac_status=$?
13927   echo "$as_me:13927: \$? = $ac_status" >&5
13928   (exit $ac_status); } &&
13929          { ac_try='test -s conftest.$ac_objext'
13930   { (eval echo "$as_me:13930: \"$ac_try\"") >&5
13931   (eval $ac_try) 2>&5
13932   ac_status=$?
13933   echo "$as_me:13933: \$? = $ac_status" >&5
13934   (exit $ac_status); }; }; then
13935   cf_cv_mbstate_t=no
13936 else
13937   echo "$as_me: failed program was:" >&5
13938 cat conftest.$ac_ext >&5
13939 cat >conftest.$ac_ext <<_ACEOF
13940 #line 13940 "configure"
13941 #include "confdefs.h"
13942
13943 #include <stdlib.h>
13944 #include <stdarg.h>
13945 #include <stdio.h>
13946 #include <wchar.h>
13947 #ifdef HAVE_LIBUTF8_H
13948 #include <libutf8.h>
13949 #endif
13950 int
13951 main ()
13952 {
13953 mbstate_t value
13954   ;
13955   return 0;
13956 }
13957 _ACEOF
13958 rm -f conftest.$ac_objext
13959 if { (eval echo "$as_me:13959: \"$ac_compile\"") >&5
13960   (eval $ac_compile) 2>&5
13961   ac_status=$?
13962   echo "$as_me:13962: \$? = $ac_status" >&5
13963   (exit $ac_status); } &&
13964          { ac_try='test -s conftest.$ac_objext'
13965   { (eval echo "$as_me:13965: \"$ac_try\"") >&5
13966   (eval $ac_try) 2>&5
13967   ac_status=$?
13968   echo "$as_me:13968: \$? = $ac_status" >&5
13969   (exit $ac_status); }; }; then
13970   cf_cv_mbstate_t=yes
13971 else
13972   echo "$as_me: failed program was:" >&5
13973 cat conftest.$ac_ext >&5
13974 cf_cv_mbstate_t=unknown
13975 fi
13976 rm -f conftest.$ac_objext conftest.$ac_ext
13977 fi
13978 rm -f conftest.$ac_objext conftest.$ac_ext
13979 fi
13980 echo "$as_me:13980: result: $cf_cv_mbstate_t" >&5
13981 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
13982
13983 if test "$cf_cv_mbstate_t" = yes ; then
13984         cat >>confdefs.h <<\EOF
13985 #define NEED_WCHAR_H 1
13986 EOF
13987
13988         NEED_WCHAR_H=1
13989 fi
13990
13991 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
13992 if test "$cf_cv_mbstate_t" = unknown ; then
13993         NCURSES_MBSTATE_T=1
13994 fi
13995
13996 # if we find mbstate_t in either place, use substitution to provide a fallback.
13997 if test "$cf_cv_mbstate_t" != unknown ; then
13998         NCURSES_OK_MBSTATE_T=1
13999 fi
14000
14001 # This is needed on Tru64 5.0 to declare wchar_t
14002 echo "$as_me:14002: checking if we must include wchar.h to declare wchar_t" >&5
14003 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
14004 if test "${cf_cv_wchar_t+set}" = set; then
14005   echo $ECHO_N "(cached) $ECHO_C" >&6
14006 else
14007
14008 cat >conftest.$ac_ext <<_ACEOF
14009 #line 14009 "configure"
14010 #include "confdefs.h"
14011
14012 #include <stdlib.h>
14013 #include <stdarg.h>
14014 #include <stdio.h>
14015 #ifdef HAVE_LIBUTF8_H
14016 #include <libutf8.h>
14017 #endif
14018 int
14019 main ()
14020 {
14021 wchar_t state
14022   ;
14023   return 0;
14024 }
14025 _ACEOF
14026 rm -f conftest.$ac_objext
14027 if { (eval echo "$as_me:14027: \"$ac_compile\"") >&5
14028   (eval $ac_compile) 2>&5
14029   ac_status=$?
14030   echo "$as_me:14030: \$? = $ac_status" >&5
14031   (exit $ac_status); } &&
14032          { ac_try='test -s conftest.$ac_objext'
14033   { (eval echo "$as_me:14033: \"$ac_try\"") >&5
14034   (eval $ac_try) 2>&5
14035   ac_status=$?
14036   echo "$as_me:14036: \$? = $ac_status" >&5
14037   (exit $ac_status); }; }; then
14038   cf_cv_wchar_t=no
14039 else
14040   echo "$as_me: failed program was:" >&5
14041 cat conftest.$ac_ext >&5
14042 cat >conftest.$ac_ext <<_ACEOF
14043 #line 14043 "configure"
14044 #include "confdefs.h"
14045
14046 #include <stdlib.h>
14047 #include <stdarg.h>
14048 #include <stdio.h>
14049 #include <wchar.h>
14050 #ifdef HAVE_LIBUTF8_H
14051 #include <libutf8.h>
14052 #endif
14053 int
14054 main ()
14055 {
14056 wchar_t value
14057   ;
14058   return 0;
14059 }
14060 _ACEOF
14061 rm -f conftest.$ac_objext
14062 if { (eval echo "$as_me:14062: \"$ac_compile\"") >&5
14063   (eval $ac_compile) 2>&5
14064   ac_status=$?
14065   echo "$as_me:14065: \$? = $ac_status" >&5
14066   (exit $ac_status); } &&
14067          { ac_try='test -s conftest.$ac_objext'
14068   { (eval echo "$as_me:14068: \"$ac_try\"") >&5
14069   (eval $ac_try) 2>&5
14070   ac_status=$?
14071   echo "$as_me:14071: \$? = $ac_status" >&5
14072   (exit $ac_status); }; }; then
14073   cf_cv_wchar_t=yes
14074 else
14075   echo "$as_me: failed program was:" >&5
14076 cat conftest.$ac_ext >&5
14077 cf_cv_wchar_t=unknown
14078 fi
14079 rm -f conftest.$ac_objext conftest.$ac_ext
14080 fi
14081 rm -f conftest.$ac_objext conftest.$ac_ext
14082 fi
14083 echo "$as_me:14083: result: $cf_cv_wchar_t" >&5
14084 echo "${ECHO_T}$cf_cv_wchar_t" >&6
14085
14086 if test "$cf_cv_wchar_t" = yes ; then
14087         cat >>confdefs.h <<\EOF
14088 #define NEED_WCHAR_H 1
14089 EOF
14090
14091         NEED_WCHAR_H=1
14092 fi
14093
14094 # if we do not find wchar_t in either place, use substitution to provide a fallback.
14095 if test "$cf_cv_wchar_t" = unknown ; then
14096         NCURSES_WCHAR_T=1
14097 fi
14098
14099 # if we find wchar_t in either place, use substitution to provide a fallback.
14100 if test "$cf_cv_wchar_t" != unknown ; then
14101         NCURSES_OK_WCHAR_T=1
14102 fi
14103
14104 # This is needed on Tru64 5.0 to declare wint_t
14105 echo "$as_me:14105: checking if we must include wchar.h to declare wint_t" >&5
14106 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
14107 if test "${cf_cv_wint_t+set}" = set; then
14108   echo $ECHO_N "(cached) $ECHO_C" >&6
14109 else
14110
14111 cat >conftest.$ac_ext <<_ACEOF
14112 #line 14112 "configure"
14113 #include "confdefs.h"
14114
14115 #include <stdlib.h>
14116 #include <stdarg.h>
14117 #include <stdio.h>
14118 #ifdef HAVE_LIBUTF8_H
14119 #include <libutf8.h>
14120 #endif
14121 int
14122 main ()
14123 {
14124 wint_t state
14125   ;
14126   return 0;
14127 }
14128 _ACEOF
14129 rm -f conftest.$ac_objext
14130 if { (eval echo "$as_me:14130: \"$ac_compile\"") >&5
14131   (eval $ac_compile) 2>&5
14132   ac_status=$?
14133   echo "$as_me:14133: \$? = $ac_status" >&5
14134   (exit $ac_status); } &&
14135          { ac_try='test -s conftest.$ac_objext'
14136   { (eval echo "$as_me:14136: \"$ac_try\"") >&5
14137   (eval $ac_try) 2>&5
14138   ac_status=$?
14139   echo "$as_me:14139: \$? = $ac_status" >&5
14140   (exit $ac_status); }; }; then
14141   cf_cv_wint_t=no
14142 else
14143   echo "$as_me: failed program was:" >&5
14144 cat conftest.$ac_ext >&5
14145 cat >conftest.$ac_ext <<_ACEOF
14146 #line 14146 "configure"
14147 #include "confdefs.h"
14148
14149 #include <stdlib.h>
14150 #include <stdarg.h>
14151 #include <stdio.h>
14152 #include <wchar.h>
14153 #ifdef HAVE_LIBUTF8_H
14154 #include <libutf8.h>
14155 #endif
14156 int
14157 main ()
14158 {
14159 wint_t value
14160   ;
14161   return 0;
14162 }
14163 _ACEOF
14164 rm -f conftest.$ac_objext
14165 if { (eval echo "$as_me:14165: \"$ac_compile\"") >&5
14166   (eval $ac_compile) 2>&5
14167   ac_status=$?
14168   echo "$as_me:14168: \$? = $ac_status" >&5
14169   (exit $ac_status); } &&
14170          { ac_try='test -s conftest.$ac_objext'
14171   { (eval echo "$as_me:14171: \"$ac_try\"") >&5
14172   (eval $ac_try) 2>&5
14173   ac_status=$?
14174   echo "$as_me:14174: \$? = $ac_status" >&5
14175   (exit $ac_status); }; }; then
14176   cf_cv_wint_t=yes
14177 else
14178   echo "$as_me: failed program was:" >&5
14179 cat conftest.$ac_ext >&5
14180 cf_cv_wint_t=unknown
14181 fi
14182 rm -f conftest.$ac_objext conftest.$ac_ext
14183 fi
14184 rm -f conftest.$ac_objext conftest.$ac_ext
14185 fi
14186 echo "$as_me:14186: result: $cf_cv_wint_t" >&5
14187 echo "${ECHO_T}$cf_cv_wint_t" >&6
14188
14189 if test "$cf_cv_wint_t" = yes ; then
14190         cat >>confdefs.h <<\EOF
14191 #define NEED_WCHAR_H 1
14192 EOF
14193
14194         NEED_WCHAR_H=1
14195 fi
14196
14197 # if we do not find wint_t in either place, use substitution to provide a fallback.
14198 if test "$cf_cv_wint_t" = unknown ; then
14199         NCURSES_WINT_T=1
14200 fi
14201
14202 # if we find wint_t in either place, use substitution to provide a fallback.
14203 if test "$cf_cv_wint_t" != unknown ; then
14204         NCURSES_OK_WINT_T=1
14205 fi
14206
14207 if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
14208
14209 echo "$as_me:14209: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14210 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14211 cat >conftest.$ac_ext <<_ACEOF
14212 #line 14212 "configure"
14213 #include "confdefs.h"
14214
14215 #ifndef _XOPEN_SOURCE_EXTENDED
14216 #define _XOPEN_SOURCE_EXTENDED
14217 #endif
14218 #include <${cf_cv_ncurses_header:-curses.h}>
14219 int
14220 main ()
14221 {
14222
14223 mbstate_t foo
14224
14225   ;
14226   return 0;
14227 }
14228 _ACEOF
14229 rm -f conftest.$ac_objext
14230 if { (eval echo "$as_me:14230: \"$ac_compile\"") >&5
14231   (eval $ac_compile) 2>&5
14232   ac_status=$?
14233   echo "$as_me:14233: \$? = $ac_status" >&5
14234   (exit $ac_status); } &&
14235          { ac_try='test -s conftest.$ac_objext'
14236   { (eval echo "$as_me:14236: \"$ac_try\"") >&5
14237   (eval $ac_try) 2>&5
14238   ac_status=$?
14239   echo "$as_me:14239: \$? = $ac_status" >&5
14240   (exit $ac_status); }; }; then
14241   cf_result=yes
14242 else
14243   echo "$as_me: failed program was:" >&5
14244 cat conftest.$ac_ext >&5
14245 cf_result=no
14246 fi
14247 rm -f conftest.$ac_objext conftest.$ac_ext
14248 echo "$as_me:14248: result: $cf_result" >&5
14249 echo "${ECHO_T}$cf_result" >&6
14250 if test $cf_result = yes ; then
14251
14252 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14253
14254         cat >>confdefs.h <<EOF
14255 #define $cf_result 1
14256 EOF
14257
14258 else
14259         cat >>confdefs.h <<EOF
14260 #define mbstate_t long
14261 EOF
14262
14263 fi
14264
14265 fi
14266
14267 if test "$NCURSES_OK_WCHAR_T" = 0 ; then
14268
14269 echo "$as_me:14269: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14270 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14271 cat >conftest.$ac_ext <<_ACEOF
14272 #line 14272 "configure"
14273 #include "confdefs.h"
14274
14275 #ifndef _XOPEN_SOURCE_EXTENDED
14276 #define _XOPEN_SOURCE_EXTENDED
14277 #endif
14278 #include <${cf_cv_ncurses_header:-curses.h}>
14279 int
14280 main ()
14281 {
14282
14283 wchar_t foo
14284
14285   ;
14286   return 0;
14287 }
14288 _ACEOF
14289 rm -f conftest.$ac_objext
14290 if { (eval echo "$as_me:14290: \"$ac_compile\"") >&5
14291   (eval $ac_compile) 2>&5
14292   ac_status=$?
14293   echo "$as_me:14293: \$? = $ac_status" >&5
14294   (exit $ac_status); } &&
14295          { ac_try='test -s conftest.$ac_objext'
14296   { (eval echo "$as_me:14296: \"$ac_try\"") >&5
14297   (eval $ac_try) 2>&5
14298   ac_status=$?
14299   echo "$as_me:14299: \$? = $ac_status" >&5
14300   (exit $ac_status); }; }; then
14301   cf_result=yes
14302 else
14303   echo "$as_me: failed program was:" >&5
14304 cat conftest.$ac_ext >&5
14305 cf_result=no
14306 fi
14307 rm -f conftest.$ac_objext conftest.$ac_ext
14308 echo "$as_me:14308: result: $cf_result" >&5
14309 echo "${ECHO_T}$cf_result" >&6
14310 if test $cf_result = yes ; then
14311
14312 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14313
14314         cat >>confdefs.h <<EOF
14315 #define $cf_result 1
14316 EOF
14317
14318 else
14319         cat >>confdefs.h <<EOF
14320 #define wchar_t long
14321 EOF
14322
14323 fi
14324
14325 fi
14326
14327 if test "$NCURSES_OK_WINT_T" = 0 ; then
14328
14329 echo "$as_me:14329: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
14330 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14331 cat >conftest.$ac_ext <<_ACEOF
14332 #line 14332 "configure"
14333 #include "confdefs.h"
14334
14335 #ifndef _XOPEN_SOURCE_EXTENDED
14336 #define _XOPEN_SOURCE_EXTENDED
14337 #endif
14338 #include <${cf_cv_ncurses_header:-curses.h}>
14339 int
14340 main ()
14341 {
14342
14343 wint_t foo
14344
14345   ;
14346   return 0;
14347 }
14348 _ACEOF
14349 rm -f conftest.$ac_objext
14350 if { (eval echo "$as_me:14350: \"$ac_compile\"") >&5
14351   (eval $ac_compile) 2>&5
14352   ac_status=$?
14353   echo "$as_me:14353: \$? = $ac_status" >&5
14354   (exit $ac_status); } &&
14355          { ac_try='test -s conftest.$ac_objext'
14356   { (eval echo "$as_me:14356: \"$ac_try\"") >&5
14357   (eval $ac_try) 2>&5
14358   ac_status=$?
14359   echo "$as_me:14359: \$? = $ac_status" >&5
14360   (exit $ac_status); }; }; then
14361   cf_result=yes
14362 else
14363   echo "$as_me: failed program was:" >&5
14364 cat conftest.$ac_ext >&5
14365 cf_result=no
14366 fi
14367 rm -f conftest.$ac_objext conftest.$ac_ext
14368 echo "$as_me:14368: result: $cf_result" >&5
14369 echo "${ECHO_T}$cf_result" >&6
14370 if test $cf_result = yes ; then
14371
14372 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14373
14374         cat >>confdefs.h <<EOF
14375 #define $cf_result 1
14376 EOF
14377
14378 else
14379         cat >>confdefs.h <<EOF
14380 #define wint_t long
14381 EOF
14382
14383 fi
14384
14385 fi
14386
14387 echo "$as_me:14387: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14388 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14389 cat >conftest.$ac_ext <<_ACEOF
14390 #line 14390 "configure"
14391 #include "confdefs.h"
14392
14393 #ifdef HAVE_XCURSES
14394 #include <xcurses.h>
14395 char * XCursesProgramName = "test";
14396 #else
14397 #include <${cf_cv_ncurses_header:-curses.h}>
14398 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14399 #include <ncursesw/term.h>
14400 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14401 #include <ncurses/term.h>
14402 #elif defined(HAVE_TERM_H)
14403 #include <term.h>
14404 #endif
14405 #endif
14406
14407 int
14408 main ()
14409 {
14410
14411 void *foo = &(boolnames)
14412
14413   ;
14414   return 0;
14415 }
14416 _ACEOF
14417 rm -f conftest.$ac_objext
14418 if { (eval echo "$as_me:14418: \"$ac_compile\"") >&5
14419   (eval $ac_compile) 2>&5
14420   ac_status=$?
14421   echo "$as_me:14421: \$? = $ac_status" >&5
14422   (exit $ac_status); } &&
14423          { ac_try='test -s conftest.$ac_objext'
14424   { (eval echo "$as_me:14424: \"$ac_try\"") >&5
14425   (eval $ac_try) 2>&5
14426   ac_status=$?
14427   echo "$as_me:14427: \$? = $ac_status" >&5
14428   (exit $ac_status); }; }; then
14429   cf_result=yes
14430 else
14431   echo "$as_me: failed program was:" >&5
14432 cat conftest.$ac_ext >&5
14433 cf_result=no
14434 fi
14435 rm -f conftest.$ac_objext conftest.$ac_ext
14436 echo "$as_me:14436: result: $cf_result" >&5
14437 echo "${ECHO_T}$cf_result" >&6
14438 if test $cf_result = yes ; then
14439
14440 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14441
14442         cat >>confdefs.h <<EOF
14443 #define $cf_result 1
14444 EOF
14445
14446 else
14447         echo "$as_me:14447: checking for data boolnames in library" >&5
14448 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
14449         cat >conftest.$ac_ext <<_ACEOF
14450 #line 14450 "configure"
14451 #include "confdefs.h"
14452
14453 #ifdef HAVE_XCURSES
14454 #include <xcurses.h>
14455 char * XCursesProgramName = "test";
14456 #else
14457 #include <${cf_cv_ncurses_header:-curses.h}>
14458 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14459 #include <ncursesw/term.h>
14460 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14461 #include <ncurses/term.h>
14462 #elif defined(HAVE_TERM_H)
14463 #include <term.h>
14464 #endif
14465 #endif
14466
14467 extern char boolnames;
14468 int
14469 main ()
14470 {
14471
14472         do {
14473                 void *foo = &(boolnames);
14474                 ${cf_cv_main_return:-return}(foo == 0);
14475         } while (0)
14476
14477   ;
14478   return 0;
14479 }
14480 _ACEOF
14481 rm -f conftest.$ac_objext conftest$ac_exeext
14482 if { (eval echo "$as_me:14482: \"$ac_link\"") >&5
14483   (eval $ac_link) 2>&5
14484   ac_status=$?
14485   echo "$as_me:14485: \$? = $ac_status" >&5
14486   (exit $ac_status); } &&
14487          { ac_try='test -s conftest$ac_exeext'
14488   { (eval echo "$as_me:14488: \"$ac_try\"") >&5
14489   (eval $ac_try) 2>&5
14490   ac_status=$?
14491   echo "$as_me:14491: \$? = $ac_status" >&5
14492   (exit $ac_status); }; }; then
14493   cf_result=yes
14494 else
14495   echo "$as_me: failed program was:" >&5
14496 cat conftest.$ac_ext >&5
14497 cf_result=no
14498 fi
14499 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14500         echo "$as_me:14500: result: $cf_result" >&5
14501 echo "${ECHO_T}$cf_result" >&6
14502         if test $cf_result = yes ; then
14503
14504 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14505
14506                 cat >>confdefs.h <<EOF
14507 #define $cf_result 1
14508 EOF
14509
14510         fi
14511 fi
14512
14513 echo "$as_me:14513: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
14514 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
14515 cat >conftest.$ac_ext <<_ACEOF
14516 #line 14516 "configure"
14517 #include "confdefs.h"
14518
14519 #ifdef HAVE_XCURSES
14520 #include <xcurses.h>
14521 char * XCursesProgramName = "test";
14522 #else
14523 #include <${cf_cv_ncurses_header:-curses.h}>
14524 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14525 #include <ncursesw/term.h>
14526 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14527 #include <ncurses/term.h>
14528 #elif defined(HAVE_TERM_H)
14529 #include <term.h>
14530 #endif
14531 #endif
14532
14533 int
14534 main ()
14535 {
14536
14537 void *foo = &(boolfnames)
14538
14539   ;
14540   return 0;
14541 }
14542 _ACEOF
14543 rm -f conftest.$ac_objext
14544 if { (eval echo "$as_me:14544: \"$ac_compile\"") >&5
14545   (eval $ac_compile) 2>&5
14546   ac_status=$?
14547   echo "$as_me:14547: \$? = $ac_status" >&5
14548   (exit $ac_status); } &&
14549          { ac_try='test -s conftest.$ac_objext'
14550   { (eval echo "$as_me:14550: \"$ac_try\"") >&5
14551   (eval $ac_try) 2>&5
14552   ac_status=$?
14553   echo "$as_me:14553: \$? = $ac_status" >&5
14554   (exit $ac_status); }; }; then
14555   cf_result=yes
14556 else
14557   echo "$as_me: failed program was:" >&5
14558 cat conftest.$ac_ext >&5
14559 cf_result=no
14560 fi
14561 rm -f conftest.$ac_objext conftest.$ac_ext
14562 echo "$as_me:14562: result: $cf_result" >&5
14563 echo "${ECHO_T}$cf_result" >&6
14564 if test $cf_result = yes ; then
14565
14566 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14567
14568         cat >>confdefs.h <<EOF
14569 #define $cf_result 1
14570 EOF
14571
14572 else
14573         echo "$as_me:14573: checking for data boolfnames in library" >&5
14574 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
14575         cat >conftest.$ac_ext <<_ACEOF
14576 #line 14576 "configure"
14577 #include "confdefs.h"
14578
14579 #ifdef HAVE_XCURSES
14580 #include <xcurses.h>
14581 char * XCursesProgramName = "test";
14582 #else
14583 #include <${cf_cv_ncurses_header:-curses.h}>
14584 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14585 #include <ncursesw/term.h>
14586 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14587 #include <ncurses/term.h>
14588 #elif defined(HAVE_TERM_H)
14589 #include <term.h>
14590 #endif
14591 #endif
14592
14593 extern char boolfnames;
14594 int
14595 main ()
14596 {
14597
14598         do {
14599                 void *foo = &(boolfnames);
14600                 ${cf_cv_main_return:-return}(foo == 0);
14601         } while (0)
14602
14603   ;
14604   return 0;
14605 }
14606 _ACEOF
14607 rm -f conftest.$ac_objext conftest$ac_exeext
14608 if { (eval echo "$as_me:14608: \"$ac_link\"") >&5
14609   (eval $ac_link) 2>&5
14610   ac_status=$?
14611   echo "$as_me:14611: \$? = $ac_status" >&5
14612   (exit $ac_status); } &&
14613          { ac_try='test -s conftest$ac_exeext'
14614   { (eval echo "$as_me:14614: \"$ac_try\"") >&5
14615   (eval $ac_try) 2>&5
14616   ac_status=$?
14617   echo "$as_me:14617: \$? = $ac_status" >&5
14618   (exit $ac_status); }; }; then
14619   cf_result=yes
14620 else
14621   echo "$as_me: failed program was:" >&5
14622 cat conftest.$ac_ext >&5
14623 cf_result=no
14624 fi
14625 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14626         echo "$as_me:14626: result: $cf_result" >&5
14627 echo "${ECHO_T}$cf_result" >&6
14628         if test $cf_result = yes ; then
14629
14630 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14631
14632                 cat >>confdefs.h <<EOF
14633 #define $cf_result 1
14634 EOF
14635
14636         fi
14637 fi
14638
14639 TEST_ARGS="$LIBS"
14640 LIBS=
14641
14642 ac_config_files="$ac_config_files Makefile"
14643 ac_config_commands="$ac_config_commands default"
14644 cat >confcache <<\_ACEOF
14645 # This file is a shell script that caches the results of configure
14646 # tests run on this system so they can be shared between configure
14647 # scripts and configure runs, see configure's option --config-cache.
14648 # It is not useful on other systems.  If it contains results you don't
14649 # want to keep, you may remove or edit it.
14650 #
14651 # config.status only pays attention to the cache file if you give it
14652 # the --recheck option to rerun configure.
14653 #
14654 # `ac_cv_env_foo' variables (set or unset) will be overriden when
14655 # loading this file, other *unset* `ac_cv_foo' will be assigned the
14656 # following values.
14657
14658 _ACEOF
14659
14660 # The following way of writing the cache mishandles newlines in values,
14661 # but we know of no workaround that is simple, portable, and efficient.
14662 # So, don't put newlines in cache variables' values.
14663 # Ultrix sh set writes to stderr and can't be redirected directly,
14664 # and sets the high bit in the cache file unless we assign to the vars.
14665 {
14666   (set) 2>&1 |
14667     case `(ac_space=' '; set | grep ac_space) 2>&1` in
14668     *ac_space=\ *)
14669       # `set' does not quote correctly, so add quotes (double-quote
14670       # substitution turns \\\\ into \\, and sed turns \\ into \).
14671       sed -n \
14672         "s/'/'\\\\''/g;
14673           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14674       ;;
14675     *)
14676       # `set' quotes correctly as required by POSIX, so do not add quotes.
14677       sed -n \
14678         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
14679       ;;
14680     esac;
14681 } |
14682   sed '
14683      t clear
14684      : clear
14685      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
14686      t end
14687      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
14688      : end' >>confcache
14689 if cmp -s $cache_file confcache; then :; else
14690   if test -w $cache_file; then
14691     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
14692     cat confcache >$cache_file
14693   else
14694     echo "not updating unwritable cache $cache_file"
14695   fi
14696 fi
14697 rm -f confcache
14698
14699 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14700 # Let make expand exec_prefix.
14701 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14702
14703 # VPATH may cause trouble with some makes, so we remove $(srcdir),
14704 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
14705 # trailing colons and then remove the whole line if VPATH becomes empty
14706 # (actually we leave an empty line to preserve line numbers).
14707 if test "x$srcdir" = x.; then
14708   ac_vpsub='/^[         ]*VPATH[        ]*=/{
14709 s/:*\$(srcdir):*/:/;
14710 s/:*\${srcdir}:*/:/;
14711 s/:*@srcdir@:*/:/;
14712 s/^\([^=]*=[    ]*\):*/\1/;
14713 s/:*$//;
14714 s/^[^=]*=[      ]*$//;
14715 }'
14716 fi
14717
14718 DEFS=-DHAVE_CONFIG_H
14719
14720 : ${CONFIG_STATUS=./config.status}
14721 ac_clean_files_save=$ac_clean_files
14722 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14723 { echo "$as_me:14723: creating $CONFIG_STATUS" >&5
14724 echo "$as_me: creating $CONFIG_STATUS" >&6;}
14725 cat >$CONFIG_STATUS <<_ACEOF
14726 #! $SHELL
14727 # Generated automatically by configure.
14728 # Run this file to recreate the current configuration.
14729 # Compiler output produced by configure, useful for debugging
14730 # configure, is in config.log if it exists.
14731
14732 debug=false
14733 SHELL=\${CONFIG_SHELL-$SHELL}
14734 ac_cs_invocation="\$0 \$@"
14735
14736 _ACEOF
14737
14738 cat >>$CONFIG_STATUS <<\_ACEOF
14739 # Be Bourne compatible
14740 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14741   emulate sh
14742   NULLCMD=:
14743 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14744   set -o posix
14745 fi
14746
14747 # Name of the executable.
14748 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14749
14750 if expr a : '\(a\)' >/dev/null 2>&1; then
14751   as_expr=expr
14752 else
14753   as_expr=false
14754 fi
14755
14756 rm -f conf$$ conf$$.exe conf$$.file
14757 echo >conf$$.file
14758 if ln -s conf$$.file conf$$ 2>/dev/null; then
14759   # We could just check for DJGPP; but this test a) works b) is more generic
14760   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14761   if test -f conf$$.exe; then
14762     # Don't use ln at all; we don't have any links
14763     as_ln_s='cp -p'
14764   else
14765     as_ln_s='ln -s'
14766   fi
14767 elif ln conf$$.file conf$$ 2>/dev/null; then
14768   as_ln_s=ln
14769 else
14770   as_ln_s='cp -p'
14771 fi
14772 rm -f conf$$ conf$$.exe conf$$.file
14773
14774 as_executable_p="test -f"
14775
14776 # Support unset when possible.
14777 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14778   as_unset=unset
14779 else
14780   as_unset=false
14781 fi
14782
14783 # NLS nuisances.
14784 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14785 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14786 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14787 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14788 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14789 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14790 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14791 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14792
14793 # IFS
14794 # We need space, tab and new line, in precisely that order.
14795 as_nl='
14796 '
14797 IFS="   $as_nl"
14798
14799 # CDPATH.
14800 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14801
14802 exec 6>&1
14803
14804 _ACEOF
14805
14806 # Files that config.status was made for.
14807 if test -n "$ac_config_files"; then
14808   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14809 fi
14810
14811 if test -n "$ac_config_headers"; then
14812   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14813 fi
14814
14815 if test -n "$ac_config_links"; then
14816   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14817 fi
14818
14819 if test -n "$ac_config_commands"; then
14820   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14821 fi
14822
14823 cat >>$CONFIG_STATUS <<\EOF
14824
14825 ac_cs_usage="\
14826 \`$as_me' instantiates files from templates according to the
14827 current configuration.
14828
14829 Usage: $0 [OPTIONS] [FILE]...
14830
14831   -h, --help       print this help, then exit
14832   -V, --version    print version number, then exit
14833   -d, --debug      don't remove temporary files
14834       --recheck    update $as_me by reconfiguring in the same conditions
14835   --file=FILE[:TEMPLATE]
14836                    instantiate the configuration file FILE
14837   --header=FILE[:TEMPLATE]
14838                    instantiate the configuration header FILE
14839
14840 Configuration files:
14841 $config_files
14842
14843 Configuration headers:
14844 $config_headers
14845
14846 Configuration commands:
14847 $config_commands
14848
14849 Report bugs to <dickey@invisible-island.net>."
14850 EOF
14851
14852 cat >>$CONFIG_STATUS <<EOF
14853 ac_cs_version="\\
14854 config.status
14855 configured by $0, generated by GNU Autoconf 2.52.20101001,
14856   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14857
14858 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14859 Free Software Foundation, Inc.
14860 This config.status script is free software; the Free Software Foundation
14861 gives unlimited permission to copy, distribute and modify it."
14862 srcdir=$srcdir
14863 INSTALL="$INSTALL"
14864 EOF
14865
14866 cat >>$CONFIG_STATUS <<\EOF
14867 # If no file are specified by the user, then we need to provide default
14868 # value.  By we need to know if files were specified by the user.
14869 ac_need_defaults=:
14870 while test $# != 0
14871 do
14872   case $1 in
14873   --*=*)
14874     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14875     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14876     shift
14877     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14878     shift
14879     ;;
14880   -*);;
14881   *) # This is not an option, so the user has probably given explicit
14882      # arguments.
14883      ac_need_defaults=false;;
14884   esac
14885
14886   case $1 in
14887   # Handling of the options.
14888 EOF
14889 cat >>$CONFIG_STATUS <<EOF
14890   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14891     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14892     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14893 EOF
14894 cat >>$CONFIG_STATUS <<\EOF
14895   --version | --vers* | -V )
14896     echo "$ac_cs_version"; exit 0 ;;
14897   --he | --h)
14898     # Conflict between --help and --header
14899     { { echo "$as_me:14899: error: ambiguous option: $1
14900 Try \`$0 --help' for more information." >&5
14901 echo "$as_me: error: ambiguous option: $1
14902 Try \`$0 --help' for more information." >&2;}
14903    { (exit 1); exit 1; }; };;
14904   --help | --hel | -h )
14905     echo "$ac_cs_usage"; exit 0 ;;
14906   --debug | --d* | -d )
14907     debug=: ;;
14908   --file | --fil | --fi | --f )
14909     shift
14910     CONFIG_FILES="$CONFIG_FILES $1"
14911     ac_need_defaults=false;;
14912   --header | --heade | --head | --hea )
14913     shift
14914     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14915     ac_need_defaults=false;;
14916
14917   # This is an error.
14918   -*) { { echo "$as_me:14918: error: unrecognized option: $1
14919 Try \`$0 --help' for more information." >&5
14920 echo "$as_me: error: unrecognized option: $1
14921 Try \`$0 --help' for more information." >&2;}
14922    { (exit 1); exit 1; }; } ;;
14923
14924   *) ac_config_targets="$ac_config_targets $1" ;;
14925
14926   esac
14927   shift
14928 done
14929
14930 exec 5>>config.log
14931 cat >&5 << _ACEOF
14932
14933 ## ----------------------- ##
14934 ## Running config.status.  ##
14935 ## ----------------------- ##
14936
14937 This file was extended by $as_me 2.52.20101001, executed with
14938   CONFIG_FILES    = $CONFIG_FILES
14939   CONFIG_HEADERS  = $CONFIG_HEADERS
14940   CONFIG_LINKS    = $CONFIG_LINKS
14941   CONFIG_COMMANDS = $CONFIG_COMMANDS
14942   > $ac_cs_invocation
14943 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14944
14945 _ACEOF
14946 EOF
14947
14948 cat >>$CONFIG_STATUS <<EOF
14949 #
14950 # INIT-COMMANDS section.
14951 #
14952
14953 AWK="$AWK"
14954 ECHO_LD="$ECHO_LD"
14955
14956 EOF
14957
14958 cat >>$CONFIG_STATUS <<\EOF
14959 for ac_config_target in $ac_config_targets
14960 do
14961   case "$ac_config_target" in
14962   # Handling of arguments.
14963   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14964   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
14965   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
14966   *) { { echo "$as_me:14966: error: invalid argument: $ac_config_target" >&5
14967 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
14968    { (exit 1); exit 1; }; };;
14969   esac
14970 done
14971
14972 # If the user did not use the arguments to specify the items to instantiate,
14973 # then the envvar interface is used.  Set only those that are not.
14974 # We use the long form for the default assignment because of an extremely
14975 # bizarre bug on SunOS 4.1.3.
14976 if $ac_need_defaults; then
14977   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14978   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14979   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14980 fi
14981
14982 # Create a temporary directory, and hook for its removal unless debugging.
14983 $debug ||
14984 {
14985   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
14986   trap '{ (exit 1); exit 1; }' 1 2 13 15
14987 }
14988
14989 # Create a (secure) tmp directory for tmp files.
14990 : ${TMPDIR=/tmp}
14991 {
14992   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
14993   test -n "$tmp" && test -d "$tmp"
14994 }  ||
14995 {
14996   tmp=$TMPDIR/cs$$-$RANDOM
14997   (umask 077 && mkdir $tmp)
14998 } ||
14999 {
15000    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
15001    { (exit 1); exit 1; }
15002 }
15003
15004 EOF
15005
15006 cat >>$CONFIG_STATUS <<EOF
15007
15008 #
15009 # CONFIG_FILES section.
15010 #
15011
15012 # No need to generate the scripts if there are no CONFIG_FILES.
15013 # This happens for instance when ./config.status config.h
15014 if test -n "\$CONFIG_FILES"; then
15015   # Protect against being on the right side of a sed subst in config.status.
15016   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
15017    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
15018 s,@SHELL@,$SHELL,;t t
15019 s,@exec_prefix@,$exec_prefix,;t t
15020 s,@prefix@,$prefix,;t t
15021 s,@program_transform_name@,$program_transform_name,;t t
15022 s,@bindir@,$bindir,;t t
15023 s,@sbindir@,$sbindir,;t t
15024 s,@libexecdir@,$libexecdir,;t t
15025 s,@datadir@,$datadir,;t t
15026 s,@sysconfdir@,$sysconfdir,;t t
15027 s,@sharedstatedir@,$sharedstatedir,;t t
15028 s,@localstatedir@,$localstatedir,;t t
15029 s,@libdir@,$libdir,;t t
15030 s,@includedir@,$includedir,;t t
15031 s,@oldincludedir@,$oldincludedir,;t t
15032 s,@infodir@,$infodir,;t t
15033 s,@mandir@,$mandir,;t t
15034 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
15035 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
15036 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
15037 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
15038 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
15039 s,@build_alias@,$build_alias,;t t
15040 s,@host_alias@,$host_alias,;t t
15041 s,@target_alias@,$target_alias,;t t
15042 s,@ECHO_C@,$ECHO_C,;t t
15043 s,@ECHO_N@,$ECHO_N,;t t
15044 s,@ECHO_T@,$ECHO_T,;t t
15045 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
15046 s,@DEFS@,$DEFS,;t t
15047 s,@LIBS@,$LIBS,;t t
15048 s,@build@,$build,;t t
15049 s,@build_cpu@,$build_cpu,;t t
15050 s,@build_vendor@,$build_vendor,;t t
15051 s,@build_os@,$build_os,;t t
15052 s,@host@,$host,;t t
15053 s,@host_cpu@,$host_cpu,;t t
15054 s,@host_vendor@,$host_vendor,;t t
15055 s,@host_os@,$host_os,;t t
15056 s,@SET_MAKE@,$SET_MAKE,;t t
15057 s,@CC@,$CC,;t t
15058 s,@CFLAGS@,$CFLAGS,;t t
15059 s,@LDFLAGS@,$LDFLAGS,;t t
15060 s,@CPPFLAGS@,$CPPFLAGS,;t t
15061 s,@ac_ct_CC@,$ac_ct_CC,;t t
15062 s,@EXEEXT@,$EXEEXT,;t t
15063 s,@OBJEXT@,$OBJEXT,;t t
15064 s,@CPP@,$CPP,;t t
15065 s,@AWK@,$AWK,;t t
15066 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
15067 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
15068 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
15069 s,@LINT@,$LINT,;t t
15070 s,@LINT_OPTS@,$LINT_OPTS,;t t
15071 s,@CTAGS@,$CTAGS,;t t
15072 s,@ETAGS@,$ETAGS,;t t
15073 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
15074 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
15075 s,@MATH_LIB@,$MATH_LIB,;t t
15076 s,@CC_G_OPT@,$CC_G_OPT,;t t
15077 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
15078 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15079 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15080 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
15081 s,@LD@,$LD,;t t
15082 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
15083 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
15084 s,@LD_MODEL@,$LD_MODEL,;t t
15085 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
15086 s,@LIBTOOL@,$LIBTOOL,;t t
15087 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
15088 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
15089 s,@LIB_LINK@,$LIB_LINK,;t t
15090 s,@LINK_TESTS@,$LINK_TESTS,;t t
15091 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
15092 s,@PTHREAD@,$PTHREAD,;t t
15093 s,@TEST_ARGS@,$TEST_ARGS,;t t
15094 s,@TEST_DEPS@,$TEST_DEPS,;t t
15095 s,@TEST_LIBS@,$TEST_LIBS,;t t
15096 s,@TINFO_ARGS@,$TINFO_ARGS,;t t
15097 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
15098 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
15099 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
15100 s,@ECHO_LT@,$ECHO_LT,;t t
15101 s,@ECHO_LD@,$ECHO_LD,;t t
15102 s,@RULE_CC@,$RULE_CC,;t t
15103 s,@SHOW_CC@,$SHOW_CC,;t t
15104 s,@ECHO_CC@,$ECHO_CC,;t t
15105 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
15106 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
15107 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
15108 s,@X_CFLAGS@,$X_CFLAGS,;t t
15109 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
15110 s,@X_LIBS@,$X_LIBS,;t t
15111 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
15112 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
15113 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
15114 CEOF
15115
15116 EOF
15117
15118   cat >>$CONFIG_STATUS <<\EOF
15119   # Split the substitutions into bite-sized pieces for seds with
15120   # small command number limits, like on Digital OSF/1 and HP-UX.
15121   ac_max_sed_lines=48
15122   ac_sed_frag=1 # Number of current file.
15123   ac_beg=1 # First line for current file.
15124   ac_end=$ac_max_sed_lines # Line after last line for current file.
15125   ac_more_lines=:
15126   ac_sed_cmds=
15127   while $ac_more_lines; do
15128     if test $ac_beg -gt 1; then
15129       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15130     else
15131       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15132     fi
15133     if test ! -s $tmp/subs.frag; then
15134       ac_more_lines=false
15135     else
15136       # The purpose of the label and of the branching condition is to
15137       # speed up the sed processing (if there are no `@' at all, there
15138       # is no need to browse any of the substitutions).
15139       # These are the two extra sed commands mentioned above.
15140       (echo ':t
15141   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15142       if test -z "$ac_sed_cmds"; then
15143         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15144       else
15145         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15146       fi
15147       ac_sed_frag=`expr $ac_sed_frag + 1`
15148       ac_beg=$ac_end
15149       ac_end=`expr $ac_end + $ac_max_sed_lines`
15150     fi
15151   done
15152   if test -z "$ac_sed_cmds"; then
15153     ac_sed_cmds=cat
15154   fi
15155 fi # test -n "$CONFIG_FILES"
15156
15157 EOF
15158 cat >>$CONFIG_STATUS <<\EOF
15159 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15160   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15161   case $ac_file in
15162   - | *:- | *:-:* ) # input from stdin
15163         cat >$tmp/stdin
15164         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15165         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15166   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15167         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15168   * )   ac_file_in=$ac_file.in ;;
15169   esac
15170
15171   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15172   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15173          X"$ac_file" : 'X\(//\)[^/]' \| \
15174          X"$ac_file" : 'X\(//\)$' \| \
15175          X"$ac_file" : 'X\(/\)' \| \
15176          .     : '\(.\)' 2>/dev/null ||
15177 echo X"$ac_file" |
15178     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15179           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15180           /^X\(\/\/\)$/{ s//\1/; q; }
15181           /^X\(\/\).*/{ s//\1/; q; }
15182           s/.*/./; q'`
15183   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15184     { case "$ac_dir" in
15185   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15186   *)                      as_incr_dir=.;;
15187 esac
15188 as_dummy="$ac_dir"
15189 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15190   case $as_mkdir_dir in
15191     # Skip DOS drivespec
15192     ?:) as_incr_dir=$as_mkdir_dir ;;
15193     *)
15194       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15195       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15196     ;;
15197   esac
15198 done; }
15199
15200     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15201     # A "../" for each directory in $ac_dir_suffix.
15202     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15203   else
15204     ac_dir_suffix= ac_dots=
15205   fi
15206
15207   case $srcdir in
15208   .)  ac_srcdir=.
15209       if test -z "$ac_dots"; then
15210          ac_top_srcdir=.
15211       else
15212          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15213       fi ;;
15214   [\\/]* | ?:[\\/]* )
15215       ac_srcdir=$srcdir$ac_dir_suffix;
15216       ac_top_srcdir=$srcdir ;;
15217   *) # Relative path.
15218     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15219     ac_top_srcdir=$ac_dots$srcdir ;;
15220   esac
15221
15222   case $INSTALL in
15223   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15224   *) ac_INSTALL=$ac_dots$INSTALL ;;
15225   esac
15226
15227   if test x"$ac_file" != x-; then
15228     { echo "$as_me:15228: creating $ac_file" >&5
15229 echo "$as_me: creating $ac_file" >&6;}
15230     rm -f "$ac_file"
15231   fi
15232   # Let's still pretend it is `configure' which instantiates (i.e., don't
15233   # use $as_me), people would be surprised to read:
15234   #    /* config.h.  Generated automatically by config.status.  */
15235   configure_input="Generated automatically from `echo $ac_file_in |
15236                                                  sed 's,.*/,,'` by configure."
15237
15238   # First look for the input files in the build tree, otherwise in the
15239   # src tree.
15240   ac_file_inputs=`IFS=:
15241     for f in $ac_file_in; do
15242       case $f in
15243       -) echo $tmp/stdin ;;
15244       [\\/$]*)
15245          # Absolute (can't be DOS-style, as IFS=:)
15246          test -f "$f" || { { echo "$as_me:15246: error: cannot find input file: $f" >&5
15247 echo "$as_me: error: cannot find input file: $f" >&2;}
15248    { (exit 1); exit 1; }; }
15249          echo $f;;
15250       *) # Relative
15251          if test -f "$f"; then
15252            # Build tree
15253            echo $f
15254          elif test -f "$srcdir/$f"; then
15255            # Source tree
15256            echo $srcdir/$f
15257          else
15258            # /dev/null tree
15259            { { echo "$as_me:15259: error: cannot find input file: $f" >&5
15260 echo "$as_me: error: cannot find input file: $f" >&2;}
15261    { (exit 1); exit 1; }; }
15262          fi;;
15263       esac
15264     done` || { (exit 1); exit 1; }
15265 EOF
15266 cat >>$CONFIG_STATUS <<EOF
15267   sed "$ac_vpsub
15268 $extrasub
15269 EOF
15270 cat >>$CONFIG_STATUS <<\EOF
15271 :t
15272 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15273 s,@configure_input@,$configure_input,;t t
15274 s,@srcdir@,$ac_srcdir,;t t
15275 s,@top_srcdir@,$ac_top_srcdir,;t t
15276 s,@INSTALL@,$ac_INSTALL,;t t
15277 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15278   rm -f $tmp/stdin
15279   if test x"$ac_file" != x-; then
15280     mv $tmp/out $ac_file
15281   else
15282     cat $tmp/out
15283     rm -f $tmp/out
15284   fi
15285
15286 done
15287 EOF
15288 cat >>$CONFIG_STATUS <<\EOF
15289
15290 #
15291 # CONFIG_HEADER section.
15292 #
15293
15294 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15295 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15296 #
15297 # ac_d sets the value in "#define NAME VALUE" lines.
15298 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15299 ac_dB='[        ].*$,\1#\2'
15300 ac_dC=' '
15301 ac_dD=',;t'
15302 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15303 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15304 ac_iB='\([      ]\),\1#\2define\3'
15305 ac_iC=' '
15306 ac_iD='\4,;t'
15307 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15308 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15309 ac_uB='$,\1#\2define\3'
15310 ac_uC=' '
15311 ac_uD=',;t'
15312
15313 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15314   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15315   case $ac_file in
15316   - | *:- | *:-:* ) # input from stdin
15317         cat >$tmp/stdin
15318         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15319         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15320   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15321         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15322   * )   ac_file_in=$ac_file.in ;;
15323   esac
15324
15325   test x"$ac_file" != x- && { echo "$as_me:15325: creating $ac_file" >&5
15326 echo "$as_me: creating $ac_file" >&6;}
15327
15328   # First look for the input files in the build tree, otherwise in the
15329   # src tree.
15330   ac_file_inputs=`IFS=:
15331     for f in $ac_file_in; do
15332       case $f in
15333       -) echo $tmp/stdin ;;
15334       [\\/$]*)
15335          # Absolute (can't be DOS-style, as IFS=:)
15336          test -f "$f" || { { echo "$as_me:15336: error: cannot find input file: $f" >&5
15337 echo "$as_me: error: cannot find input file: $f" >&2;}
15338    { (exit 1); exit 1; }; }
15339          echo $f;;
15340       *) # Relative
15341          if test -f "$f"; then
15342            # Build tree
15343            echo $f
15344          elif test -f "$srcdir/$f"; then
15345            # Source tree
15346            echo $srcdir/$f
15347          else
15348            # /dev/null tree
15349            { { echo "$as_me:15349: error: cannot find input file: $f" >&5
15350 echo "$as_me: error: cannot find input file: $f" >&2;}
15351    { (exit 1); exit 1; }; }
15352          fi;;
15353       esac
15354     done` || { (exit 1); exit 1; }
15355   # Remove the trailing spaces.
15356   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15357
15358 EOF
15359
15360 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15361 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15362 # be either 'cat' or 'sort'.
15363 cat confdefs.h | uniq >conftest.vals
15364
15365 # Break up conftest.vals because some shells have a limit on
15366 # the size of here documents, and old seds have small limits too.
15367
15368 rm -f conftest.tail
15369 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15370 while grep . conftest.vals >/dev/null
15371 do
15372   # Write chunks of a limited-size here document to conftest.frag.
15373   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15374   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15375   echo 'CEOF' >> $CONFIG_STATUS
15376   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15377   rm -f conftest.vals
15378   mv conftest.tail conftest.vals
15379 done
15380 rm -f conftest.vals
15381
15382 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15383 # marker @DEFS@.
15384 echo '  cat >> conftest.edit <<CEOF
15385 /@DEFS@/r conftest.frag
15386 /@DEFS@/d
15387 CEOF
15388 sed -f conftest.edit $tmp/in > $tmp/out
15389 rm -f $tmp/in
15390 mv $tmp/out $tmp/in
15391 rm -f conftest.edit conftest.frag
15392 ' >> $CONFIG_STATUS
15393
15394 cat >>$CONFIG_STATUS <<\EOF
15395   # Let's still pretend it is `configure' which instantiates (i.e., don't
15396   # use $as_me), people would be surprised to read:
15397   #    /* config.h.  Generated automatically by config.status.  */
15398   if test x"$ac_file" = x-; then
15399     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15400   else
15401     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15402   fi
15403   cat $tmp/in >>$tmp/config.h
15404   rm -f $tmp/in
15405   if test x"$ac_file" != x-; then
15406     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15407       { echo "$as_me:15407: $ac_file is unchanged" >&5
15408 echo "$as_me: $ac_file is unchanged" >&6;}
15409     else
15410       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15411          X"$ac_file" : 'X\(//\)[^/]' \| \
15412          X"$ac_file" : 'X\(//\)$' \| \
15413          X"$ac_file" : 'X\(/\)' \| \
15414          .     : '\(.\)' 2>/dev/null ||
15415 echo X"$ac_file" |
15416     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15417           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15418           /^X\(\/\/\)$/{ s//\1/; q; }
15419           /^X\(\/\).*/{ s//\1/; q; }
15420           s/.*/./; q'`
15421       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15422         { case "$ac_dir" in
15423   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15424   *)                      as_incr_dir=.;;
15425 esac
15426 as_dummy="$ac_dir"
15427 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15428   case $as_mkdir_dir in
15429     # Skip DOS drivespec
15430     ?:) as_incr_dir=$as_mkdir_dir ;;
15431     *)
15432       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15433       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15434     ;;
15435   esac
15436 done; }
15437
15438       fi
15439       rm -f $ac_file
15440       mv $tmp/config.h $ac_file
15441     fi
15442   else
15443     cat $tmp/config.h
15444     rm -f $tmp/config.h
15445   fi
15446 done
15447 EOF
15448 cat >>$CONFIG_STATUS <<\EOF
15449 #
15450 # CONFIG_COMMANDS section.
15451 #
15452 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15453   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15454   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15455
15456   case $ac_dest in
15457     default )
15458
15459 for cf_dir in .
15460 do
15461         if test ! -d $srcdir/$cf_dir; then
15462                 continue
15463         elif test -f $srcdir/$cf_dir/programs; then
15464                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
15465         fi
15466 done
15467
15468         cat >>Makefile <<TEST_EOF
15469
15470 # These rules are generated so we do not rely on suffix rules, which do not
15471 # work consistently for different make-programs (the '\$(MODEL)/' confuses
15472 # some, and the '\$x' confuses others).
15473 TEST_EOF
15474
15475 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
15476 for N in $LIST
15477 do
15478         cat >>Makefile <<TEST_EOF
15479
15480 \$(MODEL)/$N.o : $N.c \\
15481         test.priv.h \\
15482         ncurses_cfg.h
15483         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
15484 TEST_EOF
15485 done
15486
15487 if test -f ../config.guess && test -f ../config.sub
15488 then
15489         cat >>Makefile <<TEST_EOF
15490
15491 # if we used CF_INHERIT for getting these files, we can remove them
15492 distclean::
15493         rm -f config.guess config.sub
15494 TEST_EOF
15495 fi
15496  ;;
15497   esac
15498 done
15499 EOF
15500
15501 cat >>$CONFIG_STATUS <<\EOF
15502
15503 { (exit 0); exit 0; }
15504 EOF
15505 chmod +x $CONFIG_STATUS
15506 ac_clean_files=$ac_clean_files_save
15507
15508 # configure is writing to config.log, and then calls config.status.
15509 # config.status does its own redirection, appending to config.log.
15510 # Unfortunately, on DOS this fails, as config.log is still kept open
15511 # by configure, so config.status won't be able to write to it; its
15512 # output is simply discarded.  So we exec the FD to /dev/null,
15513 # effectively closing config.log, so it can be properly (re)opened and
15514 # appended to by config.status.  When coming back to configure, we
15515 # need to make the FD available again.
15516 if test "$no_create" != yes; then
15517   ac_cs_success=:
15518   exec 5>/dev/null
15519   $SHELL $CONFIG_STATUS || ac_cs_success=false
15520   exec 5>>config.log
15521   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15522   # would make configure fail if this is the last instruction.
15523   $ac_cs_success || { (exit 1); exit 1; }
15524 fi
15525